Module Name: src Committed By: rmind Date: Sat May 17 21:22:56 UTC 2014
Modified Files: src/share/man/man3: queue.3 src/sys/sys: queue.h Log Message: Rename LIST_CONCAT() to LIST_MOVE() as that is what it actually does (and there is no point to implement LIST_CONCAT() which would iterate). Update the queue(3) manpage. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/share/man/man3/queue.3 cvs rdiff -u -r1.66 -r1.67 src/sys/sys/queue.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/man/man3/queue.3 diff -u src/share/man/man3/queue.3:1.47 src/share/man/man3/queue.3:1.48 --- src/share/man/man3/queue.3:1.47 Thu Nov 28 16:45:36 2013 +++ src/share/man/man3/queue.3 Sat May 17 21:22:56 2014 @@ -1,4 +1,4 @@ -.\" $NetBSD: queue.3,v 1.47 2013/11/28 16:45:36 wiz Exp $ +.\" $NetBSD: queue.3,v 1.48 2014/05/17 21:22:56 rmind Exp $ .\" .\" Copyright (c) 2000, 2002 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -53,7 +53,7 @@ .\" .\" @(#)queue.3 8.1 (Berkeley) 12/13/93 .\" -.Dd November 27, 2013 +.Dd May 17, 2014 .Dt QUEUE 3 .Os .Sh NAME @@ -85,6 +85,7 @@ .Nm LIST_INSERT_HEAD , .Nm LIST_REMOVE , .Nm LIST_REPLACE , +.Nm LIST_MOVE , .Nm SIMPLEQ_HEAD , .Nm SIMPLEQ_HEAD_INITIALIZER , .Nm SIMPLEQ_ENTRY , @@ -176,6 +177,7 @@ .Fn LIST_INSERT_HEAD "LIST_HEAD *head" "TYPE *elm" "LIST_ENTRY NAME" .Fn LIST_REMOVE "TYPE *elm" "LIST_ENTRY NAME" .Fn LIST_REPLACE "TYPE *elm" "TYPE *new" "LIST_ENTRY NAME" +.Fn LIST_MOVE "LIST_HEAD *head1" "LIST_HEAD *head2" .Pp .Fn SIMPLEQ_HEAD "HEADNAME" "TYPE" .Fn SIMPLEQ_HEAD_INITIALIZER "head" @@ -661,6 +663,14 @@ replaces the element with .Fa new in the list. +.Pp +The macro +.Nm LIST_MOVE +moves the list headed by +.Fa head1 +onto the list headed by +.Fa head2 , +always making the former empty. .Sh LIST EXAMPLE .Bd -literal LIST_HEAD(listhead, entry) head; Index: src/sys/sys/queue.h diff -u src/sys/sys/queue.h:1.66 src/sys/sys/queue.h:1.67 --- src/sys/sys/queue.h:1.66 Sat May 17 20:34:49 2014 +++ src/sys/sys/queue.h Sat May 17 21:22:56 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: queue.h,v 1.66 2014/05/17 20:34:49 rmind Exp $ */ +/* $NetBSD: queue.h,v 1.67 2014/05/17 21:22:56 rmind Exp $ */ /* * Copyright (c) 1991, 1993 @@ -211,10 +211,11 @@ struct { \ ((tvar) = LIST_NEXT((var), field), 1); \ (var) = (tvar)) -#define LIST_CONCAT(head1, head2) do { \ - if (!LIST_EMPTY((head2))) { \ - (head1)->lh_first = (head2)->lh_first; \ - LIST_INIT((head2)); \ +#define LIST_MOVE(head1, head2) do { \ + LIST_INIT((head2)); \ + if (!LIST_EMPTY((head1))) { \ + (head2)->lh_first = (head1)->lh_first; \ + LIST_INIT((head1)); \ } \ } while (/*CONSTCOND*/0)