home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 164.lha / IPC / Sources / IPCPorts.h < prev    next >
C/C++ Source or Header  |  1988-04-28  |  4KB  |  98 lines

  1. #ifndef IPC_PORTS_H
  2. #define IPC_PORTS_H
  3.  
  4. /*** include this BEFORE IPC.H (if required) ***/
  5.  
  6. /*******************************************************************
  7.  *                                                                 *
  8.  *                           IPCPorts.h                            *
  9.  *                                                                 *
  10.  *           Inter-Process-Communication Port Format               *
  11.  *                                                                 *
  12.  *              Release  1.2 -- 1988 July 22                       *
  13.  *                                                                 *
  14.  *              Copyright 1988 Peter Goodeve                       *
  15.  *                                                                 *
  16.  *  This source is freely distributable, and may be used freely    *
  17.  *  in any program,  but the structures should not be modified     *
  18.  *  without prior consultation with the author.  (This is just to  *                    *
  19.  *  prevent proliferation of incompatible variants.  Don't be      *
  20.  *  inhibited from suggesting enhancements!)                       *
  21.  *                                                                 *
  22.  *******************************************************************/
  23. /*******************************************************************
  24.  *                                                                 *
  25.  *  88:7:22     ipp_BrokerInfo added to IPCPort                    *
  26.  *                                                                 *
  27.  *******************************************************************/
  28.  
  29. #ifndef EXEC_TYPES_H
  30. #include "exec/types.h"
  31. #endif
  32.  
  33. #ifndef EXEC_PORTS_H
  34. #include "exec/ports.h"
  35. #endif
  36.  
  37. /*******************************************************************
  38.  *                                                                 *
  39.  *  IPC Ports are essentially standard Exec message Ports except   *
  40.  *  for added fields to keep track of their usage.  Also they      *
  41.  *  are kept on their own list.                                    *
  42.  *                                                                 *
  43.  *  Note that the port name has to be kept WITHIN the structure    *
  44.  *  also, as the process that created it may go away.  The size    *
  45.  *  field holds the size of the structure including the name, so   *
  46.  *  it may be deleted safely when no longer needed.                *
  47.  *                                                                 *
  48.  *******************************************************************/
  49.  
  50. struct IPCPort {
  51.     struct MsgPort  ipp_Port;
  52.     ULONG           ipp_Id;         /* for future use */
  53.     UWORD           ipp_UseCount,   /* number of connections to the port */
  54.                     ipp_Flags,      /* internal information */
  55.                     ipp_Size;       /* size of the WHOLE structure */
  56.     void          * ipp_Broker_Info;  /* pointer to private information */
  57.     char            ipp_Name[1];    /* where name is actually kept! */
  58.     };
  59.  
  60.  
  61. /* ipp_Flags -- defined in IPC.h: */
  62.  
  63. /***********************************
  64. #define IPP_SERVED 0x8000
  65. #define IPP_SHUT 0x4000
  66. #define IPP_REOPEN 0x2000
  67. #define IPP_LOADING 0x1000
  68.  
  69. #define IPP_NOTIFY 0x0001
  70. ***********************************/
  71.  
  72. #define IPP_SERVER_FLAGS 0x00FF
  73.  
  74.  
  75.  
  76. /*******************************************************************
  77.  *                                                                 *
  78.  *  Only one IPCBasePort structure will exist in the system.       *
  79.  *  It is the only IPC Port on the public Exec port list, and      *
  80.  *  has the standard name "IPC_Base_Port".  (Note that the name    *
  81.  *  string begins in the last location of the IPCPort structure;   *
  82.  *  "moreName" is just to provide the necessary space, so the      *
  83.  *  list header begins at a defined offset.)                       *
  84.  *                                                                 *
  85.  *******************************************************************/
  86.  
  87. struct IPCBasePort {
  88.     struct IPCPort ipcb_Port;   /* used to place in public Port list */
  89.                                 /* also will be public port for a Broker */
  90.     char        moreName[20];   /* enough space for name  */
  91.     struct List ipcb_PortList;  /* List of current IPCPorts */
  92.     };
  93.  
  94. /*******************************************************************/
  95.  
  96. #endif
  97.  
  98.