1 | /* message.h |
---|
2 | * Function prototypes for message.c |
---|
3 | * Copyright (C) 1998-2003,2005 Olly Betts |
---|
4 | * |
---|
5 | * This program is free software; you can redistribute it and/or modify |
---|
6 | * it under the terms of the GNU General Public License as published by |
---|
7 | * the Free Software Foundation; either version 2 of the License, or |
---|
8 | * (at your option) any later version. |
---|
9 | * |
---|
10 | * This program is distributed in the hope that it will be useful, |
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | * GNU General Public License for more details. |
---|
14 | * |
---|
15 | * You should have received a copy of the GNU General Public License |
---|
16 | * along with this program; if not, write to the Free Software |
---|
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
18 | */ |
---|
19 | |
---|
20 | #ifndef MESSAGE_H /* only include once */ |
---|
21 | #define MESSAGE_H |
---|
22 | |
---|
23 | #ifdef __cplusplus |
---|
24 | extern "C" { |
---|
25 | #endif |
---|
26 | |
---|
27 | #include <stdarg.h> |
---|
28 | |
---|
29 | #include "osdepend.h" |
---|
30 | #include "osalloc.h" |
---|
31 | |
---|
32 | #define STDERR stdout |
---|
33 | |
---|
34 | #define CHARSET_BAD -1 |
---|
35 | #define CHARSET_USASCII 0 |
---|
36 | #define CHARSET_ISO_8859_1 1 |
---|
37 | #define CHARSET_DOSCP850 2 |
---|
38 | //#define CHARSET_RISCOS31 3 |
---|
39 | #define CHARSET_UTF8 4 |
---|
40 | #define CHARSET_WINCP1252 5 |
---|
41 | #define CHARSET_ISO_8859_15 6 |
---|
42 | //#define CHARSET_DOSCP437 7 |
---|
43 | #define CHARSET_ISO_8859_2 8 |
---|
44 | #define CHARSET_WINCP1250 9 |
---|
45 | |
---|
46 | extern int msg_warnings; /* keep track of how many warnings we've given */ |
---|
47 | extern int msg_errors; /* and how many (non-fatal) errors */ |
---|
48 | |
---|
49 | /* The language code - e.g. "en_GB" */ |
---|
50 | extern const char *msg_lang; |
---|
51 | /* If the language code has a country specific qualification, then this will |
---|
52 | * be just the language code. Otherwise it's NULL. e.g. "en" */ |
---|
53 | extern const char *msg_lang2; |
---|
54 | |
---|
55 | void msg_init(char *const *argv); |
---|
56 | |
---|
57 | const char *msg_cfgpth(void); |
---|
58 | const char *msg_exepth(void); |
---|
59 | const char *msg_appname(void); |
---|
60 | |
---|
61 | /* Message may be overwritten by next call */ |
---|
62 | const char *msg(int en); |
---|
63 | /* Returns persistent copy of message */ |
---|
64 | const char *msgPerm(int en); |
---|
65 | /* Kill persistent copy of message */ |
---|
66 | #define msgFree(S) (void)0 |
---|
67 | |
---|
68 | void v_report(int severity, const char *fnm, int line, int en, va_list ap); |
---|
69 | |
---|
70 | void warning(int en, ...); |
---|
71 | void error(int en, ...); |
---|
72 | void fatalerror(int en, ...); |
---|
73 | |
---|
74 | void warning_in_file(const char *fnm, int line, int en, ...); |
---|
75 | void error_in_file(const char *fnm, int line, int en, ...); |
---|
76 | void fatalerror_in_file(const char *fnm, int line, int en, ...); |
---|
77 | |
---|
78 | int select_charset(int charset_code); |
---|
79 | |
---|
80 | #ifdef __cplusplus |
---|
81 | } |
---|
82 | #endif |
---|
83 | |
---|
84 | #endif /* MESSAGE_H */ |
---|