home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / LESS177.ZIP / src / option.h < prev    next >
C/C++ Source or Header  |  1992-07-18  |  1KB  |  39 lines

  1. #define    END_OPTION_STRING    ('$')
  2.  
  3. /*
  4.  * Types of options.
  5.  */
  6. #define    BOOL        01    /* Boolean option: 0 or 1 */
  7. #define    TRIPLE        02    /* Triple-valued option: 0, 1 or 2 */
  8. #define    NUMBER        04    /* Numeric option */
  9. #define    STRING        010    /* String-valued option */
  10. #define    NOVAR        020    /* No associated variable */
  11. #define    REPAINT        040    /* Repaint screen after toggling option */
  12. #define    NO_TOGGLE    0100    /* Option cannot be toggled with "-" cmd */
  13.  
  14. #define    OTYPE        (BOOL|TRIPLE|NUMBER|STRING|NOVAR)
  15.  
  16. /*
  17.  * Argument to a handling function tells what type of activity:
  18.  */
  19. #define    INIT    0    /* Initialization (from command line) */
  20. #define    QUERY    1    /* Query (from _ or - command) */
  21. #define    TOGGLE    2    /* Change value (from - command) */
  22.  
  23. /* Flag to toggle_option to specify how to "toggle" */
  24. #define    OPT_NO_TOGGLE    0
  25. #define    OPT_TOGGLE    1
  26. #define    OPT_UNSET    2
  27. #define    OPT_SET        3
  28.  
  29. struct option
  30. {
  31.     char oletter;        /* The controlling letter (a-z) */
  32.     char otype;        /* Type of the option */
  33.     int odefault;        /* Default value */
  34.     int *ovar;        /* Pointer to the associated variable */
  35.     void (*ofunc)();    /* Pointer to special handling function */
  36.     char *odesc[3];        /* Description of each value */
  37. };
  38.  
  39.