macrodef_parser
[mala.git] / includes / mala.h
blob0d59cd3ac2a87384da37a327592bb5661e4a0316
1 /*
2 mala-glibc.h - declarations for the glibc implementation of MaLa
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.
20 #ifndef MALA_H
21 #define MALA_H
23 #include "engine/mala_types.h"
24 #include "engine/engine.h"
25 #include "engine/action.h"
26 #include "engine/actiondesc.h"
27 #include "engine/strings.h"
28 //#include "engine/mala_types.h"
33 * Macros for parsers
35 /*TODO macros for common parsers MALA_SUBSTITUTE_PARSER("FOO","BAR") etc */
38 #define MALA_CHECK_NOTNEGATED \
39 if (mala_engine_is_negated (eng)) \
40 return mala_engine_exception (eng, pptr, pptr, "--ERROR-NEGATED")
42 #define MALA_CHECK_HASARG \
43 if (llist_get_next ((LList) pptr) == mala_engine_getprogram (eng)) \
44 return mala_engine_exception (eng, pptr, pptr, "--ERROR-MISSINGARG")
46 #define MALA_CHECK_HASARGS(n) \
47 if (llist_distance ((LList) pptr, mala_engine_getprogram (eng)) < n) \
48 return mala_engine_exception (eng, pptr, \
49 llist_get_tail (mala_engine_getprogram (eng)), \
50 "--ERROR-MISSINGARG")
53 #endif
55 // Local Variables:
56 // mode: C
57 // c-file-style: "gnu"
58 // End:
59 // arch-tag: bf4fcf70-efe9-4c6e-baab-629a8e195bc3
60 // end_of_file