summaryrefslogtreecommitdiffstats
path: root/src/opt.c
blob: 85960df43a674ce6c7660187251e29d2cbc4cec0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>

#include "internal.h"
#include "opt.h"

rcc_option_value rccGetOption(rcc_context ctx, rcc_option option) {
    if ((!ctx)||(option<0)||(option>=RCC_MAX_OPTIONS)) return -1;
    
    return ctx->options[option];
}

int rccSetOption(rcc_context ctx, rcc_option option, rcc_option_value value) {
    if ((!ctx)||(option>=RCC_MAX_OPTIONS)) return -1;

    if (ctx->options[option] != value) {
	ctx->configure = 1;
	ctx->options[option]=value;
    }
    
    return 0;
}