home *** CD-ROM | disk | FTP | other *** search
- /* odin.h */
- /* headerfile for odin.library. V2.7 2-Sep-90 */
-
- #ifndef ODIN_H
- #define ODIN_H 1
-
- #ifndef EXEC_NODES_H
- #include "exec/nodes.h"
- #endif
- #ifndef EXEC_LISTS_H
- #include "exec/lists.h"
- #endif
- #ifndef EXEC_PORTS_H
- #include "exec/ports.h"
- #endif
- #ifndef EXEC_SEMAPHORES_H
- #include "exec/semaphores.h"
- #endif
- #ifndef EXEC_LIBRARIES_H
- #include "exec/libraries.h"
- #endif
- #ifndef EXEC_TASKS_H
- #include "exec/tasks.h"
- #endif
- #ifndef LIBRARIES_DOSEXTENS_H
- #include "libraries/dosextens.h"
- #endif
-
- #define ODINNAME "odin.library"
-
- struct OdinBase {
- struct Library odin_LibNode;
- BPTR odin_SegList;
- UBYTE odin_Flags;
- /* You MUST ObtainSemaphore() this before using
- * the WaitList!
- */
- struct SignalSemaphore odin_Sem; /* signal semaphore */
- struct MinList odin_WaitList;
- };
-
- #define odin_Sizeof sizeof(struct OdinBase)
-
- /* prefix for envelopes */
-
- typedef struct _Env {
- struct MinNode e_link; /* first a link for use in e-space */
- STRPTR e_name; /* the name of this envelope */
- ULONG e_len; /* bytelength of whole envelope */
- struct _Env * (*e_copyfunc)();/* opt. C-function for copying */
- struct _Env * (*e_proc)(); /* C-func. to call in Eval() */
- } Envelope;
-
- #define e_sizeof (ULONG)sizeof(Envelope)
-
- /* wait-structure used in WaitList. Used internally */
-
- struct WaitStruct {
- struct MinNode ow_link;
- Envelope *ow_envelope;
- struct Task *ow_waittask;
- UBYTE ow_sigbit;
- BYTE ow_type;
- };
-
- #define ow_replyport ow_waittask
- #define ow_sizeof (ULONG)sizeof(struct WaitStruct)
-
- /* ow_types (used internally) */
-
- #define RD_REQUEST 0
- #define IN_REQUEST 1
- #define ASYNCIN_REQUEST 2
- #define ASYNCRD_REQUEST 3
-
- /* the et parameter to Eval() */
-
- #define EVAL_PROCESS (long)0
- #define EVAL_TASK (long)1
-
- /* the struct put to a MsgPort by AsyncIn/Rd */
-
- struct EnvMsg {
- struct Message em_msg;
- Envelope *em_env; /* ptr to the returned envelope */
- };
-
- #ifndef ANSI
- /* function returntypes */
- #define NoCopyFunc 0L
- extern Envelope *In(),*Rd(),*Rdp(),*Inp();
- extern void Out();
- extern BOOL CopyOut();
- extern struct Task *Eval();
- extern struct Task *StartTask();
- extern struct Process *StartProcess();
- extern Envelope *AwaitNamedEnvelope();
- extern Envelope *PollNamedEnvelope();
- extern BOOL OutEmptyEnvelope();
- extern Envelope *CreateEnvelope(),*InitEnvelope();
- extern void DisposeEnvelope();
- /* version 2 additions */
- extern Envelope *TimedIn(), *TimedRd();
- extern void AsyncIn(), AsyncRd();
- extern Envelope *AwaitTimed();
- extern void AsyncRequest();
- extern char *UniqueName();
-
- #else
- /* ANSI function-prototypes, worked with PDC 3.33 */
- #define NoCopyFunc (Envelope *(*cf)())0L
- extern Envelope *In(Envelope *);
- extern Envelope *Rd(Envelope *);
- extern Envelope *Rdp(Envelope *);
- extern Envelope *Inp(Envelope *);
- extern void Out(Envelope *);
- extern BOOL CopyOut(Envelope *);
- extern struct Task *Eval(Envelope *,long,ULONG,long);
- extern struct Task *StartTask(void(),char *,long,long);
- extern struct Process *StartProcess(void(),char *,long,long);
- extern Envelope *AwaitNamedEnvelope(char *);
- extern Envelope *PollNamedEnvelope(char *);
- extern BOOL OutEmptyEnvelope(char *);
- extern Envelope *CreateEnvelope(char *,ULONG);
- extern Envelope *InitEnvelope(Envelope *,char *,ULONG,Envelope *(*copyfunc)());
- extern void DisposeEnvelope(Envelope *);
- /* version 2 additions */
- extern Envelope *TimedIn(Envelope *,ULONG,ULONG);
- extern Envelope *TimedRd(Envelope *,ULONG,ULONG);
- extern void AsyncIn(Envelope *,struct MsgPort *);
- extern void AsyncRd(Envelope *,struct MsgPort *);
- extern Envelope *AwaitTimed(char *,ULONG,ULONG);
- extern void AsyncRequest(char *,struct MsgPort *);
- extern char *UniqueName(char *);
- #endif /* ANSI */
-
- #endif /* ODIN_H */
-