By always setting enums as 1, the 0 value can be reserved as not-set.
There are still a few situations where enums must not start at 1.
Some are:
1) Type defenitions, so as in f_types where the status codes need to start at 0 for f_false.
2) Any enums that map 1to1 to an array, such as with parameter options.
*/
#ifndef _di_f_console_ids_
enum {
- f_console_none,
+ f_console_none = 1,
f_console_short_enable,
f_console_short_disable,
f_console_long_enable,
typedef unsigned short f_console_id;
enum {
- f_console_result_none,
+ f_console_result_none = 1,
f_console_result_found,
f_console_result_additional,
};
enum {
- f_console_type_normal,
+ f_console_type_normal = 1,
f_console_type_inverse,
f_console_type_other,
};
#ifndef _di_f_fss_codes_
enum {
- f_fss_basic,
+ f_fss_basic = 1,
f_fss_extended,
f_fss_basic_list,
f_fss_extended_list,
#define f_socket_close_id unsigned short
enum {
- f_socket_close_fast, // As in close();
+ f_socket_close_fast = 1, // As in close();
f_socket_close_read, // As in shutdown(, SHUT_RD);
f_socket_close_write, // As in shutdown(, SHUT_WR);
f_socket_close_read_write, // As in shutdown(, SHUT_RDWR);
#ifndef _di_byte_dump_defines_
enum {
- byte_dump_mode_hexidecimal,
+ byte_dump_mode_hexidecimal = 1,
byte_dump_mode_octal,
byte_dump_mode_binary,
byte_dump_mode_decimal,
};
enum {
- byte_dump_presentation_normal,
+ byte_dump_presentation_normal = 1,
byte_dump_presentation_simple,
byte_dump_presentation_classic,
};
#define firewall_chain_delete_command_length 2
enum {
- firewall_program_none,
+ firewall_program_none = 1,
firewall_program_iptables,
firewall_program_ip6tables,
firewall_program_ip46tables,