home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d500 / swindows.lha / sWindows / Source / swMemory.h < prev    next >
C/C++ Source or Header  |  1991-06-06  |  1KB  |  46 lines

  1. #include <exec/memory.h>
  2.  
  3. #define MEMFLAGS    MEMF_CLEAR
  4.  
  5. /*
  6.  *  Macros for making and freeing data structures
  7.  */
  8.  
  9. #define NEW(s,p)    (p=(struct s *)AllocMem(sizeof(struct s),MEMFLAGS))
  10. #define FREE(s,p)   (FreeMem(p,sizeof(struct s)))
  11.  
  12. typedef struct ScreenListItem   *SLISTITEM;
  13. typedef struct WindowListItem   *WLISTITEM;
  14.  
  15.  
  16. /*
  17.  *  ScreenListItem
  18.  *
  19.  *  This item stores information about a screen that has sWindows open on it.
  20.  */
  21.  
  22. struct ScreenListItem
  23. {
  24.    SLISTITEM Next,Prev;      /* linked list pointers */
  25.    struct Screen *Screen;    /* the Intuition screen in use */
  26.    APTR CloseTask;           /* the task waiting to close the window, or NULL */
  27.    ULONG CloseSignal;        /* the Signal for this task */
  28.    WORD UseCount;            /* the number of sWindows on this screen */
  29. };
  30.  
  31.  
  32. /*
  33.  *  WindowListItem
  34.  *
  35.  *  The item stores information about each window opened by sWindows
  36.  */
  37.  
  38. struct WindowListItem
  39. {
  40.    WLISTITEM Next,Prev;     /* linked list pointers */
  41.    struct Window *Window;   /* the window that sWindows opened */
  42.    SLISTITEM Screen;        /* pointer to a ScreenListItem for the screen */
  43. };                          /*  where the window was opened */
  44.  
  45. extern APTR AllocMem();
  46.