summaryrefslogtreecommitdiff
path: root/src/bin/eolian/eo1_generator.c
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-04-03 16:20:58 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-04-10 05:55:16 +0300
commit87776ff0fa79f6c62dc7d2208f5c5d651c7afdcc (patch)
tree3b86b17d730a2b92330ea9cf182de695b3bb3d18 /src/bin/eolian/eo1_generator.c
parentbbba6a20b4e321165f9efb6878ac3247869d4ebe (diff)
Eolian: add support for functions scope.
This patch adds support for protected functions. In the .eo file, the scope (public by default) has to be added before the function name e.g: protected foo ... To access the protected APIs, #define (CLASS)_PROTECTED is needed e.g: #define ELM_BUTTON_PROTECTED
Diffstat (limited to '')
-rw-r--r--src/bin/eolian/eo1_generator.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/bin/eolian/eo1_generator.c b/src/bin/eolian/eo1_generator.c
index a4d95685e5..669125b1cf 100644
--- a/src/bin/eolian/eo1_generator.c
+++ b/src/bin/eolian/eo1_generator.c
@@ -113,7 +113,7 @@ static const char
113tmpl_eo_subid_apnd[] = " @#EOPREFIX_SUB_ID_@#FUNC,\n"; 113tmpl_eo_subid_apnd[] = " @#EOPREFIX_SUB_ID_@#FUNC,\n";
114 114
115static const char 115static const char
116tmpl_eo_funcdef_doxygen[] = "\n\ 116tmpl_eo_funcdef_doxygen[] = "\
117/**\n\ 117/**\n\
118 * @def @#eoprefix_@#func\n\ 118 * @def @#eoprefix_@#func\n\
119 *\n\ 119 *\n\
@@ -163,6 +163,7 @@ eo1_fundef_generate(const char *classname, Eolian_Function func, Eolian_Function
163 Eina_Bool var_as_ret = EINA_FALSE; 163 Eina_Bool var_as_ret = EINA_FALSE;
164 const char *rettype = NULL; 164 const char *rettype = NULL;
165 Eina_Bool ret_const = EINA_FALSE; 165 Eina_Bool ret_const = EINA_FALSE;
166 Eolian_Function_Scope scope = eolian_function_scope_get(func);
166 167
167 char *fsuffix = ""; 168 char *fsuffix = "";
168 rettype = eolian_function_return_type_get(func, ftype); 169 rettype = eolian_function_return_type_get(func, ftype);
@@ -189,12 +190,17 @@ eo1_fundef_generate(const char *classname, Eolian_Function func, Eolian_Function
189 const char *funcdesc = eolian_function_description_get(func, descname); 190 const char *funcdesc = eolian_function_description_get(func, descname);
190 191
191 Eina_Strbuf *str_func = eina_strbuf_new(); 192 Eina_Strbuf *str_func = eina_strbuf_new();
192 _template_fill(str_func, tmpl_eo_funcdef_doxygen, classname, funcname, EINA_TRUE); 193 if (scope == EOLIAN_SCOPE_PROTECTED)
194 eina_strbuf_append_printf(str_func, "#ifdef %s_PROTECTED\n", capclass);
195 _template_fill(str_func, tmpl_eo_funcdef_doxygen, classname, funcname, EINA_FALSE);
193#ifndef EO 196#ifndef EO
194 _template_fill(str_func, tmpl_eo1_funcdef, classname, funcname, EINA_FALSE); 197 _template_fill(str_func, tmpl_eo1_funcdef, classname, funcname, EINA_FALSE);
195#else 198#else
196 _template_fill(str_func, tmpl_eo_funcdef, classname, funcname, EINA_FALSE); 199 _template_fill(str_func, tmpl_eo_funcdef, classname, funcname, EINA_FALSE);
200 if (scope == EOLIAN_SCOPE_PROTECTED)
201 eina_strbuf_append_printf(str_func, "#endif\n");
197#endif 202#endif
203 eina_strbuf_append_printf(str_func, "\n");
198 204
199 eina_strbuf_replace_all(str_func, "@#EOPREFIX", current_eo_prefix_upper); 205 eina_strbuf_replace_all(str_func, "@#EOPREFIX", current_eo_prefix_upper);
200 eina_strbuf_replace_all(str_func, "@#eoprefix", current_eo_prefix_lower); 206 eina_strbuf_replace_all(str_func, "@#eoprefix", current_eo_prefix_lower);