2 * (c) Oleg Puchinin 2007
3 * graycardinalster@gmail.com
11 #include <gclib/gclib.h>
12 #include <gclib/gclib_c.h>
17 extern "C" DArray
* plugin_init (struct env_t
*env
);
20 char simple_plugin_opt (DArray
* d_opts
, int * pos
)
25 if (! d_opts
|| ! pos
)
28 count
= d_opts
->get_size ();
29 S
= d_opts
->get (*pos
);
30 if (EQ (S
, "--simple_plugin")) {
31 if (++(*pos
) >= count
)
32 return 0; // Missed argument for option "--simple-plugin".
39 char simple_plugin_opt2 (DArray
* d_opts
, int * pos
)
43 if (! d_opts
|| ! pos
)
46 S
= d_opts
->get (*pos
);
47 if (EQ (S
, "--simple_plugin")) {
48 // Do somethings at stage two.
54 void simple_plugin_info ()
56 printf ("Simple plugin.\n");
57 printf ("Version: 1.0\n");
58 printf ("options: --simple-plugin\n");
61 DArray
* plugin_init (struct env_t
*env
)
64 struct mod_feature
* pm
;
68 pm
= CNEW (mod_feature
, 1);
69 memset (pm
, 0, sizeof (mod_feature
));
70 pm
->mod
.Type
= TYPE_FEATURE
;
71 pm
->mod
.Version
= strdup ("1.0");
72 pm
->mod
.info
= simple_plugin_info
;
73 pm
->opt
= simple_plugin_opt
;
74 pm
->opt2
= simple_plugin_opt2
;
76 Ret
->add (LPCHAR (pm
));