Lines Matching +full:entry +full:- +full:name
12 .\" 3. Neither the name of the University nor the names of its contributors
31 .Sh NAME
122 .Nd implementations of singly-linked lists, singly-linked tail queues,
129 .Fn SLIST_CONCAT "SLIST_HEAD *head1" "SLIST_HEAD *head2" "TYPE" "SLIST_ENTRY NAME"
133 .Fn SLIST_FOREACH "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME"
134 .Fn SLIST_FOREACH_FROM "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME"
135 .Fn SLIST_FOREACH_FROM_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var"
136 .Fn SLIST_FOREACH_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var"
140 .Fn SLIST_INSERT_AFTER "TYPE *listelm" "TYPE *elm" "SLIST_ENTRY NAME"
141 .Fn SLIST_INSERT_HEAD "SLIST_HEAD *head" "TYPE *elm" "SLIST_ENTRY NAME"
142 .Fn SLIST_NEXT "TYPE *elm" "SLIST_ENTRY NAME"
143 .Fn SLIST_REMOVE "SLIST_HEAD *head" "TYPE *elm" "TYPE" "SLIST_ENTRY NAME"
144 .Fn SLIST_REMOVE_AFTER "TYPE *elm" "SLIST_ENTRY NAME"
145 .Fn SLIST_REMOVE_HEAD "SLIST_HEAD *head" "SLIST_ENTRY NAME"
154 .Fn STAILQ_FOREACH "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME"
155 .Fn STAILQ_FOREACH_FROM "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME"
156 .Fn STAILQ_FOREACH_FROM_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var"
157 .Fn STAILQ_FOREACH_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var"
161 .Fn STAILQ_INSERT_AFTER "STAILQ_HEAD *head" "TYPE *listelm" "TYPE *elm" "STAILQ_ENTRY NAME"
162 .Fn STAILQ_INSERT_HEAD "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME"
163 .Fn STAILQ_INSERT_TAIL "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME"
164 .Fn STAILQ_LAST "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME"
165 .Fn STAILQ_NEXT "TYPE *elm" "STAILQ_ENTRY NAME"
166 .Fn STAILQ_REMOVE "STAILQ_HEAD *head" "TYPE *elm" "TYPE" "STAILQ_ENTRY NAME"
167 .Fn STAILQ_REMOVE_AFTER "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME"
168 .Fn STAILQ_REMOVE_HEAD "STAILQ_HEAD *head" "STAILQ_ENTRY NAME"
173 .Fn LIST_CONCAT "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY NAME"
177 .Fn LIST_FOREACH "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME"
178 .Fn LIST_FOREACH_FROM "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME"
179 .Fn LIST_FOREACH_FROM_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var"
180 .Fn LIST_FOREACH_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var"
184 .Fn LIST_INSERT_AFTER "TYPE *listelm" "TYPE *elm" "LIST_ENTRY NAME"
185 .Fn LIST_INSERT_BEFORE "TYPE *listelm" "TYPE *elm" "LIST_ENTRY NAME"
186 .Fn LIST_INSERT_HEAD "LIST_HEAD *head" "TYPE *elm" "LIST_ENTRY NAME"
187 .Fn LIST_NEXT "TYPE *elm" "LIST_ENTRY NAME"
188 .Fn LIST_PREV "TYPE *elm" "LIST_HEAD *head" "TYPE" "LIST_ENTRY NAME"
189 .Fn LIST_REMOVE "TYPE *elm" "LIST_ENTRY NAME"
190 .Fn LIST_REPLACE "TYPE *elm" "TYPE *new" "LIST_ENTRY NAME"
191 .Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY NAME"
195 .Fn TAILQ_CONCAT "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TAILQ_ENTRY NAME"
199 .Fn TAILQ_FOREACH "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME"
200 .Fn TAILQ_FOREACH_FROM "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME"
201 .Fn TAILQ_FOREACH_FROM_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var"
202 .Fn TAILQ_FOREACH_REVERSE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME"
203 .Fn TAILQ_FOREACH_REVERSE_FROM "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME"
204 .Fn TAILQ_FOREACH_REVERSE_FROM_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "T…
205 .Fn TAILQ_FOREACH_REVERSE_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "TYPE *…
206 .Fn TAILQ_FOREACH_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var"
210 .Fn TAILQ_INSERT_AFTER "TAILQ_HEAD *head" "TYPE *listelm" "TYPE *elm" "TAILQ_ENTRY NAME"
211 .Fn TAILQ_INSERT_BEFORE "TYPE *listelm" "TYPE *elm" "TAILQ_ENTRY NAME"
212 .Fn TAILQ_INSERT_HEAD "TAILQ_HEAD *head" "TYPE *elm" "TAILQ_ENTRY NAME"
213 .Fn TAILQ_INSERT_TAIL "TAILQ_HEAD *head" "TYPE *elm" "TAILQ_ENTRY NAME"
215 .Fn TAILQ_NEXT "TYPE *elm" "TAILQ_ENTRY NAME"
216 .Fn TAILQ_PREV "TYPE *elm" "HEADNAME" "TAILQ_ENTRY NAME"
217 .Fn TAILQ_REMOVE "TAILQ_HEAD *head" "TYPE *elm" "TAILQ_ENTRY NAME"
218 .Fn TAILQ_REPLACE "TAILQ_HEAD *head" "TYPE *elm" "TYPE *new" "TAILQ_ENTRY NAME"
219 .Fn TAILQ_SWAP "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TYPE" "TAILQ_ENTRY NAME"
224 .Bl -enum -compact -offset indent
228 Singly-linked lists
230 Singly-linked tail queues
235 .Bl -enum -compact -offset indent
237 Insertion of a new entry at the head of the list.
239 Insertion of a new entry after any element in the list.
241 O(1) removal of an entry from the head of the list.
248 Singly-linked lists are the simplest of the four data structures
250 Singly-linked lists are ideal for applications with large datasets
253 Singly-linked lists add the following functionality:
254 .Bl -enum -compact -offset indent
256 O(n) removal of any entry in the list.
261 Singly-linked tail queues add the following functionality:
262 .Bl -enum -compact -offset indent
266 O(n) removal of any entry in the list.
271 .Bl -enum -compact -offset indent
275 Each head entry requires two pointers rather than one.
278 than singly-linked lists.
281 Singly-linked tail queues are ideal for applications with large datasets and
287 .Bl -enum -compact -offset indent
289 Insertion of a new entry before any element in the list.
291 O(1) removal of any entry in the list.
294 .Bl -enum -compact -offset indent
299 twice that of the singly-linked data-structures.
304 .Bl -enum -compact -offset indent
311 .Bl -enum -compact -offset indent
313 To traverse backwards, an entry to begin the traversal and the list in
318 .Bl -enum -compact -offset indent
327 .Bl -enum -compact -offset indent
331 Each head entry requires two pointers rather than one.
334 than singly-linked lists.
339 is the name of a user defined structure.
341 .Fa NAME
350 is the name of a user defined class.
352 .Fa NAME
361 is the name of a user defined structure that must be declared
374 .Sh SINGLY-LINKED LISTS
375 A singly-linked list is headed by a structure defined by the
387 .Bd -literal -offset indent
393 is the name of the structure to be defined, and
397 .Bd -literal -offset indent
422 A singly-linked tail queue should be used if this macro is needed in
423 high-usage code paths or to operate on long lists.
534 A doubly-linked list should be used if this macro is needed in
535 high-usage code paths or to operate on long lists.
543 .Sh SINGLY-LINKED LIST EXAMPLE
544 .Bd -literal
545 SLIST_HEAD(slisthead, entry) head =
547 struct slisthead *headp; /* Singly-linked List head. */
548 struct entry {
550 SLIST_ENTRY(entry) entries; /* Singly-linked List. */
556 n1 = malloc(sizeof(struct entry)); /* Insert at the head. */
559 n2 = malloc(sizeof(struct entry)); /* Insert after. */
562 SLIST_REMOVE(&head, n2, entry, entries);/* Deletion. */
570 np-> ...
573 np->do_stuff();
575 SLIST_REMOVE(&head, np, entry, entries);
585 .Sh SINGLY-LINKED TAIL QUEUES
586 A singly-linked tail queue is headed by a structure defined by the
600 .Bd -literal -offset indent
606 is the name of the structure to be defined, and
610 .Bd -literal -offset indent
753 A doubly-linked tail queue should be used if this macro is needed in
754 high-usage code paths or to operate on long tail queues.
762 .Sh SINGLY-LINKED TAIL QUEUE EXAMPLE
763 .Bd -literal
764 STAILQ_HEAD(stailhead, entry) head =
766 struct stailhead *headp; /* Singly-linked tail queue head. */
767 struct entry {
769 STAILQ_ENTRY(entry) entries; /* Tail queue. */
775 n1 = malloc(sizeof(struct entry)); /* Insert at the head. */
778 n1 = malloc(sizeof(struct entry)); /* Insert at the tail. */
781 n2 = malloc(sizeof(struct entry)); /* Insert after. */
784 STAILQ_REMOVE(&head, n2, entry, entries);
792 np-> ...
795 np->do_stuff();
797 STAILQ_REMOVE(&head, np, entry, entries);
828 .Bd -literal -offset indent
834 is the name of the structure to be defined, and
838 .Bd -literal -offset indent
864 high-usage code paths or to operate on long lists.
987 .Bd -literal
988 LIST_HEAD(listhead, entry) head =
991 struct entry {
993 LIST_ENTRY(entry) entries; /* List. */
999 n1 = malloc(sizeof(struct entry)); /* Insert at the head. */
1002 n2 = malloc(sizeof(struct entry)); /* Insert after. */
1005 n3 = malloc(sizeof(struct entry)); /* Insert before. */
1012 np-> ...
1016 np->do_stuff();
1051 .Bd -literal -offset indent
1057 is the name of the structure to be defined, and
1061 .Bd -literal -offset indent
1256 .Bd -literal
1257 TAILQ_HEAD(tailhead, entry) head =
1260 struct entry {
1262 TAILQ_ENTRY(entry) entries; /* Tail queue. */
1268 n1 = malloc(sizeof(struct entry)); /* Insert at the head. */
1271 n1 = malloc(sizeof(struct entry)); /* Insert at the tail. */
1274 n2 = malloc(sizeof(struct entry)); /* Insert after. */
1277 n3 = malloc(sizeof(struct entry)); /* Insert before. */
1283 n4 = malloc(sizeof(struct entry)); /* Replacement. */
1288 np-> ...
1291 np->do_stuff();
1298 np-> ...
1340 .Bl -hang -offset indent
1341 .It Fn SLIST_REMOVE_PREVPTR "TYPE **prev" "TYPE *elm" "SLIST_ENTRY NAME"