4.4Lite2 implemented the LIST_INSERT_BEFORE and TAILQ_INSERT_BEFORE

exactly as I did (should have checked there first I guess) except my
macro for TAILQ_INSERT_BEFORE took an unneeded arg.  We now match 4.4Lite2.

Suggested by: Jeffrey Hsu <hsu@FreeBSD.org>
This commit is contained in:
Justin T. Gibbs 1996-02-12 08:20:54 +00:00
parent 5f6bedf2ac
commit 3652ff557d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14055
2 changed files with 4 additions and 4 deletions

View File

@ -74,7 +74,7 @@
.Fn TAILQ_HEAD "HEADNAME" "TYPE"
.Fn TAILQ_INIT "TAILQ_HEAD *head"
.Fn TAILQ_INSERT_AFTER "TAILQ_HEAD *head" "TYPE *listelm" "TYPE *elm" "TAILQ_ENTRY NAME"
.Fn TAILQ_INSERT_BEFORE "TAILQ_HEAD *head" "TYPE *listelm" "TYPE *elm" "TAILQ_ENTRY NAME"
.Fn TAILQ_INSERT_BEFORE "TYPE *listelm" "TYPE *elm" "TAILQ_ENTRY NAME"
.Fn TAILQ_INSERT_HEAD "TAILQ_HEAD *head" "TYPE *elm" "TAILQ_ENTRY NAME"
.Fn TAILQ_INSERT_TAIL "TAILQ_HEAD *head" "TYPE *elm" "TAILQ_ENTRY NAME"
.Fn TAILQ_REMOVE "TAILQ_HEAD *head" "TYPE *elm" "TAILQ_ENTRY NAME"
@ -371,7 +371,7 @@ n2 = malloc(sizeof(struct entry)); /* Insert after. */
TAILQ_INSERT_AFTER(&head, n1, n2, entries);
n3 = malloc(sizeof(struct entry)); /* Insert before. */
TAILQ_INSERT_BEFORE(&head, n2, n3, entries);
TAILQ_INSERT_BEFORE(n2, n3, entries);
TAILQ_REMOVE(&head, n2, entries); /* Deletion. */
free(n2);

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)queue.h 8.4 (Berkeley) 1/4/94
* $Id: queue.h,v 1.4 1995/12/03 13:45:34 bde Exp $
* $Id: queue.h,v 1.5 1996/01/29 03:20:41 gibbs Exp $
*/
#ifndef _SYS_QUEUE_H_
@ -166,7 +166,7 @@ struct { \
(elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
}
#define TAILQ_INSERT_BEFORE(head, listelm, elm, field) { \
#define TAILQ_INSERT_BEFORE(listelm, elm, field) { \
(elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
(elm)->field.tqe_next = (listelm); \
*(listelm)->field.tqe_prev = (elm); \