home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************/
- /* $VER: SynhLib.h Revison 1.1 */
- /* This file is part of Synth Librarian v1.1 */
- /* ©1993-1994 Jean-Alexis MONTIGNIES */
- /* This file must not be distributed modified or separatly */
- /* without my written permission */
- /* See Synth_Librarian.guide for more details */
- /**************************************************************/
-
- /* Synth librarian common include file */
-
- #include <exec/types.h>
- #include <exec/nodes.h>
- #include <exec/ports.h>
- /* Définitions communes aux deux taches */
-
- /* DumpNode est utilisé pour mémoriser les différents dumps qui parviennent
- à l'AMIGA */
-
- struct DumpNode
- {struct Node DNode;
- UBYTE *Dump;
- ULONG DumpLength;
- UBYTE *Data;
- ULONG DataLength;
- UWORD Flags;
- UBYTE Name[32];
- UBYTE Type[16];
- };
-
- #define NODE_FLAGS_BUSY 1
- #define NODE_FLAGS_UNNAMED 2
- #define NODE_FLAGS_UNTYPED 4
-
- /* Messages que les tâches s'adressent */
-
- struct LibMessage
- {struct Message LMess;
- UBYTE Code;
- UBYTE *Data;
- };
-
- /* Donnees à echanger */
- struct Exchange
- {UBYTE *DataPtr;
- struct DumpNode *Node;
- ULONG Length;
- ULONG Data1;
- STRPTR Message;
- };
-
- /* Données concernant un driver */
- struct DriverData
- {USHORT Flags;
- ULONG (* Driver)(ULONG *StepPtr,struct Exchange *Ex);
- void (* Close)(void);
- struct List *TypeList;
- STRPTR (* About)(void);
- struct Node * (* Recognize)(struct DumpNode *ANode);
- };
-
- /* Significations de Step */
- /* Reception */
- #define STEP_RECIEVE_COMPLETE -4
- #define STEP_ABORT -3
- #define STEP_IO_ERROR -2
- #define STEP_WAIT 0
- #define STEP_START 1
- #define STEP_RECIEVE 2
- #define STEP_CONTINUE 3
- #define STEP_RECIEVE_EOF 4
- #define STEP_NEXT_SYSEX 6
-
- /* Emission */
- #define STEP_SEND 0x0100
- #define STEP_SEND_START 1+STEP_SEND
- #define STEP_SEND_CONTINUE 2+STEP_SEND
- #define STEP_SEND_SEND 3+STEP_SEND
- #define STEP_SEND_DELAY 5+STEP_SEND
- #define STEP_SEND_WAIT 6+STEP_SEND
- #define STEP_SEND_RECIEVE 8+STEP_SEND
- #define STEP_SEND_RECIEVE_EOF 10+STEP_SEND
- #define STEP_SEND_IO_ERROR -5+STEP_SEND
- #define STEP_SEND_ABORT -3+STEP_SEND
- #define STEP_SEND_COMPLETE -4+STEP_SEND
- /* Autres */
- #define STEP_MISC 0x0200
- #define STEP_INIT_DRIVER STEP_MISC+0
- #define STEP_EXIT_DRIVER STEP_MISC+1
- /* Requette */
- #define STEP_REQ 0x0300
- #define STEP_REQ_START STEP_REQ+0
- #define STEP_REQ_SEND STEP_REQ+1
- #define STEP_REQ_CONTINUE STEP_REQ+3
- #define STEP_REQ_ABORT STEP_REQ-3
- #define STEP_REQ_COMPLETE STEP_REQ-4
- #define STEP_REQ_IO_ERROR STEP_REQ-5
- #define STEP_REQ_WAIT STEP_REQ+4
- #define STEP_REQ_RECIEVE STEP_REQ+6
- #define STEP_REQ_RECIEVE_EOF STEP_REQ+8
-
- /* Significations des codes de messages */
- #define MSGCODE_INFO 0
- #define MSGCODE_ERROR 1
- #define MSGCODE_DATA 2
- #define MSGCODE_BYE 3
- #define MSGCODE_SEND_FINISHED 4
- #define MSGCODE_REQ_RESULT 5
- #define MSGCODE_DRIVER_QUITED 6
- #define MSGCODE_ABORT 64
- #define MSGCODE_SEND 65
- #define MSGCODE_EXIT 66
- #define MSGCODE_REQUEST 67
- #define MSGCODE_QUIT_DRIVER 68
- #define MSGCODE_NEW_DRIVER 69
- #define MSGCODE_IGNORED 128
-
- /* Valeurs de Status */
- #define STATUS_RECIEVING (1<<8)
- #define STATUS_SENDING (1<<9)
- #define STATUS_EXIT (1<<10)
- #define STATUS_REQUEST (1<<11)
- #define STATUS_QUIT_DRIVER (1<<12)
- #define STATUS_MASK_WAIT 0xFF
- #define STATUS_WAIT_IN 1
- #define STATUS_WAIT_OUT 2
- #define STATUS_WAIT_DELAY 3
- #define STATUS_WAIT_OUT_DELAY 4
- #define STATUS_WAIT_ALL 5
- #define STATUS_WAIT_OUT_IN 6
- #define STATUS_NOEXIT (STATUS_RECIEVING+STATUS_SENDING+STATUS_REQUEST)
-
- #define CODE_INIT_NOPORT 1
- #define CODE_INIT_NOSERIAL 2
- #define CODE_INIT_NOTIMER 3
- #define CODE_ERROR_SERIALIN 5
-
- /* prototypes */
- void ComTask(void);
- int FileOpInit(void);
- void FileOpClose(void);
- void NewMessage(char *Str,UBYTE Code);
- void AddDumpToList(struct DumpNode *Node);
-
- /* Externe */
- extern struct List DumpList;
- extern ULONG Flags;
- extern ULONG SelectedNumber;
- extern struct DumpNode *SelectedDump;
- extern ULONG SelectedRequest;
- extern struct Node *SelectedRequestNode;
-
- #define MAIN_FLAGS_END 1
- #define MAIN_FLAGS_CLOSETASK 2
- #define MAIN_FLAGS_COMTASK 4
- #define MAIN_FLAGS_REQUEST 8
- #define MAIN_FLAGS_SEND 16
- #define MAIN_FLAGS_NAMED 32
- #define MAIN_FLAGS_DRIVER 64
- #define MAIN_FLAGS_CHANGE_DRIVER 128
-
- #define GTD_LocaleBase 3
- #define GTD_ExecBase 2
- #define GTD_DosBase 1
- #define GTD_IntuitionBase 4
-