home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume19 / parseargs / patch05a / PATCH05 < prev   
Encoding:
Text File  |  1991-05-17  |  52.7 KB  |  1,248 lines

  1. diff -cNr ../patchlevel4/Intro ./Intro
  2. *** ../patchlevel4/Intro    Thu May  2 10:56:07 1991
  3. --- ./Intro    Thu May  2 14:34:14 1991
  4. ***************
  5. *** 51,58 ****
  6.    Parseargs consists of a set of C-functions to parse arguments from the
  7.    command-line, from files, from strings, from linked-lists, and from
  8.    string-vectors. Also included is a command-line interface which will parse
  9. !  arguments for shell scripts (sh, csh/tcsh, ksh, bash, and rc), awk-scripts,
  10. !  and perl-scripts.
  11.   
  12.    The basic structure used by parseargs is the argument-descriptor (sometimes
  13.    called "argdesc" for brevity).  An array/string of argdescs is declared by
  14. --- 51,58 ----
  15.    Parseargs consists of a set of C-functions to parse arguments from the
  16.    command-line, from files, from strings, from linked-lists, and from
  17.    string-vectors. Also included is a command-line interface which will parse
  18. !  arguments for shell scripts (sh, csh/tcsh/itcsh, ksh, bash, zsh, and rc),
  19. !  awk-scripts, and perl-scripts.
  20.   
  21.    The basic structure used by parseargs is the argument-descriptor (sometimes
  22.    called "argdesc" for brevity).  An array/string of argdescs is declared by
  23. ***************
  24. *** 78,86 ****
  25.    or from a shell script as in the following example:
  26.   
  27.       echo "$ARGDESC_STR" | parseargs -s sh -- "$0" "$@" >tmp$$
  28. !     if [ $? = 0 ] ; then
  29. !        . tmp$$
  30. !     fi
  31.       /bin/rm -f tmp$$
  32.   
  33.    And before you know it, your command-line had been parsed, all variables 
  34. --- 78,84 ----
  35.    or from a shell script as in the following example:
  36.   
  37.       echo "$ARGDESC_STR" | parseargs -s sh -- "$0" "$@" >tmp$$
  38. !     test  $? = 0  &&  . tmp$$
  39.       /bin/rm -f tmp$$
  40.   
  41.    And before you know it, your command-line had been parsed, all variables 
  42. diff -cNr ../patchlevel4/MANIFEST ./MANIFEST
  43. *** ../patchlevel4/MANIFEST    Thu May  2 11:06:06 1991
  44. --- ./MANIFEST    Thu May  2 13:00:33 1991
  45. ***************
  46. *** 6,12 ****
  47.    Makefile.cpp               3    makefile template read by the C preprocessor
  48.    README                     1    release information
  49.    amiga_args.c               4    parse AmigaDOS command-lines
  50. !  arglist.c                  2    implement the listXxxx functions for arglists
  51.    argtype.c                  5    implement the argXxxx argument type functions
  52.    doc                        1    directory containing documentation
  53.    doc/Makefile               2    makefile for the documentation
  54. --- 6,12 ----
  55.    Makefile.cpp               3    makefile template read by the C preprocessor
  56.    README                     1    release information
  57.    amiga_args.c               4    parse AmigaDOS command-lines
  58. !  arglist.c                  3    implement the listXxxx functions for arglists
  59.    argtype.c                  5    implement the argXxxx argument type functions
  60.    doc                        1    directory containing documentation
  61.    doc/Makefile               2    makefile for the documentation
  62. ***************
  63. *** 15,21 ****
  64.    doc/argflags.inc           2    describe argument flags
  65.    doc/argtype.man3           3    {n,t}roff source for argtype(3)
  66.    doc/argvalopt.inc          1    describe options with optional arguments
  67. !  doc/bugs.inc               2    BUGS section for parseargs(1)
  68.    doc/caveats.inc            1    CAVEATS section for parseargs(1) and (3)
  69.    doc/cmd_macros.inc         1    describe CMD_XXX macros
  70.    doc/defargs.inc            1    describe the default argdesc-array
  71. --- 15,21 ----
  72.    doc/argflags.inc           2    describe argument flags
  73.    doc/argtype.man3           3    {n,t}roff source for argtype(3)
  74.    doc/argvalopt.inc          1    describe options with optional arguments
  75. !  doc/bugs.inc               1    BUGS section for parseargs(1)
  76.    doc/caveats.inc            1    CAVEATS section for parseargs(1) and (3)
  77.    doc/cmd_macros.inc         1    describe CMD_XXX macros
  78.    doc/defargs.inc            1    describe the default argdesc-array
  79. ***************
  80. *** 44,56 ****
  81.    doc/vparseargs3.inc        1    describe vparseargs(3)
  82.    ibm_args.c                 5    parse MS-DOS and OS/2 command-lines
  83.    parseargs.awk              3    parseargs for awk
  84. !  parseargs.c                7    C source for parseargs(1)
  85. !  parseargs.h                6    include file for parseargs library
  86.    parseargs.pl               2    parseargs for perl
  87. !  patchlevel.h               1    list of patches (most recent first)
  88.    pgopen.c                   4    pipe output to a pager
  89.    pgopen.h                   1    include file for pgopen.c
  90. !  stest.c                    3    test progarm for parseargs(3)
  91.    strfuncs.c                 6    string library
  92.    strfuncs.h                 1    include file for strfuncs.c
  93.    syserr.c                   2    diagnostic message printing routines
  94. --- 44,56 ----
  95.    doc/vparseargs3.inc        1    describe vparseargs(3)
  96.    ibm_args.c                 5    parse MS-DOS and OS/2 command-lines
  97.    parseargs.awk              3    parseargs for awk
  98. !  parseargs.c                8    C source for parseargs(1)
  99. !  parseargs.h                7    include file for parseargs library
  100.    parseargs.pl               2    parseargs for perl
  101. !  patchlevel.h               2    list of patches (most recent first)
  102.    pgopen.c                   4    pipe output to a pager
  103.    pgopen.h                   1    include file for pgopen.c
  104. !  stest.c                    4    test program for parseargs(3)
  105.    strfuncs.c                 6    string library
  106.    strfuncs.h                 1    include file for strfuncs.c
  107.    syserr.c                   2    diagnostic message printing routines
  108. ***************
  109. *** 60,69 ****
  110.    test.pl                    1    perl test program for parseargs(1)
  111.    test.rc                    1    Plan 9 shell test program for parseargs(1)
  112.    test.sh                    1    Bourne shell test program for parseargs(1)
  113. !  unix_args.c                4    parse Unix command-lines
  114.    unix_man.c                 3    print Unix manual-page templates
  115.    useful.h                   3    common include file for the library
  116. !  vms_args.c                 5    parse VAX/VMS DCL command-lines
  117.    vprintf.c                  3    portable vfprintf, vprintf, and vsprintf
  118.    winsize.c                  3    determine # rows and # columns of window
  119. !  xparse.c                   8    implement the parseargs library
  120. --- 60,70 ----
  121.    test.pl                    1    perl test program for parseargs(1)
  122.    test.rc                    1    Plan 9 shell test program for parseargs(1)
  123.    test.sh                    1    Bourne shell test program for parseargs(1)
  124. !  test.zsh                   2    Z shell test program for parseargs(1)
  125. !  unix_args.c                5    parse Unix command-lines
  126.    unix_man.c                 3    print Unix manual-page templates
  127.    useful.h                   3    common include file for the library
  128. !  vms_args.c                 6    parse VAX/VMS DCL command-lines
  129.    vprintf.c                  3    portable vfprintf, vprintf, and vsprintf
  130.    winsize.c                  3    determine # rows and # columns of window
  131. !  xparse.c                   9    implement the parseargs library
  132. diff -cNr ../patchlevel4/README ./README
  133. *** ../patchlevel4/README    Thu May  2 10:56:10 1991
  134. --- ./README    Thu May  2 14:34:23 1991
  135. ***************
  136. *** 58,106 ****
  137.   
  138.    CONTENTS
  139.    ========
  140. !      README : this file.
  141. !      [ Intro : introduction to parseargs -- BDA ]
  142. !      [ doc/Makefile : makefile for parseargs documentation -- BDA ]
  143. !      [ doc/* : documentation for parseargs -- BDA ]
  144. !      Makefile : a makefile for the library.
  145. !      [ Makefile.cpp : a makefile template -- BDA ]
  146. !      useful.h : a general header file, used by most everything.
  147. !      parseargs.h : headers for the argument parser.
  148. !      [ parseargs.c is now broken down into the following files : PDS ]
  149. !          unix_args.c : a command line argument parser. Popular
  150. !              response to my C Advisor column about this routine
  151. !              in UNIX Review Vol. 7 No. 11 prompted me to make
  152. !              this distribution available.
  153. !          amiga_args.c : Amiga version of unix_args.c -- PDS
  154. !          ibm_args.c : IBM-PC version of unix_args.c -- BDA
  155. !          vms_args.c : VAX/VMS version of unix_args.c -- BDA
  156. !          arglist.c : routines for ARGLIST options. -- PDS
  157. !          argtype.c : routines for other options. The argument value parsers
  158. !              for floating point values may be excluded by #defining the
  159. !              macro NOFLOAT (only if you do NOT need floating-point values).
  160. !              I had to break this out because RISC/os 4.01 from Mips doesn't
  161. !              seem to support strtod in the BSD environment. You may find you
  162. !              need to include -lm for this to work.
  163. !          strfuncs.[ch] : string-manipulation functions &
  164. !              dictionary-style searching routines.
  165. !      [ end of parseargs.c : PDS ]
  166. !      [ parseargs.c has been resurrected as a command line interface
  167. !              to the parseargs library routines -- BDA ]
  168. !      syserr.c : error message printing routines.
  169. !      stest.c : a small test program for the argument parser.
  170. !      [ xparse.c : source for [flsv]parseargs() and parsecntl() -- BDA ]
  171. !      [ unix_man.c : routine to print unix man1 templates -- BDA ]
  172. !      [ winsize.c : routine to "portably" get the screen size -- BDA ]
  173. !      [ pgopen.[ch] : Unix source to pipe output to a pager -- BDA ]
  174. !      [ vprintf.c : portable implementations of vprintf() & vfprintf() ]
  175. !      [ parseargs.awk : awk interface to parseargs(1) -- BDA ]
  176. !      [ parseargs.pl : perl interface to parseargs(1) -- BDA ]
  177. !      [ test.sh : Bourne shell-script to test parseargs(1) -- BDA ]
  178. !      [ test.csh : C shell-script to test parseargs(1) -- BDA ]
  179. !      [ test.ksh : Korn shell-script to test parseargs(1) -- BDA ]
  180. !      [ test.awk : awk script to test parseargs(1) -- BDA ]
  181. !      [ test.pl : perl script to test parseargs(1) -- BDA ]
  182.   
  183.    The parseargs routines really ought to have a way of matching a  list
  184.    (e.g., return the rest of argv). This isn't especially hard to do, but
  185.    I haven't gotten around to it yet. [ Added, with ARGLIST flag -- PDS ]
  186. --- 58,68 ----
  187.   
  188.    CONTENTS
  189.    ========
  190. !  See the file "MANIFEST" in the distribution for a complete list and
  191. !  description of all the files included in this release.
  192.   
  193. +  TO DO
  194. +  =====
  195.    The parseargs routines really ought to have a way of matching a  list
  196.    (e.g., return the rest of argv). This isn't especially hard to do, but
  197.    I haven't gotten around to it yet. [ Added, with ARGLIST flag -- PDS ]
  198. ***************
  199. *** 261,268 ****
  200.   
  201.                Update to parseargs (and major re-write) by Brad Appleton
  202.                           (brad@travis.ssd.csd.harris.com)
  203. !                               Last Update: 03/01/91
  204.   
  205.    DISCLAIMER
  206.    ==========
  207.    Neither Brad Appleton, nor Harris Corporation (including any of its
  208. --- 223,237 ----
  209.   
  210.                Update to parseargs (and major re-write) by Brad Appleton
  211.                           (brad@travis.ssd.csd.harris.com)
  212. !                               Last Update: 04/12/91
  213. !  
  214.   
  215. +  THIS RELEASE
  216. +  ============
  217. +  Read the file patchlevel.h in the distribution to find out what version
  218. +  and patchlevel of parseargs you have received.
  219.    DISCLAIMER
  220.    ==========
  221.    Neither Brad Appleton, nor Harris Corporation (including any of its
  222. ***************
  223. *** 427,449 ****
  224.    If someone wants to try to add more shell-types to parseargs.c, here
  225.    are the main things that need to be done:
  226.   
  227. !  1. add #defines for both the name (a string) and type (an integer) of
  228. !     shell (e.g #define BOURNE_SHELL "sh" and #define SH 4)
  229.   
  230. !  2. add a shell_info entry into the array Shell[]. The index of the
  231. !     entry in the array should be the number used in the #define for the
  232. !     type of shell.
  233. !  3. make sure that get_shell_type() will return the proper value for
  234. !     the new shell.
  235. !  4. print_args doesnt really do any shell specific stuff outside of
  236. !     indexing into the table. The print_arglist() and
  237. !     unset_positional_parameters() functions do some shell specific stuff
  238. !     and will need a case added to the switch statement(s) for the newly
  239. !     added shell.
  240.   
  241. !  5. If the information in the shell-info structure is not sufficient
  242.       for the new shell then you should either:
  243.          a) redefine the structure for all shells including your shell.
  244.          b) add some special code into print_args() for your shell!
  245. --- 396,412 ----
  246.    If someone wants to try to add more shell-types to parseargs.c, here
  247.    are the main things that need to be done:
  248.   
  249. !  1. add an entry for the shell type into the type definition for the
  250. !     "shell_t" enumerated type.
  251.   
  252. !  2. add a shell_info entry for the shell into the array Shell[].
  253.   
  254. !  3. print_args doesnt really do any shell specific stuff outside of
  255. !     indexing into the table. The print_arglist() function does some
  256. !     shell specific stuff and MAY need a case added to the switch statement(s)
  257. !     for the newly added shell.
  258. !  4. If the information in the shell-info structure is not sufficient
  259.       for the new shell then you should either:
  260.          a) redefine the structure for all shells including your shell.
  261.          b) add some special code into print_args() for your shell!
  262. ***************
  263. *** 786,792 ****
  264.           NAME                        OS
  265.       ------------------   ------------------------
  266.        unix                Unix (BSD or AT&T)
  267. !      BSD, ucb_universe   BSD Unix (only one need be present)
  268.        MANX, AZTEC         AmigaDOS
  269.        MSDOS               MS-DOS for IBM PCs
  270.        OS2                 OS/2 for IBM PCs
  271. --- 749,755 ----
  272.           NAME                        OS
  273.       ------------------   ------------------------
  274.        unix                Unix (BSD or AT&T)
  275. !      BSD, SYSV           BSD Unix or AT&T Unix (only one should be present)
  276.        MANX, AZTEC         AmigaDOS
  277.        MSDOS               MS-DOS for IBM PCs
  278.        OS2                 OS/2 for IBM PCs
  279. ***************
  280. *** 817,823 ****
  281.    By default, if SWITCHAR is undefined then both the long and short
  282.    option prefix character are '/'. One is able to distinguish an option
  283.    from a long-option in this case because the third character of an
  284. !  option-arg will always be '=' or ' '. Hence, using the test program
  285.    with the defaults, both "ibm_test foo /D=directory" and "ibm_test
  286.    /DIR=directory" are equivalent.
  287.   
  288. --- 780,786 ----
  289.    By default, if SWITCHAR is undefined then both the long and short
  290.    option prefix character are '/'. One is able to distinguish an option
  291.    from a long-option in this case because the third character of an
  292. !  option-arg will always be '=' or '\0'. Hence, using the test program
  293.    with the defaults, both "ibm_test foo /D=directory" and "ibm_test
  294.    /DIR=directory" are equivalent.
  295.   
  296. ***************
  297. *** 852,859 ****
  298.    thanks to posters from comp.os.vms for giving me a clue on how to do
  299.    this). As a result of this, under VAX/VMS, there are two new argtype
  300.    functions "argInput" and "argOutput": each requires that ad->ad_valp
  301. !  be a  file pointer (not a pointer to a file pointer as in "__ &stdin"
  302. !  but an actual file pointer as in "__ stdin"). ArgInput and argOutput
  303.    close the stream associated with the given file-pointer and reconnect
  304.    the stream to the named file for input or output (so the effect is to
  305.    redirect input (output) from (to) the stream to the named file. If
  306. --- 815,822 ----
  307.    thanks to posters from comp.os.vms for giving me a clue on how to do
  308.    this). As a result of this, under VAX/VMS, there are two new argtype
  309.    functions "argInput" and "argOutput": each requires that ad->ad_valp
  310. !  be a pointer to a file pointer (not a FILE * variable as in "__ stdin"
  311. !  but an actual FILE ** variable as in "__ &stdin"). ArgInput & argOutput
  312.    close the stream associated with the given file-pointer and reconnect
  313.    the stream to the named file for input or output (so the effect is to
  314.    redirect input (output) from (to) the stream to the named file. If
  315. ***************
  316. *** 888,904 ****
  317.    vms_args.c as well.
  318.   
  319.   
  320.    LITERATE PROGRAMMING
  321.    ====================
  322.    If you look at the source code you will notice that it contains lots
  323.    of funny looking comments with sections that have titles enclosed
  324.    between '^' and ':' characters. This is my own feeble attempt at
  325. !  literate programming. I  have a Unix-shell script which will extract
  326. !  certain portions of these "structured" comments so that I  may dump
  327. !  them directly into the documentation (and thus attempt to keep the
  328. !  documentation up-to-date at the same rate as the source). If anyone
  329. !  is interested in my script(s) please let me know and I will gladly e-
  330. !  mail them to the interested parties.
  331.   
  332.   
  333.    ACKNOWLEDGEMENTS
  334. --- 851,879 ----
  335.    vms_args.c as well.
  336.   
  337.   
  338. +  TO DO
  339. +  =====
  340. +  - get parseargs(1) to work for DCL under VMS using symbols
  341. +  - add ash to the list of shells supported by parseargs(1)
  342. +  - add clam to the list of shells supported by parseargs(1)
  343. +  - get parseargs(1) to support arrays for bash
  344. +  - verify that parseargs(1) works for rc, the Plan 9 shell
  345. +  - verify that parseargs(1) works for zsh
  346. +  - verify that parseargs(3) works on VMS systems.
  347. +  - verify that parseargs(3) works on MS-DOS and OS/2 systems.
  348.    LITERATE PROGRAMMING
  349.    ====================
  350.    If you look at the source code you will notice that it contains lots
  351.    of funny looking comments with sections that have titles enclosed
  352.    between '^' and ':' characters. This is my own feeble attempt at
  353. !  literate programming. I have a Korn shell script (xdoc) which will
  354. !  extract certain portions of these "structured" comments so that I may
  355. !  dump them directly into the documentation (and thus attempt to keep
  356. !  the documentation up-to-date at the same rate as the source). If anyone
  357. !  is interested in my script(s) please let me know and I will gladly
  358. !  e-mail them to the interested parties.
  359.   
  360.   
  361.    ACKNOWLEDGEMENTS
  362. ***************
  363. *** 905,911 ****
  364.    ================
  365.    I was in constant contact with Peter Da Silva during the entire period
  366.    that I  implemented all of the above modifications and would like to
  367. !  thank him for his time and his sage advice.
  368.   
  369.    Thanx also to Jim Barbour for helping me with some VMS specific things
  370.    (like getting the original, unparsed command-line from DCL and
  371. --- 880,887 ----
  372.    ================
  373.    I was in constant contact with Peter Da Silva during the entire period
  374.    that I  implemented all of the above modifications and would like to
  375. !  thank him for his time and his sage advice. Many of the ideas which I 
  376. !  implemented are a direct result of our discussions.
  377.   
  378.    Thanx also to Jim Barbour for helping me with some VMS specific things
  379.    (like getting the original, unparsed command-line from DCL and
  380. ***************
  381. *** 912,920 ****
  382.    retreiving the value of a symbol), and to Tom Christiansen and Raymond
  383.    Chen for their help in getting parseargs(1) to work for perl scripts.
  384.   
  385.    Lastly, thanks to all those who use and will continue to improve
  386.    parseargs, all I ask is that you keep me updated of your efforts (so I
  387.    can keep my own version of parseargs up-to-date). I am always eager
  388.    to discuss possible changes or enhancements with any interested
  389.    parties.
  390. --- 888,899 ----
  391.    retreiving the value of a symbol), and to Tom Christiansen and Raymond
  392.    Chen for their help in getting parseargs(1) to work for perl scripts.
  393.   
  394. +  Thanx also to Gillmer J. Derge, Marco Nijdam, & Chris Johnston for sending
  395. +  me their bug reports and fixes so that I could incorporate them into the
  396. +  latest patch of parseargs.
  397.    Lastly, thanks to all those who use and will continue to improve
  398.    parseargs, all I ask is that you keep me updated of your efforts (so I
  399.    can keep my own version of parseargs up-to-date). I am always eager
  400.    to discuss possible changes or enhancements with any interested
  401.    parties.
  402. diff -cNr ../patchlevel4/amiga_args.c ./amiga_args.c
  403. *** ../patchlevel4/amiga_args.c    Thu May  2 11:06:07 1991
  404. --- ./amiga_args.c    Thu May  2 14:34:25 1991
  405. ***************
  406. *** 199,205 ****
  407.               ad = ARGDESCNULL;
  408.            }/*else*/
  409.         }
  410. !       else if (cmd_prev(cmd)) {
  411.            flags = arg_flags(cmd_prev(cmd));    /* save flags */
  412.            if ( ARG_isGIVEN(cmd_prev(cmd)) ) {   /* reset flags */
  413.               BCLEAR( arg_flags(cmd_prev(cmd)), ARGVALSEP );
  414. --- 199,210 ----
  415.               ad = ARGDESCNULL;
  416.            }/*else*/
  417.         }
  418. !       else if (cmd_prev(cmd)) { /* expecting a vlue from previous arg */
  419. !          /* reset the argument flags - if this arg was already given, some
  420. !          ** of its flags may be set to indicate how it was given before.
  421. !          ** we need to know how it was given now (but save the old ones
  422. !          ** just in case the new one fails).
  423. !          */
  424.            flags = arg_flags(cmd_prev(cmd));    /* save flags */
  425.            if ( ARG_isGIVEN(cmd_prev(cmd)) ) {   /* reset flags */
  426.               BCLEAR( arg_flags(cmd_prev(cmd)), ARGVALSEP );
  427. ***************
  428. *** 228,233 ****
  429. --- 233,243 ----
  430.         }
  431.         else {  /* it's a positional argument or a list item */
  432.            if ( cmd_list(cmd) ) { /* its a list item */
  433. +             /* reset the argument flags - if this arg was already given, some
  434. +             ** of its flags may be set to indicate how it was given before.
  435. +             ** we need to know how it was given now (but save the old ones
  436. +             ** just in case the new one fails).
  437. +             */
  438.               flags = arg_flags(cmd_list(cmd));    /* save flags */
  439.               if ( ARG_isGIVEN(cmd_list(cmd)) ) {   /* reset flags */
  440.                  BCLEAR( arg_flags(cmd_list(cmd)), ARGVALSEP );
  441. ***************
  442. *** 243,248 ****
  443. --- 253,260 ----
  444.               continue;
  445.            }
  446.            else {  /* its a positional argument */
  447. +             /* if FLAGS1ST is set then first positional marks end-of-flags */
  448.               if ( BTEST(cmd_flags(cmd), pa_FLAGS1ST) )
  449.                  BSET( cmd_state(cmd), ps_NOFLAGS );
  450.   
  451. ***************
  452. *** 265,270 ****
  453. --- 277,287 ----
  454.                  ad = ARGDESCNULL;
  455.               }
  456.               else {
  457. +                /* reset the argument flags - if this arg was already given, some
  458. +                ** of its flags may be set to indicate how it was given before.
  459. +                ** we need to know how it was given now (but save the old ones
  460. +                ** just in case the new one fails).
  461. +                */
  462.                  flags = arg_flags(ad);    /* save flags */
  463.                  if ( ARG_isGIVEN(ad) ) {   /* reset flags for this appearance */
  464.                     BCLEAR( arg_flags(ad), ARGVALSEP );
  465. diff -cNr ../patchlevel4/argtype3.txt ./argtype3.txt
  466. *** ../patchlevel4/argtype3.txt    Thu May  2 11:06:44 1991
  467. --- ./argtype3.txt    Wed Dec 31 18:00:00 1969
  468. ***************
  469. *** 1,264 ****
  470. - ARGTYPE(3)                           ARGTYPE(3)
  471. - NAME
  472. -      argtype - argument    type functions used by parseargs(3)
  473. - SYNOPSIS
  474. -      #include <parseargs.h>
  475. -      BOOL  argUsage(  argdesc,    argstr,     copyf    );
  476. -      BOOL  argEnd(  argdesc,  argstr,  copyf  );
  477. -      BOOL  argDummy(  argdesc,    argstr,     copyf    );
  478. -      BOOL  argBool(  argdesc,  argstr,    copyf  );
  479. -      BOOL  argSBool(  argdesc,    argstr,     copyf    );
  480. -      BOOL  argUBool(  argdesc,    argstr,     copyf    );
  481. -      BOOL  argTBool(  argdesc,    argstr,     copyf    );
  482. -      BOOL  argChar(  argdesc,  argstr,    copyf  );
  483. -      BOOL  argStr(  argdesc,  argstr,  copyf  );
  484. -      BOOL  argInt(  argdesc,  argstr,  copyf  );
  485. -      BOOL  argShort(  argdesc,    argstr,     copyf    );
  486. -      BOOL  argLong(  argdesc,  argstr,    copyf  );
  487. -      BOOL  argFloat(  argdesc,    argstr,     copyf    );
  488. -      BOOL  argDouble(  argdesc,     argstr,  copyf     );
  489. -      BOOL  listStr(  argdesc,  argstr,    copyf  );
  490. -      void  listFree(  arglist  );
  491. -      void  vecFree(  argvec, type  );
  492. -      void  vecDeepFree(     argvec, type  );
  493. -      ARGDESC  *argdesc;
  494. -      char  *argstr;
  495. -      BOOL  copyf;
  496. -      ArgList  *arglist;
  497. - DESCRIPTION
  498. -      Each of these converts a parameter    value to the internal
  499. -      form, including validity checking.     Their parameters and
  500. -      return values all behave similarly. One of    these routines is
  501. -      called when an argument of    that particular    type is    matched
  502. -      by    one of the argument parsing function in    parseargs(3).
  503. -      When such an argument is matched, its argument translation
  504. -      routine is    invoked    and is passed (1) the address of the
  505. -      argument descriptor for the matched argument, (2) the possi-
  506. -      ble argument string for that matched argument, and    (3) a
  507. -      boolean field that    is TRUE    only if    the second parameter
  508. -      points to temporary storage (indicating that some copying
  509. -      may need to be done instead of just pointing to the same
  510. -      object).
  511. -      Once the argument translation routine is invoked, it is
  512. -      responsible for converting    the argument string to the
  513. -      desired internal form (perhaps a number), and assigning the
  514. -      resultant value to    the arg_valp(ad) field of the argument
  515. -      descriptor    (this includes handling    any necessary
  516. -      (re)allocation if the matched argument has    the ARGVEC flag
  517. -      enabled). If the argument is an ARGVEC or ARGLIST then the
  518. - Page 1
  519. - ARGTYPE(3)                           ARGTYPE(3)
  520. -      routine is    responsible for    allocating any space, copying the
  521. -      arg-flags to the value-specific flags, and    setting    the
  522. -      ARGCOPYF flag for the value if it needs to    be allocated as
  523. -      well.
  524. - RETURN VALUE
  525. -      TRUE    The conversion was    successful and the entire value
  526. -          was used.
  527. -      FALSE   The conversion failed.  The reason    for failure
  528. -          should be diagnosed using usrerr(3).
  529. -      -N         The conversion was    successful but only N characters
  530. -          of    the value were used, the remaining characters may
  531. -          still match other arguments.
  532. - PSEUDO-TYPES: argUsage,    argDummy, argEnd
  533. -      ArgUsage is used to specify an argument that causes the com-
  534. -      mand usage    to be printed.
  535. -      ArgDummy is used to force an item to show up in usage-
  536. -      messages but the item itself is never matched against any
  537. -      arguments from the    command-line.
  538. -      ArgEnd is used by Amiga style command-lines to indicate an
  539. -      argument that forces all remaining    arguments to be    con-
  540. -      sidered positional    args.
  541. -      These three are dummy functions. The routines themselves do
  542. -      nothing of    importance, we just need to have their addresses
  543. -      available for identification in the corresponding command-
  544. -      line styles.
  545. - STRING-TYPES: argStr
  546. -      ArgStr is one of the few argument translation routines that
  547. -      actually uses the copyf flag. If copyf is true then the
  548. -      string is duplicated.
  549. -      ArgStr assigns the    given string (or a copy    of it) to the
  550. -      value referenced by arg_valp(ad) (unless the argument is a
  551. -      vector in which case the given string is appended to the
  552. -      end).
  553. -      ArgStr ensures that the very last item in a vector    of
  554. -      strings (the one accessed as vec.array[ vec.count ]) will
  555. -      always be NULL.
  556. - Page 2
  557. - ARGTYPE(3)                           ARGTYPE(3)
  558. - CHARACTER-TYPES: argChar
  559. -      ArgChar assigns the given character to the    value referenced
  560. -      by    arg_valp(ad) (unless the argument is a vector in which
  561. -      case the given character is appended to the end).
  562. -      ArgChar ensures that the very last    item in    a vector of char-
  563. -      acter (the    one accessed as    vec.array[ vec.count ])    will
  564. -      always be a NULL byte so that the resulting vector    may also
  565. -      be    used as    a NULL terminated string.
  566. -      Unlike argStr, argChar will translate character escape
  567. -      sequences such as `\n' and    `\012'.
  568. - INTEGER-TYPES: argInt, argShort, argLong
  569. -      Each of these functions converts the given    string to the
  570. -      desired integral type. The    value may be specified as an
  571. -      octal number by specifying    the first digit    to be 0. Simi-
  572. -      larly, If the first two characters    are `0x' then the number
  573. -      is    treated    as hexadecimal.
  574. - FLOATING-POINT-TYPES: argFloat,    argDouble
  575. -      Each of these functions converts the given    string to the
  576. -      desired floating-point type.
  577. - BOOLEAN-TYPES: argBool,    argSBool, argTBool, argUBool
  578. -      ArgBool and argSBool set a    boolean    value (if no value is
  579. -      given).  ArgUBool unsets a    boolean    value (if no value is
  580. -      given). ArgTBool toggles a    boolean    value (if no value is
  581. -      given). If    a value    is supplied to any of these routines,
  582. -      then the string is    looked up in a table and assigned the
  583. -      corresponding value.
  584. -      If    a value    is supplied for    an argument that was matched via
  585. -      its single    character name and is part of the same argv ele-
  586. -      ment as the argument-name (so that    both ARGKEYWORD    and
  587. -      ARGVALSEP are not set), then only the first character of the
  588. -      value is used (unless it is not found in our table, in which
  589. -      case the value is ignored and the default action is taken).
  590. -      The table used for    single-character-options is the    follow-
  591. -      ing:
  592. -      `0' or `-'
  593. -       The corresponding boolean flag is set    to FALSE.
  594. -      `1' or `+'
  595. -       The corresponding boolean flag is set    to TRUE.
  596. -      `^' or `~'
  597. -       The corresponding boolean flag is toggled.
  598. -      The possible argument strings for long-options (keywords)
  599. -      are as follows (case-insensitive):
  600. - Page 3
  601. - ARGTYPE(3)                           ARGTYPE(3)
  602. -      ``0'', ``-'', ``OFF'', or ``FALSE''
  603. -       The corresponding boolean flag is set    to FALSE.
  604. -      ``1'', ``+'', ``ON'', or ``TRUE''
  605. -       The corresponding boolean flag is set    to TRUE.
  606. - LIST TYPES: listStr
  607. -      The listStr argument translation routine is only intended
  608. -      for use on    behalf of arguments that have the ARGLIST flag
  609. -      enabled. It will allocate space for a new node (and for the
  610. -      new string    if copyf is set) and append it to the end of the
  611. -      list. The argument-list may later be deallocated by invoking
  612. -      the function listFree and passing it the address of the
  613. -      first item    in the list.
  614. -      VecFree is    a macro    that is    used to    deallocate argument-
  615. -      vectors.  It will free the    array and flags    fields of a vec-
  616. -      tor, set them to NULL, and    set the    count field to zero. Vec-
  617. -      DeepFree is a macro that is similar to vecFree but    will
  618. -      additionally look at each item in the array; any component
  619. -      of    the array that had ARGCOPYF enabled will also be deallo-
  620. -      cated.  Both macros are given the vector structure    to free
  621. -      followed by the type of the items in the vector.
  622. - SEE ALSO
  623. -      parseargs(3), parseargs(1), parsecntl(3)
  624. - Page 4
  625. --- 0 ----
  626. diff -cNr ../patchlevel4/doc/Makefile ./doc/Makefile
  627. *** ../patchlevel4/doc/Makefile    Thu May  2 11:05:46 1991
  628. --- ./doc/Makefile    Tue May 14 12:32:17 1991
  629. ***************
  630. *** 90,101 ****
  631.   ###
  632.   # include dependencies
  633.   ###
  634. ! argtype.3:
  635. ! parseargs.1:
  636. ! parseargs.3:
  637. ! parsecntl.3:
  638.   
  639.   
  640.   ###
  641.   # maintenance dependencies
  642.   ###
  643. --- 90,140 ----
  644.   ###
  645.   # include dependencies
  646.   ###
  647. ! argtype.3:    argtype.man3
  648.   
  649. + parseargs.1:    parseargs.man1 \
  650. +         ../test.sh \
  651. +         argvalopt.inc \
  652. +         bugs.inc \
  653. +         caveats.inc \
  654. +         env_args.inc \
  655. +         env_parse.inc \
  656. +         env_usage.inc \
  657. +         parseargs1.inc \
  658. +         sh_arrays.inc \
  659. +         shells.inc
  660.   
  661. + parseargs.3:    parseargs.man3 \
  662. +         arg_macros.inc \
  663. +         argdesc.inc \
  664. +         argflags.inc \
  665. +         caveats.inc \
  666. +         cmd_macros.inc \
  667. +         defargs.inc \
  668. +         effects.inc \
  669. +         env_args.inc \
  670. +         env_parse.inc \
  671. +         env_usage.inc \
  672. +         fparseargs3.inc \
  673. +         lib_bugs.inc \
  674. +         lparseargs3.inc \
  675. +         multivals.inc \
  676. +         parseargs3.inc \
  677. +         returns.inc \
  678. +         sparseargs3.inc \
  679. +         usage3.inc \
  680. +         vparseargs3.inc
  681. + parsecntl.3:    parsecntl.man3 \
  682. +         argflags.inc \
  683. +         effects.inc \
  684. +         parsecntl3.inc \
  685. +         parsecntls.inc \
  686. +         parseflags.inc \
  687. +         parsemodes.inc \
  688. +         returns.inc
  689.   ###
  690.   # maintenance dependencies
  691.   ###
  692. ***************
  693. *** 105,111 ****
  694.   clobber: clean
  695.       ${DEL} *.txt
  696.   
  697. ! spell: ${INCS} ${SRCS}}
  698.       ${SPELL} ${SPELLFLAGS} ${INCS} ${SRCS}
  699.   
  700.   print: ${MANFILES} ${INCS}
  701. --- 144,150 ----
  702.   clobber: clean
  703.       ${DEL} *.txt
  704.   
  705. ! spell: ${INCS} ${SRCS}
  706.       ${SPELL} ${SPELLFLAGS} ${INCS} ${SRCS}
  707.   
  708.   print: ${MANFILES} ${INCS}
  709. diff -cNr ../patchlevel4/doc/arg_macros.inc ./doc/arg_macros.inc
  710. *** ../patchlevel4/doc/arg_macros.inc    Thu May  2 10:56:14 1991
  711. --- ./doc/arg_macros.inc    Thu May  2 14:34:39 1991
  712. ***************
  713. *** 27,33 ****
  714.   .IP "\fIarg_sdesc\fP(ad)"
  715.   Return the description of an argument. If a description was supplied,
  716.   the \fI\s-1ARGDESCRIBED\s+1\fP flag will be set and the description will
  717. ! immediately follow the terminating NUL byte of the string name.
  718.   .\"---------------------------------------------
  719.   .IP "\fIARG_isDESCRIBED\fP(ad)"
  720.   Evaluates to \s-1TRUE\s+1 only if an argument description was provided.
  721. --- 27,33 ----
  722.   .IP "\fIarg_sdesc\fP(ad)"
  723.   Return the description of an argument. If a description was supplied,
  724.   the \fI\s-1ARGDESCRIBED\s+1\fP flag will be set and the description will
  725. ! immediately follow the terminating NULL byte of the string name.
  726.   .\"---------------------------------------------
  727.   .IP "\fIARG_isDESCRIBED\fP(ad)"
  728.   Evaluates to \s-1TRUE\s+1 only if an argument description was provided.
  729. diff -cNr ../patchlevel4/doc/argdesc.inc ./doc/argdesc.inc
  730. *** ../patchlevel4/doc/argdesc.inc    Thu May  2 11:00:21 1991
  731. --- ./doc/argdesc.inc    Thu May  2 14:34:41 1991
  732. ***************
  733. *** 52,57 ****
  734.   square-brackets, or angle-brackets). If the long-name contains any
  735.   uppercase characters, then the substring of long-name consisting of
  736.   all uppercase characters is used as the argument keyword and the entire
  737. ! long-name is used as the name of the argument (if a value my be
  738.   supplied). The long-name may be matched by supplying a unique prefix
  739.   of either the argument keyword or the argument name.
  740. --- 52,57 ----
  741.   square-brackets, or angle-brackets). If the long-name contains any
  742.   uppercase characters, then the substring of long-name consisting of
  743.   all uppercase characters is used as the argument keyword and the entire
  744. ! long-name is used as the name of the argument (if a value may be
  745.   supplied). The long-name may be matched by supplying a unique prefix
  746.   of either the argument keyword or the argument name.
  747. diff -cNr ../patchlevel4/doc/argflags.inc ./doc/argflags.inc
  748. *** ../patchlevel4/doc/argflags.inc    Thu May  2 10:56:15 1991
  749. --- ./doc/argflags.inc    Thu May  2 14:34:44 1991
  750. ***************
  751. *** 51,57 ****
  752.   .\"---------------------------------------------
  753.   .IP "\fI\s-1ARGLIST\s+1\fP"
  754.   A variable number of values are used for this argument (and hence may
  755. ! use more than one or two argv elements from the command-line as in
  756.   "\fB\-l\fI val1 val2\fR ..."). The list of values must be stored in an
  757.   .I ArgList
  758.   structure (\s-1NOT\s+1 a vector structure), an the corresponding argument-type
  759. --- 51,57 ----
  760.   .\"---------------------------------------------
  761.   .IP "\fI\s-1ARGLIST\s+1\fP"
  762.   A variable number of values are used for this argument (and hence may
  763. ! use more than one or two \f4argv\fP elements from the command-line as in
  764.   "\fB\-l\fI val1 val2\fR ..."). The list of values must be stored in an
  765.   .I ArgList
  766.   structure (\s-1NOT\s+1 a vector structure), an the corresponding argument-type
  767. diff -cNr ../patchlevel4/doc/argtype.man3 ./doc/argtype.man3
  768. *** ../patchlevel4/doc/argtype.man3    Thu May  2 11:00:40 1991
  769. --- ./doc/argtype.man3    Thu May  2 14:34:47 1991
  770. ***************
  771. *** 37,45 ****
  772.   all behave similarly. One of these routines is called when an
  773.   argument of that particular type is matched by one of the argument
  774.   parsing function in \fIparseargs\fP(3). When such an argument is matched,
  775. ! its argument translation routines is invoked and is passed (1) the address of
  776.   the argument descriptor for the matched argument, (2) the possible argument
  777. ! string for that matched argument, and (3) a boolean filed that is \s-1TRUE\s+1
  778.   only if the second parameter points to temporary storage (indicating that
  779.   some copying may need to be done instead of just pointing to the same object).
  780.   
  781. --- 37,45 ----
  782.   all behave similarly. One of these routines is called when an
  783.   argument of that particular type is matched by one of the argument
  784.   parsing function in \fIparseargs\fP(3). When such an argument is matched,
  785. ! its argument translation routine is invoked and is passed (1) the address of
  786.   the argument descriptor for the matched argument, (2) the possible argument
  787. ! string for that matched argument, and (3) a boolean field that is \s-1TRUE\s+1
  788.   only if the second parameter points to temporary storage (indicating that
  789.   some copying may need to be done instead of just pointing to the same object).
  790.   
  791. ***************
  792. *** 128,134 ****
  793.   in a table and assigned the corresponding value.
  794.   
  795.   If a value is supplied for an argument that was matched via its
  796. ! single character name and is part of the same argv element as the
  797.   argument-name (so that both \fBARGKEYWORD\fP and \fBARGVALSEP\fP
  798.   are not set),
  799.   then only the first character of the value is used (unless it is
  800. --- 128,134 ----
  801.   in a table and assigned the corresponding value.
  802.   
  803.   If a value is supplied for an argument that was matched via its
  804. ! single character name and is part of the same \f4argv\fP element as the
  805.   argument-name (so that both \fBARGKEYWORD\fP and \fBARGVALSEP\fP
  806.   are not set),
  807.   then only the first character of the value is used (unless it is
  808. ***************
  809. *** 168,172 ****
  810.   type of the items in the vector.
  811.   .SH SEE ALSO
  812.   .IR parseargs (3),
  813. ! .IR parseargs (3),
  814. ! .IR parsecntl (1),
  815. --- 168,172 ----
  816.   type of the items in the vector.
  817.   .SH SEE ALSO
  818.   .IR parseargs (3),
  819. ! .IR parseargs (1),
  820. ! .IR parsecntl (3)
  821. diff -cNr ../patchlevel4/doc/bugs.inc ./doc/bugs.inc
  822. *** ../patchlevel4/doc/bugs.inc    Thu May  2 10:56:16 1991
  823. --- ./doc/bugs.inc    Thu May  2 14:34:52 1991
  824. ***************
  825. *** 27,38 ****
  826.   .PP
  827.   \fIParseargs\fP cannot properly preserve any newlines in shell variables
  828.   if the \fBeval\fP command is used to read its output (this is a shortcoming
  829. ! of the eval command, not of parseargs). If the user is concerned about this
  830. ! particular case, then the user should redirect the output from \fBparseargs\fP
  831. ! to a temporary file and use the \fBsource\fP command in \fIcsh\fP or the
  832. ! dot command (`\fB.\fP') in sh and ksh, to interpret the results; otherwise,
  833. ! newlines will be translated into spaces, or characters following
  834. ! a newline may be lost, in any variables that are set by \fBparseargs\fP.
  835. ! .PP
  836. ! Parseargs(1) is subject to the same caveats as parseargs(3). Refer to the
  837. ! \s-1CAVEATS\s+1 section of the parseargs(3) manual page(s) for more information.
  838. --- 27,36 ----
  839.   .PP
  840.   \fIParseargs\fP cannot properly preserve any newlines in shell variables
  841.   if the \fBeval\fP command is used to read its output (this is a shortcoming
  842. ! of the \fBeval\fP command, not of \fBparseargs\fP). If the user is concerned
  843. ! about this particular case, then the user should redirect the output from
  844. ! \fBparseargs\fP to a temporary file and use the \fBsource\fP command in
  845. ! \fIcsh\fP or the dot command (`\fB.\fP') in sh and ksh, to interpret the
  846. ! results; otherwise, newlines will be translated into spaces, or characters
  847. ! following a newline may be lost, in any variables that are set by
  848. ! \fBparseargs\fP.
  849. diff -cNr ../patchlevel4/doc/cmd_macros.inc ./doc/cmd_macros.inc
  850. *** ../patchlevel4/doc/cmd_macros.inc    Thu May  2 10:56:17 1991
  851. --- ./doc/cmd_macros.inc    Thu May  2 14:34:57 1991
  852. ***************
  853. *** 3,9 ****
  854.   .\"--   xdoc -man -p '[ \t]*' -s CMD-MACROS ../parseargs.h
  855.   .\"----------------------------------------------------------------------------
  856.   .SH "CMD MACROS"
  857. ! Parseargs.h defines a set of macros to allow a more "self documenting"
  858.   approach to declaring argument-descriptor arrays. The "old-style" is
  859.   still accepted (but if used it is recommended that the \s-1STARTOFARGS\s+1
  860.   macro is used in conjunction with \s-1ENDOFARGS\s+1).
  861. --- 3,9 ----
  862.   .\"--   xdoc -man -p '[ \t]*' -s CMD-MACROS ../parseargs.h
  863.   .\"----------------------------------------------------------------------------
  864.   .SH "CMD MACROS"
  865. ! \f4<parseargs.h>\fP defines a set of macros to allow a more "self documenting"
  866.   approach to declaring argument-descriptor arrays. The "old-style" is
  867.   still accepted (but if used it is recommended that the \s-1STARTOFARGS\s+1
  868.   macro is used in conjunction with \s-1ENDOFARGS\s+1).
  869. diff -cNr ../patchlevel4/doc/defargs.inc ./doc/defargs.inc
  870. *** ../patchlevel4/doc/defargs.inc    Thu May  2 10:56:18 1991
  871. --- ./doc/defargs.inc    Thu May  2 14:34:59 1991
  872. ***************
  873. *** 4,11 ****
  874.   .\"----------------------------------------------------------------------------
  875.   .SH "DEFAULT ARGUMENT DESCRIPTOR"
  876.   .PP
  877. ! Each argdesc-array has an initial default argument list (which may
  878. ! be reset using the pc_DEFARGS function code with parsecntl). This initial
  879.   default argument-list contains `?' and `H' which may be used as single
  880.   character keywords to display command-usage for all command-line styles.
  881.   Similarly, ``?'', ``H'', and ``Help'' may be used as long-keywords to display
  882. --- 4,11 ----
  883.   .\"----------------------------------------------------------------------------
  884.   .SH "DEFAULT ARGUMENT DESCRIPTOR"
  885.   .PP
  886. ! Each argdesc-array has an initial default argument list (which may be reset
  887. ! using the pc_DEFARGS function code with \fIparsecntl\fP). This initial
  888.   default argument-list contains `?' and `H' which may be used as single
  889.   character keywords to display command-usage for all command-line styles.
  890.   Similarly, ``?'', ``H'', and ``Help'' may be used as long-keywords to display
  891. ***************
  892. *** 12,17 ****
  893.   command-usage for all command-line styles.  In Addition, for \s-1VMS\s+1
  894.   style commands, the qualifiers \fB\s-1/INPUT\s+1=\fIfile\fR,
  895.   \fB\s-1/OUTPUT\s+1=\fIfile\fR, and \fB\s-1/ERROR\s+1=\fIfile\fR, may be used
  896. ! to redirect stdin, stdout, and stderr (respectively) to a file.  For
  897. ! Amiga\s-1DOS\s+1 style commands, the keyword ``ENDKWDS'' may be used to
  898. ! disable parsing for any more keywords on the command-line.
  899. --- 12,17 ----
  900.   command-usage for all command-line styles.  In Addition, for \s-1VMS\s+1
  901.   style commands, the qualifiers \fB\s-1/INPUT\s+1=\fIfile\fR,
  902.   \fB\s-1/OUTPUT\s+1=\fIfile\fR, and \fB\s-1/ERROR\s+1=\fIfile\fR, may be used
  903. ! to redirect \f4stdin\fP, \f4stdout\fP, and \f4stderr\fP (respectively) to a
  904. ! file.  For Amiga\s-1DOS\s+1 style commands, the keyword ``ENDKWDS'' may be
  905. ! used to disable parsing for any more keywords on the command-line.
  906. diff -cNr ../patchlevel4/doc/env_args.inc ./doc/env_args.inc
  907. *** ../patchlevel4/doc/env_args.inc    Thu May  2 11:00:46 1991
  908. --- ./doc/env_args.inc    Thu May  2 14:35:04 1991
  909. ***************
  910. *** 5,11 ****
  911.   .SH "SUPPLYING DEFAULT ARGUMENTS"
  912.   Programs that use \fIparseargs\fP may be given default arguments under UNIX
  913.   and PCs through the use of environment variables (symbols are used for VMS
  914. ! systems). If a  C-program or shell-script uses parseargs to implement a
  915.   command named ``\fIcmd\fP'' then the environment variable ``\s-1CMD_ARGS\s+1''
  916.   will be parsed for any "default" arguments before the command-line is parsed.
  917.   The command-line will over-ride any options that are specified in this
  918. --- 5,11 ----
  919.   .SH "SUPPLYING DEFAULT ARGUMENTS"
  920.   Programs that use \fIparseargs\fP may be given default arguments under UNIX
  921.   and PCs through the use of environment variables (symbols are used for VMS
  922. ! systems). If a  C-program or shell-script uses \fIparseargs\fP to implement a
  923.   command named ``\fIcmd\fP'' then the environment variable ``\s-1CMD_ARGS\s+1''
  924.   will be parsed for any "default" arguments before the command-line is parsed.
  925.   The command-line will over-ride any options that are specified in this
  926. diff -cNr ../patchlevel4/doc/env_parse.inc ./doc/env_parse.inc
  927. *** ../patchlevel4/doc/env_parse.inc    Thu May  2 11:00:56 1991
  928. --- ./doc/env_parse.inc    Thu May  2 14:35:06 1991
  929. ***************
  930. *** 8,19 ****
  931.   The user may set his (or her) own desired parsing
  932.   behavior through the use of the ``\s-1PARSECNTL\s+1'' environment variable.
  933.   By indicating any number of flags (possibly negated) the user will
  934. ! directly modify the behavior of the parseargs library. Flags may be
  935.   combined by placing a `+' or `|' character in between flags. A switch
  936.   is negated by immediately preceding it with a `!' or `-' character.
  937.   The possible ``flags'' are given by the following table. 
  938.   Flags are case-insensitive.
  939.   .sp 4p
  940.   .IP "\fIPrompt\fP"
  941.   Prompt the user for any missing arguments that are required on the
  942.   command-line. No special escaping or quoting is performed on the
  943. --- 8,20 ----
  944.   The user may set his (or her) own desired parsing
  945.   behavior through the use of the ``\s-1PARSECNTL\s+1'' environment variable.
  946.   By indicating any number of flags (possibly negated) the user will
  947. ! directly modify the behavior of the \fIparseargs\fP library. Flags may be
  948.   combined by placing a `+' or `|' character in between flags. A switch
  949.   is negated by immediately preceding it with a `!' or `-' character.
  950.   The possible ``flags'' are given by the following table. 
  951.   Flags are case-insensitive.
  952.   .sp 4p
  953. + .\"---------------------------------------------
  954.   .IP "\fIPrompt\fP"
  955.   Prompt the user for any missing arguments that are required on the
  956.   command-line. No special escaping or quoting is performed on the
  957. ***************
  958. *** 20,61 ****
  959.   user input. Required arguments that expect a list of values will
  960.   be repeatedly prompted for (one item per line) until a blank line
  961.   (followed by a carriage return) is entered.
  962. ! .\"----------------------
  963.   .IP "\fIIgnore\fP"
  964.   Ignore any unrecognized or improperly specified command-line arguments
  965. ! and continue execution of the program. Normally, if an argument is
  966. ! unmatched (or is improperly specified), a usage message is printed
  967. ! and program execution is terminated.
  968. ! .\"----------------------
  969.   .IP "\fIOptsOnly\fP"
  970. ! Under UNIX, setting this flag will disable the parsing of long-option
  971. ! syntax. This will cause all arguments starting with '+' to always be
  972.   treated as a positional parameter (instead of a long-option).
  973. ! .\"----------------------
  974.   .IP "\fIKwdsOnly\fP"
  975. ! Under UNIX, setting this flag disables the parsing of single-character
  976. ! options.  This will cause all arguments starting with '-' to always
  977.   be treated as a positional parameter (instead of an option).
  978. ! .\"----------------------
  979.   .IP "\fILoptsOnly\fP"
  980.   Same as \fIKwdsOnly\fP.
  981. ! .\"----------------------
  982.   .IP "\fIFlags1st\fP"
  983. ! Setting this flag causes the parseargs library to force any and all
  984.   non-positional arguments to be specified before any positional ones.
  985. ! As an example, under UNIX, if this flag is SET then parseargs will
  986. ! consider the command line "cmd -x arg" to consist of one option and
  987. ! one positional argument; however the command line "cmd arg -x" would
  988. ! be considered to consist of two positional arguments (the -x option
  989. ! will be unmatched).
  990.   
  991. ! If this flag is UNSET, then both of the previous examples are
  992.   considered to consist of one option and one positional argument.
  993. ! .\"----------------------
  994.   .IP "\fICaseIgnore\fP"
  995. ! Setting this flag causes character-case to be ignored when attempting
  996. ! to match single-character argument names (i.e. causes "-i" and "-I"
  997. ! will be considered equivalent).
  998.   .sp 4p
  999.   .PP
  1000.   If the environment variable ``\s-1PARSECNTL\s+1'' is empty or
  1001. --- 21,64 ----
  1002.   user input. Required arguments that expect a list of values will
  1003.   be repeatedly prompted for (one item per line) until a blank line
  1004.   (followed by a carriage return) is entered.
  1005. ! .\"---------------------------------------------
  1006.   .IP "\fIIgnore\fP"
  1007.   Ignore any unrecognized or improperly specified command-line arguments
  1008. ! and continue execution of the program. Normally, if a required argument is
  1009. ! unmatched (or an argument is improperly specified), a usage message is printed
  1010. ! program execution is terminated.
  1011. ! .\"---------------------------------------------
  1012.   .IP "\fIOptsOnly\fP"
  1013. ! Under \s-1UNIX\s+1, setting this flag will disable the parsing of long-option
  1014. ! syntax. This will cause all arguments starting with `+' to always be
  1015.   treated as a positional parameter (instead of a long-option).
  1016. ! .\"---------------------------------------------
  1017.   .IP "\fIKwdsOnly\fP"
  1018. ! Under \s-1UNIX\s+1, setting this flag disables the parsing of single-character
  1019. ! options.  This will cause all arguments starting with `\-' to always
  1020.   be treated as a positional parameter (instead of an option).
  1021. ! .\"---------------------------------------------
  1022.   .IP "\fILoptsOnly\fP"
  1023.   Same as \fIKwdsOnly\fP.
  1024. ! .\"---------------------------------------------
  1025.   .IP "\fIFlags1st\fP"
  1026. ! Setting this flag causes the \fIparseargs\fP library to force any and all
  1027.   non-positional arguments to be specified before any positional ones.
  1028. ! As an example, under \s-1UNIX\s+1, if this flag is \s-1SET\s+1 then
  1029. ! .I parseargs
  1030. ! will consider the command line "\fBcmd \-x\fI arg\fR" to consist of one
  1031. ! option and one positional argument; however the command line
  1032. ! "\fBcmd\fI arg -x\fR" would be considered to consist of two positional
  1033. ! arguments (the \fB\-x\fP option will be unmatched).
  1034.   
  1035. ! If this flag is \s-1UNSET\s+1, then both of the previous examples are
  1036.   considered to consist of one option and one positional argument.
  1037. ! .\"---------------------------------------------
  1038.   .IP "\fICaseIgnore\fP"
  1039. ! Setting this flag will cause character-case to be ignored when attempting
  1040. ! to match single-character argument names (i.e. causes "\fB\-i\fP" and
  1041. ! "\fB\-I\fP" to be considered equivalent).
  1042. ! .\"---------------------------------------------
  1043.   .sp 4p
  1044.   .PP
  1045.   If the environment variable ``\s-1PARSECNTL\s+1'' is empty or
  1046. diff -cNr ../patchlevel4/doc/env_usage.inc ./doc/env_usage.inc
  1047. *** ../patchlevel4/doc/env_usage.inc    Thu May  2 10:56:19 1991
  1048. --- ./doc/env_usage.inc    Thu May  2 14:35:08 1991
  1049. ***************
  1050. *** 16,22 ****
  1051.   printed (this is also refferred to as ``terse'' mode). The other two ``modes''
  1052.   control the displaying of option syntax and long-option syntax. A mode may
  1053.   be explicitly disabled by preceding its corresponding string with the `!'
  1054. ! character. The ``modes'' which correspond to the possible values of the
  1055.   ``\s-1USAGECNTL\s+1'' environment variable are given by the following table.
  1056.   .sp 4p
  1057.   .\"---------------------------------------
  1058. --- 16,22 ----
  1059.   printed (this is also refferred to as ``terse'' mode). The other two ``modes''
  1060.   control the displaying of option syntax and long-option syntax. A mode may
  1061.   be explicitly disabled by preceding its corresponding string with the `!'
  1062. ! or `-' character. The ``modes'' which correspond to the possible values of the
  1063.   ``\s-1USAGECNTL\s+1'' environment variable are given by the following table.
  1064.   .sp 4p
  1065.   .\"---------------------------------------
  1066. diff -cNr ../patchlevel4/doc/fparseargs3.inc ./doc/fparseargs3.inc
  1067. *** ../patchlevel4/doc/fparseargs3.inc    Thu May  2 10:56:20 1991
  1068. --- ./doc/fparseargs3.inc    Thu May  2 14:35:10 1991
  1069. ***************
  1070. *** 4,10 ****
  1071.   .\"----------------------------------------------------------------------------
  1072.   .PP
  1073.   Given a readable input stream and an argdesc array, \fIfparseargs\fP
  1074. ! will parse arguments in a file in much the same manner as \fIparseargs\fP.
  1075.   A maximum-line length of 255 characters is imposed.  NO ``escaping'' of any
  1076.   kind is performed. Comments of a limited form are permitted: if the first
  1077.   non-whitespace character on a line is a '#' (or '!' for \s-1VMS\s+1) then
  1078. --- 4,10 ----
  1079.   .\"----------------------------------------------------------------------------
  1080.   .PP
  1081.   Given a readable input stream and an argdesc array, \fIfparseargs\fP
  1082. ! will parse arguments in a file in the same manner as \fIparseargs\fP.
  1083.   A maximum-line length of 255 characters is imposed.  NO ``escaping'' of any
  1084.   kind is performed. Comments of a limited form are permitted: if the first
  1085.   non-whitespace character on a line is a '#' (or '!' for \s-1VMS\s+1) then
  1086. diff -cNr ../patchlevel4/doc/lparseargs3.inc ./doc/lparseargs3.inc
  1087. *** ../patchlevel4/doc/lparseargs3.inc    Thu May  2 11:01:17 1991
  1088. --- ./doc/lparseargs3.inc    Thu May  2 14:35:15 1991
  1089. ***************
  1090. *** 4,7 ****
  1091.   .\"----------------------------------------------------------------------------
  1092.   .PP
  1093.   Given an ArgList and an argdesc array, \fIlparseargs\fP
  1094. ! will parse arguments in an ArgList in much the same manner as \fIparseargs\fP.
  1095. --- 4,7 ----
  1096.   .\"----------------------------------------------------------------------------
  1097.   .PP
  1098.   Given an ArgList and an argdesc array, \fIlparseargs\fP
  1099. ! will parse arguments in an ArgList in the same manner as \fIparseargs\fP.
  1100. diff -cNr ../patchlevel4/doc/multivals.inc ./doc/multivals.inc
  1101. *** ../patchlevel4/doc/multivals.inc    Thu May  2 11:01:27 1991
  1102. --- ./doc/multivals.inc    Thu May  2 14:35:18 1991
  1103. ***************
  1104. *** 28,44 ****
  1105.   the function
  1106.   .I listFree.
  1107.   .I ListFree
  1108. ! takes one parameter: first of which is the address of the first item in
  1109. ! the arg-list.
  1110.   .PP
  1111.   An alternative to argument-lists is argument vectors (or arg-vectors).
  1112.   Arg-vectors use the \s-1ARGVEC\s+1 flag instead of the \s-1ARGLIST\s+1 flag
  1113.   and do not require a special \fIlistXxxx\fP function for each vector-type.
  1114.   Each of the \fIargXxxx\fP functions is responsible for handling vectors of its
  1115. ! type (although some argXxx functions such as the boolean types do not support
  1116. ! vectors). An arg-vector is a structure which contains a count, an
  1117. ! array of elements (i.e. an argc/argv pair), and an array of flags, one for 
  1118. ! each element of argv. There are two macros in defined in
  1119.   \f4<parseargs.h>\fR which are used for arg-vectors. \s-1ARGVEC_T\s+1 may be
  1120.   used to declare a vector structure or a vector type;
  1121.   \s-1ARGVEC_EMPTY\s+1 may be used to initialize the structure.
  1122. --- 28,43 ----
  1123.   the function
  1124.   .I listFree.
  1125.   .I ListFree
  1126.