libkmime

kmime_warning.h
1 #ifndef KMIME_NO_WARNING
2 # include <kdebug.h>
3 # define KMIME_WARN kdWarning(5100) << "Tokenizer Warning: "
4 # define KMIME_WARN_UNKNOWN(x,y) KMIME_WARN << "unknown " #x ": \"" \
5  << y << "\"" << endl;
6 # define KMIME_WARN_UNKNOWN_ENCODING KMIME_WARN << "unknown encoding in " \
7  "RFC 2047 encoded-word (only know 'q' and 'b')" << endl;
8 # define KMIME_WARN_UNKNOWN_CHARSET(c) KMIME_WARN << "unknown charset \"" \
9  << c << "\" in RFC 2047 encoded-word" << endl;
10 # define KMIME_WARN_8BIT(ch) KMIME_WARN \
11  << "8Bit character '" << TQString(TQChar(ch)) << "'" << endl
12 # define KMIME_WARN_IF_8BIT(ch) if ( (unsigned char)(ch) > 127 ) \
13  { KMIME_WARN_8BIT(ch); }
14 # define KMIME_WARN_PREMATURE_END_OF(x) KMIME_WARN \
15  << "Premature end of " #x << endl
16 # define KMIME_WARN_LONE(x) KMIME_WARN << "Lonely " #x " character" << endl
17 # define KMIME_WARN_NON_FOLDING(x) KMIME_WARN << "Non-folding " #x << endl
18 # define KMIME_WARN_CTL_OUTSIDE_QS(x) KMIME_WARN << "Control character " \
19  #x " outside quoted-string" << endl
20 # define KMIME_WARN_INVALID_X_IN_Y(X,Y) KMIME_WARN << "Invalid character '" \
21  TQString(TQChar(X)) << "' in " #Y << endl;
22 # define KMIME_WARN_TOO_LONG(x) KMIME_WARN << #x \
23  " too long or missing delimiter" << endl;
24 #else
25 # define KMIME_NOP do {} while (0)
26 # define KMIME_WARN_8BIT(ch) KMIME_NOP
27 # define KMIME_WARN_IF_8BIT(ch) KMIME_NOP
28 # define KMIME_WARN_PREMATURE_END_OF(x) KMIME_NOP
29 # define KMIME_WARN_LONE(x) KMIME_NOP
30 # define KMIME_WARN_NON_FOLDING(x) KMIME_NOP
31 # define KMIME_WARN_CTL_OUTSIDE_QS(x) KMIME_NOP
32 #endif