nv_pair_list.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* nv_pair_list.h - the opkg package management system
  2. Carl D. Worth
  3. Copyright (C) 2001 University of Southern California
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License as
  6. published by the Free Software Foundation; either version 2, or (at
  7. your option) any later version.
  8. This program is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. */
  13. #ifndef NV_PAIR_LIST_H
  14. #define NV_PAIR_LIST_H
  15. #include "nv_pair.h"
  16. #include "void_list.h"
  17. typedef struct void_list_elt nv_pair_list_elt_t;
  18. typedef struct void_list nv_pair_list_t;
  19. static inline int nv_pair_list_empty(nv_pair_list_t * list)
  20. {
  21. return void_list_empty((void_list_t *) list);
  22. }
  23. void nv_pair_list_init(nv_pair_list_t * list);
  24. void nv_pair_list_deinit(nv_pair_list_t * list);
  25. nv_pair_t *nv_pair_list_append(nv_pair_list_t * list,
  26. const char *name, const char *value);
  27. void nv_pair_list_push(nv_pair_list_t * list, nv_pair_t * data);
  28. nv_pair_list_elt_t *nv_pair_list_pop(nv_pair_list_t * list);
  29. char *nv_pair_list_find(nv_pair_list_t * list, char *name);
  30. nv_pair_list_elt_t *nv_pair_list_first(nv_pair_list_t * list);
  31. nv_pair_list_elt_t *nv_pair_list_prev(nv_pair_list_t * list,
  32. nv_pair_list_elt_t * node);
  33. nv_pair_list_elt_t *nv_pair_list_next(nv_pair_list_t * list,
  34. nv_pair_list_elt_t * node);
  35. nv_pair_list_elt_t *nv_pair_list_last(nv_pair_list_t * list);
  36. #endif