.sval = ipmi_solconfig_set_ ## name }}} #define F_INT(name) \ { .datatype = IPMI_SOLCONFIG_INT, .fname = #name, \ .u = { .ival = { .gval = ipmi_solconfig_get_ ## name, \ .sval = ipmi_solconfig_set_ ## name }}} #define F_INTV(name) \ { .datatype = IPMI_SOLCONFIG_INT, .fname = #name, \ .u = { .ival = { .gval_v = ipmi_solconfig_get_ ## name, \ .sval_v = ipmi_solconfig_set_ ## name }}} static solparm_gendata_t gdata[] = { F_BOOL(enable), /* 0 */ F_BOOL(force_payload_encryption), F_BOOL(force_payload_authentication), F_INT(privilege_level), F_INT(retry_count), F_INT(retry_interval), /* 5 */ F_INT(char_accumulation_interval), F_INT(char_send_threshold), F_INT(non_volatile_bitrate), F_INT(volatile_bitrate), F_INTV(payload_channel), /* 10 */ F_INTV(port_number), }; #define NUM_GDATA_ENTRIES (sizeof(gdata) / sizeof(solparm_gendata_t)) int ipmi_solconfig_enum_val(unsigned int parm, int val, int *nval, const char **sval) {
typedef struct field_t { char *name; field_type type; field_default def; int offset; } field; typedef struct struct_to_field_t { void *_struct; const field *fields; int num_fields; } struct_to_field; const field f_video[] = { F_INT(settings_video, screen_w, 640), F_INT(settings_video, screen_h, 400), F_BOOL(settings_video, vsync, 0), F_BOOL(settings_video, fullscreen, 0), F_INT(settings_video, scaling, 0), F_BOOL(settings_video, instant_console, 0), F_BOOL(settings_video, crossfade_on, 1), F_STRING(settings_video, scaler, "Nearest"), F_INT(settings_video, scale_factor, 1), }; const field f_sound[] = { F_STRING(settings_sound, sink, "openal"), F_BOOL(settings_sound, music_mono, 0), F_INT(settings_sound, sound_vol, 5), F_INT(settings_sound, music_vol, 5),