1 | /* |
2 | kmime_warning.h |
3 | |
4 | KMime, the KDE Internet mail/usenet news message library. |
5 | Copyright (c) 2001-2002 Marc Mutz <mutz@kde.org> |
6 | See file AUTHORS for details |
7 | |
8 | This library is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU Library General Public |
10 | License as published by the Free Software Foundation; either |
11 | version 2 of the License, or (at your option) any later version. |
12 | |
13 | This library is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 | Library General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Library General Public License |
19 | along with this library; see the file COPYING.LIB. If not, write to |
20 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
21 | Boston, MA 02110-1301, USA. |
22 | */ |
23 | |
24 | #ifndef KMIME_WARNING_H |
25 | #define KMIME_WARNING_H |
26 | |
27 | #ifndef KMIME_NO_WARNING |
28 | # include <kdebug.h> |
29 | # define KMIME_WARN kDebug() << "Tokenizer Warning:" |
30 | # define KMIME_WARN_UNKNOWN(x,y) KMIME_WARN << "unknown " #x ": \"" \ |
31 | << y << "\""; |
32 | # define KMIME_WARN_UNKNOWN_ENCODING KMIME_WARN << "unknown encoding in " \ |
33 | "RFC 2047 encoded-word (only know 'q' and 'b')"; |
34 | # define KMIME_WARN_UNKNOWN_CHARSET(c) KMIME_WARN << "unknown charset \"" \ |
35 | << c << "\" in RFC 2047 encoded-word"; |
36 | # define KMIME_WARN_8BIT(ch) KMIME_WARN \ |
37 | << "8Bit character '" << ch << "'" |
38 | # define KMIME_WARN_IF_8BIT(ch) if ( (unsigned char)(ch) > 127 ) \ |
39 | { KMIME_WARN_8BIT(ch); } |
40 | # define KMIME_WARN_PREMATURE_END_OF(x) KMIME_WARN \ |
41 | << "Premature end of " #x |
42 | # define KMIME_WARN_LONE(x) KMIME_WARN << "Lonely " #x " character" |
43 | # define KMIME_WARN_NON_FOLDING(x) KMIME_WARN << "Non-folding " #x |
44 | # define KMIME_WARN_CTL_OUTSIDE_QS(x) KMIME_WARN << "Control character " \ |
45 | #x " outside quoted-string" |
46 | # define KMIME_WARN_INVALID_X_IN_Y(X,Y) KMIME_WARN << "Invalid character '" \ |
47 | QString(QChar(X)) << "' in " #Y; |
48 | # define KMIME_WARN_TOO_LONG(x) KMIME_WARN << #x \ |
49 | " too long or missing delimiter"; |
50 | #else |
51 | # define KMIME_NOP do {} while (0) |
52 | # define KMIME_WARN_8BIT(ch) KMIME_NOP |
53 | # define KMIME_WARN_IF_8BIT(ch) KMIME_NOP |
54 | # define KMIME_WARN_PREMATURE_END_OF(x) KMIME_NOP |
55 | # define KMIME_WARN_LONE(x) KMIME_NOP |
56 | # define KMIME_WARN_NON_FOLDING(x) KMIME_NOP |
57 | # define KMIME_WARN_CTL_OUTSIDE_QS(x) KMIME_NOP |
58 | #endif |
59 | |
60 | #endif |
61 | |