new stdmodule file layout
[mala.git] / engine / action.h
blob8f1fff430dcf7f3afd8f159ad1123547241e3258
1 /*
2 action.h - MaLa action handler
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_ACTION_H
21 #define MALA_ACTION_H
23 #include <sys/queue.h>
24 #include "mala_types.h"
26 struct
27 mala_actioninit_struct
29 const char * command;
30 MalaParserFunc parser;
31 MalaDataFactory factory;
32 void *data;
33 const char * parent;
36 #define MALA_ACTIONS_END {NULL,NULL,NULL,NULL,NULL}
38 struct mala_action_struct
40 MalaString name;
41 MalaParserFunc parser;
42 MalaDataFactory factory;
43 void * data;
44 MalaActionDesc desc;
46 MalaAction parent;
47 mala_childstack childs;
48 LIST_ENTRY(mala_action_struct) cldnode;
50 LIST_ENTRY(mala_action_struct) stknode;
54 MalaAction
55 mala_action_new_actioninit (MalaActionInit init, MalaStringBucket bucket);
57 void
58 mala_action_free (MalaAction self);
60 // TODO DELETE void
61 //mala_action_destroy (MalaAction self);
63 int
64 mala_action_attach (MalaAction self);
67 MalaAction
68 mala_action_new (MalaString name,
69 void * data,
70 MalaParserFunc parser,
71 MalaDataFactory factory,
72 MalaAction parent);
74 MalaAction
75 mala_action_get_cstr (MalaStringBucket bucket, const char*parent);
77 int
78 mala_action_execute (MalaAction self, MalaStringListNode_ref pptr, MalaEngine eng);
82 #if 0
85 t_uchar *
86 mala_action_getname (MalaAction self);
89 #endif /*TODO*/
94 #endif /*MALA_ACTION_H*/
96 // Local Variables:
97 // mode: C
98 // c-file-style: "gnu"
99 // End:
100 // arch-tag: d8b425b7-18c1-4dc8-a19b-cdd095873e70
101 // end_of_file