nvp.h 734 B

1234567891011121314151617181920212223242526272829
  1. #ifndef _NVP_H_
  2. #define _NVP_H_
  3. #ifndef _HAVE_NVP_TYPE
  4. #define _HAVE_NVP_TYPE
  5. typedef struct nvp_s {
  6. struct nvp_s *prev;
  7. struct nvp_s *next;
  8. char* name;
  9. unsigned int h;
  10. char* value;
  11. void *data;
  12. } nvp_t;
  13. #endif
  14. /* defined in nvp.c */
  15. void nvp_free(nvp_t **list, int data);
  16. nvp_t *nvp_get(nvp_t **list, char* name);
  17. char* nvp_get_str(nvp_t **list, char* name);
  18. int nvp_get_int(nvp_t **list, char* name);
  19. float nvp_get_float(nvp_t **list, char* name);
  20. int nvp_get_bool(nvp_t **list, char* name);
  21. void *nvp_get_data(nvp_t **list, char* name);
  22. void nvp_set(nvp_t **list, char* name, char* value, void *data);
  23. void nvp_set_int(nvp_t **list, char* name, int value);
  24. void nvp_set_float(nvp_t **list, char* name, float value);
  25. #endif