Schily's LIBRARY FUNCTIONS                          GETALLARGS(3)


NAME

     getallargs() - parses all the flag-type arguments


SYNOPSIS

     int getallargs(pac, pav, fmt, a1, ..., an)
          int *pac;       /* pointer to arg count */
          char *(*pav)[]; /* pointer to address of arg vector */
          char *fmt;      /* format string */
          type *a1;       /* pointer to result 1 */
                          /* (corresponding to the */
                          /* first descriptor in fmt) */
          type *an;       /* pointer to result n */
                          /* (corresponding to the */
                          /* nth descriptor in fmt) */


DESCRIPTION

     getallargs() parses all  flag  arguments  (anywhere  on  the
     line).  It does not return until all the arguments have been
     parsed correctly (returning 0), or  an  error  has  occurred
     (returning < 0).

     See getargs() for a more detailed description of the parame-
     ter matching.


RETURNS

     0    successfully examined all arguments.

     -1   a bad flag argument was supplied to the  program.   The
          *pav contains the offending switch.

     -2   a bad descriptor string.  The program, rather than  the
          user, was in error.


EXAMPLES


SEE ALSO

     getargs(3), getfiles(3).


NOTES

     getallargs() must be called with the address of a  count  of
     items  in  the  vector  and  the address of a pointer to the
     vector. Both  addresses  must  already  have  been  properly
     treated  in  order to skip over the first parameter which is
     the name of the program.  [e.g.  --ac; ++av].

     Since getallargs() will destroy these values, copies  should
     be  made  for  later use in the program. If an error occurs,
     av[0] points to the unmatched argument.

     The special argument, "--", is ignored,  but  the  following
     argument  in  the  command  line  is  treated  as  a literal

Joerg Schilling    Last change: 15. Juli 1988                   1


Schily's LIBRARY FUNCTIONS                          GETALLARGS(3)

     filename argument. This way, filenames beginning  with  '-',
     '+', or containing '=' can be passed to the routine.


BUGS

     none


AUTHOR

     Joerg Schilling
     Seestr. 110
     D-13353 Berlin
     Germany

     Mail bugs and suggestions to:

     schilling@fokus.gmd.de     or     js@cs.tu-berlin.de      or
     joerg@schily.isdn.cs.tu-berlin.de

Joerg Schilling    Last change: 15. Juli 1988                   2


Man(1) output converted with man2html


FhG Schily's Home VED powered