envsubst fixed
[mala.git] / includes / mala-impl.h
blobd6d6a444789f5eaf4259c9c583119182dd8734a7
1 /*
2 mala-impl.h - private declarations for 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_IMPL_H
21 #define MALA_IMPL_H
24 MALA_TYPES(mala_actiondict, MalaActionDict);
25 //MALA_TYPES(mala_action, MalaAction);
27 struct mala_engine_struct
29 llist program;
30 llist arguments;
31 MalaActionDict actions;
33 const char * argv_0;
35 int negated:1;
37 int state;
40 struct mala_action_struct
42 t_uchar * name;
43 MalaParseFunc parser;
44 MalaDataDestructor destructor;
45 void *data;
46 llist stknode;
47 llist childs;
48 llist cldnode;
53 * llist memory stuff
55 LList
56 mala_llistnode_malloc (void);
60 * abstraction of strings
63 * Lists of strings
66 int
67 mala_strlist_pushback_cstrings (LList self, int count, const char ** strs);
69 int
70 mala_strlist_pushfront_cstrings (LList self, int count, const char ** strs);
72 LList
73 mala_strlist_erase_strings (LList self);
75 void
76 mala_strlist_delete_string (LList self);
78 void
79 mala_strlist_substitute_string (LList self, const t_uchar* newstr);
81 int
82 mala_strlist_insert_before (LList self, const char * str);
84 int
85 mala_strlist_insert_after_cat2 (LList self, const char * str1, const char * str2);
89 * Sorted/Stacked set of MalaActions
91 MalaActionDict
92 mala_actiondict_new (void);
94 void
95 mala_actiondict_destroy (MalaActionDict self);
97 int
98 mala_actiondict_push (MalaActionDict self, MalaAction data);
100 void
101 mala_actiondict_destroy_action (MalaActionDict self, MalaAction action);
103 LList
104 mala_actiondict_lookup (MalaActionDict self, const t_uchar * key);
106 MalaAction
107 mala_actiondict_lookupaction (MalaActionDict self, const t_uchar * key);
109 MalaAction
110 mala_actiondict_lookupprevaction (MalaActionDict self, const t_uchar * key);
114 * Mala engine
116 MalaEngine
117 mala_engine_malloc (void);
119 MalaEngine
120 mala_engine_new (void);
127 TODO delete
128 MalaAction
129 mala_action_malloc (void);
131 MalaAction
132 mala_action_new_actioninit (MalaActionInit);
134 MalaAction
135 mala_action_new_brief (MalaActionInit, MalaAction parent);
137 MalaAction
138 mala_action_new_help (MalaActionInit, MalaAction parent);
140 MalaAction
141 mala_action_new (t_uchar ** name, void ** data,
142 MalaParseFunc, MalaDataDestructor);
145 mala_action_destroy (MalaAction self);
148 mala_action_execute (MalaAction self, LList pptr, MalaEngine eng);
150 t_uchar *
151 mala_action_getname (MalaAction self);
155 #endif /*MALA_IMPL_H*/
158 // Local Variables:
159 // mode: C
160 // c-file-style: "gnu"
161 // End:
162 // arch-tag: 3bca0ae4-0d5d-4f87-8957-158e4017ea44
163 // end_of_file