home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / prog_c / suplib.lzh / SUPLIB / INCLUDE / LOCAL / IPC.H < prev    next >
C/C++ Source or Header  |  1991-08-16  |  2KB  |  66 lines

  1.  
  2. #ifndef LOCAL_IPC_H
  3. #define LOCAL_IPC_H
  4.  
  5. #ifndef EXEC_TYPES_H
  6. #include <exec/types.h>
  7. #endif
  8.  
  9. #ifndef EXEC_PORTS_H
  10. #include <exec/ports.h>
  11. #endif
  12.  
  13. typedef struct MinNode    MNODE;
  14. typedef struct MsgPort    PORT;
  15.  
  16. #define IPCMSG    struct _IPCMSG
  17. #define IPCPORT struct _IPCPORT
  18.  
  19. IPCPORT {
  20.     PORT    Port;
  21.     long    Flags;    /*  Open flags for port */
  22. };
  23.  
  24. IPCMSG {
  25.     struct Message   Msg;     /*  EXEC message header */
  26.     MNODE   ANode;    /*  Application node    */
  27.     long    Error;    /*  optional error code */
  28.     IPCPORT *ToPort;
  29.     void    (*Confirm)();
  30.  
  31.     APTR    TBuf;    /*  Sender Command    */
  32.     long    TLen;
  33.     long    TFlags;
  34.  
  35.     APTR    RBuf;    /*  Receiver Reply    */
  36.     long    RLen;
  37.     long    RFlags;
  38. };
  39.  
  40. #define IF_NOCOPY   0x0001    /*  Do allocate a copy of the buffer      */
  41. #define IF_ALLOC    0x0002    /*  Message was allocated          */
  42. #define IF_NOTFND   0x0004    /*  Command not found           (+IF_ERROR)*/
  43. #define IF_ERROR    0x0008    /*  Error occured              */
  44.  
  45. #define IF_NOAPP    0x0020    /*  Req. Application not found (+IF_ERROR)*/
  46. #define IF_GLOBAL   0x0040    /*  global message... sent to all servers */
  47. #define IF_ALLOCMSG 0x8000    /*  IPCMSG structure was allocated      */
  48.  
  49. #define PERR_NOMEM  1        /*  Ran out of memory parsing command      */
  50. #define PERR_NOVAR  2        /*  Could not find string variable      */
  51.  
  52. extern __stdargs int    ParseCmd    ARGS((char *, char **, char *((*)()), char *((*)()), long *, long));
  53. extern __stdargs void    FreeParseCmd    ARGS((char **));
  54. extern __stdargs IPCPORT *OpenIPC   ARGS((char *, long));
  55. extern __stdargs void    CloseIPC    ARGS((IPCPORT *));
  56. extern __stdargs IPCMSG *SendIPC    ARGS((char *, APTR, long, long));
  57. extern __stdargs IPCMSG *SendIPC2   ARGS((char *, IPCMSG *));
  58. extern __stdargs void    DoIPC2        ARGS((char *, IPCMSG *, void (*)(), PORT *));
  59. extern __stdargs void    ReplyIPC    ARGS((IPCMSG *, APTR, long, long));
  60. extern __stdargs void    FreeIPC     ARGS((IPCMSG *));
  61. extern __stdargs APTR    Duplicate   ARGS((APTR, long));
  62.  
  63.  
  64. #endif
  65.  
  66.