05/17/90  decode_definition_


The decode_definition_ subroutine returns decoded information from an
object segment definition into a directly accessible structure.


Entry points in decode_definition_:
   (List is generated by the help command)


:Entry: decode_definition_: 05/15/90  decode_definition_

Function: returns the decoded information of an object segment
definition in a directly accessible structure.  This subroutine can
only be used on one segment at a time because it uses internal static
storage for information about the current segment.


Syntax:
declare decode_definition_ entry (ptr, ptr, bit(1) aligned);
call decode_definition_ (def_ptr, structure_ptr, eof);


Arguments:
def_ptr
   is a pointer to the selected definition, or to the base of the
   object segment.  (Input).  If def_ptr points to the base of the
   object segment, decode_definition_ returns the first acceptable
   definition in the definition section (see Notes).  Otherwise it is
   expected to be pointing to a definition.
structure_ptr
   is a pointer to the structure in which decode_definition_ returns
   the desired information.  This structure is defined in
   decode_definition_str.incl.pl1.  (Input)


eof
   is a binary indicator that is "1"b if the current invocation of
   decode_definition_ causes the search to go beyond the end of the
   definition list.  If that is the case, the returned information in
   the structure is null.  It may also be "1"b if any error occurs.
   (Output)


Notes: decode_definition_ may not return the definition pointed to by
def_ptr.  It checks the "ignore" bit of each definition, and if that
bit is "1"b it will continue scanning the list of definitions until it
finds one for which the "ignore" bit is not set.

To be sure the internal static information about the current segment
has been properly initialized, the first call to decode_definition_
should either pass a pointer to the base of the object segment in
def_ptr, or it should follow a call to decode_definition_$init.

When decode_definition_ is called following a call to
decode_definition_$init for the same object segment, it will ignore
the value of def_ptr and always return the first definition in the
definition section (for which "ignore" is not set).


:Entry:  full:  05/17/90 decode_definition_$full

Function: This entry point, given a pointer to an object segment
definition, returns more complete information about that definition.
The symbolic name returned by this entry point can contain up to 256
characters.  This entry point does not use internal static storage.


Syntax:
declare decode_definition_$full entry (ptr, ptr, ptr, bit(1) aligned);
call decode_definition_$full (def_ptr, structure_ptr, oi_ptr, eof);


Arguments:
def_ptr
   is a pointer to the selected definition.  (Input).
structure_ptr
   is a pointer to the provided structure into which the
   decode_definition_$full entry point returns the desired information.
   This structure is defined in decode_definition_str.incl.pl1.
   (Input).
oi_ptr
   is a pointer to the structure returned by any entry point of the
   object_info subroutine.  (Input).


eof
   is a binary indicator that is "1"b if the current invocation of
   decode_definition_$full causes the search to go beyond the end of
   the definition list.  If that is the case, the returned information
   in the structure is null.  It may also be "1"b if any error occurs.
   (Output).


Notes: decode_definition_$full will return the definition pointed to by
def_ptr, whether or not the "ignore" bit is set for that definition.
If def_ptr points to the definition header, however, this entry point
will skip over it and return the first definition in the definition
section.


:Entry:  init:  05/16/90 decode_definition_$init

Function: This entry point is used for initialization of the internal
static storage used to locate the current segment.  It is especially
useful when the object segment does not begin at offset 0 (as for an
archive component).  This entry point only effects the main entry
point, decode_definition_.


Syntax:
declare decode_definition_$init entry (ptr, fixed bin(24));
call decode_definition_$init (seg_ptr, bit_count);


Arguments:
seg_ptr
   is a pointer to the beginning of an object segment (not necessarily
   with an offset of 0).  (Input)
bit_count
   is the bit count of the object segment.  (Input)
