X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=ccan%2Flist%2Flist.h;h=c4956a0d03814145a4d42e3b11a8bce93a611484;hb=22ffb884ca6a5f16517e49e051d8fb5a22e5049d;hp=3496294b52c89acc65ac10f58398ff4e08bfe523;hpb=1f4312c3320f353a18ab4aec4b8ae725fc25c911;p=ccan diff --git a/ccan/list/list.h b/ccan/list/list.h index 3496294b..c4956a0d 100644 --- a/ccan/list/list.h +++ b/ccan/list/list.h @@ -39,7 +39,7 @@ struct list_head }; /** - * list_check - check a list for consistency + * list_check - check head of a list for consistency * @h: the list_head * @abortstr: the location to print on aborting, or NULL. * @@ -51,6 +51,8 @@ struct list_head * Returns the list head if the list is consistent, NULL if not (it * can never return NULL if @abortstr is set). * + * See also: list_check_node() + * * Example: * static void dump_parent(struct parent *p) * { @@ -64,6 +66,25 @@ struct list_head */ struct list_head *list_check(const struct list_head *h, const char *abortstr); +/** + * list_check_node - check node of a list for consistency + * @n: the list_node + * @abortstr: the location to print on aborting, or NULL. + * + * Check consistency of the list node is in (it must be in one). + * + * See also: list_check() + * + * Example: + * static void dump_child(const struct child *c) + * { + * list_check_node(&c->list, "bad child list"); + * printf("%s\n", c->name); + * } + */ +struct list_node *list_check_node(const struct list_node *n, + const char *abortstr); + #ifdef CCAN_LIST_DEBUG #define debug_list(h) list_check((h), __func__) #else