Eina_Bool add_star = EINA_FALSE;
Eolian_Parameter_Dir pdir;
eolian_parameter_information_get((Eolian_Function_Parameter)data, &pdir, &ptype, &pname, &pdesc);
- Eina_Bool is_const = eolian_parameter_get_const_attribute_get(data);
+ Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == GET);
if (ftype == GET) {
add_star = EINA_TRUE;
pdir = EOLIAN_OUT_PARAM;
void* data = eina_list_data_get(l);
eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &rettype, &retname, NULL);
var_as_ret = EINA_TRUE;
- ret_const = eolian_parameter_get_const_attribute_get(data);
+ ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
}
}
}
const char *pname;
const char *ptype;
eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &ptype, &pname, NULL);
- Eina_Bool is_const = eolian_parameter_get_const_attribute_get(data);
+ Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == GET);
eina_strbuf_append_printf(va_args, " %s%s %s = va_arg(*list, %s%s);\n",
ftype == GET && is_const?"const ":"", ptype, pname,
ftype == GET && is_const?"const ":"", _varg_upgr(ptype));
eina_strbuf_append_printf(params, ", %s", pname);
eina_strbuf_append_printf(full_params, ", %s%s %s",
- ftype == GET && eolian_parameter_get_const_attribute_get(data)?"const ":"",
+ ftype == GET && eolian_parameter_const_attribute_get(data, ftype == GET)?"const ":"",
ptype, pname);
}
if (!var_as_ret)
const char *ptype;
Eolian_Parameter_Dir pdir;
eolian_parameter_information_get((Eolian_Function_Parameter)data, &pdir, &ptype, &pname, NULL);
- Eina_Bool is_const = eolian_parameter_get_const_attribute_get(data);
+ Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == GET);
Eina_Bool had_star = !!strchr(ptype, '*');
if (ftype == UNRESOLVED || ftype == METHOD_FUNC) add_star = (pdir == EOLIAN_OUT_PARAM);
eina_strbuf_append_printf(va_args, " %s%s%s%s%s = va_arg(*list, %s%s%s%s);\n",
- ftype == GET && is_const?"const ":"", ptype, had_star?"":" ", add_star?"*":"", pname,
- ftype == GET && is_const?"const ":"", add_star ? ptype : _varg_upgr(ptype), !had_star && add_star?" ":"", add_star?"*":"");
+ is_const?"const ":"", ptype, had_star?"":" ", add_star?"*":"", pname,
+ is_const?"const ":"", add_star ? ptype : _varg_upgr(ptype), !had_star && add_star?" ":"", add_star?"*":"");
eina_strbuf_append_printf(params, ", %s", pname);
eina_strbuf_append_printf(full_params, ", %s%s%s%s%s",
- ftype == GET && eolian_parameter_get_const_attribute_get(data)?"const ":"",
+ is_const?"const ":"",
ptype, had_star?"":" ", add_star?"*":"", pname);
}
}
eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &ptype, &pname, &pdesc);
leg_param_idx++;
eina_strbuf_append_printf(fparam, ", %s%s %s",
- eolian_parameter_get_const_attribute_get(data)?"const":"",
+ eolian_parameter_const_attribute_get(data, ftype == GET)?"const":"",
ptype, pname);
eina_strbuf_append_printf(descparam, " * @param[in] %s %s\n", pname, pdesc?pdesc:"No description supplied.");
if (eolian_parameter_is_nonull((Eolian_Function_Parameter)data))
if (ftype == SET) pdir = EOLIAN_IN_PARAM;
leg_param_idx++;
eina_strbuf_append_printf(fparam, ", %s%s%s%s%s",
- eolian_parameter_get_const_attribute_get(data)?"const":"",
+ eolian_parameter_const_attribute_get(data, ftype == GET)?"const":"",
ptype, had_star?"":" ", add_star?"*":"", pname);
const char *dir_str = str_dir[(int)pdir];
eina_strbuf_append_printf(descparam, " * @param[%s] %s %s\n", dir_str, pname, pdesc?pdesc:"No description supplied.");
void* data = eina_list_data_get(l);
eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &rettype, &retname, NULL);
var_as_ret = EINA_TRUE;
- ret_const = eolian_parameter_get_const_attribute_get(data);
+ ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
}
}
}
const char *ptype;
eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &ptype, &pname, NULL);
eina_strbuf_append_printf(fparam, ", %s%s %s",
- ftype == GET && eolian_parameter_get_const_attribute_get(data)?"const ":"",
+ eolian_parameter_const_attribute_get(data, ftype == GET)?"const ":"",
ptype, pname);
if (eina_strbuf_length_get(eoparam)) eina_strbuf_append(eoparam, ", ");
eina_strbuf_append_printf(eoparam, "%s", pname);
Eina_Bool had_star = !!strchr(ptype, '*');
if (ftype == UNRESOLVED || ftype == METHOD_FUNC) add_star = (pdir == EOLIAN_OUT_PARAM);
eina_strbuf_append_printf(fparam, ", %s%s%s%s%s",
- ftype == GET && eolian_parameter_get_const_attribute_get(data)?"const ":"",
+ eolian_parameter_const_attribute_get(data, ftype == GET)?"const ":"",
ptype, had_star?"":" ", add_star?"*":"", pname);
if (eina_strbuf_length_get(eoparam)) eina_strbuf_append(eoparam, ", ");
eina_strbuf_append_printf(eoparam, "%s", pname);
* parameter in the get operation.
*
* @param[in] param_desc parameter handle
+ * @param[in] is_get indicates if the information needed is for get or set.
* @return EINA_TRUE if const in get, EINA_FALSE otherwise
*
* @ingroup Eolian
*/
-EAPI Eina_Bool eolian_parameter_get_const_attribute_get(Eolian_Function_Parameter param_desc);
+EAPI Eina_Bool eolian_parameter_const_attribute_get(Eolian_Function_Parameter param_desc, Eina_Bool is_get);
/*
* @brief Indicates if a parameter cannot be NULL.
accessor->comment);
Eo_Accessor_Param *acc_param;
Eina_List *m2;
- /* Only in get access, we check const attribute */
- if (accessor->type == GETTER)
+ EINA_LIST_FOREACH(accessor->params, m2, acc_param)
{
- EINA_LIST_FOREACH(accessor->params, m2, acc_param)
+ Eolian_Function_Parameter desc = eolian_function_parameter_get(foo_id, acc_param->name);
+ if (!desc)
{
- Eolian_Function_Parameter desc = eolian_function_parameter_get(foo_id, acc_param->name);
- if (!desc)
- {
- printf("Error - %s not known as parameter of property %s\n", acc_param->name, prop->name);
- }
- else
- if (strstr(acc_param->attrs, "const"))
- {
- database_parameter_get_const_attribute_set(desc, EINA_TRUE);
- }
+ printf("Error - %s not known as parameter of property %s\n", acc_param->name, prop->name);
}
+ else
+ if (strstr(acc_param->attrs, "const"))
+ {
+ database_parameter_const_attribute_set(desc, accessor->type == GETTER, EINA_TRUE);
+ }
}
}
database_class_function_add(kls->name, foo_id);
accessor->comment);
Eo_Accessor_Param *acc_param;
Eina_List *m2;
- /* Only in get access, we check const attribute */
- if (accessor->type == GETTER)
+ EINA_LIST_FOREACH(accessor->params, m2, acc_param)
{
- EINA_LIST_FOREACH(accessor->params, m2, acc_param)
+ Eolian_Function_Parameter desc = eolian_function_parameter_get(foo_id, acc_param->name);
+ if (!desc)
{
- Eolian_Function_Parameter desc = eolian_function_parameter_get(foo_id, acc_param->name);
- if (!desc)
- {
- printf("Error - %s not known as parameter of property %s\n", acc_param->name, prop->name);
- }
- else
- if (strstr(acc_param->attrs, "const"))
- {
- database_parameter_get_const_attribute_set(desc, EINA_TRUE);
- }
+ printf("Error - %s not known as parameter of property %s\n", acc_param->name, prop->name);
}
+ else
+ if (strstr(acc_param->attrs, "const"))
+ {
+ database_parameter_const_attribute_set(desc, accessor->type == GETTER, EINA_TRUE);
+ }
}
}
database_class_function_add(kls->name, foo_id);
Eina_Stringshare *type;
Eina_Stringshare *description;
Eolian_Parameter_Dir param_dir;
- Eina_Bool is_const :1; /* True if const in this function (e.g get) but not const in the opposite one (e.g set) */
+ Eina_Bool is_const_on_get :1; /* True if const in this the get property */
+ Eina_Bool is_const_on_set :1; /* True if const in this the set property */
Eina_Bool nonull :1; /* True if this argument cannot be NULL */
Eina_Bool own :1; /* True if the ownership of this argument passes to the caller/callee */
} _Parameter_Desc;
}
void
-database_parameter_get_const_attribute_set(Eolian_Function_Parameter param_desc, Eina_Bool is_const)
+database_parameter_const_attribute_set(Eolian_Function_Parameter param_desc, Eina_Bool is_get, Eina_Bool is_const)
{
_Parameter_Desc *param = (_Parameter_Desc *)param_desc;
EINA_SAFETY_ON_NULL_RETURN(param);
- param->is_const = is_const;
+ if (is_get)
+ param->is_const_on_get = is_const;
+ else
+ param->is_const_on_set = is_const;
}
EAPI Eina_Bool
-eolian_parameter_get_const_attribute_get(Eolian_Function_Parameter param_desc)
+eolian_parameter_const_attribute_get(Eolian_Function_Parameter param_desc, Eina_Bool is_get)
{
_Parameter_Desc *param = (_Parameter_Desc *)param_desc;
EINA_SAFETY_ON_NULL_RETURN_VAL(param, EINA_FALSE);
- return param->is_const;
+ if (is_get)
+ return param->is_const_on_get;
+ else
+ return param->is_const_on_set;
}
void
/* Add a parameter to a method */
Eolian_Function_Parameter database_method_parameter_add(Eolian_Function foo_id, Eolian_Parameter_Dir param_dir, const char *type, const char *name, const char *description);
-void database_parameter_get_const_attribute_set(Eolian_Function_Parameter param_desc, Eina_Bool is_const);
+void database_parameter_const_attribute_set(Eolian_Function_Parameter param_desc, Eina_Bool is_get, Eina_Bool is_const);
void database_parameter_nonull_set(Eolian_Function_Parameter, Eina_Bool nonull);