sleep_parser
[mala.git] / includes / mala.h
blobd0cec35934ca1db25e6521e2743002cbd8c237ac
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 */
37 #define MALA_PARSER(n,p,f,d,m) {n, (MalaParserFunc)p, (MalaDataFactory)f, d, m}
39 #define MALA_CHECK_NOTNEGATED \
40 if (mala_engine_is_negated (eng)) \
41 return mala_engine_exception (eng, pptr, pptr, "--ERROR-NEGATED")
43 #define MALA_CHECK_HASARG \
44 if (llist_get_next ((LList) pptr) == mala_engine_getprogram (eng)) \
45 return mala_engine_exception (eng, pptr, pptr, "--ERROR-MISSINGARG")
47 #define MALA_CHECK_HASARGS(n) \
48 if (llist_distance ((LList) pptr, mala_engine_getprogram (eng)) < n) \
49 return mala_engine_exception (eng, pptr, \
50 llist_get_tail (mala_engine_getprogram (eng)), \
51 "--ERROR-MISSINGARG")
54 #endif
56 // Local Variables:
57 // mode: C
58 // c-file-style: "gnu"
59 // End:
60 // arch-tag: bf4fcf70-efe9-4c6e-baab-629a8e195bc3
61 // end_of_file