Docs » Autodocs » dos.library » ReadItem
ReadItem - reads a single argument/name from command line (V36)
value = ReadItem(buffer, maxchars, input) D0 D1 D2 D3 LONG ReadItem(STRPTR, LONG, struct CSource *)
Reads a "word" from either Input() (buffered), or via CSource, if it is non-NULL (see <dos/rdargs.h> for more information). Handles quoting and some '*' substitutions (*e and *n) inside quotes (only). See dos/dos.h for a listing of values returned by ReadItem() (ITEM_XXXX). A "word" is delimited by whitespace, quotes, '=', or an EOF. ReadItem always unreads the last thing read (UnGetC(fh,-1)) so the caller can find out what the terminator was.
buffer - buffer to store word in. maxchars - size of the buffer input - CSource input or NULL (uses FGetC(Input()))
value - See <dos/dos.h> for return values.
Doesn't actually unread the terminator.
ReadArgs(), FindArg(), UnGetC(), FGetC(), Input(), <dos/dos.h>, <dos/rdargs.h>, FreeArgs()
|