aboutsummaryrefslogtreecommitdiff
path: root/include/libsurvive/survive.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libsurvive/survive.h')
-rw-r--r--include/libsurvive/survive.h22
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.