home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_07 / 8n07045a < prev    next >
Text File  |  1990-06-19  |  1KB  |  48 lines

  1.  
  2.  
  3. ------------------------------------------------------
  4. LISTING 2
  5.  
  6.  
  7. /*        Options.h
  8. */
  9. enum boolean { FALSE, TRUE};
  10. typedef int    boolean;
  11. typedef void * Options; /*hides definition of the object*/
  12.  
  13. Options CreateOptions( void );
  14.  
  15. void    PutArgs( Options options, const int argc, char **argv);
  16.     /*  Establishes the options list as the argc strings
  17.         pointed to by argv.
  18.     */
  19.  
  20. boolean IsSwitch(      Options, const char switch_character);
  21.     /* Returns TRUE if -switch_character is an option.
  22.        It also marks this arguement as used.
  23.     */
  24. char *  GetParameter( Options, const char switch_character);
  25.     /* Returns a pointer to the string following
  26.        the first occurance of -switch_character 
  27.        in the arguement list, called the switch parameter.
  28.        It also marks this arguement as used.
  29.     */
  30.  
  31. boolean IsMoreSwitches( Options options );
  32.     /*  Returns TRUE if there are switches
  33.         which have not been marked as used by IsSwitch()
  34.     */
  35.  
  36. char *  GetNextOption( Options );
  37.     /* Returns pointers to the options
  38.        in first-in, first-out or left-to-right order,
  39.        and NULL when there are no more options.
  40.  
  41.        Options are the strings in the arguement list
  42.            which are neither switches nor switch parameters.
  43.        GetParameter() marks the switch parameters.
  44.     */
  45.  
  46. void    DestroyOptions(Options);
  47.  
  48.