Very old versions for history.
[opsoft_archive.git] / silentbob / silent_bob-1.2 / src / opts_globals.cpp
blob09c7a7044ea3ece9164dd8f69817ac6ab4a6310e
1 /*
2 * (c) Oleg Puchinin 2006
3 * graycardinalster@gmail.com
5 */
7 #include "head.h"
8 #include "wit.h"
10 int opts_globals (DArray * d_opts, int & i, int * i_cmd)
12 int old_cmd = *i_cmd;
14 if (! i_cmd)
15 return -1;
17 *i_cmd = cmd_globals;
18 if (EQ (d_opts->get (i), "--globals")) {
19 ENV->d_global_type = GLOBAL_TYPE_TYPEDEF |
20 GLOBAL_TYPE_VARIABLE |
21 GLOBAL_TYPE_STRUCT |
22 GLOBAL_TYPE_FUNCTION |
23 GLOBAL_TYPE_DEFINE |
24 GLOBAL_TYPE_CLASS |
25 GLOBAL_TYPE_NAMESPACE;
26 } else if (EQ (d_opts->get (i), "--globals-typedef"))
27 ENV->d_global_type = GLOBAL_TYPE_TYPEDEF;
28 else if (EQ (d_opts->get (i), "--globals-extern"))
29 ENV->d_global_type = GLOBAL_TYPE_EXTERN;
30 else if (EQ (d_opts->get (i), "--globals-function"))
31 ENV->d_global_type = GLOBAL_TYPE_FUNCTION;
32 else if (EQ (d_opts->get (i), "--globals-struct"))
33 ENV->d_global_type = GLOBAL_TYPE_STRUCT;
34 else if (EQ (d_opts->get (i), "--globals-variable"))
35 ENV->d_global_type = GLOBAL_TYPE_VARIABLE;
36 else if (EQ (d_opts->get (i), "--globals-define"))
37 ENV->d_global_type = GLOBAL_TYPE_DEFINE;
38 else {
39 *i_cmd = old_cmd;
40 return -1;
43 return 0;