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


NAME
    NextTagItem -- Iterate tagitem lists. (v36)

SYNOPSIS
    next_tag = NextTagItem( tagItemPtr )
    D0                      A0

    struct tagitem *nexttagitem( struct tagitem **tagitemptr );

FUNCTION
    Iterates through a (chained) array of tagitem structures,
    skipping and chaining as dictated by system tags.  TAG_SKIP
    will cause it to skip the entry and the next, TAG_IGNORE ignores
    that single entry, and TAG_MORE has a pointer to another array
    of tags (and terminates the current array!)  TAG_DONE also
    terminates the current array.  Each call returns either the next
    tagitem you should examine, or NULL at the end.

INPUTS
    tagItemPtr      - doubly-indirect reference to a tagitem structure.
                      The pointer will be changed to keep track of the
                      iteration.

RESULT
    next_tag        - Each tagitem in the array or chain of arrays that
                      should be processed according to system Tag values
                      (in utility/tagitem.h) is returned in turn with
                      successive calls.

EXAMPLE
    Iterate( struct tagitem *tags );
    {
            struct tagitem *tstate;
            struct tagitem *tag;

            tstate = tags;
            while ( tag = NextTagItem( &tstate ) )
            {
                    switch ( tag->ti_Tag )
                    {
                    case TAG1:
                        ...
                        break;
                    case TAG2:
                        ...
                        break;
                    ...
                    }
            }
    }

NOTES
    Do NOT use the value of *tagItemPtr, but rather use the pointer
    returned by NextTagItem().


BUGS

SEE ALSO
    utility/tagitem.h, gettagdata(), packbooltags(), findtagitem()