Very old versions for history.
[opsoft_archive.git] / silentbob / silent_bob-1.2 / src / plugins / plugin_c-files.cpp
blob553a7db844bad2c41ce5e4ce8db7ead7a6a92a75
1 /*
2 * (c) Oleg Puchinin 2006
3 * graycardinalster@gmail.com
5 */
7 #include <gclib/gclib.h>
8 #include <sys/wait.h>
9 #include "../mod.h"
10 #include "../head.h"
11 #include "../dbg.h"
13 extern "C" DArray * plugin_init (struct env_t *env);
15 char cfiles_opt (DArray * d_opts, int * pos)
17 char m_buf[512];
18 char * S;
20 if (! d_opts || ! pos)
21 return 0;
23 S = d_opts->get (*pos);
24 if (EQ (S, "--cfiles") ||
25 EQ (S, "-f")) {
26 unlink ("./cfiles");
27 find_cfiles ();
28 sprintf (m_buf, "mv \"%s\" ./cfiles", ENV->tmp_files);
29 system (m_buf);
30 exit (0);
33 return 0;
36 void cfiles_info ()
38 printf ("C/C++ files.\n");
39 printf ("Version: 1.0\n");
40 printf ("options: --cfiles\n");
43 DArray * plugin_init (struct env_t *env)
45 DArray * Ret;
46 struct mod_feature * pm;
48 ENV = env;
49 Ret = new DArray (1);
50 pm = CNEW (mod_feature, 1);
51 memset (pm, 0, sizeof (mod_feature));
52 pm->mod.Type = TYPE_FEATURE;
53 pm->mod.Version = strdup ("1.0");
54 pm->mod.info = cfiles_info;
55 pm->opt = cfiles_opt;
57 Ret->add (LPCHAR (pm));
58 return Ret;