linkm.h 981 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef GRASS_LINKM_H
  2. #define GRASS_LINKM_H
  3. #ifndef FILE
  4. # include <stdio.h>
  5. #endif
  6. #define VOID_T char
  7. #define PTR_CNT 10
  8. struct link_head
  9. {
  10. VOID_T **ptr_array; /* array of pointers to chunks */
  11. int max_ptr; /* num of chunks alloced */
  12. int alloced; /* size of ptr_array */
  13. int chunk_size; /* size of alloc chucks in units */
  14. int unit_size; /* size of each user defined unit */
  15. VOID_T *Unused; /* Unused list pointer */
  16. int exit_flag; /* exit on error ? */
  17. };
  18. #endif
  19. /* destroy.c */
  20. void link_destroy(struct link_head *, VOID_T *);
  21. /* dispose.c */
  22. void link_dispose(struct link_head *, VOID_T *);
  23. /* init.c */
  24. void link_set_chunk_size(int);
  25. void link_exit_on_error(int);
  26. struct link_head *link_init(int);
  27. void link_cleanup(struct link_head *);
  28. /* new.c */
  29. struct link_head *link_new(struct link_head *);
  30. /* next.c */
  31. VOID_T *link__get_next(VOID_T *);
  32. void link__set_next(VOID_T *, VOID_T *);
  33. /* oom.c */
  34. int link_out_of_memory(void);