Skip to content

New picklists and parsers #553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README/OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct _tidy_option
TidyOptionType type; /* string, int or bool */
ulong dflt; /* default for TidyInteger and TidyBoolean */
ParseProperty* parser; /* parsing method, read-only if NULL */
const ctmbstr* pickList; /* pick list */
PickListItems* pickList; /* pick list */
ctmbstr pdflt; /* default for TidyString */
};
~~~
Expand Down Expand Up @@ -78,7 +78,7 @@ Care, each of these enumeration strings have been equated to two uppercase lette

The next item is the `default` value for a boolean, tristate or integer. Note tidy set `no=0` and `yes=1` as its own `Bool` enumeration.

There are a number of `parser` for the options. Likewise a number of `pickList`. Find another option similar to your new option and use the same values.
There are a number of `parser` for the options. Likewise a number of `pickList`. Find another option similar to your new option and use the same values. The `parser` is the function that parses config file or command line text input, and the `picklist` constitutes the canonical values for the option. Some types of values logically don't have picklists, such as strings or pure integers.

Presently no options have the final `default` string, and it is left out of the table. The compiler will add a NULL.

Expand Down
30 changes: 30 additions & 0 deletions include/tidyenum.h
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,36 @@ typedef enum
TidyCR /**< Use Macintosh style: CR */
} TidyLineEnding;


/** TidyEncodingOptions option values specify the input and/or output encoding.
** @remark This enum's starting value is guaranteed to remain stable.
*/
typedef enum
{
TidyEncRaw = 0,
TidyEncAscii,
TidyEncLatin0,
TidyEncLatin1,
TidyEncUtf8,
#ifndef NO_NATIVE_ISO2022_SUPPORT
TidyEncIso2022,
#endif
TidyEncMac,
TidyEncWin1252,
TidyEncIbm858,

#if SUPPORT_UTF16_ENCODINGS
TidyEncUtf16le,
TidyEncUtf16be,
TidyEncUtf16,
#endif

#if SUPPORT_ASIAN_ENCODINGS
TidyEncBig5,
TidyEncShiftjis
#endif
} TidyEncodingOptions;


/** Mode controlling treatment of doctype
** @remark This enum's starting value is guaranteed to remain stable.
Expand Down
Loading