2 * (c) Oleg Puchinin 2006
3 * graycardinalster@gmail.com
9 #include <temp_names.h>
11 #define SB_IMMUNE_FILE ".silent_bob/silent_bob_immune"
12 const char * c_ops
[] = { "if", "else", "do", "while",
13 "switch", "case", "for", "return", NULL
};
18 sprintf (m_buf
, "%s/.silent_bob", ENV
->home_dir
);
20 sprintf (m_buf
, "%s/.silent_bob/plugins", ENV
->home_dir
);
22 ENV
->home_plugins
= strdup (m_buf
);
23 ENV
->shared_plugins
= strdup ("/usr/lib/silent_bob/");
28 char * sb_immune_path
= CNEW (char, 256);
31 stdout_vbuf
= CNEW (char, 4096 * 100);
32 setvbuf (stdout
, stdout_vbuf
, _IOFBF
, 4096*100);
35 memset (ENV
, 0, sizeof (env_t
));
37 ENV
->d_cops
= new EArray(10);
38 ENV
->d_cops
->push ((char **) c_ops
);
42 ENV
->d_tags_file
= NULL
;
43 ENV
->immune_list
= NULL
;
47 ENV
->home_dir
= getenv ("HOME");
48 ENV
->tmp_files
= CNEW (char, strlen (ENV
->home_dir
) + strlen (TMPNAME_FILES
) + 20);
49 sprintf (ENV
->tmp_files
, "%s/.silent_bob/%s", ENV
->home_dir
, TMPNAME_FILES
);
50 ENV
->tmp_tags
= CNEW (char, strlen (ENV
->home_dir
) + strlen (TMPNAME_TAGS
) + 20);
51 sprintf (ENV
->tmp_tags
, "%s/.silent_bob/%s", ENV
->home_dir
, TMPNAME_TAGS
);
52 ENV
->debug_file
= (char *) "/tmp/silent_bob.log";
55 sprintf (sb_immune_path
, "%s/.silent_bob/%s", getenv ("HOME"), SB_IMMUNE_FILE
);
57 ENV
->immune_list
= new EArray
;
58 ENV
->immune_list
->from_file (sb_immune_path
);
59 ENV
->immune_list
->foreach ((Dfunc_t
) chomp
);
60 ENV
->full_list
= new EArray
;
61 ENV
->settings
= new EHash
;
63 ENV
->d_stream_dbg
= fopen ("/dev/null", "w");
66 ENV
->proc_list
= new DJobs
;
67 ENV
->listOptions
= new EList
;
68 ENV
->language
= strdup ("C");