home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / M2V11-2.LHA / modula / dice / dice.lha / examples / shared_lib / init.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-15  |  424 b   |  35 lines

  1.  
  2. /*
  3.  *  INIT.C
  4.  */
  5.  
  6. #include "defs.h"
  7.  
  8. Prototype void InitC(void);
  9. Prototype void UnInitC(void);
  10.  
  11. Prototype SignalSemaphore SemLock;
  12. Prototype List          StrList;
  13.  
  14. SignalSemaphore SemLock;
  15. List        StrList;
  16.  
  17. void
  18. InitC(void)
  19. {
  20.     int i;
  21.  
  22.     NewList(&StrList);
  23.     InitSemaphore(&SemLock);
  24. }
  25.  
  26. void
  27. UnInitC(void)
  28. {
  29.     Node *node;
  30.  
  31.     while (node = RemHead(&StrList))
  32.     FreeMem(node, sizeof(Node) + strlen(node->ln_Name) + 1);
  33. }
  34.  
  35.