2 * (c) Oleg Puchinin 2006
3 * graycardinalster@gmail.com
11 #include <gclib/gclib.h>
15 #include "../the_tt.h"
16 #include "the_fly.hpp"
18 extern "C" DArray
* plugin_init (struct env_t
*env
);
19 char t_op2 (char ** d_in
, char ** d_prev
);
21 void __perl_files (char * f_name
)
24 sblib_find ("./", "*.pm", f_name
);
25 sblib_find ("./", "*.pl", f_name
);
26 sblib_find ("./", "*.ph", f_name
);
29 void plpkg_one (struct tt_state_t
* tt
)
31 char * d_out
, *d_ptr
; // for t_op2
40 ch
= t_op2 (&d_ptr
, &d_out
);
48 if (! block_depth
&& !strncmp (S
, "package ", 8))
66 struct tt_state_t
* tt
;
69 d_files
= ENV
->d_files
;
70 if (d_files
->get_size () == 0) {
71 __perl_files (ENV
->tmp_files
);
72 d_files
->from_file (ENV
->tmp_files
);
73 d_files
->foreach ((Dfunc_t
)chomp
);
74 unlink (ENV
->tmp_files
);
77 for (i
= 0; i
< d_files
->get_size (); i
++) {
78 tt
= CNEW (tt_state_t
, 1);
80 memset (tt
, 0, sizeof (struct tt_state_t
));
81 if (! d_files
->get (i
))
84 tt
->d_file_name
= strdup (d_files
->get (i
));
85 THE_FLY::fly_for_file (tt
);
91 char pl_opt (DArray
* d_opts
, int * i
)
96 if (EQ (d_opts
->get (*i
), "--packages")) {
97 if (EQ (ENV
->language
, "Perl")) {
108 printf ("Perl packages.\n");
109 printf ("Version: 1.0\n");
110 printf ("options: --perl --packages\n");
113 DArray
* plugin_init (struct env_t
* env
)
116 struct mod_feature
* pm
;
119 Ret
= new DArray (32);
120 pm
= CNEW (mod_feature
, 1);
121 memset (pm
, 0, sizeof (mod_feature
));
122 pm
->mod
.Type
= TYPE_FEATURE
;
123 pm
->mod
.Version
= strdup ("1.0");
124 pm
->mod
.info
= plug_info
;
127 Ret
->add (LPCHAR (pm
));