Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtksh / msgs.c
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: msgs.c /main/4 1995/11/01 15:56:14 rswiston $ */
24 #include "stdio.h"
25 #include <sys/param.h>
26 #include <string.h>
27 #ifndef _SUN_OS
28 #include <nl_types.h>
29 #endif
30 #include "msgs.h"
31
32
33 char *
34 GetSharedMsg(
35         int msgId )
36 {
37    char * msg;
38
39    switch (msgId)
40    {
41       case DT_BAD_FIELD_NAME:
42          msg = GETMESSAGE(11,1, "Cannot find a field named '%s' in the structure '%s'");
43          break;
44
45       case DT_CONV_BUF_OVFL:
46          msg = GETMESSAGE(11,2, "DtkshCvtCallbackToString: An internal conversion buffer overflowed");
47          break;
48
49       case DT_HASHING_FAILURE:
50          msg = GETMESSAGE(11,3, "Hashing failure for resource '%s' in widget class '%s'");
51          break;
52
53       case DT_NO_FUNC_NAME:
54          msg = GETMESSAGE(11,4, "No function name was supplied");
55          break;
56
57       case DT_TK_NOT_INIT:
58          msg = GETMESSAGE(11,5, "The command cannot be executed; the toolkit has not been initialized");
59          break;
60
61       case DT_WIDGET_CREATE_FAILED:
62          msg = GETMESSAGE(11,6, "The creation of widget '%s' failed");
63          break;
64
65       case DT_BAD_DISPLAY:
66          msg = GETMESSAGE(11,7, "The display parameter is invalid: %s");
67          break;
68
69       case DT_BAD_ATOM:
70          msg = GETMESSAGE(11,8, "The following property atom is invalid: %s");
71          break;
72
73       case DT_UNDEF_RESOURCE:
74          msg = GETMESSAGE(11,9, "The following resource is not defined for widget '%s': %s");
75          break;
76
77       case DT_BAD_POSITION:
78          msg = GETMESSAGE(11,10, "The position specified is invalid: %s");
79          break;
80
81       case DT_BAD_FONT:
82          msg = GETMESSAGE(11,11, "The specified font is invalid: %s");
83          break;
84
85       case DT_BAD_WIDGET_HANDLE:
86          msg = GETMESSAGE(11,12, "The widget handle '%s' does not refer to an existing widget");
87          break;
88
89       case DT_CMD_WIDGET:
90          msg = GETMESSAGE(11,13, "The widget must be a 'command' widget");
91          break;
92
93       case DT_MAIN_WIN_WIDGET:
94          msg = GETMESSAGE(11,14, "The widget must be a 'mainWindow' widget");
95          break;
96
97       case DT_SCALE_WIDGET:
98          msg = GETMESSAGE(11,15, "The widget must be a 'scale' widget");
99          break;
100
101       case DT_SCROLLBAR_WIDGET:
102          msg = GETMESSAGE(11,16, "The widget must be a 'scrollBar' widget");
103          break;
104
105       case DT_TOGGLE_WIDGET:
106          msg = GETMESSAGE(11,17, "The widget must be a 'toggleButton' widget or gadget");
107          break;
108
109       case DT_BAD_WINDOW:
110          msg = GETMESSAGE(11,18, "The window parameter is invalid: %s");
111          break;
112
113       case DT_ALLOC_FAILURE:
114          msg = GETMESSAGE(11,19, "Unable to allocate required memory; exiting");
115          break;
116
117       case DT_NO_PARENT:
118          msg = GETMESSAGE(11,20, "Unable to find the parent widget");
119          break;
120
121       case DT_UNDEF_SYMBOL:
122          msg = GETMESSAGE(11,21, "Unable to locate the symbol '%s'");
123          break;
124
125       case DT_UNDEF_TYPE:
126          msg = GETMESSAGE(11,22, "Unable to locate the type '%s'");
127          break;
128
129       case DT_BAD_DECL:
130          msg = GETMESSAGE(11,23, "Unable to parse the declaration '%s'; using 'unsigned long'");
131          break;
132
133       case DT_UNKNOWN_CHILD_TYPE:
134          msg = GETMESSAGE(11,24, "Unknown child type: %s");
135          break;
136
137       case DT_UNKNOWN_OPTION:
138          msg = GETMESSAGE(11,25, "Unrecognized option flag: %s");
139          break;
140
141       case DT_USAGE_WIDGET_POS:
142          msg = GETMESSAGE(11,26, "Usage: %s widget position");
143          break;
144
145       case DT_USAGE_WIDGET_TIME:
146          msg = GETMESSAGE(11,27, "Usage: %s widget time");
147          break;
148
149       case DT_USAGE_WIDGET:
150          msg = GETMESSAGE(11,28, "Usage: %s widget");
151          break;
152
153       case DT_ERROR:
154          msg = GETMESSAGE(11,29, "dtksh error");
155          break;
156
157       case DT_WARNING:
158          msg = GETMESSAGE(11,30, "dtksh warning");
159          break;
160
161       case DT_USAGE_DISPLAY_WINDOW:
162          msg = GETMESSAGE(11,31, "Usage: %s display window");
163          break;
164
165       case DT_USAGE_DISPLAY_WINDOW_VAR:
166          msg = GETMESSAGE(11,32, "Usage: %s display window variable");
167          break;
168
169       case DT_USAGE_DISPLAY_ROOT_VAR:
170          msg = GETMESSAGE(11,33, "Usage: %s display rootWindow variable");
171          break;
172
173       case DT_BAD_TIMEOUT:
174          msg = GETMESSAGE(11,34, "The timeout parameter is invalid: %s");
175          break;
176
177       case DT_BAD_MESSAGE:
178          msg = GETMESSAGE(11,35, "The msg parameter is invalid: %s");
179          break;
180
181       case DT_BAD_PATTERN:
182          msg = GETMESSAGE(11,36, "The patterns parameter is invalid: %s");
183          break;
184    }
185    return(msg);
186 }