The xtype C Library, Version 1.00

The XLIST Type

Contents:

  1. xlappend
  2. xlbehead
  3. xldata
  4. xldelete
  5. xldequeue
  6. xlend
  7. xlenqueue
  8. xlfree
  9. xlget
  10. xllen
  11. xlnew
  12. xlnext
  13. xlpop
  14. xlprepend
  15. xlprev
  16. xlpush
  17. xlrewind
  18. xlsize

XLIST *xlappend(XLIST *xl, void *p, int s)

Function

Append a node to the list pointed to by xl. The new node will contained the data in a buffer of size s pointed to by p.

Returns


void *xlbehead(XLIST *xl, void *p)

Function

Delete the head of the list pointed to by xl, copying the data in it into the buffer pointed to by p if p is not NULL. The list cursor will point to the new head of the list.

Returns


void *xldata(XLIST *xl)

Function

Obtain a pointer to the data contained in the current node of the list pointed to by xl.

Returns


void xldelete(XLIST *xl)

Function

Delete the current node of the list pointed to by xl.


void *xldequeue(XLIST *xl, void *p)

Function

Pseudonym for xlbehead().


int xlend(XLIST *xl)

Function

Test the list pointed to by xl to see if its cursor is at the end of the list. xlend() is implemented as a macro.

Returns


XLIST *xlenqueue(XLIST *xl, void *p, int s)

Function

Pseudonym for xlappend().


void xlfree(XLIST *xl)

Function

De-allocate the memory used by the list pointed to by xl. xlfree() frees the memory used by the XLIST structure itself; if the node elements are pointers to dynamically-allocated objects, these must be freed separately. Do not use xl after calling this function.


void *xlget(XLIST *xl, void *p)

Function

Copy the data in the current node of the list pointed to by xl into a buffer pointed to by p.

Returns


int xllen(XLIST *xl)

Function

Compute the length of the list pointed to by xl. xllen() is implemented as a macro.

Returns


XLIST *xlnew(void)

Function

Create a new linked list. The new list can be freed by calling xlfree().

Returns


void *xlnext(XLIST *xl)

Function

Advance the cursor of the list pointed to by xl by one node.

Returns


void *xlpop(XLIST *xl, void *p)

Function

Pseudonym for xlbehead().


XLIST *xlprepend(XLIST *xl, void *p, int s)

Function

Add a new node to the start of the list pointed to by xl. The new node will contained the data in a buffer of size s pointed to by p.

Returns


void *xlprev(XLIST *xl)

Function

Move the cursor of the list pointed to by xl back one node.

Returns


XLIST *xlpush(XLIST *xl, void *p, int s)

Function

Pseudonym for xlprepend().


void *xlrewind(XLIST *xl)

Function

Move the cursor of the list pointed to by xl to the head of the list.

Returns


int xlsize(XLIST *xl)

Function

Return the size of the data element in the current node of the list pointed to by xl.

Returns