From 2d201af32693992b5f0982e5711bbd505cf73e4f Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 1 Apr 2022 14:14:54 -0700 Subject: [PATCH] libpkgconf: Add a helper to zero `pkgconf_list_t`s --- libpkgconf/iter.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libpkgconf/iter.h b/libpkgconf/iter.h index f871234..199d299 100644 --- a/libpkgconf/iter.h +++ b/libpkgconf/iter.h @@ -34,6 +34,14 @@ typedef struct { #define PKGCONF_LIST_INITIALIZER { NULL, NULL, 0 } +static inline void +pkgconf_list_zero(pkgconf_list_t *list) +{ + list->head = NULL; + list->tail = NULL; + list->length = 0; +} + static inline void pkgconf_node_insert(pkgconf_node_t *node, void *data, pkgconf_list_t *list) {