Commit graph

4 commits

Author SHA1 Message Date
Ariadne Conill
81d0ebc3e8 remove unnecessary strcmp wrapper, use typecasting instead 2020-07-28 17:57:51 -04:00
Maximilian Wilhelm
f51c976b52 dict: Add lif_dict_add_once()
Add a function to add a key/value pair to the dict only if it doesn't exist
  within the dict already.

  As the dict is type agnostic this requires a comparator function to be given.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-07-28 22:44:22 +02:00
Maximilian Wilhelm
b1dfa609f9 dict: Add lif_dict_find_all().
As a dict can have multiple values for any given key we add a function to
  query all occurences of a given key and return them as a (new) list.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-07-28 22:41:41 +02:00
Ariadne Conill
3f618d2a3b libifupdown: add a simple key-value dictionary based on linked lists 2020-07-18 03:11:43 -06:00