home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 418.lha / OdinLibrary_v1.11 / odin.h < prev    next >
C/C++ Source or Header  |  1990-09-01  |  3KB  |  110 lines

  1. /* odin.h */
  2. /* headerfile for odin.library. V1.11 13-jun-90 */
  3.  
  4. #ifndef ODIN_H
  5. #define ODIN_H 1
  6.  
  7. #ifndef EXEC_NODES_H
  8. #include "exec/nodes.h"
  9. #endif
  10. #ifndef EXEC_LISTS_H
  11. #include "exec/lists.h"
  12. #endif
  13. #ifndef EXEC_SEMAPHORES_H
  14. #include "exec/semaphores.h"
  15. #endif
  16. #ifndef EXEC_LIBRARIES_H
  17. #include "exec/libraries.h"
  18. #endif
  19. #ifndef EXEC_TASKS_H
  20. #include "exec/tasks.h"
  21. #endif
  22. #ifndef LIBRARIES_DOSEXTENS_H
  23. #include "libraries/dosextens.h"
  24. #endif
  25.  
  26. #define ODINNAME "odin.library"
  27.  
  28. struct OdinBase {
  29.     struct Library        odin_LibNode;
  30.     BPTR            odin_SegList;
  31.     UBYTE            odin_Flags;
  32.     /* You MUST ObtainSemaphore() this before using 
  33.      * the WaitList!
  34.      */ 
  35.     struct SignalSemaphore    odin_Sem;    /* signal semaphore */
  36.     struct MinList        odin_WaitList;
  37. };
  38.  
  39. #define odin_Sizeof sizeof(struct OdinBase)
  40.  
  41. /* prefix for envelopes */
  42.  
  43. typedef struct _Env {
  44.     struct MinNode    e_link;        /* first a link for use in e-space */
  45.     STRPTR        e_name;        /* the name of this envelope */
  46.     ULONG        e_len;        /* bytelength of whole envelope */
  47.     struct _Env *    (*e_copyfunc)();/* opt. C-function for copying */
  48.     struct _Env *    (*e_proc)();    /* C-func. to call in Eval() */
  49. } Envelope;
  50.  
  51. #define e_sizeof (ULONG)sizeof(Envelope)
  52.  
  53. /* wait-structure used in WaitList. Used internally */
  54.  
  55. struct WaitStruct {
  56.     struct MinNode    ow_link;
  57.     Envelope    *ow_envelope;
  58.     struct Task    *ow_waittask;
  59.     UBYTE        ow_sigbit;
  60.     BYTE        ow_type;
  61. };
  62.  
  63. #define ow_sizeof (ULONG)sizeof(struct WaitStruct)
  64.  
  65. /* ow_types */
  66.  
  67. #define RD_REQUEST 0
  68. #define IN_REQUEST 1
  69.  
  70. /* the et parameter to Eval() */
  71.  
  72. #define EVAL_PROCESS (long)0
  73. #define EVAL_TASK    (long)1
  74.  
  75. #ifndef ANSI
  76. /* function returntypes */
  77. #define NoCopyFunc 0L
  78. extern Envelope *In(),*Rd(),*Rdp(),*Inp();
  79. extern void Out(),CopyOut();
  80. extern struct Task *Eval();
  81. extern struct Task *StartTask();
  82. extern struct Process *StartProcess();
  83. extern Envelope *AwaitNamedEnvelope();
  84. extern Envelope *PollNamedEnvelope();
  85. extern void OutEmptyEnvelope();
  86. extern Envelope *CreateEnvelope(),*InitEnvelope();
  87. extern void DisposeEnvelope();
  88.  
  89. #else
  90. /* ANSI function-prototypes, worked with PDC 3.33 */
  91. #define NoCopyFunc (Envelope *(*cf)())0L
  92. extern Envelope *In(Envelope *);
  93. extern Envelope *Rd(Envelope *);
  94. extern Envelope *Rdp(Envelope *);
  95. extern Envelope *Inp(Envelope *);
  96. extern void Out(Envelope *);
  97. extern CopyOut(Envelope *);
  98. extern struct Task *Eval(Envelope *,long,ULONG,long);
  99. extern struct Task *StartTask(void(),char *,long,long);
  100. extern struct Process *StartProcess(void(),char *,long,long);
  101. extern Envelope *AwaitNamedEnvelope(char *);
  102. extern Envelope *PollNamedEnvelope(char *);
  103. extern void OutEmptyEnvelope(char *);
  104. extern Envelope *CreateEnvelope(char *,ULONG);
  105. extern Envelope *InitEnvelope(Envelope *,char *,ULONG,Envelope *(*copyfunc)());
  106. extern void DisposeEnvelope(Envelope *);
  107. #endif /* ANSI */
  108.  
  109. #endif /* ODIN_H */
  110.