v2.c

Mon, 23 May 2011 16:54:56 +0200

author
Mike Becker <universe@uap-core.de>
date
Mon, 23 May 2011 16:54:56 +0200
changeset 2
29ac790c27ad
parent 1
34a5e235d16e
permissions
-rw-r--r--

removed binary files from repository and added hgignore

1
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 #include "v2.h"
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2 #include "include.h"
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
4 int checkArgument(const char* arg, const char* expected) {
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5 int len = strlen(expected);
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
6 int ret = 0;
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8 if (arg[0] == '-') {
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9 if (arg[1] != '-') {
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 for (int t = 0 ; t < len ; t++) {
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
11 ret |= (strchr(arg, expected[t]) > 0) << t;
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 }
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13 }
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 }
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16 return ret;
34a5e235d16e cline version 2
Mike Becker <universe@uap-core.de>
parents:
diff changeset
17 }

mercurial