home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_10 / 9n10097a < prev    next >
Text File  |  1991-06-13  |  1KB  |  34 lines

  1. /* ---------------------------------------------------------
  2.     CSWITCH.H
  3.  
  4.     This is the header file for the subsystem that
  5.     supports generic command-line switches.
  6.  
  7.     Written by: William J. McMahon     on: August 25, 1990
  8. --------------------------------------------------------- */
  9. #ifndef CSWITCH_H         /* Avoid duplicate definitions. */
  10. #define CSWITCH_H
  11.  
  12. /* Macros that could be put in a more general header file.*/
  13.  
  14. typedef unsigned char  BOOL;    /* ... TRUE or FALSE      */
  15.  
  16. #define MAX_STR        128      /* ... for string buffers.*/
  17.  
  18. #define TRUE           1
  19. #define FALSE          0
  20.  
  21. /* --------------- Function Prototypes ------------------ */
  22. BOOL csw_ison(char *, int);
  23. void csw_parse(int, char **);
  24.  
  25. /* -------- Macro for switchable execution -------------- */
  26. #ifdef NO_CSW
  27. #define CSW_EXEC(x)    ((void)0)
  28. #else
  29. #define CSW_EXEC(x)    (csw_ison(__FILE__, __LINE__) ? \
  30.                        (x) : ((void)0) )
  31. #endif
  32.  
  33. #endif                 /* #ifndef CSWITCH_H               */
  34.