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

Earlier it was mentioned that supplying a position value of IFFSLI_PROP to
StoreLocalItem() would store it in the topmost property scope.
FindPropContext() is the routine that finds that topmost context.

Property chunks (such as the BMHD, CMAP, and others) have dominion over
the FORM that contains them; they are said to be "in scope" and their
definition persists until the FORM's context ends.  Thus, a property chunk
has a scoping level equal to the FORM that contains it; when the FORM
ends, the property dies with it.

Consider a more complicated example.  Suppose you have a LIST with a PROP
in it.  PROPs are the global variables of LISTs; thus a property chunk
declared in a PROP will persist until the LIST's context ends.

This is what FindPropContext() is looking for; a context level in which a
property chunk may be installed.

FindPropContext() starts at the parent of the current context (second from
the top of the context stack) and starts searching downward, looking for
the first FORM or LIST context it finds.  If it finds one, it returns a
pointer to that ContextNode.  If it can't find a suitable context level,
it returns NULL.

FindPropContext() is called as follows:

    struct ContextNode *cn;

    cn = FindPropContext (iff);