2 test-mala_stdmodule.c - MaLa stdandard module test suite
4 Copyright (C) 2004, Christian Thaeter <chth@gmx.net>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as
8 published by the Free Software Foundation.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, contact me.
24 #define MALA_SUBSTITUTE_PARSER(a,b) {a,mala_substitute_parser,NULL,b,NULL,NULL}
26 mala_actioninit my_actions
[] =
28 MALA_SUBSTITUTE_PARSER("--FLAG-NUMSPLIT-EXPANSION","--TRUE"),
29 MALA_SUBSTITUTE_PARSER("--FLAG-EXCLAM-EXPANSION","--TRUE"),
30 MALA_SUBSTITUTE_PARSER("--FLAG-NO-EXPANSION","--TRUE"),
31 MALA_SUBSTITUTE_PARSER("--FLAG-ASSIGN-EXPANSION","--TRUE"),
32 MALA_SUBSTITUTE_PARSER("--FLAG-ENVVAR-EXPANSION","--TRUE"),
33 MALA_SUBSTITUTE_PARSER("--FLAG-CHAR-EXPANSION","--TRUE"),
34 MALA_SUBSTITUTE_PARSER("--FLAG-UNDERSCORE-EXPANSION","--TRUE"),
35 //MALA_SUBSTITUTE_PARSER("--FLAG-NUMSPLIT-EXPANSION","--TRUE"),
36 //MALA_SUBSTITUTE_PARSER("--FLAG-NUMSPLIT-EXPANSION","--TRUE"),
40 mala_substitute_parser
,
44 (const char*[]){"help",NULL
},
49 mala_substitute_parser
,
53 (const char*[]){"help",NULL
},
59 main(int argc
, char * argv
[])
62 my_engine
= mala_engine_new_main (0, argc
, argv
, my_actions
);
65 my_engine
= mala_engine_new_main (mala_stdmodule_init
, argc
, argv
, 0);
68 mala_engine_run (my_engine
);
70 mala_engine_dumpargs (my_engine
, "arg: ", "\n");
71 mala_engine_dumpprogram (my_engine
, "prg: ", "\n");
73 printf ("variable: %s\n", getenv ("variable"));
74 printf ("negated: %d\n", mala_engine_negated (my_engine
));
75 printf ("state: %d\n", mala_engine_state_get (my_engine
));
77 MALA_DEBUG("freeing engine");
78 mala_engine_free (my_engine
);
87 // c-file-style: "gnu"
89 // arch-tag: 56bcc0c2-d247-4a47-95dc-a460f26a444b