Link with C++ linker
[oweals/cde.git] / cde / programs / dtimsstart / ximserr.h
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 librararies 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
25 #ifndef _XIMSERR_H_
26 #define _XIMSERR_H_     1
27
28 #include        <errno.h>
29
30     /* Error Codes */
31 #define NO_ERROR                0
32 #define ERROR_BASE              -200
33
34 typedef enum {
35     NoError = 0,
36     ErrSyntax = ERROR_BASE,     /* -200 */
37     ErrNoHome,                  /* -199 */
38     ErrNoLocale,                /* -198 */
39     ErrNoCDELocale,             /* -197 */
40     ErrNoDisplay,               /* -196 */
41     ErrDisabled,                /* -195 */
42     ErrSignaled,                /* -194 */
43
44         /* File I/O */
45     ErrFileOpen,                /* -193 */
46     ErrFileCreate,              /* -192 */
47     ErrDirCreate,               /* -191 */
48     ErrMissEntry,               /* -190 */
49
50         /* Selection */
51     ErrAnotherProg,             /* -189 */
52     ErrNoSelectionFile,         /* -188 */
53     ErrSaveSelection,           /* -187 */
54     ErrNoSelection,             /* -186 */
55     ErrNoLocaleConf,            /* -185 */
56     ErrNoImsEntry,              /* -184 */
57     ErrNoImsConf,               /* -183 */
58     ErrNotRegistered,           /* -182 */
59     ErrNoExecutable,            /* -181 */
60
61         /* Start */
62     ErrImsRunning,              /* -180 */
63     ErrImsExecution,            /* -179 */
64     ErrImsAborted,              /* -178 */
65     ErrImsTimeout,              /* -177 */
66
67         /* Remote */
68     ErrUnknownHost,             /* -176 */
69     ErrRemoteAction,            /* -175 */
70     ErrRemoteData,              /* -174 */
71     ErrRemoteNoIms,             /* -173 */
72     ErrRemoteMissIms,           /* -172 */
73     ErrNoImsstart,              /* -171 */
74     ErrRemoteIms,               /* -170 */
75
76         /* X */
77     ErrOpenDpy,                 /* -169 */
78     ErrOpenResource,            /* -168 */
79
80         /* Misc */
81     ErrMemory,                  /* -167 */
82
83         /* Internal */
84     ErrIsNone,                  /* -166 */
85     ErrNotRun,                  /* -165 */
86     ErrImsWaiting,              /* -164 */
87     ErrImsWaitDone,             /* -163 */
88     ErrImsConnecting,           /* -162 */
89     ErrImsConnectDone,          /* -161 */
90     ErrInvState,                /* -160 */
91     ErrInternal,                /* -159 */
92
93     LastErrorCode               /* -158 */
94 } ximsError;
95
96
97     /* Global Variabls */
98 # ifdef _EXTERN_DEFINE_
99 #define Extern
100 # else
101 #define Extern  extern
102 # endif /* _EXTERN_DEFINE_ */
103 Extern ximsError        OpErrCode;
104 Extern void             *ximsErrArgs[3];
105 Extern char             errFilePath[MAXPATHLEN];
106 Extern char             *errFuncName;
107
108     /* Macros for setting parameters of error messages */
109 #define _setErrArg(n, arg)      ximsErrArgs[n] = (void *)(arg)
110 #define setErrArg1(arg)         _setErrArg(0, arg)
111 #define setErrArg2(arg)         _setErrArg(1, arg)
112 #define setErrArg3(arg)         _setErrArg(2, arg)
113 #define setErrFile(path)        strcpy(errFilePath, (path))
114 #define setErrFunc(name)        errFuncName = (name)
115
116 #undef  Extern
117
118 #endif  /* _XIMSERR_H_ */
119