summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-29 16:44:10 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-29 16:44:36 +0100
commit8dc8d6873d6a5807239e5d9434635b0d216508de (patch)
tree105df4ac30efcd0fda64f2dc2f9de8f78b419bdf /src/bin
parent79083ed3afd273ca1aaa65b5c237f380095e38c5 (diff)
eolian/generator: clean up comment gen
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian/eo_generator.c14
-rw-r--r--src/bin/eolian/legacy_generator.c6
2 files changed, 8 insertions, 12 deletions
diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index 6f86a3cd32..cb8a612e22 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -61,12 +61,8 @@ EAPI const Eo_Class *@#klasstype_get(void) EINA_CONST;\n\
61static const char 61static const char
62tmpl_eo_funcdef_doxygen[] = "\ 62tmpl_eo_funcdef_doxygen[] = "\
63/**\n\ 63/**\n\
64 *\n\
65@#desc\n\ 64@#desc\n\
66 *\n\
67@#list_desc_param\ 65@#list_desc_param\
68@#ret_desc\
69 *\n\
70 */\n"; 66 */\n";
71 67
72static const char 68static const char
@@ -142,8 +138,6 @@ eo_fundef_generate(const Eolian_Class *class, const Eolian_Function *func, Eolia
142 138
143 Eina_Strbuf *str_par = eina_strbuf_new(); 139 Eina_Strbuf *str_par = eina_strbuf_new();
144 Eina_Strbuf *str_pardesc = eina_strbuf_new(); 140 Eina_Strbuf *str_pardesc = eina_strbuf_new();
145 Eina_Strbuf *str_retdesc = eina_strbuf_new();
146 Eina_Strbuf *str_typecheck = eina_strbuf_new();
147 141
148 itr = eolian_property_keys_get(func, ftype); 142 itr = eolian_property_keys_get(func, ftype);
149 EINA_ITERATOR_FOREACH(itr, data) 143 EINA_ITERATOR_FOREACH(itr, data)
@@ -154,6 +148,8 @@ eo_fundef_generate(const Eolian_Class *class, const Eolian_Function *func, Eolia
154 const char *ptype = eolian_type_c_type_get(ptypet); 148 const char *ptype = eolian_type_c_type_get(ptypet);
155 const char *pdesc = eolian_parameter_description_get(param); 149 const char *pdesc = eolian_parameter_description_get(param);
156 150
151 if (!eina_strbuf_length_get(str_pardesc))
152 eina_strbuf_append(str_pardesc, " *\n");
157 eina_strbuf_append_printf(str_pardesc, tmpl_eo_pardesc, "in", pname, pdesc?pdesc:"No description supplied."); 153 eina_strbuf_append_printf(str_pardesc, tmpl_eo_pardesc, "in", pname, pdesc?pdesc:"No description supplied.");
158 154
159 if (eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, ", "); 155 if (eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, ", ");
@@ -185,6 +181,8 @@ eo_fundef_generate(const Eolian_Class *class, const Eolian_Function *func, Eolia
185 181
186 const char *dir_str = str_dir[(int)pdir]; 182 const char *dir_str = str_dir[(int)pdir];
187 183
184 if (!eina_strbuf_length_get(str_pardesc))
185 eina_strbuf_append(str_pardesc, " *\n");
188 eina_strbuf_append_printf(str_pardesc, tmpl_eo_pardesc, dir_str, pname, pdesc?pdesc:"No description supplied."); 186 eina_strbuf_append_printf(str_pardesc, tmpl_eo_pardesc, dir_str, pname, pdesc?pdesc:"No description supplied.");
189 187
190 if (eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, ", "); 188 if (eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, ", ");
@@ -208,16 +206,12 @@ eo_fundef_generate(const Eolian_Class *class, const Eolian_Function *func, Eolia
208 if (!eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, "void"); 206 if (!eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, "void");
209 eina_strbuf_replace_all(str_func, "@#full_params", eina_strbuf_string_get(str_par)); 207 eina_strbuf_replace_all(str_func, "@#full_params", eina_strbuf_string_get(str_par));
210 eina_strbuf_replace_all(str_func, "@#list_desc_param", eina_strbuf_string_get(str_pardesc)); 208 eina_strbuf_replace_all(str_func, "@#list_desc_param", eina_strbuf_string_get(str_pardesc));
211 eina_strbuf_replace_all(str_func, "@#ret_desc", eina_strbuf_string_get(str_retdesc));
212 eina_strbuf_replace_all(str_func, "@#list_typecheck", eina_strbuf_string_get(str_typecheck));
213 209
214 if (rettype) eina_stringshare_del(rettype); 210 if (rettype) eina_stringshare_del(rettype);
215 211
216 free(tmpstr); 212 free(tmpstr);
217 eina_strbuf_free(str_par); 213 eina_strbuf_free(str_par);
218 eina_strbuf_free(str_retdesc);
219 eina_strbuf_free(str_pardesc); 214 eina_strbuf_free(str_pardesc);
220 eina_strbuf_free(str_typecheck);
221 215
222 eina_strbuf_append(functext, eina_strbuf_string_get(str_func)); 216 eina_strbuf_append(functext, eina_strbuf_string_get(str_func));
223 eina_strbuf_free(str_func); 217 eina_strbuf_free(str_func);
diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c
index c65103d816..ea6cfb409e 100644
--- a/src/bin/eolian/legacy_generator.c
+++ b/src/bin/eolian/legacy_generator.c
@@ -15,9 +15,7 @@ static _eolian_class_vars class_env;
15static const char 15static const char
16tmpl_eapi_funcdef[] = "\n\ 16tmpl_eapi_funcdef[] = "\n\
17/**\n\ 17/**\n\
18 *\n\
19@#desc\n\ 18@#desc\n\
20 *\n\
21@#list_desc_param\ 19@#list_desc_param\
22 */\n\ 20 */\n\
23EAPI @#type_return%s(@#params)@#flags;\n\ 21EAPI @#type_return%s(@#params)@#flags;\n\
@@ -124,6 +122,8 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
124 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", "); 122 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", ");
125 eina_strbuf_append_printf(fparam, "%s %s", ptype, pname); 123 eina_strbuf_append_printf(fparam, "%s %s", ptype, pname);
126 eina_stringshare_del(ptype); 124 eina_stringshare_del(ptype);
125 if (!eina_strbuf_length_get(descparam))
126 eina_strbuf_append(descparam, " *\n");
127 eina_strbuf_append_printf(descparam, " * @param[in] %s %s\n", pname, pdesc?pdesc:"No description supplied."); 127 eina_strbuf_append_printf(descparam, " * @param[in] %s %s\n", pname, pdesc?pdesc:"No description supplied.");
128 if (eolian_parameter_is_nonull((Eolian_Function_Parameter*)data)) 128 if (eolian_parameter_is_nonull((Eolian_Function_Parameter*)data))
129 { 129 {
@@ -159,6 +159,8 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
159 ptype, had_star?"":" ", add_star?"*":"", pname); 159 ptype, had_star?"":" ", add_star?"*":"", pname);
160 eina_stringshare_del(ptype); 160 eina_stringshare_del(ptype);
161 const char *dir_str = str_dir[(int)pdir]; 161 const char *dir_str = str_dir[(int)pdir];
162 if (!eina_strbuf_length_get(descparam))
163 eina_strbuf_append(descparam, " *\n");
162 eina_strbuf_append_printf(descparam, " * @param[%s] %s %s\n", dir_str, pname, pdesc?pdesc:"No description supplied."); 164 eina_strbuf_append_printf(descparam, " * @param[%s] %s %s\n", dir_str, pname, pdesc?pdesc:"No description supplied.");
163 if (eolian_parameter_is_nonull((Eolian_Function_Parameter*)data)) 165 if (eolian_parameter_is_nonull((Eolian_Function_Parameter*)data))
164 { 166 {