Sun, 06 Nov 2011 20:12:55 +0100
replaced stricmp with strcasecmp to stay standard compliant
10 | 1 | /* |
2 | * arguments.c | |
3 | * | |
4 | * Created on: 15.09.2011 | |
20
43725438ac50
Changed author comments + added signatures for upcomming bfile heuristics
Mike Becker <universe@uap-core.de>
parents:
10
diff
changeset
|
5 | * Author: Mike |
10 | 6 | */ |
7 | ||
8 | #include "arguments.h" | |
9 | ||
10 | int checkArgument(const char* arg, const char* expected) { | |
11 | int len = strlen(expected); | |
12 | int ret = 0; | |
13 | ||
14 | if (arg[0] == '-') { | |
15 | if (arg[1] != '-') { | |
16 | for (int t = 0 ; t < len ; t++) { | |
17 | ret |= (strchr(arg, expected[t]) > 0) << t; | |
18 | } | |
19 | } | |
20 | } | |
21 | ||
22 | return ret; | |
23 | } | |
24 | ||
25 | bool registerArgument(int* reg, int mask) { | |
26 | bool ret = (*reg & mask) > 0; | |
27 | *reg |= mask; | |
28 | return ret; | |
29 | } |