Commit graph

8 commits

Author SHA1 Message Date
Ariadne Conill
df2519c1ec dict: cleanups 2020-08-04 11:59:36 -06:00
Ariadne Conill
81d0ebc3e8 remove unnecessary strcmp wrapper, use typecasting instead 2020-07-28 17:57:51 -04:00
Ariadne Conill
cfbfa07e85 list: refactor lif_list_free_nodes() a bit 2020-07-28 17:53:48 -04:00
Maximilian Wilhelm
9d958892ed Free nodes of a lif_dict_find_all() result.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-07-28 23:25:01 +02: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
86a83d9e95 implement /e/n/i parsing 2020-07-18 18:48:49 -06:00
Ariadne Conill
3f618d2a3b libifupdown: add a simple key-value dictionary based on linked lists 2020-07-18 03:11:43 -06:00