summaryrefslogtreecommitdiffstats
path: root/src/opt.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-05 03:15:53 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-05 03:15:53 +0000
commit9922cef1af71786ae788903b52a8968e5775d510 (patch)
treebadf23fc2701946b61df1d15227736783e44a754 /src/opt.c
parenta21deef1c62467b21500f94dfb2ab3d58e69cb85 (diff)
downloadlibrcc-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.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;