diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-07-06 15:42:04 +0000 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-07-06 15:42:04 +0000 |
commit | 232dbc756390d30a86ae6de0cc84600eddb1c0b2 (patch) | |
tree | e4aadbb4076392bcaf30cce6329dc715375a98d7 /src/opt.c | |
parent | 550bda3e54a0895e027fee14860f14171a357ac9 (diff) | |
download | librcc-232dbc756390d30a86ae6de0cc84600eddb1c0b2.tar.gz librcc-232dbc756390d30a86ae6de0cc84600eddb1c0b2.tar.bz2 librcc-232dbc756390d30a86ae6de0cc84600eddb1c0b2.tar.xz librcc-232dbc756390d30a86ae6de0cc84600eddb1c0b2.zip |
Recode FS Fixes
Diffstat (limited to 'src/opt.c')
-rw-r--r-- | src/opt.c | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -4,19 +4,31 @@ #include "opt.h" rcc_option_value rccGetOption(rcc_context ctx, rcc_option option) { - if ((!ctx)||(option<0)||(option>=RCC_MAX_OPTIONS)) return -1; + if (!ctx) { + if (rcc_default_ctx) ctx = rcc_default_ctx; + else return (rcc_option_value)0; + } + if ((option<0)||(option>=RCC_MAX_OPTIONS)) return 0; return ctx->options[option]; } int rccOptionIsDefault(rcc_context ctx, rcc_option option) { - if ((!ctx)||(option<0)||(option>=RCC_MAX_OPTIONS)) return -1; + if (!ctx) { + if (rcc_default_ctx) ctx = rcc_default_ctx; + else return -1; + } + if ((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; + if (!ctx) { + if (rcc_default_ctx) ctx = rcc_default_ctx; + else return -1; + } + if ((option<0)||(option>=RCC_MAX_OPTIONS)) return -1; ctx->default_options[option] = 0; @@ -30,7 +42,12 @@ int rccSetOption(rcc_context ctx, rcc_option option, rcc_option_value value) { int rccOptionSetDefault(rcc_context ctx, rcc_option option) { rcc_option_value value; - if ((!ctx)||(option>=RCC_MAX_OPTIONS)) return -1; + + if (!ctx) { + if (rcc_default_ctx) ctx = rcc_default_ctx; + else return -1; + } + if ((option<0)||(option>=RCC_MAX_OPTIONS)) return -1; ctx->default_options[option] = 1; value = rccGetOptionDefaultValue(option); |