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
};
24 sprintf (m_buf
, "%s/.silent_bob", ENV
->home_dir
);
26 sprintf (m_buf
, "%s/.silent_bob/plugins", ENV
->home_dir
);
28 ENV
->home_plugins
= strdup (m_buf
);
29 ENV
->shared_plugins
= strdup ("/usr/lib/silent_bob/");
34 char * sb_immune_path
= CNEW (char, 256);
37 stdout_vbuf
= CNEW (char, 4096 * 100);
38 setvbuf (stdout
, stdout_vbuf
, _IOFBF
, 4096*100);
41 memset (ENV
, 0, sizeof (env_t
));
43 ENV
->d_cops
= new EArray(10);
44 ENV
->d_cops
->push ((char **) c_ops
);
48 ENV
->d_tags_file
= NULL
;
49 ENV
->immune_list
= NULL
;
53 ENV
->home_dir
= getenv ("HOME");
54 ENV
->tmp_files
= CNEW (char, strlen (ENV
->home_dir
) + strlen (TMPNAME_FILES
) + 20);
55 sprintf (ENV
->tmp_files
, "%s/.silent_bob/%s", ENV
->home_dir
, TMPNAME_FILES
);
56 ENV
->tmp_tags
= CNEW (char, strlen (ENV
->home_dir
) + strlen (TMPNAME_TAGS
) + 20);
57 sprintf (ENV
->tmp_tags
, "%s/.silent_bob/%s", ENV
->home_dir
, TMPNAME_TAGS
);
58 ENV
->debug_file
= (char *) "/tmp/silent_bob.log";
61 sprintf (sb_immune_path
, "%s/.silent_bob/%s", getenv ("HOME"), SB_IMMUNE_FILE
);
63 ENV
->immune_list
= new EArray
;
64 ENV
->immune_list
->from_file (sb_immune_path
);
65 ENV
->immune_list
->foreach ((Dfunc_t
) chomp
);
66 ENV
->full_list
= new EArray
;
67 ENV
->settings
= new EHash
;
69 ENV
->d_stream_dbg
= fopen ("/dev/null", "w");
72 ENV
->proc_list
= new DJobs
;
73 ENV
->listOptions
= new EList
;
74 ENV
->language
= strdup ("C");