Home | History | Annotate | Download | only in dbus

Lines Matching full:link

56   DBusList *link;
70 link = _dbus_mem_pool_alloc (list_pool);
71 if (link == NULL)
81 link = _dbus_mem_pool_alloc (list_pool);
84 if (link)
85 link->data = data;
89 return link;
93 free_link (DBusList *link)
96 if (_dbus_mem_pool_dealloc (list_pool, link))
108 DBusList *link)
112 link->prev = link;
113 link->next = link;
114 *list = link;
118 link->next = before_this_link;
119 link->prev = before_this_link->prev;
120 before_this_link->prev = link;
121 link->prev->next = link;
124 *list = link;
131 DBusList *link)
135 link->prev = link;
136 link->next = link;
137 *list = link;
141 link->prev = after_this_link;
142 link->next = after_this_link->next;
143 after_this_link->next = link;
144 link->next->prev = link;
168 * Gets the next link in the list, or #NULL if
172 * DBusList *link;
173 * link = _dbus_list_get_first_link (&list);
174 * while (link != NULL)
176 * printf ("value is %p\n", link->data);
177 * link = _dbus_list_get_next_link (&link);
182 * @param link current link.
183 * @returns the next link, or %NULL if none.
190 * Gets the previous link in the list, or #NULL if
194 * DBusList *link;
195 * link = _dbus_list_get_last_link (&list);
196 * while (link != NULL)
198 * printf ("value is %p\n", link->data);
199 * link = _dbus_list_get_prev_link (&link);
204 * @param link current link.
205 * @returns the previous link, or %NULL if none.
214 * @param data the value to store in the link.
215 * @returns a newly allocated link.
227 * @param link the list node
230 _dbus_list_free_link (DBusList *link)
232 free_link (link);
238 * if insufficient memory exists to add a list link.
260 * if insufficient memory exists to add a list link.
271 DBusList *link;
273 link = alloc_link (data);
274 if (link == NULL)
277 link_before (list, *list, link);
283 * Appends a link to the list.
288 * @param link the link to append.
292 DBusList *link)
294 _dbus_list_prepend_link (list, link);
301 * Prepends a link to the list.
306 * @param link the link to prepend.
310 DBusList *link)
312 link_before (list, *list, link);
317 * Inserts data into the list before the given existing link.
320 * @param before_this_link existing link to insert before, or #NULL to append
329 DBusList *link;
335 link = alloc_link (data);
336 if (link == NULL)
339 link_before (list, before_this_link, link);
347 * Inserts data into the list after the given existing link.
350 * @param after_this_link existing link to insert after, or #NULL to prepend
359 DBusList *link;
365 link = alloc_link (data);
366 if (link == NULL)
369 link_after (list, after_this_link, link);
376 * Inserts a link into the list before the given existing link.
379 * @param before_this_link existing link to insert before, or #NULL to append
380 * @param link the link to insert
385 DBusList *link)
388 _dbus_list_append_link (list, link);
390 link_before (list, before_this_link, link);
394 * Inserts a link into the list after the given existing link.
397 * @param after_this_link existing link to insert after, or #NULL to prepend
398 * @param link the link to insert
403 DBusList *link)
406 _dbus_list_prepend_link (list, link);
408 link_after (list, after_this_link, link);
425 DBusList *link;
427 link = *list;
428 while (link != NULL)
430 if (link->data == data)
432 _dbus_list_remove_link (list, link);
436 link = _dbus_list_get_next_link (list, link);
456 DBusList *link;
458 link = _dbus_list_find_last (list, data);
459 if (link)
461 _dbus_list_remove_link (list, link);
469 * Finds a value in the list. Returns the last link
476 * @returns the link if found
482 DBusList *link;
484 link = _dbus_list_get_last_link (list);
486 while (link != NULL)
488 if (link->data == data)
489 return link;
491 link = _dbus_list_get_prev_link (list, link);
498 * Removes the given link from the list, but doesn't
500 * link and also frees it.
503 * @param link the link in the list
507 DBusList *link)
509 if (link->next == link)
516 link->prev->next = link->next;
517 link->next->prev = link->prev;
519 if (*list == link)
520 *list = link->next;
523 link->next = NULL;
524 link->prev = NULL;
528 * Removes a link from the list. This is a constant-time operation.
531 * @param link the list link to remove.
535 DBusList *link)
537 _dbus_list_unlink (list, link);
538 free_link (link);
543 * not free the data in each link, for obvious reasons. This is a
551 DBusList *link;
553 link = *list;
554 while (link != NULL)
556 DBusList *next = _dbus_list_get_next_link (list, link);
558 free_link (link);
560 link = next;
567 * Gets the first link in the list.
571 * @returns the first link, or #NULL for an empty list.
580 * Gets the last link in the list.
584 * @returns the last link, or #NULL for an empty list.
628 * Removes the first link in the list and returns it. This is a
632 * @returns the first link in the list, or #NULL for an empty list.
637 DBusList *link;
639 link = _dbus_list_get_first_link (list);
640 if (link == NULL)
643 _dbus_list_unlink (list, link);
645 return link;
658 DBusList *link;
661 link = _dbus_list_get_first_link (list);
662 if (link == NULL)
665 data = link->data;
666 _dbus_list_remove_link (list, link);
681 DBusList *link;
684 link = _dbus_list_get_last_link (list);
685 if (link == NULL)
688 data = link->data;
689 _dbus_list_remove_link (list, link);
696 * Removes the last link in the list and returns it. This is a
700 * @returns the last link in the list, or #NULL for an empty list.
705 DBusList *link;
707 link = _dbus_list_get_last_link (list);
708 if (link == NULL)
711 _dbus_list_unlink (list, link);
713 return link;
730 DBusList *link;
736 link = *list;
737 while (link != NULL)
739 if (!_dbus_list_append (dest, link->data))
746 link = _dbus_list_get_next_link (list, link);
762 DBusList *link;
767 link = *list;
768 while (link != NULL)
772 link = _dbus_list_get_next_link (list, link);
793 DBusList *link;
795 link = *list;
796 while (link != NULL)
798 DBusList *next = _dbus_list_get_next_link (list, link);
800 (* function) (link->data, data);
802 link = next;
828 DBusList *link;
831 link = *list;
833 if (link == NULL)
836 if (link->next == link)
838 _dbus_assert (link->prev == link);
839 _dbus_assert (*list == link);
847 _dbus_assert (link->prev->next == link);
848 _dbus_assert (link->next->prev == link);
849 link = link->next;
851 while (link != *list);
864 DBusList *link;
869 link = _dbus_list_get_first_link (list);
870 while (link != NULL)
872 int v = _DBUS_POINTER_TO_INT (link->data);
879 link = _dbus_list_get_next_link (list, link);
888 DBusList *link;
893 link = _dbus_list_get_first_link (list);
894 while (link != NULL)
896 int v = _DBUS_POINTER_TO_INT (link->data);
903 link = _dbus_list_get_next_link (list, link);
912 DBusList *link;
914 link = _dbus_list_get_first_link (list);
915 while (link != NULL)
917 int v = _DBUS_POINTER_TO_INT (link->data);
922 link = _dbus_list_get_next_link (list, link);
931 DBusList *link;
933 link = _dbus_list_get_first_link (list);
934 while (link != NULL)
936 int v = _DBUS_POINTER_TO_INT (link->data);
941 link = _dbus_list_get_next_link (list, link);
1137 verify_list (&link2); /* pretend this link is the head */
1149 verify_list (&link1); /* pretend this link is the head */
1161 verify_list (&link1); /* pretend this link is the head */
1245 /* Test remove link more generally */