summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian/types_generator.c55
1 files changed, 15 insertions, 40 deletions
diff --git a/src/bin/eolian/types_generator.c b/src/bin/eolian/types_generator.c
index 96811b7eaa..d18a0df6d6 100644
--- a/src/bin/eolian/types_generator.c
+++ b/src/bin/eolian/types_generator.c
@@ -159,55 +159,30 @@ _type_generate(const Eolian_Type *tp, Eina_Bool full)
159Eina_Bool 159Eina_Bool
160types_header_generate(const char *eo_filename, Eina_Strbuf *buf, Eina_Bool full) 160types_header_generate(const char *eo_filename, Eina_Strbuf *buf, Eina_Bool full)
161{ 161{
162 const Eolian_Type *tp; 162 const Eolian_Declaration *decl;
163 163
164 /* Generation of typedefs */ 164 Eina_Iterator *itr = eolian_declarations_get_by_file(eo_filename);
165 Eina_Iterator *itr = eolian_type_aliases_get_by_file(eo_filename); 165 EINA_ITERATOR_FOREACH(itr, decl)
166 EINA_ITERATOR_FOREACH(itr, tp)
167 { 166 {
168 if (eolian_type_is_extern(tp)) 167 Eolian_Declaration_Type dt = eolian_declaration_type_get(decl);
168 if (dt != EOLIAN_DECL_ALIAS &&
169 dt != EOLIAN_DECL_STRUCT &&
170 dt != EOLIAN_DECL_ENUM)
169 continue; 171 continue;
170 Eina_Strbuf *type_buf = _type_generate(tp, full);
171 if (type_buf)
172 {
173 eina_strbuf_append(buf, eina_strbuf_string_get(type_buf));
174 eina_strbuf_append(buf, ";\n\n");
175 eina_strbuf_free(type_buf);
176 }
177 }
178 eina_iterator_free(itr);
179 172
180 /* Generation of structs */ 173 if (dt == EOLIAN_DECL_ENUM && !full)
181 itr = eolian_type_structs_get_by_file(eo_filename);
182 EINA_ITERATOR_FOREACH(itr, tp)
183 {
184 if (eolian_type_is_extern(tp))
185 continue; 174 continue;
186 Eina_Strbuf *type_buf = _type_generate(tp, full);
187 if (type_buf)
188 {
189 eina_strbuf_append(buf, eina_strbuf_string_get(type_buf));
190 eina_strbuf_append(buf, ";\n\n");
191 eina_strbuf_free(type_buf);
192 }
193 }
194 eina_iterator_free(itr);
195 175
196 if (!full) 176 const Eolian_Type *tp = eolian_declaration_data_type_get(decl);
197 return EINA_TRUE; 177 if (!tp || eolian_type_is_extern(tp))
198
199 /* Generation of enums */
200 itr = eolian_type_enums_get_by_file(eo_filename);
201 EINA_ITERATOR_FOREACH(itr, tp)
202 {
203 if (eolian_type_is_extern(tp))
204 continue; 178 continue;
205 Eina_Strbuf *type_buf = _type_generate(tp, EINA_TRUE); 179
206 if (type_buf) 180 Eina_Strbuf *tbuf = _type_generate(tp, full);
181 if (tbuf)
207 { 182 {
208 eina_strbuf_append(buf, eina_strbuf_string_get(type_buf)); 183 eina_strbuf_append(buf, eina_strbuf_string_get(tbuf));
209 eina_strbuf_append(buf, ";\n\n"); 184 eina_strbuf_append(buf, ";\n\n");
210 eina_strbuf_free(type_buf); 185 eina_strbuf_free(tbuf);
211 } 186 }
212 } 187 }
213 eina_iterator_free(itr); 188 eina_iterator_free(itr);