diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-07-05 03:15:53 +0000 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-07-05 03:15:53 +0000 |
commit | 9922cef1af71786ae788903b52a8968e5775d510 (patch) | |
tree | badf23fc2701946b61df1d15227736783e44a754 /src/opt.c | |
parent | a21deef1c62467b21500f94dfb2ab3d58e69cb85 (diff) | |
download | librcc-9922cef1af71786ae788903b52a8968e5775d510.tar.gz librcc-9922cef1af71786ae788903b52a8968e5775d510.tar.bz2 librcc-9922cef1af71786ae788903b52a8968e5775d510.tar.xz librcc-9922cef1af71786ae788903b52a8968e5775d510.zip |
Save / Load
Diffstat (limited to 'src/opt.c')
-rw-r--r-- | src/opt.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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; |