dict.h 435 B

123456789101112131415
  1. // Borrowed from https://github.com/b-k/21st-Century-Examples
  2. #include "keyval.h"
  3. extern void *dictionary_not_found;
  4. typedef struct dictionary{
  5. keyval **pairs;
  6. int length;
  7. } dictionary;
  8. dictionary *dictionary_new (void);
  9. dictionary *dictionary_copy(dictionary *in);
  10. void dictionary_free(dictionary *in);
  11. void dictionary_add(dictionary *in, char *key, void *value);
  12. void *dictionary_find(dictionary const *in, char const *key);