1 /****************************************************************************
3 * Copyright (C) 1991-1997 SciTech Software, Inc.
6 * ======================================================================
7 * This library is free software; you can use it and/or
8 * modify it under the terms of the SciTech MGL Software License.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * SciTech MGL Software License for more details.
14 * ======================================================================
16 * Filename: $Workfile: getopt.h $
22 * Description: Header file for command line parsing module. This module
23 * contains code to parse the command line, extracting options
24 * and parameters in standard System V style.
29 * (Log is kept at end of this file)
31 ****************************************************************************/
47 /*---------------------------- Typedef's etc -----------------------------*/
56 /* Option type sepecifiers */
58 #define OPT_INTEGER 'd'
61 #define OPT_UNSIGNED 'u'
62 #define OPT_LINTEGER 'D'
64 #define OPT_LOCTAL 'O'
65 #define OPT_LUNSIGNED 'U'
67 #define OPT_DOUBLE 'F'
68 #define OPT_LDOUBLE 'L'
69 #define OPT_STRING 's'
70 #define OPT_SWITCH '!'
72 // I need to generate a typedefs file for this.
75 typedef unsigned char uchar;
78 typedef unsigned int uint;
82 typedef unsigned long ulong;
102 uchar opt; /* The letter to describe the option */
103 uchar type; /* Type descriptor for the option */
104 void *arg; /* Place to store the argument */
105 char *desc; /* Description for this option */
108 #define NUM_OPT(a) sizeof(a) / sizeof(Option)
111 /*--------------------------- Global variables ---------------------------*/
114 extern char *nextchar;
116 /*------------------------- Function Prototypes --------------------------*/
118 // extern int getopt(int argc,char **argv,char *format,char **argument);
120 extern int getargs(int argc, char *argv[],int num_opt, Option ** optarr,
121 int (*do_param)(char *param,int num));
123 extern void print_desc(int num_opt, Option **optarr); // Not original code
133 /* Revision 1.2 1998/04/21 17:02:41 curt
134 /* Prepairing for C++ integration.
136 * Revision 1.1 1998/02/13 00:23:39 curt