underscore expansion
[mala.git] / engine / action.h
blobf9e2923b43890397025700cf35b7776c8a3ada70
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 #define mala_substitute_parser mala_null_parser
27 #define mala_expand_parser mala_null_parser
28 #define mala_macro_parser mala_null_parser
30 struct
31 mala_actioninit_struct
33 const char * command;
34 MalaParserFunc parser;
35 MalaDataDestructor destructor;
36 void *data;
37 const char * brief;
38 const char ** help;
41 #define MALA_ACTIONS_END {NULL,NULL,NULL,NULL,NULL,NULL}
43 struct mala_action_struct
45 MalaString name;
46 MalaParserFunc parser;
47 MalaDataDestructor destructor;
48 void * data;
49 MalaActionDesc desc;
51 MalaAction parent;
52 mala_childstack childs;
53 LIST_ENTRY(mala_action_struct) cldnode;
55 LIST_ENTRY(mala_action_struct) stknode;
59 MalaAction
60 mala_action_new_actioninit (MalaActionInit init, MalaStringBucket bucket);
62 void
63 mala_action_free (MalaAction self);
65 // TODO DELETE void
66 //mala_action_destroy (MalaAction self);
68 int
69 mala_action_attach (MalaAction self);
72 MalaAction
73 mala_action_new (MalaString name, void * data,
74 MalaParserFunc, MalaDataDestructor);
76 MalaAction
77 mala_action_new_brief (MalaActionInit init, MalaAction parent, MalaStringBucket bucket);
79 MalaAction
80 mala_action_new_help (MalaActionInit init, MalaAction parent, MalaStringBucket bucket);
82 int
83 mala_action_execute (MalaAction self, MalaStringListNode pptr, MalaEngine eng);
87 #if 0
90 t_uchar *
91 mala_action_getname (MalaAction self);
94 #endif /*TODO*/
99 #endif /*MALA_ACTION_H*/
101 // Local Variables:
102 // mode: C
103 // c-file-style: "gnu"
104 // End:
105 // arch-tag: d8b425b7-18c1-4dc8-a19b-cdd095873e70
106 // end_of_file