From 9922cef1af71786ae788903b52a8968e5775d510 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Tue, 5 Jul 2005 03:15:53 +0000 Subject: Save / Load --- src/opt.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/opt.c') 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; -- cgit v1.2.3