2 * (c) Oleg Puchinin 2006
3 * graycardinalster@gmail.com
7 #include <gclib/gclib.h>
13 extern "C" DArray
* plugin_init (struct env_t
*env
);
16 void __do_aap_program (char * pr_name
)
22 d_files
= ENV
->d_files
;
23 if (! d_files
|| d_files
->get_size () <= 0)
26 count
= d_files
->get_size ();
30 printf ("CFLAGS=-O3 -Wall -pipe\n");
31 printf ("CXXFLAGS=$CFLAGS\n");
33 printf (":program %s : %s\n", pr_name
, d_files
->get (i
));
35 for (i
= 1; i
< count
; ++i
)
36 printf ("\t%s\n", d_files
->get (i
));
41 char aap_program_opt2 (DArray
* d_opts
, int * pos
)
47 if (! d_opts
|| ! pos
)
50 count
= d_opts
->get_size ();
51 S
= d_opts
->get (*pos
);
52 if (EQ (S
, "--aap-program")) {
53 if (++(*pos
) >= count
)
55 S
= d_opts
->get (*pos
);
61 if (EQ (S
, "--aap-vars")) {
69 char aap_program_opt (DArray
* d_opts
, int * pos
)
74 if (! d_opts
|| ! pos
)
77 count
= d_opts
->get_size ();
78 S
= d_opts
->get (*pos
);
79 if (EQ (S
, "--aap-program")) {
80 if (++(*pos
) >= count
)
87 void aap_program_info ()
89 printf ("AAP file.\n");
90 printf ("Version: 1.0\n");
91 printf ("options: --aap-program --aap-vars\n");
94 DArray
* plugin_init (struct env_t
*env
)
96 struct mod_feature
* pm
;
100 Ret
= new DArray (1);
101 pm
= CNEW (mod_feature
, 1);
102 memset (pm
, 0, sizeof (mod_feature
));
103 pm
->mod
.Type
= TYPE_FEATURE
;
104 pm
->mod
.Version
= strdup ("0.1");
105 pm
->mod
.info
= aap_program_info
;
106 pm
->opt
= aap_program_opt
;
107 pm
->opt2
= aap_program_opt2
;
109 Ret
->add (LPCHAR (pm
));