I am developing a C API that, among other things, should provide a way to set some two-digit parameters. To determine the parameters, I use the following enumeration:
typedef enum { OptionA, OptionB, ... } Option;
Is it possible to use Option as a parameter type in a public API function:
int set_option(Option opt, double value);
or better to use int instead:
int set_option(int opt, double value);
considering that I may need to add additional options in the future?
Also, are there any good examples of existing APIs that demonstrate any approach?
vitaut
source share