Skip to content

Commit b6bf48c

Browse files
authored
Merge pull request #553 from htacg/new_picklists
New picklists and parsers
2 parents 66bed8b + a399725 commit b6bf48c

File tree

5 files changed

+386
-458
lines changed

5 files changed

+386
-458
lines changed

README/OPTIONS.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct _tidy_option
3838
TidyOptionType type; /* string, int or bool */
3939
ulong dflt; /* default for TidyInteger and TidyBoolean */
4040
ParseProperty* parser; /* parsing method, read-only if NULL */
41-
const ctmbstr* pickList; /* pick list */
41+
PickListItems* pickList; /* pick list */
4242
ctmbstr pdflt; /* default for TidyString */
4343
};
4444
~~~
@@ -78,7 +78,7 @@ Care, each of these enumeration strings have been equated to two uppercase lette
7878

7979
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.
8080

81-
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.
81+
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.
8282

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

include/tidyenum.h

+30
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,36 @@ typedef enum
725725
TidyCR /**< Use Macintosh style: CR */
726726
} TidyLineEnding;
727727

728+
729+
/** TidyEncodingOptions option values specify the input and/or output encoding.
730+
** @remark This enum's starting value is guaranteed to remain stable.
731+
*/
732+
typedef enum
733+
{
734+
TidyEncRaw = 0,
735+
TidyEncAscii,
736+
TidyEncLatin0,
737+
TidyEncLatin1,
738+
TidyEncUtf8,
739+
#ifndef NO_NATIVE_ISO2022_SUPPORT
740+
TidyEncIso2022,
741+
#endif
742+
TidyEncMac,
743+
TidyEncWin1252,
744+
TidyEncIbm858,
745+
746+
#if SUPPORT_UTF16_ENCODINGS
747+
TidyEncUtf16le,
748+
TidyEncUtf16be,
749+
TidyEncUtf16,
750+
#endif
751+
752+
#if SUPPORT_ASIAN_ENCODINGS
753+
TidyEncBig5,
754+
TidyEncShiftjis
755+
#endif
756+
} TidyEncodingOptions;
757+
728758

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

0 commit comments

Comments
 (0)