View source code
Display the source code in dmd/tk/dlist.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Module dmd.tk.dlist

Interface to the C linked list type.

List is a complete package of functions to deal with singly linked lists of pointers or integers.

Features

1. Uses mem package. 2. Has loop-back tests. 3. Each item in the list can have multiple predecessors, enabling different lists to 'share' a common tail.

Functions

NameDescription
list_append(plist, ptr) Append ptr to *plist.
list_appenddata(plist, d) Append integer item to list.
list_apply(plist, fp) Apply a function fp to each member of a list.
list_build(p) Build a list out of the null-terminated argument list.
list_cat(pl1, l2) Concatenate two lists (l2 appended to l1).
list_cmp(list1, list2, fp) Compare two lists using the comparison function fp. The comparison function is the same as used for qsort().
list_copy(list) Copy a list and return it.
list_copyinto(, ) Copy list of pointers into an array of pointers.
list_data(list)
list_equal(list1, list2) Compare two lists.
list_free(plist, freeptr) Free list.
list_init() Initialize list package.
list_inlist(list, ptr) Search for ptr in list.
list_insert(, , n) Insert item into list at nth position.
list_last(list)
list_link(list) Create link to existing list, that is, share the list with somebody else.
list_next(list)
list_nitems(list) Count up and return number of items in list.
list_nth(list, n)
list_pop(plist) Remove first element in list pointed to by *plist.
list_prepend(plist, ptr) Prepend ptr to *plist.
list_prependdata(plist, d) Prepend integer item to list.
list_prev(start, list)
list_ptr(list)
list_reverse() Reverse a list.
list_subtract(plist, ptr) Remove ptr from the list pointed to by *plist.
list_term() Terminate list package.

Authors

Walter Bright

License

Boost License 1.0