diff options
author | Jan Hutter <jhutter@hsr.ch> | 2005-11-30 16:31:10 +0000 |
---|---|---|
committer | Jan Hutter <jhutter@hsr.ch> | 2005-11-30 16:31:10 +0000 |
commit | 1e54ebfac4625ef359ec5a061088bd5966882dd8 (patch) | |
tree | cea0d8883849d589b86896594688f84faf039327 /Source/charon/utils/linked_list.h | |
parent | df3af01a5c2d3e26f06b38c7b8e9cf6a9140fc8c (diff) | |
download | strongswan-1e54ebfac4625ef359ec5a061088bd5966882dd8.tar.bz2 strongswan-1e54ebfac4625ef359ec5a061088bd5966882dd8.tar.xz |
- added positioned functionality to linked_list_t
Diffstat (limited to 'Source/charon/utils/linked_list.h')
-rw-r--r-- | Source/charon/utils/linked_list.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Source/charon/utils/linked_list.h b/Source/charon/utils/linked_list.h index ee07ce487..779252e0f 100644 --- a/Source/charon/utils/linked_list.h +++ b/Source/charon/utils/linked_list.h @@ -98,6 +98,42 @@ struct linked_list_t { void (*insert_last) (linked_list_t *linked_list, void *item); /** + * @brief Inserts a new item at a given position in the list. + * + * @param linked_list calling object + * @param position position starting at 0 to insert new entry + * @param[in] item value to insert into list + * @return + * - SUCCESS + * - INVALID_ARG if position not existing + */ + status_t (*insert_at_position) (linked_list_t *linked_list,size_t position, void *item); + + /** + * @brief Removes an item from a given position in the list. + * + * @param linked_list calling object + * @param position position starting at 0 to remove entry from + * @param[out] removed item will be stored at this location + * @return + * - SUCCESS + * - INVALID_ARG if position not existing + */ + status_t (*remove_at_position) (linked_list_t *linked_list,size_t position, void **item); + + /** + * @brief Get an item from a given position in the list. + * + * @param linked_list calling object + * @param position position starting at 0 to get entry from + * @param[out] item will be stored at this location + * @return + * - SUCCESS + * - INVALID_ARG if position not existing + */ + status_t (*get_at_position) (linked_list_t *linked_list,size_t position, void **item); + + /** * @brief Removes the last item in the list and returns its value. * * @param linked_list calling object |