View source code
Display the source code in dmd/backend/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.backend.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.


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.


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(l, pa) Copy list of pointers into an array of pointers.
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(pl, ptr, n) Insert item into list at nth position.
list_link(list) Create link to existing list, that is, share the list with somebody else.
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_reverse(l) Reverse a list in place.
list_subtract(plist, ptr) Remove ptr from the list pointed to by *plist.
list_term() Terminate list package.


ListRange Range for Lists.


Walter Bright


Boost License 1.0