gl_linked_list.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* Sequential list data type implemented by a linked list.
  2. Copyright (C) 2006, 2008-2020 Free Software Foundation, Inc.
  3. Written by Bruno Haible <bruno@clisp.org>, 2006.
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <https://www.gnu.org/licenses/>. */
  14. #include <config.h>
  15. /* Specification. */
  16. #include "gl_linked_list.h"
  17. #include <stdlib.h>
  18. /* -------------------------- gl_list_t Data Type -------------------------- */
  19. /* Generic linked list code. */
  20. #include "gl_anylinked_list1.h"
  21. #include "gl_anylinked_list2.h"
  22. const struct gl_list_implementation gl_linked_list_implementation =
  23. {
  24. gl_linked_nx_create_empty,
  25. gl_linked_nx_create,
  26. gl_linked_size,
  27. gl_linked_node_value,
  28. gl_linked_node_nx_set_value,
  29. gl_linked_next_node,
  30. gl_linked_previous_node,
  31. gl_linked_get_at,
  32. gl_linked_nx_set_at,
  33. gl_linked_search_from_to,
  34. gl_linked_indexof_from_to,
  35. gl_linked_nx_add_first,
  36. gl_linked_nx_add_last,
  37. gl_linked_nx_add_before,
  38. gl_linked_nx_add_after,
  39. gl_linked_nx_add_at,
  40. gl_linked_remove_node,
  41. gl_linked_remove_at,
  42. gl_linked_remove,
  43. gl_linked_list_free,
  44. gl_linked_iterator,
  45. gl_linked_iterator_from_to,
  46. gl_linked_iterator_next,
  47. gl_linked_iterator_free,
  48. gl_linked_sortedlist_search,
  49. gl_linked_sortedlist_search_from_to,
  50. gl_linked_sortedlist_indexof,
  51. gl_linked_sortedlist_indexof_from_to,
  52. gl_linked_sortedlist_nx_add,
  53. gl_linked_sortedlist_remove
  54. };