Very old versions for history.
[opsoft_archive.git] / silentbob / silentbob-1.1 / src / plugins / plugin_c-files.cpp
blob46e11c35a524d60ce476e24425d5e696113e444b
1 /*
2 * (c) Oleg Puchinin 2006
3 * graycardinalster@gmail.com
5 */
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <unistd.h>
10 #include <fcntl.h>
11 #include <dlib.h>
12 #include <sys/wait.h>
13 #include "../mod.h"
14 #include "../head.h"
15 #include "../dbg.h"
17 extern "C" DArray * plugin_init (struct env_t *env);
19 void find_one_ext (char * ext)
21 sblib_find ("./", ext, "./cfiles");
24 char cfiles_opt (DArray * d_opts, int * pos)
26 char * S;
28 if (! d_opts || ! pos)
29 return 0;
31 S = d_opts->get (*pos);
32 if (EQ (S, "--cfiles")) {
33 find_one_ext ("*.c");
34 find_one_ext ("*.h");
35 find_one_ext ("*.cpp");
36 find_one_ext ("*.cc");
37 find_one_ext ("*.cxx");
38 exit (0);
41 return 0;
44 void cfiles_info ()
46 printf ("C/C++ files.\n");
47 printf ("Version: 1.0\n");
48 printf ("options: --cfiles\n");
51 DArray * plugin_init (struct env_t *env)
53 DArray * Ret;
54 struct mod_feature * pm;
56 ENV = env;
57 Ret = new DArray (1);
58 pm = CNEW (mod_feature, 1);
59 bzero (pm, sizeof (mod_feature));
60 pm->mod.Type = TYPE_FEATURE;
61 pm->mod.Version = strdup ("1.0");
62 pm->mod.info = cfiles_info;
63 pm->opt = cfiles_opt;
65 Ret->add (LPCHAR (pm));
66 return Ret;