querying valid values for enums #149
Labels
abi-break
breaks the ABI (e.g. programs linked against the library have to be recompiled)
enhancement
Semantic
Change in the semantic interepretation
Looking at #148 which embeds the information about the minimum & maximum version number an element is valid for in libMatroska, I thought about also having the information available which values are valid for the various enums we have in the specs. At the moment we only have C-style
enum
for them, which means we can use them in the code via their names, but there's no way to have the program query the library if a given value is valid or not.For example, it would be nice to be able to query libMatroska & ask if the value 1 is valid for the "color primaries" element (it is) or if 14 is (it isn't).
On top of that it would be nice if the library simply provided a list of valid value/description pairs that an application can use for selection or to translate what a given value refers to (think
mkvinfo
outputting the name of the "color primaries" along with the numeric value).I'm thinking about two or three functions, the example being for an unsigned integer-based enum:
I'm trying to avoid the word "valid" here as these functions are all static; they only provide information straight from the specs. Not really happy with the names, though…
The text was updated successfully, but these errors were encountered: