summaryrefslogtreecommitdiff
path: root/src/bin/eolian/legacy_generator.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-20 18:05:45 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-20 18:05:45 +0100
commit54974b074b4031c25947576bcf4809c66d93d858 (patch)
tree4bcaf5012b7b401909c2d3753c8f77b6f54cbb7f /src/bin/eolian/legacy_generator.c
parent378e161cd3e3c9d35ec67842ce878d7e981ad678 (diff)
eolian: remove const_get/const_set support
This was made obsolete by per-accessor values. It was also hacky and i've wanted to remove it for a while.
Diffstat (limited to '')
-rw-r--r--src/bin/eolian/legacy_generator.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c
index b4f31f1270..c65103d816 100644
--- a/src/bin/eolian/legacy_generator.c
+++ b/src/bin/eolian/legacy_generator.c
@@ -54,7 +54,6 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
54 const char *rettype = NULL; 54 const char *rettype = NULL;
55 Eina_Bool var_as_ret = EINA_FALSE; 55 Eina_Bool var_as_ret = EINA_FALSE;
56 Eina_Bool add_star = EINA_FALSE; 56 Eina_Bool add_star = EINA_FALSE;
57 Eina_Bool ret_const = EINA_FALSE;
58 Eina_Bool is_prop = (ftype == EOLIAN_PROP_GET || ftype == EOLIAN_PROP_SET); 57 Eina_Bool is_prop = (ftype == EOLIAN_PROP_GET || ftype == EOLIAN_PROP_SET);
59 Eina_Iterator *itr; 58 Eina_Iterator *itr;
60 void *data, *data2; 59 void *data, *data2;
@@ -78,7 +77,6 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
78 { 77 {
79 rettypet = eolian_parameter_type_get((Eolian_Function_Parameter*)data); 78 rettypet = eolian_parameter_type_get((Eolian_Function_Parameter*)data);
80 var_as_ret = EINA_TRUE; 79 var_as_ret = EINA_TRUE;
81 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
82 } 80 }
83 eina_iterator_free(itr); 81 eina_iterator_free(itr);
84 } 82 }
@@ -124,9 +122,7 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
124 const char *pdesc = eolian_parameter_description_get(param); 122 const char *pdesc = eolian_parameter_description_get(param);
125 leg_param_idx++; 123 leg_param_idx++;
126 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", "); 124 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", ");
127 eina_strbuf_append_printf(fparam, "%s%s %s", 125 eina_strbuf_append_printf(fparam, "%s %s", ptype, pname);
128 eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET)?"const":"",
129 ptype, pname);
130 eina_stringshare_del(ptype); 126 eina_stringshare_del(ptype);
131 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.");
132 if (eolian_parameter_is_nonull((Eolian_Function_Parameter*)data)) 128 if (eolian_parameter_is_nonull((Eolian_Function_Parameter*)data))
@@ -159,8 +155,7 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
159 if (ftype == EOLIAN_PROP_SET) pdir = EOLIAN_IN_PARAM; 155 if (ftype == EOLIAN_PROP_SET) pdir = EOLIAN_IN_PARAM;
160 leg_param_idx++; 156 leg_param_idx++;
161 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", "); 157 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", ");
162 eina_strbuf_append_printf(fparam, "%s%s%s%s%s", 158 eina_strbuf_append_printf(fparam, "%s%s%s%s",
163 eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET)?"const ":"",
164 ptype, had_star?"":" ", add_star?"*":"", pname); 159 ptype, had_star?"":" ", add_star?"*":"", pname);
165 eina_stringshare_del(ptype); 160 eina_stringshare_del(ptype);
166 const char *dir_str = str_dir[(int)pdir]; 161 const char *dir_str = str_dir[(int)pdir];
@@ -186,8 +181,7 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
186 eina_strbuf_replace_all(fbody, "@#params", eina_strbuf_string_get(fparam)); 181 eina_strbuf_replace_all(fbody, "@#params", eina_strbuf_string_get(fparam));
187 eina_strbuf_replace_all(fbody, "@#list_desc_param", eina_strbuf_string_get(descparam)); 182 eina_strbuf_replace_all(fbody, "@#list_desc_param", eina_strbuf_string_get(descparam));
188 eina_strbuf_reset(fparam); 183 eina_strbuf_reset(fparam);
189 eina_strbuf_append_printf(fparam, "%s%s%s", 184 eina_strbuf_append_printf(fparam, "%s%s",
190 ret_const ? "const " : "",
191 rettype ? rettype : "void", 185 rettype ? rettype : "void",
192 rettype && strchr(rettype, '*')?"":" "); 186 rettype && strchr(rettype, '*')?"":" ");
193 eina_strbuf_replace_all(fbody, "@#type_return", eina_strbuf_string_get(fparam)); 187 eina_strbuf_replace_all(fbody, "@#type_return", eina_strbuf_string_get(fparam));
@@ -220,7 +214,6 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
220 const Eolian_Type *rettypet = NULL; 214 const Eolian_Type *rettypet = NULL;
221 const char *rettype = NULL; 215 const char *rettype = NULL;
222 const char *retname = NULL; 216 const char *retname = NULL;
223 Eina_Bool ret_const = EINA_FALSE;
224 Eina_Bool add_star = EINA_FALSE; 217 Eina_Bool add_star = EINA_FALSE;
225 Eina_Bool ret_is_void = EINA_FALSE; 218 Eina_Bool ret_is_void = EINA_FALSE;
226 Eina_Bool is_prop = (ftype == EOLIAN_PROP_GET || ftype == EOLIAN_PROP_SET); 219 Eina_Bool is_prop = (ftype == EOLIAN_PROP_GET || ftype == EOLIAN_PROP_SET);
@@ -250,7 +243,6 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
250 rettypet = eolian_parameter_type_get(param); 243 rettypet = eolian_parameter_type_get(param);
251 retname = eolian_parameter_name_get(param); 244 retname = eolian_parameter_name_get(param);
252 var_as_ret = EINA_TRUE; 245 var_as_ret = EINA_TRUE;
253 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
254 } 246 }
255 eina_iterator_free(itr); 247 eina_iterator_free(itr);
256 } 248 }
@@ -294,9 +286,7 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
294 const char *pname = eolian_parameter_name_get(param); 286 const char *pname = eolian_parameter_name_get(param);
295 const char *ptype = eolian_type_c_type_get(ptypet); 287 const char *ptype = eolian_type_c_type_get(ptypet);
296 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", "); 288 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", ");
297 eina_strbuf_append_printf(fparam, "%s%s %s", 289 eina_strbuf_append_printf(fparam, "%s %s", ptype, pname);
298 eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET)?"const ":"",
299 ptype, pname);
300 eina_stringshare_del(ptype); 290 eina_stringshare_del(ptype);
301 if (eina_strbuf_length_get(eoparam)) eina_strbuf_append(eoparam, ", "); 291 if (eina_strbuf_length_get(eoparam)) eina_strbuf_append(eoparam, ", ");
302 eina_strbuf_append_printf(eoparam, "%s", pname); 292 eina_strbuf_append_printf(eoparam, "%s", pname);
@@ -315,8 +305,7 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
315 Eina_Bool had_star = !!strchr(ptype, '*'); 305 Eina_Bool had_star = !!strchr(ptype, '*');
316 if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM); 306 if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM);
317 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", "); 307 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", ");
318 eina_strbuf_append_printf(fparam, "%s%s%s%s%s", 308 eina_strbuf_append_printf(fparam, "%s%s%s%s",
319 eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET)?"const ":"",
320 ptype, had_star?"":" ", add_star?"*":"", pname); 309 ptype, had_star?"":" ", add_star?"*":"", pname);
321 eina_stringshare_del(ptype); 310 eina_stringshare_del(ptype);
322 if (eina_strbuf_length_get(eoparam)) eina_strbuf_append(eoparam, ", "); 311 if (eina_strbuf_length_get(eoparam)) eina_strbuf_append(eoparam, ", ");
@@ -329,7 +318,7 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
329 if (rettype && (!ret_is_void)) 318 if (rettype && (!ret_is_void))
330 { 319 {
331 char tmp_ret_str[0xFF]; 320 char tmp_ret_str[0xFF];
332 sprintf (tmp_ret_str, "%s%s", ret_const?"const ":"", rettype); 321 sprintf (tmp_ret_str, "%s", rettype);
333 const Eolian_Expression *default_ret_val = 322 const Eolian_Expression *default_ret_val =
334 eolian_function_return_default_value_get(funcid, ftype); 323 eolian_function_return_default_value_get(funcid, ftype);
335 const char *val_str = NULL; 324 const char *val_str = NULL;
@@ -341,8 +330,8 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
341 val_str = eolian_expression_value_to_literal(&val); 330 val_str = eolian_expression_value_to_literal(&val);
342 } 331 }
343 Eina_Bool had_star = !!strchr(rettype, '*'); 332 Eina_Bool had_star = !!strchr(rettype, '*');
344 sprintf (tmpstr, " %s%s%s%s = %s;\n", 333 sprintf (tmpstr, " %s%s%s = %s;\n",
345 ret_const?"const ":"", rettype, had_star?"":" ", retname, 334 rettype, had_star?"":" ", retname,
346 val_str?val_str:"0"); 335 val_str?val_str:"0");
347 336
348 eina_strbuf_replace_all(fbody, "@#ret_type", tmp_ret_str); 337 eina_strbuf_replace_all(fbody, "@#ret_type", tmp_ret_str);