You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

arraylist.h 1.3 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * $Id: arraylist.h,v 1.2 2004/07/21 01:24:33 mclark Exp $
  3. *
  4. * Copyright Metaparadigm Pte. Ltd. 2004.
  5. * Michael Clark <michael@metaparadigm.com>
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public (LGPL)
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details: http://www.gnu.org/
  16. *
  17. */
  18. #ifndef _arraylist_h_
  19. #define _arraylist_h_
  20. #define ARRAY_LIST_DEFAULT_SIZE 32
  21. typedef void (array_list_free_fn) (void *data);
  22. struct array_list
  23. {
  24. void **array;
  25. int length;
  26. int size;
  27. array_list_free_fn *free_fn;
  28. };
  29. extern struct array_list*
  30. array_list_new(array_list_free_fn *free_fn);
  31. extern void
  32. array_list_free(struct array_list *this);
  33. extern void*
  34. array_list_get_idx(struct array_list *this, int i);
  35. extern int
  36. array_list_put_idx(struct array_list *this, int i, void *data);
  37. extern int
  38. array_list_add(struct array_list *this, void *data);
  39. extern int
  40. array_list_length(struct array_list *this);
  41. #endif

No Description

Contributors (1)