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 924 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * $Id: arraylist.h,v 1.4 2006/01/26 02:16:28 mclark Exp $
  3. *
  4. * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
  5. * Michael Clark <michael@metaparadigm.com>
  6. *
  7. * This library is free software; you can redistribute it and/or modify
  8. * it under the terms of the MIT license. See COPYING for details.
  9. *
  10. */
  11. #ifndef _arraylist_h_
  12. #define _arraylist_h_
  13. #define ARRAY_LIST_DEFAULT_SIZE 32
  14. typedef void (array_list_free_fn) (void *data);
  15. struct array_list
  16. {
  17. void **array;
  18. int length;
  19. int size;
  20. array_list_free_fn *free_fn;
  21. };
  22. extern struct array_list*
  23. array_list_new(array_list_free_fn *free_fn);
  24. extern void
  25. array_list_free(struct array_list *al);
  26. extern void*
  27. array_list_get_idx(struct array_list *al, int i);
  28. extern int
  29. array_list_put_idx(struct array_list *al, int i, void *data);
  30. extern int
  31. array_list_add(struct array_list *al, void *data);
  32. extern int
  33. array_list_length(struct array_list *al);
  34. #endif

No Description

Contributors (1)