home *** CD-ROM | disk | FTP | other *** search
/ Aminet 10 / aminetcdnumber101996.iso / Aminet / util / misc / fifolib38_1.lha / defs.h < prev    next >
C/C++ Source or Header  |  1995-12-11  |  2KB  |  89 lines

  1.  
  2. /*
  3.  *  DEFS.H
  4.  *
  5.  */
  6.  
  7. #include <exec/types.h>
  8. #include <exec/nodes.h>
  9. #include <exec/ports.h>
  10. #include <exec/memory.h>
  11. #include <exec/libraries.h>
  12. #include <exec/execbase.h>
  13. #include <exec/semaphores.h>
  14. #include <devices/timer.h>
  15. #if defined(_DCC)
  16. #include <clib/exec_protos.h>
  17. #include <clib/alib_protos.h>
  18. #else
  19. #include <proto/exec.h>
  20. #include <proto/alib.h>
  21. #endif
  22. #include <libraries/fifo.h>
  23. /*  do NOT include prototypes or inlines in the library itself */
  24. #include <string.h>
  25. #if defined(__GNUC__) && defined(__OPTIMIZE__)
  26. #include <inline/strsup.h>
  27. #endif
  28.  
  29. #if defined(__GNUC__)
  30. #define LibCall
  31. #else
  32. #define LibCall __geta4 __stkargs
  33. #endif
  34. #define Prototype extern
  35.  
  36. typedef unsigned char ubyte;
  37. typedef unsigned short uword;
  38. typedef unsigned long ulong;
  39. typedef struct MsgPort    MsgPort;
  40. typedef struct Message    Message;
  41. typedef struct MinNode    Node;
  42. typedef struct MinList    List;
  43. typedef struct List    MaxList;
  44. typedef struct Node    MaxNode;
  45. typedef struct Library    Library;
  46. typedef struct ExecBase ExecBase;
  47. typedef struct SignalSemaphore SignalSemaphore;
  48.  
  49. #define FIFOF_CLOSEOF    0x00010000
  50. #define FIFOF_RDNORM    0x00020000
  51. #define FIFOF_WRNORM    0x00040000
  52.  
  53. typedef struct Fifo {
  54.     MaxNode fi_Node;
  55.     List    fi_HanList;
  56.     List    fi_WrNotify;
  57.     List    fi_RdNotify;
  58.     uword   fi_RRefs;
  59.     uword   fi_WRefs;
  60.     uword   fi_ORefs;
  61.     ubyte   fi_Lock;        /*  non-normal fifo's   */
  62.     ubyte   fi_Reserved;
  63.     long    fi_RIdx;
  64.     long    fi_WIdx;
  65.     long    fi_Flags;
  66.     SignalSemaphore fi_SigSem;    /*  normal fifo's       */
  67.     long    fi_BufSize;
  68.     long    fi_BufMask;
  69.     char    fi_Buf[4];
  70. } Fifo;
  71.  
  72. typedef struct FHan {
  73.     Node    fh_Node;
  74.     Fifo    *fh_Fifo;
  75.     long    fh_Flags;
  76.     MsgPort fh_Port;
  77.     Message fh_Msg;
  78.     long    fh_RIdx;
  79. } FHan;
  80.  
  81. extern const char LibName[];
  82. extern const char LibId[];
  83. extern List FifoList;
  84. extern ExecBase *SysBase;
  85.  
  86. /* Were Protoize used
  87. #include "fifolib-protos.h"
  88. */
  89.