summaryrefslogtreecommitdiffstats
path: root/src/opt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/opt.c')
-rw-r--r--src/opt.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/opt.c b/src/opt.c
index 85960df..82e1be1 100644
--- a/src/opt.c
+++ b/src/opt.c
@@ -9,9 +9,32 @@ rcc_option_value rccGetOption(rcc_context ctx, rcc_option option) {
return ctx->options[option];
}
+int rccOptionIsDefault(rcc_context ctx, rcc_option option) {
+ if ((!ctx)||(option<0)||(option>=RCC_MAX_OPTIONS)) return -1;
+
+ return ctx->default_options[option];
+}
+
int rccSetOption(rcc_context ctx, rcc_option option, rcc_option_value value) {
if ((!ctx)||(option>=RCC_MAX_OPTIONS)) return -1;
+ ctx->default_options[option] = 0;
+
+ if (ctx->options[option] != value) {
+ ctx->configure = 1;
+ ctx->options[option]=value;
+ }
+
+ return 0;
+}
+
+int rccOptionSetDefault(rcc_context ctx, rcc_option option) {
+ rcc_option_value value;
+ if ((!ctx)||(option>=RCC_MAX_OPTIONS)) return -1;
+
+ ctx->default_options[option] = 1;
+ value = rccGetOptionDefaultValue(option);
+
if (ctx->options[option] != value) {
ctx->configure = 1;
ctx->options[option]=value;