home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 240.lha / CC / sources / list.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-05-07  |  491 b   |  23 lines

  1. /*
  2.  * expandable lists
  3.  * March 1989, Miles Bader
  4.  */
  5.  
  6. extern char insertMark;
  7.  
  8. struct list {
  9.     int num,max;
  10.     int insertionPoint;            /* where a new element gets added */
  11.     void **els;
  12.     void (*freeProc)();            /* if non-NULL, used to free elements */
  13. };
  14.  
  15. struct list *list_Create(void **initEls);
  16. void list_Free(struct list *l);
  17. void list_Add(struct list *l,void *el);
  18.  
  19. #define list_GetEls(l) ((l)->els)
  20. #define list_GetLen(l) ((l)->num)
  21.  
  22. #define list_SetFree(l,fp) ((l)->freeProc=fp)
  23.