2 stringbucket.h - MaLa stringbuckets
4 Copyright (C) 2004, 2005, 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 #include "mala_globals.c" // only extern declarations when included from here
30 /* the first codes are the states of the MaLa VM and never returned from the engine*/ \
31 MALA_STATE(SUCCESS), /* last comand returned true */ \
32 MALA_STATE(FAILURE), /* last comand returned false */ \
33 MALA_STATE(LITERAL), /* dont evaluate argument */ \
34 MALA_STATE(LIST), /* evaluated to a list */ \
35 MALA_STATE(MACRO), /* evaluated to a macro */ \
36 MALA_STATE(CONTINUE), /* command not fully evaluated yet */ \
37 MALA_STATE(START), /* start of the statemachine, nothing evaluated yet */ \
38 MALA_STATE(EXCEPTION), /* some error occured (in MaLa code) */ \
39 MALA_STATE(REMOVE), /* no sideeffects remove arguments */ \
41 MALA_STATE(EFAULT), /* beyond are runtime errors */ \
42 MALA_STATE(ENOACTION), /* no action found, exception falltrough */ \
43 MALA_STATE(EACTIONUSED), /* action has childs or is linked to an engine */ \
44 MALA_STATE(ESYNTAX), /* Syntax error in expansion */ \
45 MALA_STATE(EINCOMPLETE), /* interrupted in interactive mode */ \
47 MALA_STATE(EFATAL), /* beyond are fatal errors */ \
48 MALA_STATE(EINIT), /* initialization didnt complete */ \
49 MALA_STATE(EALLOC), /* memory allocation problem */ \
50 MALA_STATE(ENOENV), /* no environment space left */ \
51 MALA_STATE(EPARSER), /* parser wrong or missing */ \
53 MALA_STATE(EINVALID), /* something is really wrong */ \
54 MALA_STATE(STATE_TABLE_SIZEOF)
57 #define MALA_STATE(s) MALA_##s
64 typedef enum mala_state_enum mala_state
;
69 MALA_NOTRACE
, // traceing off
70 MALA_TRACESOME
, // tracing only important things
71 MALA_TRACE
, // normal traceing
72 MALA_TRACEALL
// trace details
75 typedef enum mala_trace_enum mala_trace
;
77 enum mala_action_datatype_enum
81 MALA_DATA_STRINGPOINTER
,
85 typedef enum mala_action_datatype_enum mala_action_datatype
;
90 * datastructure and handle declarations
92 #define MALA_TYPEDEFS(name,Handle) \
93 typedef struct mala_##name##_struct mala_##name;\
94 typedef const mala_##name * const_Mala##Handle;\
95 typedef mala_##name * Mala##Handle;\
96 typedef mala_##name ** Mala##Handle##_ref;\
97 typedef const mala_##name ** const_Mala##Handle##_ref
99 MALA_TYPEDEFS(actioninit
,ActionInit
);
100 MALA_TYPEDEFS(action
,Action
);
101 MALA_TYPEDEFS(string
,String
);
102 MALA_TYPEDEFS(stringbucket
,StringBucket
);
103 MALA_TYPEDEFS(stringbucketnode
,StringBucketNode
);
104 MALA_TYPEDEFS(engine
,Engine
);
105 MALA_TYPEDEFS(program
,Program
);
106 MALA_TYPEDEFS(actiondesc
,ActionDesc
);
107 MALA_TYPEDEFS(stringlist
,StringList
);
110 typedef int (*MalaPredicate
) (void* value
, void * constraint
);
111 typedef int (*MalaParserFunc
) (MalaProgram prg
);
113 //int (*MalaEngineInit) (MalaEngine self);
115 #define MALA_MUTATOR_BEGIN if (mala_program_state_get (prg) != MALA_REMOVE)
116 #define MALA_MUTATOR_END
118 #define MALA_PARSER_DEFINE(name) int mala_##name##_parser (MalaProgram prg)
121 #endif /* MALA_TYPES_H */
126 // c-file-style: "gnu"
128 // arch-tag: ee20274c-3a62-4022-a312-59572f1ffdb9