nobug renamed BUG to FIXME
[mala.git] / program / mala.c
blob2b91e2a8a55e971058ae54204435a9251e03880f
1 /*
2 mala.c - standalone MaLa interpreter
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.
19 #include <assert.h>
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include "mala.h"
23 #include "std.h"
25 mala_actioninit my_actions[] =
27 //MALA_SUBSTITUTE_PARSER("--MALA-VERSION","MaLa 0.2 ("__DATE__" "__TIME__")"),
28 //MALA_SUBSTITUTE_PARSER("-V","--version"),
29 // TODO MALA_EXPAND_PARSER("--version",("--PRINTL", "--MALA-VERSION")),
31 MALA_ACTIONS_END
34 int
35 main(int argc, char * argv[])
37 (void) argc;
38 (void) argv;
40 int ret;
41 MalaEngine my_engine;
43 my_engine = mala_engine_new ();
44 //if (getenv ("MALA_GCTRACE"))
45 // *my_engine->gc_trace = MALA_TRACE;
46 if (getenv ("MALA_TRACE"))
47 my_engine->engine_trace = MALA_TRACE;
49 //mala_module_std_init (my_engine);
50 mala_engine_actions_register (my_engine, my_actions);
52 //TODO mala_engine_ppexpand_define (my_engine, "--COMMANDLINE", argc - 1, argv + 1);
53 // TODO mala_engine_pushback_word (my_engine, "--COMMANDLINE");
54 //mala_engine_run (my_engine);
55 if (my_engine->engine_trace)
57 fprintf (stderr, "%-8s:\n", mala_engine_state_str (my_engine));
59 ret = mala_engine_state_get (my_engine);
60 if (ret > MALA_EFAULT)
62 // mala_engine_dumpprogram (my_engine, stderr, "", " ");
63 putc ('\n', stderr);
65 // else if (! mala_stringlist_is_empty (&my_engine->arguments))
66 // {
67 //mala_engine_dumpargs (my_engine, stdout, "", " ");
68 // putc ('\n', stdout);
69 // }
70 mala_engine_free (my_engine);
71 return ret; // == MALA_SUCCESS ? 0 : ret;
77 // Local Variables:
78 // mode: C
79 // c-file-style: "gnu"
80 // End:
81 // arch-tag: 0aebb81a-80ba-46d5-9738-4af8f3ceffc9
82 // end_of_file