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 ****************************************************************************/
40 /*---------------------------- Typedef's etc -----------------------------*/
49 /* Option type sepecifiers */
51 #define OPT_INTEGER 'd'
54 #define OPT_UNSIGNED 'u'
55 #define OPT_LINTEGER 'D'
57 #define OPT_LOCTAL 'O'
58 #define OPT_LUNSIGNED 'U'
60 #define OPT_DOUBLE 'F'
61 #define OPT_LDOUBLE 'L'
62 #define OPT_STRING 's'
63 #define OPT_SWITCH '!'
65 // I need to generate a typedefs file for this.
68 typedef unsigned char uchar;
71 typedef unsigned int uint;
75 typedef unsigned long ulong;
95 uchar opt; /* The letter to describe the option */
96 uchar type; /* Type descriptor for the option */
97 void *arg; /* Place to store the argument */
98 char *desc; /* Description for this option */
101 #define NUM_OPT(a) sizeof(a) / sizeof(Option)
107 /*--------------------------- Global variables ---------------------------*/
110 extern char *nextchar;
112 /*------------------------- Function Prototypes --------------------------*/
114 // extern int getopt(int argc,char **argv,char *format,char **argument);
116 extern int getargs(int argc, char *argv[],int num_opt, Option ** optarr,
117 int (*do_param)(char *param,int num));
119 extern void print_desc(int num_opt, Option **optarr); // Not original code
129 /* Revision 1.1 1998/02/13 00:23:39 curt