Listing 1 (cswitch.h) Header File for the Subsystem that Supports Generic Command-Line Switches

/* --------------------------------------------------------
   Written by: William J. McMahonon: August 25, 1990
-------------------------------------------------------- */


#ifndef CSWITCH_H        /*  Avoid duplicate definitions.*/
#define CSWITCH_H

/*Macros that could be put in a more general header file.*/

typedef unsigned char BOOL;    /* ... TRUE or FALSE      */

#define MAX_STR       128      /* ... for string buffers.*/

#define TRUE          1
#define FALSE         0

/* ---------------Function Prototypes ------------------ */
BOOL csw_ison(char*,int);
void csw_parse(int,char**);

/* ---------- Macro for switchable execution ----------- */
#ifdef NO_CSW
#define CSW_EXEC(x)     ((void)0)
#else
#define CSW_EXEC(x)     (csw_ison(_FILE_,_LINE_)?\
                    (x):((void)0) )
#endif

#endif                  /*#ifndef CSWITCH_H              */