aheinecke@404: /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik aheinecke@404: * Software engineering by Intevation GmbH aheinecke@404: * aheinecke@404: * This file is Free Software under the GNU GPL (v>=2) aheinecke@404: * and comes with ABSOLUTELY NO WARRANTY! aheinecke@404: * See LICENSE.txt for details. aheinecke@404: */ wilde@242: #ifndef NSS_SECITEMLIST_H wilde@242: #define NSS_SECITEMLIST_H wilde@242: wilde@242: /** wilde@242: * @file wilde@242: * @brief Functions to handle lists of NSS SECItem-s. wilde@242: */ wilde@242: wilde@242: #include wilde@242: #include "strhelp.h" wilde@242: andre@1255: /** andre@1255: * @struct seciteml andre@1255: * @brief simple linked list sturcture. */ wilde@242: struct seciteml { andre@1255: /*@{*/ andre@1255: SECItem *item;/**< Pointer to the held item*/ andre@1255: struct seciteml *next;/**< Pointer to the next part of the list*/ andre@1255: /*@}*/ wilde@242: }; wilde@242: wilde@242: /** wilde@242: * @brief Type for SECItem lists wilde@242: */ wilde@242: typedef struct seciteml seciteml_t; wilde@242: wilde@242: /** wilde@242: * @brief Prepend a new SECItem to list wilde@242: * wilde@242: * The data will be copied. andre@1304: * @param[in,out] list pointer to the list to which the item will be added. wilde@242: * @param[in] item the SECItem to add to the list. wilde@242: */ wilde@242: void seciteml_push (seciteml_t **list, SECItem *item); wilde@242: wilde@242: /** wilde@242: * @brief Remove and return first SECItem from list wilde@242: * andre@1304: * @param[in,out] list pointer to the list to which the item will be added. emanuel@1053: * @returns the removed item, or NULL if list is empty. wilde@242: * The caller shoud free this item after use. wilde@242: */ wilde@242: SECItem *seciteml_pop (seciteml_t **list); wilde@242: aheinecke@493: /** aheinecke@493: * @brief Free a secitem list aheinecke@493: * aheinecke@493: * Frees a secitem list aheinecke@493: * andre@1304: * @param[in,out] list pointer to the list which should be freed. set to NULL aheinecke@493: */ aheinecke@493: void seciteml_free (seciteml_t **list); aheinecke@493: aheinecke@493: wilde@242: #endif