home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / emerald / emrldsys.lha / Kernel / h / mmCodes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-17  |  6.0 KB  |  186 lines

  1. /* File: /u1/Eden/Kernel/MsgOps/mmCodes.m  Date: 16-Jan-1983  */
  2.  
  3. /*
  4.  * $Header$
  5.  * INTERFACE:    None.
  6.  *
  7.  * FUNCTION:    Define the standard error and status codes associated
  8.  *        with message module operations.  Some of these codes
  9.  *        report, in the standard Eden format, the errors returned
  10.  *        by the underlying IPC mechanism.
  11.  *
  12.  * IMPORTS:    Kernel/h/errMsgs.h.
  13.  *
  14.  * EXPORTS:    A set of #defined constants representing the error and
  15.  *        status codes returned by the message module routines.
  16.  *
  17.  * DESIGN:    
  18.  *
  19.  * $Log$
  20.  * 24-Nov-1982:    Initial implementation. S. Cady, J. Sanislo.
  21.  */
  22. #ifndef mmCodes
  23. #define mmCodes
  24.  
  25. #ifndef errMsgs
  26. #include "Kernel/h/errMsgs.h"
  27. #endif
  28.  
  29. #define    FAC_MsgModule        ((unsigned)0x0000000B)
  30. #define    VER_MsgModule        ((unsigned)0x00000004)
  31. #define    ABV_MsgModule        "MMS"
  32. #define    KMSG_MsgModule        ((unsigned)0x000B0004)
  33. /*
  34.  * Module specific success code.
  35.  */
  36. #define    MMSS_Success        ((unsigned)0x000B0001)
  37. /* "Normal, successful completion." */
  38. #define    MMSS_ServPortTaken        ((unsigned)0x000B0009)
  39. /* "Successful completion, but service port already in use." */
  40. /*
  41.  * Module specific failures.
  42.  */
  43. #define    MMSF_BadDelta        ((unsigned)0x000B0002)
  44. /* "Delta timer value <= 0." */
  45. #define    MMSF_BadID        ((unsigned)0x000B000A)
  46. /* "Invalid timer request id." */
  47. #define    MMSF_BadNode        ((unsigned)0x000B0012)
  48. /* "Invalid LNN value: %d." */
  49. #define    MMSF_BadRange        ((unsigned)0x000B001A)
  50. /* "Range exceeds msg size: %d-%d." */
  51. #define    MMSF_BadSubtype        ((unsigned)0x000B0022)
  52. /* "Invalid message subtype: %8.8x." */
  53. #define    MMSF_BadType        ((unsigned)0x000B002A)
  54. /* "Invalid message type: %8.8x." */
  55. #define    MMSF_Dupl        ((unsigned)0x000B0032)
  56. /* "Duplicate keyed queue entry: %8.8x." */
  57. #define    MMSF_MsgOvfl        ((unsigned)0x000B003A)
  58. /* "Max msg size exceeded: %d." */
  59. #define    MMSF_BufOvfl        ((unsigned)0x000B0042)
  60. /* "Msg exceeds buffer size." */
  61. #define    MMSF_NoEntry        ((unsigned)0x000B004A)
  62. /* "No entry found." */
  63. #define    MMSF_NoHOTSEntry        ((unsigned)0x000B0052)
  64. /* "No HOTS entry found." */
  65. #define    MMSF_NodeDown        ((unsigned)0x000B005A)
  66. /* "LNN %d unavailable." */
  67. #define    MMSF_NotImpl        ((unsigned)0x000B0062)
  68. /* "Service not implemented." */
  69. #define    MMSF_QOvfl        ((unsigned)0x000B006A)
  70. /* "Queue is full." */
  71. #define    MMSF_BadConfig        ((unsigned)0x000B0072)
  72. /* "Invalid module config." */
  73. #define    MMSF_TimeOut        ((unsigned)0x000B007A)
  74. /* "Message reception timeout." */
  75. #define    MMSF_NotAvail        ((unsigned)0x000B0082)
  76. /* "Service not available." */
  77. #define    MMSF_NoPhysHost        ((unsigned)0x000B008A)
  78. /* "No Such Physical Host." */
  79. #define    MMSF_NoService        ((unsigned)0x000B0092)
  80. /* "Service not found in Unix database." */
  81. #define    MMSF_EndOfHostList        ((unsigned)0x000B009A)
  82. /* "Host list in Unix database exhausted." */
  83.  
  84. /*
  85.  * Related to managing ports (as opposed to messages).
  86.  */
  87. #define    MMSF_BadName        ((unsigned)0x000B00A2)
  88. /* "Port name too long: %s." */
  89. #define    MMSF_DuplName        ((unsigned)0x000B00AA)
  90. /* "Duplicate port name: %s." */
  91. #define    MMSF_InUse        ((unsigned)0x000B00B2)
  92. /* "Port still in use: %s." */
  93. #define    MMSF_NoSuchPort        ((unsigned)0x000B00BA)
  94. /* "Unknown port: %s." */
  95. #define    MMSF_CantUnName        ((unsigned)0x000B00C2)
  96. /* "Can't remove portname: %s." */
  97. /*
  98.  * Related to IPC facilities.  Note that IPC functions return a -1
  99.  * for failure and leave a further code in the global variable `errno'.
  100.  * Therefore, the codes returned by MMS as given below must be
  101.  * constructed from the value of errno by the following algorithm.
  102.  * The values in errno (which is a byte) are returned as negative
  103.  * numbers starting at -128 and increasing.  Thus the values below
  104.  * are in REVERSE order from those defined in <cmuipc.h>
  105.  */
  106.  
  107. #define mIPC(ferrno) ( (ferrno) < -114  &&  (ferrno) > -129 )
  108.  
  109. #define mIPCError(ferrno)  \
  110.             ((FAC_MsgModule << 16) + (-(ferrno) * 8 ) + FAILURE)
  111.  
  112. #define    MMSF_IPCSpace        ((unsigned)0x000B039A)
  113. /* "Out of IPC space." */
  114. #define    MMSF_IPCMsg        ((unsigned)0x000B03A2)
  115. /* "Bad IPC message: %8.8x." */
  116. #define    MMSF_IPCChild        ((unsigned)0x000B03AA)
  117. /* "Port not a child: %8.8x." */
  118. #define    MMSF_IPCRights        ((unsigned)0x000B03B2)
  119. /* "Insufficient rights." */
  120. #define    MMSF_IPCTooBig        ((unsigned)0x000B03BA)
  121. /* "Msg exceeds max IPC size: %d." */
  122. #define    MMSF_IPCName        ((unsigned)0x000B03C2)
  123. /* "Bad IPC name: %s." */
  124. #define    MMSF_IPCType        ((unsigned)0x000B03CA)
  125. /* "Bad IPC message type: %8.8x." */
  126. #define    MMSF_IPCCall        ((unsigned)0x000B03D2)
  127. /* "Invalid IPC call: %d." */
  128. #define    MMSF_IPCOvfl        ((unsigned)0x000B03DA)
  129. /* "Maximum ports exceeded." */
  130. #define    MMSF_IPCNoRoom        ((unsigned)0x000B03E2)
  131. /* "Not enough room for IPC message." */
  132. #define    MMSF_IPCUnkType        ((unsigned)0x000B03EA)
  133. /* "Unknown IPC message type: %8.8x." */
  134. #define    MMSF_IPCFull        ((unsigned)0x000B03F2)
  135. /* "Port full." */
  136. #define    MMSF_IPCReceiver        ((unsigned)0x000B03FA)
  137. /* "No receive rights on port." */
  138. #define    MMSF_IPCPort        ((unsigned)0x000B0402)
  139. /* "Invalid port." */
  140.  
  141. /* Upcall handler error codes */
  142.  
  143. #define    MMSF_BadEventID        ((unsigned)0x000B040A)
  144. /* "Invalid Upcall event ID" */
  145. #define    MMSF_DefaultHOTSNotInitialized        ((unsigned)0x000B0412)
  146. /* "Default HOTS Entry not initialized" */
  147.  
  148. /* Miscellaneous additional error codes.  Added here in order to
  149.  * minimize impact on other codes.
  150.  */
  151.  
  152. #define    MMSF_NoIPCMsg        ((unsigned)0x000B041A)
  153. /* "Missing IPC message." */
  154. #define    MMSF_BadMsgId        ((unsigned)0x000B0422)
  155. /* "Invalid IPC message id." */
  156. #define    MMSF_UnNormal        ((unsigned)0x000B042A)
  157. /* "Normal message on DATAPORT." */
  158. #define    MMSF_UnEmergency        ((unsigned)0x000B0432)
  159. /* "Emergency message on normal port." */
  160. #define    MMSF_BadVersion        ((unsigned)0x000B043A)
  161. /* "Incompatible MM version." */
  162. #define    MMSF_SendTimeOut        ((unsigned)0x000B0442)
  163. /* "Message transmission timeout." */
  164.  
  165. /*
  166.  * Server error codes, since they indicate we are bumping up against
  167.  * the underlying Unix system.
  168.  */
  169. #define    MMSK_NoMem        ((unsigned)0x000B0004)
  170. /* "No memory available." */
  171.  
  172. /*
  173.  * Message Module message subtypes
  174.  *
  175.  */
  176. #define    MMSM_AllocStatus        ((unsigned)0x000B0005)
  177. /* "Allocate buffer status message." */
  178. #define    MMSM_NegativeAck        ((unsigned)0x000B000D)
  179. /* "Negative acknowledgement message." */
  180. #define    MMSM_CompStatus        ((unsigned)0x000B0015)
  181. /* "Completion status message." */
  182.  
  183.  
  184. #endif
  185.  
  186.