4 * Error messages and handling
6 * © 1994-1998 Straylight
9 /*----- Licensing note ----------------------------------------------------*
11 * This file is part of Straylight's Dynamic Linking System (SDLS)
13 * SDLS is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
18 * SDLS is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with SDLS. If not, write to the Free Software Foundation,
25 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
41 /*----- A word to the wise ------------------------------------------------*
43 * There's some clever preprocessor jiggery-pokery going on here, which
44 * does all the tedious matching up of error names to numbers and severities
45 * and things. Quite neat, really.
47 * To actually make the array of error strings *defined*, you should
48 * predefine the macro error__MAKETABLE.
51 #ifdef error__MAKETABLE
53 #define __entry(sev,name,msg) sev , msg "\n" ,
64 #define __entry(sev,name,msg) name ,
71 /* --- End of preprocessor trickery --- */
73 __entry(error_FATAL, NOMEM, "Out of memory")
75 __entry(error_ERROR, BADFILE, "'%s' is not a valid object file "
76 "or library -- ignored")
78 __entry(error_SEVERE, BADNAME, "Symbol '%s' not found in specified "
81 __entry(error_WARN, NOSYMS, "No symbols specified -- reading "
83 __entry(error_ERROR, DUPSYM, "Duplicate symbol '%s' found -- "
86 __entry(error_WARN, BADTAG, "Unknown option tag '%s'")
87 __entry(error_ERROR, DUPOPT, "Option '%s' already specified -- "
89 __entry(error_WARN, SILLYOPT, "Unexpected option '%s' ignored")
90 __entry(error_ERROR, SORBNOBJ, "You can't specify -o and -s or -b")
91 __entry(error_ERROR, APPNOEXT, "You can't specify -e and -app")
92 __entry(error_ERROR, NODEF, "No definition file specified")
93 __entry(error_ERROR, NOSTUB, "No stublib file specified")
94 __entry(error_ERROR, NOBIND, "No DLL header file specified")
95 __entry(error_INFO, BADCMDLINE, "Exiting due to errors in command "
98 __entry(error_WARN, LOSTSYM, "Symbol '%s' not found in specified "
101 __entry(error_SEVERE, NOOPENOUT, "Couldn't open file '%s' for "
103 __entry(error_ERROR, NOOPENIN, "Couldn't open file '%s' for "
106 __entry(error_ERROR, JUNKNOITEM, "Expected section name, found '%s'")
107 __entry(error_ERROR, JUNKNOBRA, "Expected '{', found '%s'")
108 __entry(error_ERROR, BADITEM, "Invalid item name '%s'")
109 __entry(error_ERROR, JUNKNOKET, "Expected name or '}', found '%s'")
110 __entry(error_ERROR, JUNKNOVER, "Expected version, found '%s'")
111 __entry(error_ERROR, JUNKNONAME, "Expected DLL name, found '%s'")
112 __entry(error_ERROR, JUNKNOCRIGHT, "Expected copyright string, found "
114 __entry(error_ERROR, BADVER, "Bad version number '%s'")
115 __entry(error_ERROR, QBFEOF, "Missing %c before <EOF>, inserted")
116 __entry(error_ERROR, QBFNL, "Missing %c before <newline>, "
119 __entry(error_WARN, NOVERSION, "No version number specified, "
120 "assuming version 1.00")
121 __entry(error_SEVERE, NONAME, "No DLL name specified")
122 __entry(error_WARN, NOCRIGHT, "No copyright string specified")
124 __entry(error_WARN, EASY, "Nothing to do!")
126 /* --- Terminate entries --- */
128 #ifdef error__MAKETABLE
141 /* --- Functions --- */
143 void error_setProgName(char *name);
144 char *error_progname(void);
145 void error(int message,...);
146 void error_show(void);
147 int error_returnCode(void);