home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-30 | 35.9 KB | 1,103 lines |
- *** argtype3.txt.OLD Tue Mar 26 12:01:39 1991
- --- argtype3.txt Tue Mar 26 11:59:44 1991
- ***************
- *** 38,54 ****
- DESCRIPTION
- Each of these converts a parameter value to the internal
- form, including validity checking. Their parameters and
- ! return values all behave similarly. One of these routines
- ! are called when an argunent of that particular type is
- ! matched by one of the argument parsing function in par-
- ! seargs(3). When such an argument is matched, its argument
- ! translation routines is invoked and is passed (1) the
- ! address of the argument descriptor for the matched argument,
- ! (2) the possible argument string for that matched argument,
- ! and (3) a boolean filed that is TRUE only if the second
- ! parameter points to temporary storage (indicating that some
- ! copying may need to be done instead of just pointing to the
- ! same object).
-
- Once the argument translation routine is invoked, it is
- responsible for converting the argument string to the
- --- 38,54 ----
- DESCRIPTION
- Each of these converts a parameter value to the internal
- form, including validity checking. Their parameters and
- ! return values all behave similarly. One of these routines is
- ! called when an argument of that particular type is matched
- ! by one of the argument parsing function in parseargs(3).
- ! When such an argument is matched, its argument translation
- ! routines is invoked and is passed (1) the address of the
- ! argument descriptor for the matched argument, (2) the possi-
- ! ble argument string for that matched argument, and (3) a
- ! boolean filed that is TRUE only if the second parameter
- ! points to temporary storage (indicating that some copying
- ! may need to be done instead of just pointing to the same
- ! object).
-
- Once the argument translation routine is invoked, it is
- responsible for converting the argument string to the
- ***************
- *** 91,103 ****
- still match other arguments.
-
-
- ! PSEUDO-TYPES
- ArgUsage is used to specify an argument that causes the com-
- mand usage to be printed.
-
- ArgDummy is used to force an item to show up in usage-
- messages but the item itself is never matched against any
- ! argumenmts from the command-line.
-
- ArgEnd is used by Amiga style command-lines to indicate an
- argument that forces all remaining arguments to be con-
- --- 91,103 ----
- still match other arguments.
-
-
- ! PSEUDO-TYPES: argUsage, argDummy, argEnd
- ArgUsage is used to specify an argument that causes the com-
- mand usage to be printed.
-
- ArgDummy is used to force an item to show up in usage-
- messages but the item itself is never matched against any
- ! arguments from the command-line.
-
- ArgEnd is used by Amiga style command-lines to indicate an
- argument that forces all remaining arguments to be con-
- ***************
- *** 108,114 ****
- available for identification in the corresponding command-
- line styles.
-
- ! STRING-TYPES
- ArgStr is one of the few argument translation routines that
- actually uses the copyf flag. If copyf is true then the
- string is duplicated.
- --- 108,114 ----
- available for identification in the corresponding command-
- line styles.
-
- ! STRING-TYPES: argStr
- ArgStr is one of the few argument translation routines that
- actually uses the copyf flag. If copyf is true then the
- string is duplicated.
- ***************
- *** 137,143 ****
-
-
-
- ! CHARACTER-TYPES
- ArgChar assigns the given character to the value referenced
- by arg_valp(ad) (unless the argument is a vector in which
- case the given character is appended to the end).
- --- 137,143 ----
-
-
-
- ! CHARACTER-TYPES: argChar
- ArgChar assigns the given character to the value referenced
- by arg_valp(ad) (unless the argument is a vector in which
- case the given character is appended to the end).
- ***************
- *** 150,156 ****
- Unlike argStr, argChar will translate character escape
- sequences such as `\n' and `\012'.
-
- ! INTEGER-TYPES
- Each of these functions converts the given string to the
- desired integral type. The value may be specified as an
- octal number by specifying the first digit to be 0. Simi-
- --- 150,156 ----
- Unlike argStr, argChar will translate character escape
- sequences such as `\n' and `\012'.
-
- ! INTEGER-TYPES: argInt, argShort, argLong
- Each of these functions converts the given string to the
- desired integral type. The value may be specified as an
- octal number by specifying the first digit to be 0. Simi-
- ***************
- *** 157,167 ****
- larly, If the first two characters are `0x' then the number
- is treated as hexadecimal.
-
- ! FLOATING-POINT-TYPES
- Each of these functions converts the given string to the
- desired floating-point type.
-
- ! BOOLEAN-TYPES
- ArgBool and argSBool set a boolean value (if no value is
- given). ArgUBool unsets a boolean value (if no value is
- given). ArgTBool toggles a boolean value (if no value is
- --- 157,167 ----
- larly, If the first two characters are `0x' then the number
- is treated as hexadecimal.
-
- ! FLOATING-POINT-TYPES: argFloat, argDouble
- Each of these functions converts the given string to the
- desired floating-point type.
-
- ! BOOLEAN-TYPES: argBool, argSBool, argTBool, argUBool
- ArgBool and argSBool set a boolean value (if no value is
- given). ArgUBool unsets a boolean value (if no value is
- given). ArgTBool toggles a boolean value (if no value is
- ***************
- *** 209,215 ****
- ``1'', ``+'', ``ON'', or ``TRUE''
- The corresponding boolean flag is set to TRUE.
-
- ! LIST TYPES
- The listStr argument translation routine is only intended
- for use on behalf of arguments that have the ARGLIST flag
- enabled. It will allocate space for a new node (and for the
- --- 209,215 ----
- ``1'', ``+'', ``ON'', or ``TRUE''
- The corresponding boolean flag is set to TRUE.
-
- ! LIST TYPES: listStr
- The listStr argument translation routine is only intended
- for use on behalf of arguments that have the ARGLIST flag
- enabled. It will allocate space for a new node (and for the
- ***************
- *** 229,235 ****
- followed by the type of the items in the vector.
-
- SEE ALSO
- ! parseargs(3), parseargs(1),
-
-
-
- --- 229,235 ----
- followed by the type of the items in the vector.
-
- SEE ALSO
- ! parseargs(3), parseargs(3), parsecntl(1),
-
-
-
- *** parseargs1.txt.OLD Tue Mar 26 12:01:48 1991
- --- parseargs1.txt Tue Mar 26 11:59:52 1991
- ***************
- *** 81,87 ****
- the desired type, and diagnoses problems such as missing
- arguments, extra arguments, and argument values that are
- syntactically incorrect. Other behavior such as prompting
- ! the user for missing arguments and ignoring as command-line
- syntax may be specified on the command-line through the use
- of various options, or through the use of the ``PARSECNTL''
- environment variable.
- --- 81,87 ----
- the desired type, and diagnoses problems such as missing
- arguments, extra arguments, and argument values that are
- syntactically incorrect. Other behavior such as prompting
- ! the user for missing arguments and ignoring bad command-line
- syntax may be specified on the command-line through the use
- of various options, or through the use of the ``PARSECNTL''
- environment variable.
- ***************
- *** 233,243 ****
- ``sh'', ``csh'', ``ksh'', ``tcsh'', ``bash'', ``rc'',
- ``awk'', and ``perl'' as valid command interpreters. Awk
- output is slightly different from that of the other shells
- ! in that the actual variable setting are not printed but each
- ! line of an associative array is printed (the first field is
- ! the array index, the second is the value for that index).
- ! If no shell is specified, then the Bourne shell (``sh'')
- ! will be assumed.
-
- If the user wishes to use a value other than ``TRUE'' for a
- boolean flag that is true, this may be done using the -T
- --- 233,243 ----
- ``sh'', ``csh'', ``ksh'', ``tcsh'', ``bash'', ``rc'',
- ``awk'', and ``perl'' as valid command interpreters. Awk
- output is slightly different from that of the other shells
- ! in that the actual variable settings are not printed but
- ! each line of an associative array is printed (the first
- ! field is the array index, the second is the value for that
- ! index). If no shell is specified, then the Bourne shell
- ! (``sh'') will be assumed.
-
- If the user wishes to use a value other than ``TRUE'' for a
- boolean flag that is true, this may be done using the -T
- ***************
- *** 274,280 ****
- parseargs to be able to distinguish options to itself from
- options for the calling program.
-
- ! The default behavior of parseargs is allow both single-
- character options and long-options (keywords) on the
- command-line. The user may specify that only options (long-
- options) are to be permitted by specifying the -o (-l)
- --- 274,280 ----
- parseargs to be able to distinguish options to itself from
- options for the calling program.
-
- ! The default behavior of parseargs is to allow both single-
- character options and long-options (keywords) on the
- command-line. The user may specify that only options (long-
- options) are to be permitted by specifying the -o (-l)
- ***************
- *** 340,349 ****
- positional parameters of the calling program will be re-
- assigned to the contents of the argument list.
-
- ! For the awk and perl, if the variable name corresponding to
- ! the ARGLIST argument is ``ARGV'', then the positional
- ! parameters of the calling program will be re-assigned to the
- ! contents of the argument list.
- Bourne Shell Argument Lists
-
- For the Bourne shell, if the associated variable name is NOT
- --- 340,349 ----
- positional parameters of the calling program will be re-
- assigned to the contents of the argument list.
-
- ! For awk and perl, if the variable name corresponding to the
- ! ARGLIST argument is ``ARGV'', then the positional parameters
- ! of the calling program will be re-assigned to the contents
- ! of the argument list.
- Bourne Shell Argument Lists
-
- For the Bourne shell, if the associated variable name is NOT
- ***************
- *** 471,479 ****
-
- For perl, each argument list is considered an array and is
- set using the following syntax:
- ! @name=( arg1 , arg2 , ... )
-
- -
- The word-lists used by the C shell, the arrays used by the
- Korn shell, the Plan 9 shell, awk, perl, and the positional
- parameters used by all shells (if overwritten by parseargs)
- --- 471,479 ----
-
- For perl, each argument list is considered an array and is
- set using the following syntax:
- ! @name=( arg1 , arg2 , ... );
- ! A Final Note on Argument Lists
-
- The word-lists used by the C shell, the arrays used by the
- Korn shell, the Plan 9 shell, awk, perl, and the positional
- parameters used by all shells (if overwritten by parseargs)
- ***************
- *** 493,499 ****
- is parsed. The command-line will over-ride any options that
- are specified in this environment variable (except that
- ARGLISTs and ARGVECs set in ``CMD_ARGS'' will be appended
- ! from the command-line
-
- It is important to note that the contents of the
- ``CMD_ARGS'' environment variable are NOT expanded by the
- --- 493,499 ----
- is parsed. The command-line will over-ride any options that
- are specified in this environment variable (except that
- ARGLISTs and ARGVECs set in ``CMD_ARGS'' will be appended
- ! from the command-line if they are selected).
-
- It is important to note that the contents of the
- ``CMD_ARGS'' environment variable are NOT expanded by the
- ***************
- *** 552,558 ****
- Ignore any unrecognized or improperly specified
- command-line arguments and continue execution of the
- program. Normally, if an argument is unmatched (or is
- ! improperly specified), a usage message is printed
- program execution is terminated.
-
- OptsOnly
- --- 552,558 ----
- Ignore any unrecognized or improperly specified
- command-line arguments and continue execution of the
- program. Normally, if an argument is unmatched (or is
- ! improperly specified), a usage message is printed and
- program execution is terminated.
-
- OptsOnly
- ***************
- *** 599,612 ****
-
-
-
- ! Setting this flag cause character-case to be ignored
- when attempting to match single-character argument
- names (i.e. causes "-i" and "-I" will be considered
- equivalent).
-
- If the environment variable ``PARSECNTL'' is empty or
- ! undefined, then parsing behavior set by the programmer is
- ! used. If the programmer has not explicitly used
- parsecntl(3) to modify the parsing behavior, then the
- default behavior will be ``Flags1st'' for Unix systems,
- ``!Prompt + !Ignore'' for AmigaDOS systems, ``CaseIgnore''
- --- 599,612 ----
-
-
-
- ! Setting this flag causes character-case to be ignored
- when attempting to match single-character argument
- names (i.e. causes "-i" and "-I" will be considered
- equivalent).
-
- If the environment variable ``PARSECNTL'' is empty or
- ! undefined, then the parsing behavior set by the programmer
- ! is used. If the programmer has not explicitly used
- parsecntl(3) to modify the parsing behavior, then the
- default behavior will be ``Flags1st'' for Unix systems,
- ``!Prompt + !Ignore'' for AmigaDOS systems, ``CaseIgnore''
- *** parseargs3.txt.OLD Tue Mar 26 12:01:58 1991
- --- parseargs3.txt Tue Mar 26 12:00:11 1991
- ***************
- *** 15,21 ****
- int fparseargs( FILE *fp, ARGDESC *argd )
- int lparseargs( ArgList *argls, ARGDESC *argd )
- int sparseargs( char *str, ARGDESC *argd )
- ! int vparseargs( ARGDESC *argd, ... )
- void usage( const ARGDESC *argd )
-
- DESCRIPTION
- --- 15,21 ----
- int fparseargs( FILE *fp, ARGDESC *argd )
- int lparseargs( ArgList *argls, ARGDESC *argd )
- int sparseargs( char *str, ARGDESC *argd )
- ! int vparseargs( ARGDESC *argd, int argc, ... )
- void usage( const ARGDESC *argd )
-
- DESCRIPTION
- ***************
- *** 39,45 ****
- ``-v\nval'' is a not).
-
- Given an ArgList and an argdesc array, lparseargs will parse
- ! arguments in a file in much the same manner as parseargs.
-
- Given a single string and an argdesc array, sparseargs will
- parse arguments from a string in much the same manner as
- --- 39,46 ----
- ``-v\nval'' is a not).
-
- Given an ArgList and an argdesc array, lparseargs will parse
- ! arguments in an ArgList in much the same manner as par-
- ! seargs.
-
- Given a single string and an argdesc array, sparseargs will
- parse arguments from a string in much the same manner as
- ***************
- *** 56,62 ****
- to parse, and a (possibly NULL terminated) list of
- argument-strings and parses them in much the same manner as
- parseargs. Unlike sparseargs, vparseargs assumes that all
- - parameters are already split up into tokens, hence any
-
-
-
- --- 57,62 ----
- ***************
- *** 71,79 ****
-
-
-
- ! whitespace characters contained in any of the string-
- ! parameters are used as is (and will be considered a part of
- ! an argument name or value).
-
-
- Given an argdesc array, usage will print the usage for the
- --- 71,80 ----
-
-
-
- ! parameters are already split up into tokens, hence any whi-
- ! tespace characters contained in any of the string-parameters
- ! are used as is (and will be considered a part of an argument
- ! name or value).
-
-
- Given an argdesc array, usage will print the usage for the
- ***************
- *** 103,109 ****
-
- argTypePtr_t ad_type;
- This field is a pointer to a type conversion function
- ! (such as the ones provided in argtype(3). The type
- conversion function is responsible for verifying the
- validity of the argument, allocating any necessary
- storage for its internal representation, and converting
- --- 104,110 ----
-
- argTypePtr_t ad_type;
- This field is a pointer to a type conversion function
- ! (such as the ones provided in argtype(3)). The type
- conversion function is responsible for verifying the
- validity of the argument, allocating any necessary
- storage for its internal representation, and converting
- ***************
- *** 121,128 ****
-
- ARBPTR ad_valp;
- This field is a generic pointer to the storage used to
- ! represent the internal value of the command-line argu-
- ! ment. It may be a pointer to a number, a boolean value,
-
-
-
- --- 122,128 ----
-
- ARBPTR ad_valp;
- This field is a generic pointer to the storage used to
- ! represent the internal value of the command-line
-
-
-
- ***************
- *** 137,163 ****
-
-
-
- ! a string, a list, or anything else for which there
- ! exists a corresponding arg-type function to use in the
- ! ad_type field. In the case of of parseargs(1) this
- ! field must be the name of the corresponding shell vari-
- ! able which eventually hold the value of the argument
- ! given on the command-line.
-
- const char *ad_prompt;
- This field contains the long-name of the argument and
- an optional description (the description must be
- separated from the long-name by at least one whitespace
- ! characters and may optionally be enclosed in a set of
- balanced delimiters (such as parentheses, curly-braces,
- ! square-brackets, or angle-brackets. If the long-name
- contains any uppercase characters, then the substring
- of long-name consisting of all uppercase characters is
- ! used as the argument name and the entire long-name is
- ! used as the name of the argument-value (if a value my
- ! be supplied). The long-name may be matched by supplying
- ! a unique prefix of either the argument name or the
- ! argument-value name.
-
- DEFINING ARGDESC ARRAYS
- When defining an argdesc array, the first item in the list
- --- 137,164 ----
-
-
-
- ! argument. It may be a pointer to a number, a boolean
- ! value, a string, a list, or anything else for which
- ! there exists a corresponding arg-type function to use
- ! in the ad_type field. In the case of of parseargs(1)
- ! this field must be the name of the corresponding shell
- ! variable which will eventually hold the value of the
- ! argument given on the command-line.
-
- const char *ad_prompt;
- This field contains the long-name of the argument and
- an optional description (the description must be
- separated from the long-name by at least one whitespace
- ! character and may optionally be enclosed in a set of
- balanced delimiters (such as parentheses, curly-braces,
- ! square-brackets, or angle-brackets). If the long-name
- contains any uppercase characters, then the substring
- of long-name consisting of all uppercase characters is
- ! used as the argument keyword and the entire long-name
- ! is used as the name of the argument (if a value my be
- ! supplied). The long-name may be matched by supplying a
- ! unique prefix of either the argument keyword or the
- ! argument name.
-
- DEFINING ARGDESC ARRAYS
- When defining an argdesc array, the first item in the list
- ***************
- *** 186,197 ****
- ENDOFARGS
- };
-
- - This describes a program accepting up to three flag argu-
- - ments and one or two positional arguments, plus a list of
- - additional file arguments. Only the first positional
-
-
-
- Page 3
-
-
- --- 187,197 ----
- ENDOFARGS
- };
-
-
-
-
- +
- +
- Page 3
-
-
- ***************
- *** 203,209 ****
-
-
-
- ! argument is required. The possible flags (in UNIX) are:
-
- -c count An integer repetition count. This defaults to
- two.
- --- 203,212 ----
-
-
-
- ! This describes a program accepting up to three flag argu-
- ! ments and one or two positional arguments, plus a list of
- ! additional file arguments. Only the first positional argu-
- ! ment is required. The possible flags (in UNIX) are:
-
- -c count An integer repetition count. This defaults to
- two.
- ***************
- *** 251,263 ****
- "-x value"); Its mere presence (or lack thereof) on the
- command-line is sufficient to determine the necessary
- action(s) to take (as in "-x"). Boolean argument types
- ! and Pseudo-argument types automatically default to ARG-
- ! NOVAL.
-
- - ARGVALOPT
-
-
- -
- Page 4
-
-
- --- 254,263 ----
- "-x value"); Its mere presence (or lack thereof) on the
- command-line is sufficient to determine the necessary
- action(s) to take (as in "-x"). Boolean argument types
- ! and Pseudo-argument types automatically default to
-
-
-
- Page 4
-
-
- ***************
- *** 269,274 ****
- --- 269,277 ----
-
-
-
- + ARGNOVAL.
- +
- + ARGVALOPT
- This flag is used to indicate that the command-line
- argument takes a value (as in "-s string" or
- "/str=string") but that the value to this command-line
- ***************
- *** 318,326 ****
- line.
-
- ARGVALSEP
- - The value to this argument was supplied in a separate
- - argv element from the argument itself (as in "-x value"
- - as opposed to "-xvalue").
-
-
-
- --- 321,326 ----
- ***************
- *** 335,340 ****
- --- 335,344 ----
-
-
-
- + The value to this argument was supplied in a separate
- + argv element from the argument itself (as in "-x value"
- + as opposed to "-xvalue").
- +
- ARGKEYWORD
- This argument was matched as a keyword (long-form) on
- the command-line and not as a single character.
- ***************
- *** 383,395 ****
- provided.
-
- arg_description(ad)
- - Return the description string (or an empty string if no
- - description was given) for this argument.
-
- - ARG_isPOSITIONAL(ad)
-
-
- -
- Page 6
-
-
- --- 387,395 ----
- ***************
- *** 401,406 ****
- --- 401,410 ----
-
-
-
- + Return the description string (or an empty string if no
- + description was given) for this argument.
- +
- + ARG_isPOSITIONAL(ad)
- Evaluates to TRUE if this argument may be positionally
- matched.
-
- ***************
- *** 449,461 ****
- arrays. The "old-style" is still accepted (but if used it is
- recommended that the STARTOFARGS macro is used in conjunc-
- tion with ENDOFARGS). An example use of these macros
- - (which, with one exception, all begin with ``CMD'') follows:
- - #include <parseargs.h>
-
- - static BOOL bflag = FALSE;
-
-
- -
- Page 7
-
-
- --- 453,461 ----
- ***************
- *** 467,472 ****
- --- 467,476 ----
-
-
-
- + (which, with one exception, all begin with ``CMD'') follows:
- + #include <parseargs.h>
- +
- + static BOOL bflag = FALSE;
- static char *arg1 = CHARNULL;
- static char *arg2 = CHARNULL;
-
- ***************
- *** 515,524 ****
- keywords to display command-usage for all command-line
- styles. In Addition, for VMS style commands, the qualifiers
- /INPUT=file, /OUTPUT=file, and /ERROR=file, may be used to
- - redirect stdin, stdout, and stderr (respectively) to a file.
- - For AmigaDOS style commands, the keyword ``ENDKWDS'' may be
- - used to disable parsing for any more keywords on the
- - command-line.
-
-
-
- --- 519,524 ----
- ***************
- *** 533,538 ****
- --- 533,543 ----
-
-
-
- + redirect stdin, stdout, and stderr (respectively) to a file.
- + For AmigaDOS style commands, the keyword ``ENDKWDS'' may be
- + used to disable parsing for any more keywords on the
- + command-line.
- +
- SUPPLYING DEFAULT ARGUMENTS
- Programs that use parseargs may be given default arguments
- under UNIX and PCs through the use of environment variables
- ***************
- *** 543,549 ****
- is parsed. The command-line will over-ride any options that
- are specified in this environment variable (except that
- ARGLISTs and ARGVECs set in ``CMD_ARGS'' will be appended
- ! from the command-line
-
- It is important to note that the contents of the
- ``CMD_ARGS'' environment variable are NOT expanded by the
- --- 548,554 ----
- is parsed. The command-line will over-ride any options that
- are specified in this environment variable (except that
- ARGLISTs and ARGVECs set in ``CMD_ARGS'' will be appended
- ! from the command-line if they are selected).
-
- It is important to note that the contents of the
- ``CMD_ARGS'' environment variable are NOT expanded by the
- ***************
- *** 579,593 ****
- Prompt
- Prompt the user for any missing arguments that are
- required on the command-line. No special escaping or
- ! quoting is performed on the user input. Required argu-
- ! ments that expect a list of values will be repeatedly
- ! prompted for (one item per line) until a blank line
- ! (followed by a carriage return) is entered.
-
- - Ignore
-
-
- -
- Page 9
-
-
- --- 584,593 ----
- Prompt
- Prompt the user for any missing arguments that are
- required on the command-line. No special escaping or
- ! quoting is performed on the user input. Required
-
-
-
- Page 9
-
-
- ***************
- *** 599,609 ****
-
-
-
- Ignore any unrecognized or improperly specified
- command-line arguments and continue execution of the
- program. Normally, if an argument is unmatched (or is
- ! improperly specified), a usage message is printed pro-
- ! gram execution is terminated.
-
- OptsOnly
- Under UNIX, setting this flag will disable the parsing
- --- 599,614 ----
-
-
-
- + arguments that expect a list of values will be repeat-
- + edly prompted for (one item per line) until a blank
- + line (followed by a carriage return) is entered.
- +
- + Ignore
- Ignore any unrecognized or improperly specified
- command-line arguments and continue execution of the
- program. Normally, if an argument is unmatched (or is
- ! improperly specified), a usage message is printed and
- ! program execution is terminated.
-
- OptsOnly
- Under UNIX, setting this flag will disable the parsing
- ***************
- *** 635,659 ****
- positional argument.
-
- CaseIgnore
- ! Setting this flag cause character-case to be ignored
- when attempting to match single-character argument
- names (i.e. causes "-i" and "-I" will be considered
- equivalent).
-
- If the environment variable ``PARSECNTL'' is empty or unde-
- ! fined, then parsing behavior set by the programmer is used.
- ! If the programmer has not explicitly used parsecntl(3) to
- ! modify the parsing behavior, then the default behavior will
- ! be ``Flags1st'' for Unix systems, ``!Prompt + !Ignore'' for
- ! AmigaDOS systems, ``CaseIgnore'' for MS-DOS and OS/2 sys-
- ! tems, and ``Prompt'' for VMS systems.
-
- - USAGE MESSAGES
- - Through the use of an environment variable (or a VMS sym-
- - bol), the user may control the syntax and the verbosity of
-
-
- -
- Page 10
-
-
- --- 640,659 ----
- positional argument.
-
- CaseIgnore
- ! Setting this flag causes character-case to be ignored
- when attempting to match single-character argument
- names (i.e. causes "-i" and "-I" will be considered
- equivalent).
-
- If the environment variable ``PARSECNTL'' is empty or unde-
- ! fined, then the parsing behavior set by the programmer is
- ! used. If the programmer has not explicitly used par-
- ! secntl(3) to modify the parsing behavior, then the default
- ! behavior will be ``Flags1st'' for Unix systems, ``!Prompt +
- ! !Ignore'' for AmigaDOS systems, ``CaseIgnore'' for MS-DOS
-
-
-
- Page 10
-
-
- ***************
- *** 665,670 ****
- --- 665,675 ----
-
-
-
- + and OS/2 systems, and ``Prompt'' for VMS systems.
- +
- + USAGE MESSAGES
- + Through the use of an environment variable (or a VMS sym-
- + bol), the user may control the syntax and the verbosity of
- the command-usage messages that are printed by parseargs.
- The desired level of verbosity may be set by defining the
- environment variable ``USAGECNTL" to be a combination of
- ***************
- *** 712,725 ****
- LongOpts
- Long-option syntax is displayed.
-
- - KeyWords
- - Same as LongOpts.
-
-
-
- -
- -
- -
- Page 11
-
-
- --- 717,725 ----
- ***************
- *** 731,736 ****
- --- 731,739 ----
-
-
-
- + KeyWords
- + Same as LongOpts.
- +
- If the environment variable ``USAGECNTL'' is empty or unde-
- fined, then the default usage level (which is presently
- ``Verbose + Options'') will be used.
- ***************
- *** 751,765 ****
- ArgList structure. L_NEXT returns the address of the next
- item in the list and L_STRING returns the string-value of
- the current list-item. L_FLAGS return the arg-flags for a
- ! given item in the list. With non-multivalued, only the flags
- ! in the argument descriptor are needed; lists and vectors
- ! however need a set of flags for each item they contain. Once
- ! an arg-list has been created, it may be deallocated using
- ! the function listFree. ListFree takes two parameters, the
- ! first of which is the address of the first item in the arg-
- ! list, and the second of which is a boolean value that is
- ! TRUE only if each value pointed to by each item should also
- ! be deallocated.
-
- An alternative to argument-lists is argument vectors (or
- arg-vectors). Arg-vectors use the ARGVEC flag instead of
- --- 754,766 ----
- ArgList structure. L_NEXT returns the address of the next
- item in the list and L_STRING returns the string-value of
- the current list-item. L_FLAGS return the arg-flags for a
- ! given item in the list. With non-multivalued arguments, only
- ! the flags in the argument descriptor are needed; lists and
- ! vectors however need a set of flags for each item they con-
- ! tain. Once an arg-list has been created, it may be deallo-
- ! cated using the function listFree. ListFree takes one param-
- ! eter: first of which is the address of the first item in the
- ! arg-list.
-
- An alternative to argument-lists is argument vectors (or
- arg-vectors). Arg-vectors use the ARGVEC flag instead of
- ***************
- *** 782,788 ****
-
- ( StrVec.array[ StrVec.count ] == (char *)NULL )
-
- - is always true, and character-vectors will always have an
-
-
-
- --- 783,788 ----
- ***************
- *** 797,802 ****
- --- 797,803 ----
-
-
-
- + is always true, and character-vectors will always have an
- extra NUL-character at the end such that:
-
- ( CharVec.array[ CharVec.count ] == '\0' )
- ***************
- *** 848,854 ****
- printf( "String[%d]=%s, flags=%x\n",
- i, StrVec.array[i], StrVec.flags[i] );
-
- - for ( i = 0 ; i < NumVec.count ; i++ )
-
-
-
- --- 849,854 ----
- ***************
- *** 863,868 ****
- --- 863,869 ----
-
-
-
- + for ( i = 0 ; i < NumVec.count ; i++ )
- printf( "Number[%d]=%s, flags=%x\n",
- i, NumVec.array[i], NumVec.flags[i] );
-
- ***************
- *** 887,900 ****
- being converted. Its main use is to find the location in
- which to store the converted value, located in
- argd->ad_valp. The string value to be converted is passed
- ! in argp (which will be NULL if the ARGNOVAL flag was set for
- the corresponding entry in the arg-descriptor table). The
- ! copyf flag is TRUE if the argp string value must be copied
- when saved. Most non-string types are copied implicitly
- (for example, integer arguments are stored in binary form,
- so the original string value need not be saved), so this
- argument can usually be ignored. Put simply, this flag is
- ! TRUE when argp points to a temporary buffer area.
-
- If the type function successfully converts the value, and
- uses the entire value, it should return TRUE. If the type
- --- 888,901 ----
- being converted. Its main use is to find the location in
- which to store the converted value, located in
- argd->ad_valp. The string value to be converted is passed
- ! in vp (which will be NULL if the ARGNOVAL flag was set for
- the corresponding entry in the arg-descriptor table). The
- ! copyf flag is TRUE if the vp string value must be copied
- when saved. Most non-string types are copied implicitly
- (for example, integer arguments are stored in binary form,
- so the original string value need not be saved), so this
- argument can usually be ignored. Put simply, this flag is
- ! TRUE when vp points to a temporary buffer area.
-
- If the type function successfully converts the value, and
- uses the entire value, it should return TRUE. If the type
- ***************
- *** 914,920 ****
- #define REALLOC(ptr,size) ((! ptr) ? malloc(size) : realloc(ptr, size))
- typedef ARGVEC_T(FILE *) FILEvec_t;
-
- - BOOL argReadFile( ARGDESC *ad, char *vp, BOOL copyf )
-
-
-
- --- 915,920 ----
- ***************
- *** 929,934 ****
- --- 929,935 ----
-
-
-
- + BOOL argReadFile( ARGDESC *ad, char *vp, BOOL copyf )
- {
- register FILE *fp;
- fp = fopen(vp, "r");
- ***************
- *** 979,986 ****
-
- Under VAX/VMS and AmigaDOS, single-character options are not
- used and the ``long'' name (in the prompt field of an argu-
- ! ment descriptor) is always used to match for possible argu-
- ! ments (or keywords, or qualifiers).
-
-
-
- --- 980,986 ----
-
- Under VAX/VMS and AmigaDOS, single-character options are not
- used and the ``long'' name (in the prompt field of an argu-
- ! ment descriptor) is always used to match for possible
-
-
-
- ***************
- *** 995,1000 ****
- --- 995,1002 ----
-
-
-
- + arguments (or keywords, or qualifiers).
- +
- For all supported operating systems, a long option may be
- matched in one of two ways: it may match all uppercase char-
- acters in the prompt field, or it may match all characters
- ***************
- *** 1045,1052 ****
- pe_NOMATCH
- Unable to match the named argument. This occurs when
- the argument keyword name passed to parsecntl (using
- - the pc_ARGFLAGS functions code) was found in the given
- - argdesc-array or in its default-list.
-
-
-
- --- 1047,1052 ----
- ***************
- *** 1061,1066 ****
- --- 1061,1069 ----
-
-
-
- + the pc_ARGFLAGS functions code) was found in the given
- + argdesc-array or in its default-list.
- +
- pe_BADMODE
- Bad mode for given command in parsecntl. This occurs
- when pc_WRITE or pc_RDWR mode is passed to parsecntl in
- ***************
- *** 1110,1121 ****
- Hence multiple ``leading dash'' arguments may specified as
- follows:
-
- - -f-dash_arg1 -f-dash_arg2 ...
-
-
-
- -
- -
- Page 17
-
-
- --- 1113,1121 ----
- ***************
- *** 1127,1139 ****
-
-
-
- BUGS
- When a non-multivalued argument appears more than once on
- the command-line then only the last value supplied is used.
- A problem occurs however in the following scenario: suppose
- ! `-s' is an option that takes an optional string argument (nd
- ! suppose `-x' is some boolean flag). Then if the following
- ! command-line is issued:
-
- command -s string -x -s
-
- --- 1127,1141 ----
-
-
-
- + -f-dash_arg1 -f-dash_arg2 ...
- +
- BUGS
- When a non-multivalued argument appears more than once on
- the command-line then only the last value supplied is used.
- A problem occurs however in the following scenario: suppose
- ! `-s' is an option that takes an optional string argument
- ! (and suppose `-x' is some boolean flag). Then if the follow-
- ! ing command-line is issued:
-
- command -s string -x -s
-
- ***************
- *** 1159,1166 ****
- argument flags ARGPOS, ARGVALOPT, ARGVALREQ, ARGVALGIVEN,
- ARGNOVAL, and ARGVEC; and VAX/VMS version and IBM-PC version
- by Brad Appleton
- -
- -
-
-
-
- --- 1161,1166 ----
- No differences encountered
-