home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / f2csrc.zip / f2csrc / src / parse.h < prev    next >
C/C++ Source or Header  |  1994-02-25  |  1KB  |  48 lines

  1. #ifndef PARSE_INCLUDE
  2. #define PARSE_INCLUDE
  3.  
  4. /* macros for the   parse_args   routine */
  5.  
  6. #define P_STRING 1        /* Macros for the result_type attribute */
  7. #define P_CHAR 2
  8. #define P_SHORT 3
  9. #define P_INT 4
  10. #define P_LONG 5
  11. #define P_FILE 6
  12. #define P_OLD_FILE 7
  13. #define P_NEW_FILE 8
  14. #define P_FLOAT 9
  15. #define P_DOUBLE 10
  16.  
  17. #define P_CASE_INSENSITIVE 01    /* Macros for the   flags   attribute */
  18. #define P_REQUIRED_PREFIX 02
  19.  
  20. #define P_NO_ARGS 0        /* Macros for the   arg_count   attribute */
  21. #define P_ONE_ARG 1
  22. #define P_INFINITE_ARGS 2
  23.  
  24. #define p_entry(pref,swit,flag,count,type,store,size) \
  25.     { (pref), (swit), (flag), (count), (type), (int *) (store), (size) }
  26.  
  27. typedef struct {
  28.     char *prefix;
  29.     char *string;
  30.     int flags;
  31.     int count;
  32.     int result_type;
  33.     int *result_ptr;
  34.     int table_size;
  35. } arg_info;
  36.  
  37. #ifdef KR_headers
  38. #define Argdcl(x) ()
  39. #else
  40. #define Argdcl(x) x
  41. #endif
  42. int    arg_verify Argdcl((char**, arg_info*, int));
  43. void    init_store Argdcl((arg_info*, int));
  44. int    match_table Argdcl((char*, arg_info*, int, int, int*));
  45. int    parse_args Argdcl((int, char**, arg_info*, int, char**, int));
  46.  
  47. #endif
  48.