# 2.11BSD#431 - /usr/src/local/qterm/options.h

##### Macros

    ArgHidden         X
    FALSE             X
    HELPSTR           X
    IsArg             X
    NoArg             X
    Num_Opts          X
    SepArg            X
    SkipArg           X
    SkipLine          X
    SkipNArgs         X
    StickyArg         X
    TRUE              X
    __                X

       1: /*
       2:  * Copyright (c) 1990 Michael A. Cooper.
       3:  * This software may be freely distributed provided it is not sold for
       4:  * profit and the author is credited appropriately.
       5:  */
       6:
       7: /*
       8:  * $Header: RCS/options.h,v 1.7.1 96/3/23 18:13:30 sms Exp $
       9:  *
      10:  * $Log:	options.h,v $
      11:  * Revision 1.7  90/12/15  18:13:30  mcooper
      12:  * Add copywrite notice.
      13:  *
      14:  * Revision 1.6  90/11/13  15:28:39  mcooper
      15:  * Add OptBool cvtarg routine.
      16:  *
      17:  * Revision 1.5  90/10/29  19:34:03  mcooper
      18:  * Fixed comment for NoArg.
      19:  *
      20:  * Revision 1.4  90/10/29  18:48:43  mcooper
      21:  * Cleanup some comments.
      22:  *
      23:  * Revision 1.3  90/10/29  14:47:29  mcooper
      24:  * UsageString is now a real function.
      25:  *
      26:  * Revision 1.2  90/10/26  15:55:44  mcooper
      27:  * Add defines for "__" and ArgHidden.
      28:  *
      29:  * Revision 1.1  90/10/26  14:42:53  mcooper
      30:  * Initial revision
      31:  *
      32:  */
      33:
      34:
      35: #include <stdio.h>
      36: #include <sys/types.h>
      37: #include <sys/errno.h>
      38:
      39: #define Num_Opts(o) (sizeof(o)/sizeof(OptionDescRec))
      40: #define HELPSTR     "-help"
      41: #define __      (caddr_t)
      42:
      43: #ifndef TRUE
      44: #define TRUE    1
      45: #endif
      46: #ifndef FALSE
      47: #define FALSE   0
      48: #endif
      49:
      50: /*
      51:  * Values for OptionDescRec.flags.
      52:  */
      53: #define NoArg       0x001   /* No argument for this option.  Use
      54: 				   OptionDescRec.value. */
      55: #define IsArg       0x002   /* Value is the option string itself */
      56: #define SepArg      0x004   /* Value is in next argument in argv */
      57: #define StickyArg   0x008   /* Value is characters immediately following
      58: 				   option */
      59: #define SkipArg     0x010   /* Ignore this option and the next argument in
      60: 				   argv */
      61: #define SkipLine    0x020   /* Ignore this option and the rest of argv */
      62: #define SkipNArgs   0x040   /* Ignore this option and the next
      63: 				   OptionDescRes.value arguments in argv */
      64: #define ArgHidden   0x080   /* Don't show in usage or help messages */
      65:
      66: /*
      67:  * Option description record.
      68:  */
      69: typedef struct {
      70:     char    *option;        /* Option string in argv	    */
      71:     int      flags;         /* Flag bits			    */
      72:     int     (*cvtarg)();        /* Function to convert argument     */
      73:     caddr_t  valp;          /* Variable to set		    */
      74:     caddr_t  value;         /* Default value to provide	    */
      75:     char    *usage;         /* Usage message		    */
      76:     char    *desc;          /* Description message		    */
      77: } OptionDescRec, *OptionDescList;
      78:
      79: void UsageOptions();
      80: void HelpOptions();
      81: void UserError();
      82: int ParseOptions();
      83: OptionDescRec *FindOption();
      84:
      85: int OptBool();
      86: int OptInt();
      87: int OptLong();
      88: int OptShort();
      89: int OptStr();
      90:
      91: extern char *OptionChars;
      92: extern int errno;
      93: extern char *sys_errlist[];
      94: extern long strtol();
      95: extern char *malloc();
      96: extern char *strcpy();

#### Defined macros

ArgHidden defined in line 64; used 6 times

- in /usr/src/local/qterm/options.c line 270, 309
- in /usr/src/local/qterm/qterm.c line 247-248(2), 262, 323

FALSE defined in line 47; used 29 times

- in line 46
- in /usr/src/local/qterm/options.c line 127-132(2), 246, 367, 383, 399, 415, 431
- in /usr/src/local/qterm/qterm.c line 231-239(9), 335-336(2), 414, 498, 531, 591, 655, 681, 883, 903, 919

HELPSTR defined in line 40; used 2 times

- in /usr/src/local/qterm/options.c line 111, 287

IsArg defined in line 55; used 1 times

- in /usr/src/local/qterm/options.c line 131

NoArg defined in line 53; used 21 times

- in /usr/src/local/qterm/options.c line 126
- in /usr/src/local/qterm/qterm.c line 247, 283-323(19)

Num_Opts defined in line 39; used 1 times

- in /usr/src/local/qterm/qterm.c line 382

SepArg defined in line 56; used 6 times

- in /usr/src/local/qterm/options.c line 136, 169, 453
- in /usr/src/local/qterm/qterm.c line 248, 291, 313

SkipArg defined in line 59; used 1 times

- in /usr/src/local/qterm/options.c line 185

SkipLine defined in line 61; used 1 times

- in /usr/src/local/qterm/options.c line 187

SkipNArgs defined in line 62; used 1 times

- in /usr/src/local/qterm/options.c line 189

StickyArg defined in line 57; used 6 times

- in /usr/src/local/qterm/options.c line 136, 154, 219, 452-453(2)
- in /usr/src/local/qterm/qterm.c line 248

TRUE defined in line 44; used 21 times

- in line 43
- in /usr/src/local/qterm/options.c line 150, 165, 181, 242, 369, 385, 401, 417, 440
- in /usr/src/local/qterm/qterm.c line 240, 393, 409-413(3), 476, 527, 581, 674-676(2), 884

__ defined in line 41; used 3 times

- in /usr/src/local/qterm/qterm.c line 280, 291, 313

#### Usage of this include

options.h used 2 times

- in /usr/src/local/qterm/options.c line 66
- in /usr/src/local/qterm/qterm.c line 216

Last modified: 1996-03-23 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1341 |