home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume10 / parseargs / parseargs.h < prev    next >
C/C++ Source or Header  |  1990-02-16  |  1KB  |  54 lines

  1. /*
  2. **  PARSEARGS.H -- declarations for argument vector parser
  3. **
  4. **    $Header: parseargs.h,v 2.0 89/12/24 00:56:29 eric Exp $
  5. **
  6. **    Author:
  7. **        Eric Allman
  8. **        University of California, Berkeley
  9. */
  10.  
  11. #ifndef ARGDESC
  12.  
  13. #ifndef _USEFUL_H_
  14. #include <useful.h>
  15. #endif
  16.  
  17. #define ARGDESC        struct _argdesc
  18.  
  19. ARGDESC
  20. {
  21.     char    ad_name;    /* flag name */
  22.     char    ad_flags;    /* flags */
  23.     BOOL    (*ad_type) ARGS((ARGDESC *, char *, BOOL));
  24.                 /* function to parse value */
  25.     ARBPTR    ad_valp;    /* pointer to value storage area */
  26.     char    *ad_prompt;    /* prompt string */
  27. };
  28.  
  29. /* bits for ad_flags */
  30. #define ARGREQ        0x01    /* required argument */
  31. #define ARGOPT        0x00    /* optional argument pseudo-flag */
  32. #define ARGHIDDEN    0x02    /* don't display in usage message */
  33. #define ARGGIVEN    0x08    /* (internal) argument has been specified */
  34.  
  35. /* types available for ad_type */
  36. extern BOOL    argBool ARGS((ARGDESC *, char *, BOOL));
  37. extern BOOL    argChar ARGS((ARGDESC *, char *, BOOL));
  38. extern BOOL    argStr ARGS((ARGDESC *, char *, BOOL));
  39. extern BOOL    argInt ARGS((ARGDESC *, char *, BOOL));
  40. extern BOOL    argShort ARGS((ARGDESC *, char *, BOOL));
  41. extern BOOL    argLong ARGS((ARGDESC *, char *, BOOL));
  42. extern BOOL    argFloat ARGS((ARGDESC *, char *, BOOL));
  43. extern BOOL    argDouble ARGS((ARGDESC *, char *, BOOL));
  44. extern BOOL    argList ARGS((ARGDESC *, char *, BOOL));
  45.  
  46. struct namelist {
  47.     struct namelist *nl_next;
  48.     char *nl_name;
  49. };
  50.  
  51. #define ENDOFARGS    { '\0' }
  52.  
  53. #endif
  54.