void pelem_search(
Pint struct_id, /* structure identifier */ Pint start_el, /* starting element position */ Psearch_dir dir, /* search direction */ const Pelem_type_list *incl, /* element inclusion set */ const Pelem_type_list *excl, /* element exclusion set */ Pint *error_ind, /* (out) error indicator */ Psearch_status *status, /* (out) status of search */ Pint *found_el /* (out) found element position */
)
typedef enum {
PDIR_BACKWARD,
PDIR_FORWARD
} Psearch_dir;
typedef struct {
Pint num_elem_types; /* number of element types */
Pelem_type *elem_types; /* element types */
} Pelem_type_list;
typedef enum {
PSEARCH_STATUS_FAILURE,
PSEARCH_STATUS_SUCCESS
} Psearch_status;
An element will be selected if its type does not belong to the exclusion set excl and if it belongs to the inclusion set incl.
The PELEM_ALL element means all element types and will normally appear only in the element inclusion list. If an element is both in the inclusion and exclusion sets then it will be excluded.
If the start pointer is less than 1, the search starts at the first sequential element. If the start position is greater than the number of elements in the structure, the search starts from the last sequential element.