Read configuration files and manage configuration properties.
Config files associate a property name with a value.
// comments can start at the beginning of a line
name: short values fit onto one line name: a really long value that continues on the next line
Property names are case insensitive and should be less than 60 characters in length, and must start at the begining of the line, as whitespace at the start of a line signifies a line continuation.
tidy.h
for the complete license.Go to the source code of this file.
Data Structures | |
struct | TidyOptionImpl |
This structure defines the internal representation of a Tidy option. More... | |
struct | PickListItem |
Structs of this type contain information needed in order to present picklists, relate picklist entries to public enum values, and parse strings that are accepted in order to assign the value. More... | |
struct | TidyConfigImpl |
This type is used to define a structure for keeping track of the values for each option. More... | |
struct | TidyOptionDoc |
Used to build a table of documentation cross-references. More... | |
union | TidyOptionValue |
Stored option values can be one of two internal types. More... | |
Macros | |
#define | cfg(doc, id) ((doc)->config.value[ (id) ].v) |
Access the raw, non-string uint value of the given option ID. More... | |
#define | cfgAutoBool(doc, id) ((TidyTriState) cfg(doc, id)) |
Access the TidyTriState value of the given option ID. More... | |
#define | cfgBool(doc, id) ((Bool) cfg(doc, id)) |
Access the Bool value of the given option ID. More... | |
#define | cfgStr(doc, id) ((ctmbstr) (doc)->config.value[ (id) ].p) |
Access the string value of the given option ID. More... | |
#define | TIDY_PL_SIZE 16 |
Determines the maximum number of items in an option's picklist. More... | |
Typedefs | |
typedef Bool( | ParseProperty) (TidyDocImpl *doc, const TidyOptionImpl *opt) |
This typedef describes a function that is used for parsing the input given for a particular Tidy option. More... | |
typedef const PickListItem | PickListItems[TIDY_PL_SIZE] |
An array of PickListItems, fixed in size for in-code declarations. More... | |
Functions | |
Bool | TY_❪AdjustCharEncoding❫ (TidyDocImpl *doc, int encoding) |
Ensure that char encodings are self consistent. More... | |
void | TY_❪AdjustConfig❫ (TidyDocImpl *doc) |
Ensure that the configuration options are self consistent. More... | |
int | TY_❪CharEncodingId❫ (TidyDocImpl *doc, ctmbstr charenc) |
Returns the character encoding ID for the given character encoding string. More... | |
ctmbstr | TY_❪CharEncodingName❫ (int encoding) |
Returns the full name of the encoding for the given ID. More... | |
ctmbstr | TY_❪CharEncodingOptName❫ (int encoding) |
Returns the Tidy command line option name of the encoding for the given ID. More... | |
Bool | TY_❪ConfigDiffThanDefault❫ (TidyDocImpl *doc) |
Indicates whether or not the current configuration is completely default. More... | |
Bool | TY_❪ConfigDiffThanSnapshot❫ (TidyDocImpl *doc) |
Indicates whether or not the current configuration is different from the stored snapshot. More... | |
void | TY_❪CopyConfig❫ (TidyDocImpl *docTo, TidyDocImpl *docFrom) |
Copies the configuration from one document to another. More... | |
void | TY_❪DeclareListItem❫ (TidyDocImpl *doc, const TidyOptionImpl *opt, ctmbstr name) |
Coordinates Config update and list data. More... | |
void | TY_❪FreeConfig❫ (TidyDocImpl *doc) |
Frees the configuration memory for the given Tidy document. More... | |
ctmbstr | TY_❪getNextOptionPick❫ (const TidyOptionImpl *option, TidyIterator *iter) |
Gets the next picklist possibility provided by the iterator. More... | |
const TidyOptionImpl * | TY_❪getNextOption❫ (TidyDocImpl *doc, TidyIterator *iter) |
Gets the next option provided by the iterator. More... | |
const Bool | TY_❪getOptionIsList❫ (TidyOptionId optId) |
Given an option ID, indicates whether or not the option is a list. More... | |
TidyIterator | TY_❪getOptionList❫ (TidyDocImpl *doc) |
Initiates an iterator to cycle through all of the available options. More... | |
TidyIterator | TY_❪getOptionPickList❫ (const TidyOptionImpl *option) |
Initiates an iterator to cycle through all of the available picklist possibilities. More... | |
const TidyOptionImpl * | TY_❪getOption❫ (TidyOptionId optId) |
Given an option ID, return an instance of an option. More... | |
ctmbstr | TY_❪GetPickListLabelForPick❫ (TidyOptionId optId, uint pick) |
Gets the picklist label for a given value. More... | |
void | TY_❪InitConfig❫ (TidyDocImpl *doc) |
Initialize the configuration for the given Tidy document. More... | |
const TidyOptionImpl * | TY_❪lookupOption❫ (ctmbstr optnam) |
Given an option name, return an instance of an option. More... | |
const TidyOptionDoc * | TY_❪OptGetDocDesc❫ (TidyOptionId optId) |
Returns the cross-reference information structure for optID, which is used for generating documentation. More... | |
int | TY_❪ParseConfigFileEnc❫ (TidyDocImpl *doc, ctmbstr cfgfil, ctmbstr charenc) |
Attempts to parse the given config file into the document, using the provided encoding. More... | |
int | TY_❪ParseConfigFile❫ (TidyDocImpl *doc, ctmbstr cfgfil) |
Attempts to parse the given config file into the document. More... | |
Bool | TY_❪ParseConfigOption❫ (TidyDocImpl *doc, ctmbstr optnam, ctmbstr optVal) |
Attempts to parse the provided value for the given option name. More... | |
Bool | TY_❪ParseConfigValue❫ (TidyDocImpl *doc, TidyOptionId optId, ctmbstr optVal) |
Attempts to parse the provided value for the given option id. More... | |
void | TY_❪ResetConfigToDefault❫ (TidyDocImpl *doc) |
Resets all options in the document to their default values. More... | |
void | TY_❪ResetConfigToSnapshot❫ (TidyDocImpl *doc) |
Restores all of the configuration values to their snapshotted values. More... | |
Bool | TY_❪ResetOptionToDefault❫ (TidyDocImpl *doc, TidyOptionId optId) |
Resets the given option to its default value. More... | |
int | TY_❪SaveConfigFile❫ (TidyDocImpl *doc, ctmbstr cfgfil) |
Saves the current configuration for options not having default values into the specified file. More... | |
int | TY_❪SaveConfigSink❫ (TidyDocImpl *doc, TidyOutputSink *sink) |
Writes the current configuration for options not having default values into the specified sink. More... | |
Bool | TY_❪SetOptionBool❫ (TidyDocImpl *doc, TidyOptionId optId, Bool val) |
Sets the bool value for the given option Id. More... | |
Bool | TY_❪SetOptionInt❫ (TidyDocImpl *doc, TidyOptionId optId, ulong val) |
Sets the integer value for the given option Id. More... | |
void | TY_❪TakeConfigSnapshot❫ (TidyDocImpl *doc) |
Stores a snapshot of all of the configuration values that can be restored later. More... | |