[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()


[Back to Amiga Developer Docs]