ximserr.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* @(#)$XConsortium: ximserr.h /main/3 1996/05/07 14:02:24 drk $ */
  24. #ifndef _XIMSERR_H_
  25. #define _XIMSERR_H_ 1
  26. #include <errno.h>
  27. /* Error Codes */
  28. #define NO_ERROR 0
  29. #define ERROR_BASE -200
  30. typedef enum {
  31. NoError = 0,
  32. ErrSyntax = ERROR_BASE, /* -200 */
  33. ErrNoHome, /* -199 */
  34. ErrNoLocale, /* -198 */
  35. ErrNoCDELocale, /* -197 */
  36. ErrNoDisplay, /* -196 */
  37. ErrDisabled, /* -195 */
  38. ErrSignaled, /* -194 */
  39. /* File I/O */
  40. ErrFileOpen, /* -193 */
  41. ErrFileCreate, /* -192 */
  42. ErrDirCreate, /* -191 */
  43. ErrMissEntry, /* -190 */
  44. /* Selection */
  45. ErrAnotherProg, /* -189 */
  46. ErrNoSelectionFile, /* -188 */
  47. ErrSaveSelection, /* -187 */
  48. ErrNoSelection, /* -186 */
  49. ErrNoLocaleConf, /* -185 */
  50. ErrNoImsEntry, /* -184 */
  51. ErrNoImsConf, /* -183 */
  52. ErrNotRegistered, /* -182 */
  53. ErrNoExecutable, /* -181 */
  54. /* Start */
  55. ErrImsRunning, /* -180 */
  56. ErrImsExecution, /* -179 */
  57. ErrImsAborted, /* -178 */
  58. ErrImsTimeout, /* -177 */
  59. /* Remote */
  60. ErrUnknownHost, /* -176 */
  61. ErrRemoteAction, /* -175 */
  62. ErrRemoteData, /* -174 */
  63. ErrRemoteNoIms, /* -173 */
  64. ErrRemoteMissIms, /* -172 */
  65. ErrNoImsstart, /* -171 */
  66. ErrRemoteIms, /* -170 */
  67. /* X */
  68. ErrOpenDpy, /* -169 */
  69. ErrOpenResource, /* -168 */
  70. /* Misc */
  71. ErrMemory, /* -167 */
  72. /* Internal */
  73. ErrIsNone, /* -166 */
  74. ErrNotRun, /* -165 */
  75. ErrImsWaiting, /* -164 */
  76. ErrImsWaitDone, /* -163 */
  77. ErrImsConnecting, /* -162 */
  78. ErrImsConnectDone, /* -161 */
  79. ErrInvState, /* -160 */
  80. ErrInternal, /* -159 */
  81. LastErrorCode /* -158 */
  82. } ximsError;
  83. /* Global Variabls */
  84. # ifdef _EXTERN_DEFINE_
  85. #define Extern
  86. # else
  87. #define Extern extern
  88. # endif /* _EXTERN_DEFINE_ */
  89. Extern ximsError OpErrCode;
  90. Extern void *ximsErrArgs[3];
  91. Extern char errFilePath[MAXPATHLEN];
  92. Extern char *errFuncName;
  93. /* Macros for setting parameters of error messages */
  94. #define _setErrArg(n, arg) ximsErrArgs[n] = (void *)(arg)
  95. #define setErrArg1(arg) _setErrArg(0, arg)
  96. #define setErrArg2(arg) _setErrArg(1, arg)
  97. #define setErrArg3(arg) _setErrArg(2, arg)
  98. #define setErrFile(path) snprintf(errFilePath, sizeof(errFilePath), "%s", (path))
  99. #define setErrFunc(name) errFuncName = (name)
  100. #undef Extern
  101. #endif /* _XIMSERR_H_ */