linkm.h 976 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. VOID_T **ptr_array; /* array of pointers to chunks */
  10. int max_ptr; /* num of chunks alloced */
  11. int alloced; /* size of ptr_array */
  12. int chunk_size; /* size of alloc chucks in units */
  13. int unit_size; /* size of each user defined unit */
  14. VOID_T *Unused; /* Unused list pointer */
  15. int exit_flag; /* exit on error ? */
  16. };
  17. #endif
  18. /* destroy.c */
  19. void link_destroy(struct link_head *, VOID_T *);
  20. /* dispose.c */
  21. void link_dispose(struct link_head *, VOID_T *);
  22. /* init.c */
  23. void link_set_chunk_size(int);
  24. void link_exit_on_error(int);
  25. struct link_head *link_init(int);
  26. void link_cleanup(struct link_head *);
  27. /* new.c */
  28. struct link_head *link_new(struct link_head *);
  29. /* next.c */
  30. VOID_T *link__get_next(VOID_T *);
  31. void link__set_next(VOID_T *, VOID_T *);
  32. /* oom.c */
  33. int link_out_of_memory(void);