Makefile: add -W to produce even stricter warnings
[flog.git] / flog_msg_id.h
blob9b85e744e66dfaad6242825225504e3270469ed1
1 //! Flog - Message ID definitions for the F logging library
3 //! @file flog_msg_id.h
4 //! @author Nabeel Sowan (nabeel.sowan@vibes.se)
5 //!
6 //! Useful for saving space on embedded systems, performance etc.
7 //! if FLOG_NO_MSG_ID_STRINGS is defined then the static string
8 //! data will not be included. This can be used for deeply embedded
9 //! systems where string generation isn't strictly necessary,
10 //! and can be decoded by the receiver.
13 #ifndef FLOG_MSG_ID_H
14 #define FLOG_MSG_ID_H
16 #include "config.h"
18 //! Amount of msg_id entries reserved for passing errno values
19 #define FLOG_MSG_ID_AMOUNT_RESERVED_FOR_ERRNO 8000
21 //! Built in message ids, these are used internally by flog
22 #define FLOG_MSG_IDS_BUILTIN \
23 X(FLOG_MSG_MARK, "Mark" ) \
24 X(FLOG_MSG_ASSERTION_FAILED, "Assertion failed" )
27 //! Common message ids, used by the various output modules
28 #define FLOG_MSG_IDS_COMMON \
29 X(FLOG_MSG_CANNOT_READ_FROM_STDIN, "cannot read from stdin") \
30 X(FLOG_MSG_CANNOT_WRITE_TO_STDOUT, "cannot write to stdout") \
31 X(FLOG_MSG_CANNOT_WRITE_TO_STDERR, "cannot write to stderr") \
32 X(FLOG_MSG_CANNOT_OPEN_FILE, "cannot open file" ) \
33 X(FLOG_MSG_CANNOT_READ_FILE, "cannot read from file" ) \
34 X(FLOG_MSG_CANNOT_WRITE_FILE, "cannot write to file" )
37 //! Extended message ids, useful but not entirely necessary
38 #define FLOG_MSG_IDS_EXTENDED \
39 X(FLOG_MSG_CANNOT_OPEN_SOCKET, "cannot open socket" )
42 // Custom message ids, if they are not defined, define to null
43 #ifndef FLOG_MSG_IDS_CUSTOM
44 #define FLOG_MSG_IDS_CUSTOM
45 #endif
48 //! List of message id lists to be used
49 #define FLOG_MSG_IDS \
50 FLOG_MSG_IDS_BUILTIN \
51 FLOG_MSG_IDS_COMMON \
52 FLOG_MSG_IDS_EXTENDED \
53 FLOG_MSG_IDS_CUSTOM
56 #define X(id, str) id,
57 typedef enum {
58 FLOG_MSG_NONE = 0,
59 FLOG_MSG_ID_LOWERBOUND = (FLOG_MSG_ID_AMOUNT_RESERVED_FOR_ERRNO-1),
60 FLOG_MSG_IDS
61 FLOG_MSG_ID_AMOUNT
62 } FLOG_MSG_ID_T;
63 #undef X
66 #endif //FLOG_MSG_ID_H