arg_scanstr(3)

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(3), arg_dump(3), arg_glossary(3), arg_record(3), arg_scanargv(3), arg_syntax(3), arg_typestr(3)