From b6f1b059eefb493d02913e9b32bd267d9017ee73 Mon Sep 17 00:00:00 2001 From: Pauli Date: Fri, 14 Oct 2022 10:30:47 +1100 Subject: list: add an is empty function Reviewed-by: Tim Hudson Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/19377) --- doc/internal/man3/DEFINE_LIST_OF.pod | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'doc/internal') diff --git a/doc/internal/man3/DEFINE_LIST_OF.pod b/doc/internal/man3/DEFINE_LIST_OF.pod index a0090c7685..311c200b7a 100644 --- a/doc/internal/man3/DEFINE_LIST_OF.pod +++ b/doc/internal/man3/DEFINE_LIST_OF.pod @@ -3,7 +3,8 @@ =head1 NAME DEFINE_LIST_OF, OSSL_LIST_MEMBER, OSSL_LIST, -ossl_list_TYPE_init, ossl_list_TYPE_num, +ossl_list_TYPE_init, ossl_list_TYPE_init_elem, +ossl_list_TYPE_is_empty, ossl_list_TYPE_num, ossl_list_TYPE_head, ossl_list_TYPE_tail, ossl_list_TYPE_next, ossl_list_TYPE_prev, ossl_list_TYPE_remove, ossl_list_TYPE_insert_head, ossl_list_TYPE_insert_tail, @@ -21,7 +22,9 @@ ossl_list_TYPE_insert_before, ossl_list_TYPE_after DEFINE_LIST_OF(NAME, TYPE); void ossl_list_TYPE_init(OSSL_LIST(name) *list); + void ossl_list_TYPE_init_elem(type *elem); + int ossl_list_TYPE_is_empty(const OSSL_LIST(name) *list); size_t ossl_list_TYPE_num(const OSSL_LIST(name) *list); type *ossl_list_TYPE_head(const OSSL_LIST(name) *list); type *ossl_list_TYPE_tail(const OSSL_LIST(name) *list); @@ -56,6 +59,12 @@ B(B>, B>) field. B_init>() initialises the memory pointed to by I to zero which creates an empty list. +B_init_elem>() initialises the list related memory pointed +to by I to zero which allows it to be used in lists. + +B_is_empty>() returns nonzero if I has no elements and +zero otherwise. + B_num>() returns the number of elements in I. B_head>() returns the first element in the I @@ -83,6 +92,9 @@ I element. =head1 RETURN VALUES +B_is_empty>() returns nonzero if the list is empty and zero +otherwise. + B_num>() returns the number of elements in the list. -- cgit v1.2.3