aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-25 23:11:28 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-25 23:11:28 +0000
commitdaac309efb0a17003d0973540c23519d851d7245 (patch)
tree8170814f2914d23f86616af02f2ce29661a10950 /include
parentb3aade8e81d40fdc5e11e6c537b15c7c5d1f9f0c (diff)
Merged revisions 87069 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r87069 | kpfleming | 2007-10-25 18:03:11 -0500 (Thu, 25 Oct 2007) | 2 lines appending one list to another should leave the first list empty, and not require the user to do that ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87070 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/linkedlists.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/asterisk/linkedlists.h b/include/asterisk/linkedlists.h
index b503f5b75..21e38761a 100644
--- a/include/asterisk/linkedlists.h
+++ b/include/asterisk/linkedlists.h
@@ -693,6 +693,9 @@ struct { \
\param list This is a pointer to the list to be appended.
\param field This is the name of the field (declared using AST_LIST_ENTRY())
used to link entries of this list together.
+
+ Note: The source list (the \a list parameter) will be empty after
+ calling this macro (the list entries are \b moved to the target list).
*/
#define AST_LIST_APPEND_LIST(head, list, field) do { \
if (!(head)->first) { \
@@ -702,6 +705,8 @@ struct { \
(head)->last->field.next = (list)->first; \
(head)->last = (list)->last; \
} \
+ (list)->first = NULL; \
+ (list)->last = NULL; \
} while (0)
#define AST_RWLIST_APPEND_LIST AST_LIST_APPEND_LIST