GETFILES(3)

NAME
getfiles() - gets next non flag-type argument

SYNOPSIS
#include <schily/getargs.h>
int getfiles(pac, pav, fmt)
	int *pac;       /* pointer to arg count */
	char *(*pav)[]; /* pointer to address of arg vector */
	char *fmt;      /* format string */

DESCRIPTION
getfiles() returns, with a value of +1 (NOTAFLAG) or +2 (FLAGDELIM), whenever a non-flag type argument is encountered. Flag-type (option) arguments, along with their values, are ignored. The filename is at *pav[0]. The caller must increment *pav and decrement *pac before calling getfiles() again.

RETURNS

FLAGDELIM 2
    The command line argument "-- " stopped flag processing.

NOTAFLAG  1
    The argument *pav does not appear to be a flag.

NOARGS    0
    All arguments have been successfully examined.

BADFLAG  -1
    A bad flag (option) argument was supplied to the program. The argument *pav contains the offending command line argument.

BADFMT  -2
    A bad format descriptor string has been detected. The calling program, rather than the user, was in error.

General rules for the return code:

> 0 A file type argument was found.

0   All arguments have been parsed.

< 0 An error occured or not a file type argument.

Flag and file arg processing should be terminated after getting a return code <= 0.

EXAMPLES

SEE ALSO

getallargs(3), getargerror(3), getargs(3).

NOTES
Initially, *pav must point to the first argument (not the program name) and *pac must not count the program name. Before calling getfiles() again, decrement *pac and increment *pav, or the same name will be pointed to by *pav.

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