Tidy aims to provide a consistent API for library users, and so we go to some lengths to provide a tidyStrings
enum that consists of the message code for every string that Tidy can emit (used internally), and the array tidyStringsKeys[]
containing string representations of each message code.
In order to keep code maintainable and make it simple to add new messages, the message code enums and tidyStringsKeys[]
are generated dynamically with preprocessor macros defined below.
Any visible FOREACH_MSG_* macro (including new ones) must be applied to the tidyStrings
enum with the MAKE_ENUM()
macro in this file, and to the tidyStringsKeys[]
(in messages.c
) with MAKE_STRUCT
in this file.
Modern IDE's will dynamically pre-process all of these macros, enabling code-completion of these enums and array of structs.
Code Generation Macros | |
These macros generate the enums and arrays from the Content Generation Macros defined below. | |
#define | MAKE_ENUM(MESSAGE) MESSAGE, |
Used to populate the contents of an enumerator, such as tidyStrings . More... | |
#define | MAKE_STRUCT(MESSAGE) {#MESSAGE, MESSAGE}, |
Used to populate the contents of a structure, such as tidyStringsKeys[]. More... | |
Content Generation Macros | |
These macros generate the individual entries in the enums and structs used to manage strings in Tidy. | |
#define | FOREACH_TIDYCONFIGCATEGORY(FN) |
Codes for populating TidyConfigCategory enumeration. More... | |
#define | FOREACH_MSG_MISC(FN) |
These message codes comprise every possible message that can be output by Tidy that are not diagnostic style messages, and are not console application specific messages. More... | |
#define | FOREACH_FOOTNOTE_MSG(FN) |
These messages are used to generate additional dialogue style output from Tidy when certain conditions exist, and provide more verbose explanations than the short report. More... | |
#define | FOREACH_DIALOG_MSG(FN) |
These messages are used to generate additional dialogue style output from Tidy when certain conditions exist, and provide more verbose explanations than the short report. More... | |
#define | FOREACH_REPORT_MSG(FN) |
These are report messages, i.e., messages that appear in Tidy's table of errors and warnings. More... | |
#define | FOREACH_ACCESS_MSG(FN) |
These are report messages added by Tidy's accessibility module. More... | |
#define | FOREACH_MSG_CONSOLE(FN) |
These message codes comprise every message is exclusive to theTidy console application. More... | |
#define FOREACH_ACCESS_MSG | ( | FN | ) |
These are report messages added by Tidy's accessibility module.
Note that commented out items don't have checks for them at this time, and it was probably intended that some test would eventually be written.
#define FOREACH_DIALOG_MSG | ( | FN | ) |
These messages are used to generate additional dialogue style output from Tidy when certain conditions exist, and provide more verbose explanations than the short report.
#define FOREACH_FOOTNOTE_MSG | ( | FN | ) |
These messages are used to generate additional dialogue style output from Tidy when certain conditions exist, and provide more verbose explanations than the short report.
#define FOREACH_MSG_CONSOLE | ( | FN | ) |
These message codes comprise every message is exclusive to theTidy console application.
It it possible to build LibTidy without these strings.
#define FOREACH_MSG_MISC | ( | FN | ) |
These message codes comprise every possible message that can be output by Tidy that are not diagnostic style messages, and are not console application specific messages.
#define FOREACH_REPORT_MSG | ( | FN | ) |
These are report messages, i.e., messages that appear in Tidy's table of errors and warnings.
#define FOREACH_TIDYCONFIGCATEGORY | ( | FN | ) |
Codes for populating TidyConfigCategory enumeration.
Option is internal only.
#define MAKE_ENUM | ( | MESSAGE | ) | MESSAGE, |
Used to populate the contents of an enumerator, such as tidyStrings
.
#define MAKE_STRUCT | ( | MESSAGE | ) | {#MESSAGE, MESSAGE}, |
Used to populate the contents of a structure, such as tidyStringsKeys[].