summaryrefslogtreecommitdiff
path: root/src
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
parent79083ed3afd273ca1aaa65b5c237f380095e38c5 (diff)
eolian/generator: clean up comment gen
Diffstat (limited to 'src')
-rw-r--r--src/bin/eolian/eo_generator.c14
-rw-r--r--src/bin/eolian/legacy_generator.c6
-rw-r--r--src/tests/eolian/data/class_simple_ref_eo.h12
-rw-r--r--src/tests/eolian/data/class_simple_ref_legacy.h7
-rw-r--r--src/tests/eolian/data/struct_ref.c2
-rw-r--r--src/tests/eolian/data/typedef_ref.c2
6 files changed, 8 insertions, 35 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 {
diff --git a/src/tests/eolian/data/class_simple_ref_eo.h b/src/tests/eolian/data/class_simple_ref_eo.h
index 56d9d7636e..79562668b9 100644
--- a/src/tests/eolian/data/class_simple_ref_eo.h
+++ b/src/tests/eolian/data/class_simple_ref_eo.h
@@ -22,55 +22,43 @@ EAPI const Eo_Class *class_simple_class_get(void) EINA_CONST;
22 22
23#ifdef CLASS_SIMPLE_BETA 23#ifdef CLASS_SIMPLE_BETA
24/** 24/**
25 *
26 * Common desc for a 25 * Common desc for a
27 * comment a.set 26 * comment a.set
28 * 27 *
29 * @param[in] value Value description 28 * @param[in] value Value description
30 *
31 */ 29 */
32EOAPI Eina_Bool evas_obj_simple_a_set(int value); 30EOAPI Eina_Bool evas_obj_simple_a_set(int value);
33#endif 31#endif
34 32
35#ifdef CLASS_SIMPLE_BETA 33#ifdef CLASS_SIMPLE_BETA
36/** 34/**
37 *
38 * Common desc for a 35 * Common desc for a
39 * 36 *
40 *
41 *
42 */ 37 */
43EOAPI int evas_obj_simple_a_get(void); 38EOAPI int evas_obj_simple_a_get(void);
44#endif 39#endif
45 40
46/** 41/**
47 *
48 * No description supplied. 42 * No description supplied.
49 *
50 *
51 */ 43 */
52EOAPI void evas_obj_simple_b_set(void); 44EOAPI void evas_obj_simple_b_set(void);
53 45
54#ifdef CLASS_SIMPLE_BETA 46#ifdef CLASS_SIMPLE_BETA
55/** 47/**
56 *
57 * comment foo 48 * comment foo
58 * 49 *
59 * 50 *
60 * @param[in] a a 51 * @param[in] a a
61 * @param[inout] b No description supplied. 52 * @param[inout] b No description supplied.
62 * @param[out] c No description supplied. 53 * @param[out] c No description supplied.
63 *
64 */ 54 */
65EOAPI char * evas_obj_simple_foo(int a, char *b, double *c); 55EOAPI char * evas_obj_simple_foo(int a, char *b, double *c);
66#endif 56#endif
67 57
68/** 58/**
69 *
70 * No description supplied. 59 * No description supplied.
71 * 60 *
72 * @param[in] x No description supplied. 61 * @param[in] x No description supplied.
73 *
74 */ 62 */
75EOAPI int evas_obj_simple_bar(int x); 63EOAPI int evas_obj_simple_bar(int x);
76 64
diff --git a/src/tests/eolian/data/class_simple_ref_legacy.h b/src/tests/eolian/data/class_simple_ref_legacy.h
index 176b3ed60f..91096998f4 100644
--- a/src/tests/eolian/data/class_simple_ref_legacy.h
+++ b/src/tests/eolian/data/class_simple_ref_legacy.h
@@ -18,7 +18,6 @@ typedef Eo Class_Simple;
18 */ 18 */
19 19
20/** 20/**
21 *
22 * Common desc for a 21 * Common desc for a
23 * comment a.set 22 * comment a.set
24 * 23 *
@@ -27,22 +26,17 @@ typedef Eo Class_Simple;
27EAPI Eina_Bool evas_object_simple_a_set(Class_Simple *obj, int value); 26EAPI Eina_Bool evas_object_simple_a_set(Class_Simple *obj, int value);
28 27
29/** 28/**
30 *
31 * Common desc for a 29 * Common desc for a
32 * 30 *
33 *
34 */ 31 */
35EAPI int evas_object_simple_a_get(const Class_Simple *obj); 32EAPI int evas_object_simple_a_get(const Class_Simple *obj);
36 33
37/** 34/**
38 *
39 * No description supplied. 35 * No description supplied.
40 *
41 */ 36 */
42EAPI void evas_object_simple_b_set(Class_Simple *obj); 37EAPI void evas_object_simple_b_set(Class_Simple *obj);
43 38
44/** 39/**
45 *
46 * comment foo 40 * comment foo
47 * 41 *
48 * 42 *
@@ -53,7 +47,6 @@ EAPI void evas_object_simple_b_set(Class_Simple *obj);
53EAPI char *evas_object_simple_foo(Class_Simple *obj, int a, char *b, double *c); 47EAPI char *evas_object_simple_foo(Class_Simple *obj, int a, char *b, double *c);
54 48
55/** 49/**
56 *
57 * No description supplied. 50 * No description supplied.
58 * 51 *
59 * @param[in] x No description supplied. 52 * @param[in] x No description supplied.
diff --git a/src/tests/eolian/data/struct_ref.c b/src/tests/eolian/data/struct_ref.c
index 8598ec2358..455d60ac6f 100644
--- a/src/tests/eolian/data/struct_ref.c
+++ b/src/tests/eolian/data/struct_ref.c
@@ -31,11 +31,9 @@ typedef struct _Opaque Opaque;
31EAPI const Eo_Class *struct_class_get(void) EINA_CONST; 31EAPI const Eo_Class *struct_class_get(void) EINA_CONST;
32 32
33/** 33/**
34 *
35 * No description supplied. 34 * No description supplied.
36 * 35 *
37 * @param[in] idx No description supplied. 36 * @param[in] idx No description supplied.
38 *
39 */ 37 */
40EOAPI char * struct_foo(int idx); 38EOAPI char * struct_foo(int idx);
41 39
diff --git a/src/tests/eolian/data/typedef_ref.c b/src/tests/eolian/data/typedef_ref.c
index 791d221cba..6749991eed 100644
--- a/src/tests/eolian/data/typedef_ref.c
+++ b/src/tests/eolian/data/typedef_ref.c
@@ -38,11 +38,9 @@ typedef enum
38EAPI const Eo_Class *typedef_class_get(void) EINA_CONST; 38EAPI const Eo_Class *typedef_class_get(void) EINA_CONST;
39 39
40/** 40/**
41 *
42 * No description supplied. 41 * No description supplied.
43 * 42 *
44 * @param[in] idx No description supplied. 43 * @param[in] idx No description supplied.
45 *
46 */ 44 */
47EOAPI char * typedef_foo(int idx); 45EOAPI char * typedef_foo(int idx);
48 46