[Contents] [Index] [Help] [Retrace] [browse <] [Browse >]


NAME
    ReadItem - reads a single argument/name from command line (V36)

SYNOPSIS
    value = ReadItem(buffer, maxchars, input)
    D0                D1        D2      D3

    LONG ReadItem(STRPTR, LONG, struct csource *)

FUNCTION
    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.

INPUTS
    buffer   - buffer to store word in.
    maxchars - size of the buffer
    input    - csource input or null (uses fgetc(input()))

RESULT
    value - See <dos/dos.h> for return values.

SEE ALSO
    readargs(), findarg(), ungetc(), fgetc(), input(), <dos/dos.h>,
    <dos/rdargs.h>, freeargs()