VisionX V4 | VXFIRST | VisionX V4 |
VXfirst, VXlast, VXfind, VXfindin, VXbfind − VisionX element search functions |
VisXelem_t *VXfirst (lptr); VisXelem_t *lptr; VisXelem_t *VXlast (lptr); VisXelem_t *lptr; VisXelem_t *VXfind (lptr, vxtype); VisXelem_t *list; int vxtype; VisXelem_t *VXfindin (lptr, tlist); VisXelem_t *list; int tlist[]; VisXelem_t *VXbfind (lptr, vxtype); VisXelem_t *list; int vxtype; |
VisionX represents information internally as a doubly linked list of data elements. Each element contains a type descriptor, forward and backward pointers to other elements, and data. The VisionX file i/o functions read and write these lists. The first element of a list is always a dummy element that is required for consistency. The element search functions provide a set of programming tools for locating specific list elements. The element search functions contains the following: VXfirst − move to first element of a list VXlast − move to last element of a list VXfind − find an element with a given type VXfindin − find an element with one of a set of types and VXbfind − search backwards for an element with a given type. |
VXfirst is given an arbitrary pointer to a list element lptr, and returns a pointer to the first data element in the list (not the dummy element). |
VXlast is given an arbitrary pointer to a list element lptr, and returns a pointer to the last data element in the list. If there are no elements in the list a pointer to the dummy element is returned. |
VXfind searches a list in a forward direction for a data element of type vxtype starting at the element specified by lptr. If such an element is found VXfind returns a pointer to that element. Otherwise, VXfind returns a null element pointer (VXNIL). |
VXfindin searches a list in a forward direction for a data element of one of the types specified by the zero terminated list of types specified by the argument tlist. If any element specified in tlist is found, VXfindin returns a pointer to that element. Otherwise, VXfindin returns a null element pointer (VXNIL). |
VXbfind searches a list in a BACKWARDS direction for a data element of type vxtype starting at the element specified by lptr. If such an element is found VXbfind returns a pointer to that element. Otherwise, VXfind returns a null element pointer (VXNIL). |
A. P. Reeves |