+ Fixes
[opsoft.git] / silentbob / src / opts_kinds.cxx
blobdde87b142aba8e52b562cbae52b8cd574941e89f
1 /*
2 * (c) Oleg Puchinin 2007
3 * graycardinalster@gmail.com
5 */
7 #include <head.h>
8 #include <wit.h>
10 int opts_kinds (DArray * d_opts, int & i)
12 char *S;
13 int argc;
15 if (! d_opts)
16 return 0;
18 argc = d_opts->get_size ();
19 if (EQ (d_opts->get (i), "--kinds")) {
20 if (++i >= argc)
21 return 0;
23 ENV->sb_cmd = cmd_kinds;
24 ENV->d_kinds = 0;
25 S = d_opts->get (i);
26 while (*S) {
27 switch (*S) {
28 case 'a':
29 ENV->d_kinds = 0xFFFF &
30 ~OT::Extern &
31 ~OT::Other &
32 ~OT::Call &
33 ~OT::Macro;
34 break;
35 case 'c':
36 ENV->d_kinds |= OT::Class;
37 break;
38 case 'f':
39 ENV->d_kinds |= OT::Function;
40 break;
41 case 's':
42 ENV->d_kinds |= OT::Struct;
43 break;
45 ++S;
47 return 0;
50 return -1;