NAME

arg_scanstr - Scan a command line string as per the given argument table.

SYNOPSIS

#include <argtable.h>

int arg_scanstr(char *str, arg_rec *argtable, int n, char *ErrMsg, char *ErrMark);

PARAMETERS

char *str
Ptr to command line string.
arg_rec *argtable
Ptr to argument table.
int n
Number of entries in argtable[].
char *ErrMsg
Ptr to storage for error message (may be NULL).
char *ErrMark
Ptr to storage for error marker (may be NULL).

DESCRIPTION

This function is much like arg_scanargv() except that is scans the arguments from the string at *str rather than from argv[]. The string is expected to contain a single line, space separated list of arguments, like that generated by arg_catargs().
In a departure from arg_scanargs(), this function erases the scanned arguments from *str by overwriting them with spaces once they have been successfully scanned. Furthermore, this function does not throw an error if there are still arguments remaining in *str after the argtable has been fully processed. Thus, complicated argument usages can be achieved by invoking this function multiple times on the same command line string, each time applying a different argument table until the arguments have been exhausted, or an error has been detected.

RETURN VALUE

Returns 1 upon success, 0 upon failure.

SEE ALSO

arg_catargs , arg_dump , arg_glossary , arg_record , arg_scanargv , arg_syntax , arg_typestr