home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / EFFO / forum3.lzh / DEFS / easyc.h
Text File  |  1987-10-23  |  3KB  |  70 lines

  1. /******************************************************************************/
  2. /*                                                                            */
  3. /*   Die folgenden 'defines' erm÷glichen eine komfortablere Benutzung der     */
  4. /*   'C' - Operatoren und Programmstrukturen. Durch Einbinden dieses Moduls   */
  5. /*   mit '#include <easyc.h>' in Ihr Programm k÷nnen Sie die Lesbarkeit fast  */
  6. /*   auf einen von PASCAL oder MODULA 2 gewohnten stand bringen.              */
  7. /*                                                                            */
  8. /*   Die 'defines' sind dem Artikel EASY C von Pete Orlin und John Heath,     */
  9. /*   BYTE vom Mai 1986 entnommen.                                             */
  10. /*                                                                            */
  11. /******************************************************************************/
  12.  
  13. /* Logical operators */
  14.  
  15. #define  AND  &&          /* logical AND */
  16. #define   OR  ||          /* logical OR */
  17. #define  NOT   !          /* logical NOT */
  18. #define   EQ  ==          /* equal value comparison */
  19. #define   NE  !=          /* not equal value comparison */
  20. #define   LT   <          /* less than value comparison */
  21. #define   LE  <=          /* less than or equal to value comparison */
  22. #define   GT   >          /* greater than value comparison */
  23. #define   GE  >=          /* greater than or equal to value comparison */
  24.  
  25. /* Bitwise operators */
  26.  
  27. #define  BAND   &         /* bitwise AND */
  28. #define   BOR   |         /* bitwise OR */
  29. #define  BXOR   ^         /* bitwise exclusive OR */
  30. #define  BNOT   ~         /* bitwise NOT */
  31. #define  LSHF  <<         /* left shift */
  32. #define  RSHF  >>         /* right shift */
  33.  
  34. /* Arithmetic operators */
  35.  
  36. #define  INC  ++          /* increment */
  37. #define  DEC  --          /* decrement */
  38. #define  MOD   %          /* modulo division */
  39.  
  40. /* IF...THEN...ELSEIF...ELSE construct */
  41.  
  42. #define  IF(e)        { if (e)             /* if statement */
  43. #define  THEN         {                    /* then statement */
  44. #define  ELSEIF(e)    } else if (e) {      /* elseif statement */
  45. #define  ELSE         } else {             /* else statement */
  46. #define  ENDIF        ; } }                /* end of if statement */
  47.  
  48. /* CASE construct */
  49.  
  50. #define  CASE(e)      { switch (e) {       /* head of case */
  51. #define  CASEOF(e)    case e: {            /* case block */
  52. #define  DEFCASE      default: {           /* default case block */
  53. #define  ENDCOF       } break ;            /* end of case block */
  54. #define  ENDCASE      } }                  /* end of case */
  55.  
  56. /* WHILE construct */
  57.  
  58. #define  WHILE(e)     { while (e) {        /* while statement */
  59. #define  ENDW         ; } }                /* end of while statement */
  60.  
  61. /* FOR construct */
  62.  
  63. #define  FOR(e)       { for (e) {          /* for statement */
  64. #define  ENDF         ; } }                /* end of for statement */
  65.  
  66. /* BEGIN...END construct */
  67.  
  68. #define  BEGIN        {                    /* beginning of block */
  69. #define  END          }                    /* end of block */
  70.