str_list.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* str_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 STR_LIST_H
  14. #define STR_LIST_H
  15. #include "void_list.h"
  16. typedef struct void_list_elt str_list_elt_t;
  17. typedef struct void_list str_list_t;
  18. void str_list_elt_init(str_list_elt_t * elt, char *data);
  19. void str_list_elt_deinit(str_list_elt_t * elt);
  20. str_list_t *str_list_alloc(void);
  21. void str_list_init(str_list_t * list);
  22. void str_list_deinit(str_list_t * list);
  23. void str_list_append(str_list_t * list, char *data);
  24. void str_list_push(str_list_t * list, char *data);
  25. str_list_elt_t *str_list_pop(str_list_t * list);
  26. void str_list_remove(str_list_t * list, str_list_elt_t ** iter);
  27. void str_list_remove_elt(str_list_t * list, const char *target_str);
  28. str_list_elt_t *str_list_first(str_list_t * list);
  29. str_list_elt_t *str_list_prev(str_list_t * list, str_list_elt_t * node);
  30. str_list_elt_t *str_list_next(str_list_t * list, str_list_elt_t * node);
  31. str_list_elt_t *str_list_last(str_list_t * list);
  32. void str_list_purge(str_list_t * list);
  33. #endif