Home | History | Annotate | Download | only in dbus

Lines Matching refs:link

57   DBusList *link;
71 link = _dbus_mem_pool_alloc (list_pool);
72 if (link == NULL)
82 link = _dbus_mem_pool_alloc (list_pool);
85 if (link)
86 link->data = data;
90 return link;
94 free_link (DBusList *link)
97 if (_dbus_mem_pool_dealloc (list_pool, link))
109 DBusList *link)
113 link->prev = link;
114 link->next = link;
115 *list = link;
119 link->next = before_this_link;
120 link->prev = before_this_link->prev;
121 before_this_link->prev = link;
122 link->prev->next = link;
125 *list = link;
132 DBusList *link)
136 link->prev = link;
137 link->next = link;
138 *list = link;
142 link->prev = after_this_link;
143 link->next = after_this_link->next;
144 after_this_link->next = link;
145 link->next->prev = link;
169 * Gets the next link in the list, or #NULL if
173 * DBusList *link;
174 * link = _dbus_list_get_first_link (&list);
175 * while (link != NULL)
177 * printf ("value is %p\n", link->data);
178 * link = _dbus_list_get_next_link (&link);
183 * @param link current link.
184 * @returns the next link, or %NULL if none.
191 * Gets the previous link in the list, or #NULL if
195 * DBusList *link;
196 * link = _dbus_list_get_last_link (&list);
197 * while (link != NULL)
199 * printf ("value is %p\n", link->data);
200 * link = _dbus_list_get_prev_link (&link);
205 * @param link current link.
206 * @returns the previous link, or %NULL if none.
215 * @param data the value to store in the link.
216 * @returns a newly allocated link.
228 * @param link the list node
231 _dbus_list_free_link (DBusList *link)
233 free_link (link);
239 * if insufficient memory exists to add a list link.
261 * if insufficient memory exists to add a list link.
272 DBusList *link;
274 link = alloc_link (data);
275 if (link == NULL)
278 link_before (list, *list, link);
284 * Appends a link to the list.
289 * @param link the link to append.
293 DBusList *link)
295 _dbus_list_prepend_link (list, link);
302 * Prepends a link to the list.
307 * @param link the link to prepend.
311 DBusList *link)
313 link_before (list, *list, link);
318 * Inserts data into the list before the given existing link.
321 * @param before_this_link existing link to insert before, or #NULL to append
330 DBusList *link;
336 link = alloc_link (data);
337 if (link == NULL)
340 link_before (list, before_this_link, link);
348 * Inserts data into the list after the given existing link.
351 * @param after_this_link existing link to insert after, or #NULL to prepend
360 DBusList *link;
366 link = alloc_link (data);
367 if (link == NULL)
370 link_after (list, after_this_link, link);
377 * Inserts a link into the list before the given existing link.
380 * @param before_this_link existing link to insert before, or #NULL to append
381 * @param link the link to insert
386 DBusList *link)
389 _dbus_list_append_link (list, link);
391 link_before (list, before_this_link, link);
395 * Inserts a link into the list after the given existing link.
398 * @param after_this_link existing link to insert after, or #NULL to prepend
399 * @param link the link to insert
404 DBusList *link)
407 _dbus_list_prepend_link (list, link);
409 link_after (list, after_this_link, link);
426 DBusList *link;
428 link = *list;
429 while (link != NULL)
431 if (link->data == data)
433 _dbus_list_remove_link (list, link);
437 link = _dbus_list_get_next_link (list, link);
457 DBusList *link;
459 link = _dbus_list_find_last (list, data);
460 if (link)
462 _dbus_list_remove_link (list, link);
470 * Finds a value in the list. Returns the last link
477 * @returns the link if found
483 DBusList *link;
485 link = _dbus_list_get_last_link (list);
487 while (link != NULL)
489 if (link->data == data)
490 return link;
492 link = _dbus_list_get_prev_link (list, link);
499 * Removes the given link from the list, but doesn't
501 * link and also frees it.
504 * @param link the link in the list
508 DBusList *link)
510 if (link->next == link)
517 link->prev->next = link->next;
518 link->next->prev = link->prev;
520 if (*list == link)
521 *list = link->next;
524 link->next = NULL;
525 link->prev = NULL;
529 * Removes a link from the list. This is a constant-time operation.
532 * @param link the list link to remove.
536 DBusList *link)
538 _dbus_list_unlink (list, link);
539 free_link (link);
544 * not free the data in each link, for obvious reasons. This is a
552 DBusList *link;
554 link = *list;
555 while (link != NULL)
557 DBusList *next = _dbus_list_get_next_link (list, link);
559 free_link (link);
561 link = next;
568 * Gets the first link in the list.
572 * @returns the first link, or #NULL for an empty list.
581 * Gets the last link in the list.
585 * @returns the last link, or #NULL for an empty list.
629 * Removes the first link in the list and returns it. This is a
633 * @returns the first link in the list, or #NULL for an empty list.
638 DBusList *link;
640 link = _dbus_list_get_first_link (list);
641 if (link == NULL)
644 _dbus_list_unlink (list, link);
646 return link;
659 DBusList *link;
662 link = _dbus_list_get_first_link (list);
663 if (link == NULL)
666 data = link->data;
667 _dbus_list_remove_link (list, link);
682 DBusList *link;
685 link = _dbus_list_get_last_link (list);
686 if (link == NULL)
689 data = link->data;
690 _dbus_list_remove_link (list, link);
697 * Removes the last link in the list and returns it. This is a
701 * @returns the last link in the list, or #NULL for an empty list.
706 DBusList *link;
708 link = _dbus_list_get_last_link (list);
709 if (link == NULL)
712 _dbus_list_unlink (list, link);
714 return link;
731 DBusList *link;
737 link = *list;
738 while (link != NULL)
740 if (!_dbus_list_append (dest, link->data))
747 link = _dbus_list_get_next_link (list, link);
763 DBusList *link;
768 link = *list;
769 while (link != NULL)
773 link = _dbus_list_get_next_link (list, link);
794 DBusList *link;
796 link = *list;
797 while (link != NULL)
799 DBusList *next = _dbus_list_get_next_link (list, link);
801 (* function) (link->data, data);
803 link = next;
829 DBusList *link;
832 link = *list;
834 if (link == NULL)
837 if (link->next == link)
839 _dbus_assert (link->prev == link);
840 _dbus_assert (*list == link);
848 _dbus_assert (link->prev->next == link);
849 _dbus_assert (link->next->prev == link);
850 link = link->next;
852 while (link != *list);
865 DBusList *link;
870 link = _dbus_list_get_first_link (list);
871 while (link != NULL)
873 int v = _DBUS_POINTER_TO_INT (link->data);
880 link = _dbus_list_get_next_link (list, link);
889 DBusList *link;
894 link = _dbus_list_get_first_link (list);
895 while (link != NULL)
897 int v = _DBUS_POINTER_TO_INT (link->data);
904 link = _dbus_list_get_next_link (list, link);
913 DBusList *link;
915 link = _dbus_list_get_first_link (list);
916 while (link != NULL)
918 int v = _DBUS_POINTER_TO_INT (link->data);
923 link = _dbus_list_get_next_link (list, link);
932 DBusList *link;
934 link = _dbus_list_get_first_link (list);
935 while (link != NULL)
937 int v = _DBUS_POINTER_TO_INT (link->data);
942 link = _dbus_list_get_next_link (list, link);
1138 verify_list (&link2); /* pretend this link is the head */
1150 verify_list (&link1); /* pretend this link is the head */
1162 verify_list (&link1); /* pretend this link is the head */
1246 /* Test remove link more generally */