2 * (c) Oleg Puchinin 2007
3 * graycardinalster@gmail.com
11 #include <gclib/gclib.h>
12 #include <gclib/gclib_c.h>
19 extern "C" DArray
* plugin_init (struct env_t
*env
);
22 char test_plugin_opt (DArray
* d_opts
, int * pos
)
27 if (! d_opts
|| ! pos
)
30 count
= d_opts
->get_size ();
31 S
= d_opts
->get (*pos
);
32 if (EQ (S
, "--test")) {
39 int test_plugin_file (char * fileName
)
46 tt
->loadFile (fileName
);
50 op
= tt
->nextOperator ();
54 // if (tt->bracketDepth)
58 if (m_type
& OT::Class
)
59 globalsPrint (tt
->tt
, tt
->op (), m_type
);
66 char test_plugin_opt2 (DArray
* d_opts
, int * pos
)
71 if (! d_opts
|| ! pos
)
74 S
= d_opts
->get (*pos
);
75 if (EQ (S
, "--test")) {
76 for (i
= 0; i
< ENV
->d_files
->get_size (); ++i
)
77 test_plugin_file (ENV
->d_files
->get (i
));
84 void test_plugin_info ()
86 printf ("Test plugin.\n");
87 printf ("Version: 1.0\n");
88 printf ("options: --test\n");
91 DArray
* plugin_init (struct env_t
*env
)
94 struct mod_feature
* pm
;
98 pm
= CNEW (mod_feature
, 1);
99 memset (pm
, 0, sizeof (mod_feature
));
100 pm
->mod
.Type
= TYPE_FEATURE
;
101 pm
->mod
.Version
= strdup ("1.0");
102 pm
->mod
.short_info
= test_plugin_info
;
103 pm
->opt
= test_plugin_opt
;
104 pm
->opt2
= test_plugin_opt2
;
106 Ret
->add (LPCHAR (pm
));