diff options
author | cnlohr <lohr85@gmail.com> | 2018-06-23 14:18:26 -0400 |
---|---|---|
committer | cnlohr <lohr85@gmail.com> | 2018-06-23 14:18:26 -0400 |
commit | 1dea63123ca6735cee354f3eeae69e2e62d61e3b (patch) | |
tree | a93f86d0f33ad91b4c34f975b55ae54415e8f6c1 /include | |
parent | 87b6229f6fc4e434b9472e6c7722e40497ac97a1 (diff) | |
parent | 5329e026dfb52f904965b687a717cc4c24f2cd8c (diff) | |
download | libsurvive-1dea63123ca6735cee354f3eeae69e2e62d61e3b.tar.gz libsurvive-1dea63123ca6735cee354f3eeae69e2e62d61e3b.tar.bz2 |
Merge branch 'new_config_system'
Diffstat (limited to 'include')
-rw-r--r-- | include/libsurvive/survive.h | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/include/libsurvive/survive.h b/include/libsurvive/survive.h index 831113d..ed439cb 100644 --- a/include/libsurvive/survive.h +++ b/include/libsurvive/survive.h @@ -234,10 +234,6 @@ struct SurviveContext { struct config_group *global_config_values; struct config_group *lh_config; // lighthouse configs struct config_group *temporary_config_values; // Set per-session, from command-line. Not saved but override global_config_values - - //shorthand configs for the non-function-call syntax config variables. - //It helps with self-documentation, too. Indexes into this are determined by `static_configs` - union { int i; FLT f; const char * s; } shorthand_configs[MAX_SHORTHAND_CONFIGS]; }; SURVIVE_EXPORT void survive_verify_FLT_size( @@ -291,18 +287,14 @@ SURVIVE_EXPORT FLT survive_configf(SurviveContext *ctx, const char *tag, char fl SURVIVE_EXPORT uint32_t survive_configi(SurviveContext *ctx, const char *tag, char flags, uint32_t def); SURVIVE_EXPORT const char *survive_configs(SurviveContext *ctx, const char *tag, char flags, const char *def); -#define STATIC_CONFIG_ITEM_I( variable, name, description, default_value ) static int variable; \ - SURVIVE_EXPORT_CONSTRUCTOR void REGISTER##variable() { survive_config_bind_variable( 'i', &variable, name, description, default_value ); } -#define GCONFIGI( variable ) (ctx->shorthand_configs[variable].i) - -#define STATIC_CONFIG_ITEM_F( variable, name, description, default_value ) static int variable; \ - SURVIVE_EXPORT_CONSTRUCTOR void REGISTER##variable() { survive_config_bind_variable( 'f', &variable, name, description, default_value ); } -#define GCONFIGF( variable ) (ctx->shorthand_configs[variable].f) - -#define STATIC_CONFIG_ITEM_S( variable, name, description, default_value ) static int variable; \ - SURVIVE_EXPORT_CONSTRUCTOR void REGISTER##variable() { survive_config_bind_variable( 's', &variable, name, description, default_value ); } -#define GCONFIGS( variable ) (ctx->shorthand_configs[variable].s) +SURVIVE_EXPORT void survive_attach_configi(SurviveContext *ctx, const char *tag, int * var ); +SURVIVE_EXPORT void survive_attach_configf(SurviveContext *ctx, const char *tag, FLT * var ); +SURVIVE_EXPORT void survive_attach_configs(SurviveContext *ctx, const char *tag, char * var ); +SURVIVE_EXPORT void survive_detach_config(SurviveContext *ctx, const char *tag, void * var ); +#define STATIC_CONFIG_ITEM( variable, name, type, description, default_value ) \ + SURVIVE_EXPORT_CONSTRUCTOR void REGISTER##variable() { survive_config_bind_variable( type, name, description, default_value ); } + void survive_config_bind_variable( char vt, const char * name, const char * description, ... ); //Only used at boot. // Install the calibrator. SURVIVE_EXPORT void survive_cal_install(SurviveContext *ctx); // XXX This will be removed if not already done so. |