summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian/common_funcs.c6
-rw-r--r--src/bin/eolian/eo_generator.c38
-rw-r--r--src/bin/eolian/legacy_generator.c8
-rw-r--r--src/bin/eolian_cxx/convert_comments.cc5
4 files changed, 19 insertions, 38 deletions
diff --git a/src/bin/eolian/common_funcs.c b/src/bin/eolian/common_funcs.c
index bd5f5dee9e..13d5ffc5c7 100644
--- a/src/bin/eolian/common_funcs.c
+++ b/src/bin/eolian/common_funcs.c
@@ -79,14 +79,14 @@ _class_func_env_create(const Eolian_Class *class, const char *funcname, Eolian_F
79 if (ftype == EOLIAN_PROP_GET) 79 if (ftype == EOLIAN_PROP_GET)
80 { 80 {
81 suffix = "_get"; 81 suffix = "_get";
82 legacy = eolian_function_data_get(funcid, EOLIAN_LEGACY_GET); 82 legacy = eolian_function_legacy_get(funcid, ftype);
83 } 83 }
84 if (ftype == EOLIAN_PROP_SET) 84 if (ftype == EOLIAN_PROP_SET)
85 { 85 {
86 suffix = "_set"; 86 suffix = "_set";
87 legacy = eolian_function_data_get(funcid, EOLIAN_LEGACY_SET); 87 legacy = eolian_function_legacy_get(funcid, ftype);
88 } 88 }
89 if (!legacy) legacy = eolian_function_data_get(funcid, EOLIAN_LEGACY); 89 if (!legacy) legacy = eolian_function_legacy_get(funcid, EOLIAN_METHOD);
90 90
91 _eolian_class_vars tmp_env; 91 _eolian_class_vars tmp_env;
92 _class_env_create(class, NULL, &tmp_env); 92 _class_env_create(class, NULL, &tmp_env);
diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index 02402121a8..be294d35ec 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -85,8 +85,6 @@ eo_fundef_generate(const Eolian_Class *class, Eolian_Function *func, Eolian_Func
85 const char *str_dir[] = {"in", "out", "inout"}; 85 const char *str_dir[] = {"in", "out", "inout"};
86 Eina_Iterator *itr; 86 Eina_Iterator *itr;
87 void *data, *data2; 87 void *data, *data2;
88 char funcname[0xFF];
89 char descname[0xFF];
90 char *tmpstr = malloc(0x1FF); 88 char *tmpstr = malloc(0x1FF);
91 Eina_Bool var_as_ret = EINA_FALSE; 89 Eina_Bool var_as_ret = EINA_FALSE;
92 const Eolian_Type *rettypet = NULL; 90 const Eolian_Type *rettypet = NULL;
@@ -95,30 +93,20 @@ eo_fundef_generate(const Eolian_Class *class, Eolian_Function *func, Eolian_Func
95 Eolian_Object_Scope scope = eolian_function_scope_get(func); 93 Eolian_Object_Scope scope = eolian_function_scope_get(func);
96 94
97 _class_func_env_create(class, eolian_function_name_get(func), ftype, &func_env); 95 _class_func_env_create(class, eolian_function_name_get(func), ftype, &func_env);
98 char *fsuffix = "";
99 rettypet = eolian_function_return_type_get(func, ftype); 96 rettypet = eolian_function_return_type_get(func, ftype);
100 if (ftype == EOLIAN_PROP_GET) 97 if (ftype == EOLIAN_PROP_GET && !rettypet)
101 { 98 {
102 fsuffix = "_get"; 99 itr = eolian_function_parameters_get(func);
103 if (!rettypet) 100 /* We want to check if there is only one parameter */
101 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
104 { 102 {
105 itr = eolian_function_parameters_get(func); 103 rettypet = eolian_parameter_type_get((Eolian_Function_Parameter*)data);
106 /* We want to check if there is only one parameter */ 104 var_as_ret = EINA_TRUE;
107 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2)) 105 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
108 {
109 rettypet = eolian_parameter_type_get((Eolian_Function_Parameter*)data);
110 var_as_ret = EINA_TRUE;
111 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
112 }
113 eina_iterator_free(itr);
114 } 106 }
107 eina_iterator_free(itr);
115 } 108 }
116 if (ftype == EOLIAN_PROP_SET) fsuffix = "_set"; 109 const char *funcdesc = eolian_function_description_get(func, ftype);
117
118 sprintf (funcname, "%s%s", eolian_function_name_get(func), fsuffix);
119 sprintf (descname, "comment%s", fsuffix);
120 const char *funcdesc = eolian_function_description_get(func, descname);
121
122 Eina_Strbuf *str_func = eina_strbuf_new(); 110 Eina_Strbuf *str_func = eina_strbuf_new();
123 if (scope == EOLIAN_SCOPE_PROTECTED) 111 if (scope == EOLIAN_SCOPE_PROTECTED)
124 eina_strbuf_append_printf(str_func, "#ifdef %s_PROTECTED\n", class_env.upper_classname); 112 eina_strbuf_append_printf(str_func, "#ifdef %s_PROTECTED\n", class_env.upper_classname);
@@ -727,7 +715,7 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
727 itr = eolian_class_functions_get(class, EOLIAN_CTOR); 715 itr = eolian_class_functions_get(class, EOLIAN_CTOR);
728 EINA_ITERATOR_FOREACH(itr, fn) 716 EINA_ITERATOR_FOREACH(itr, fn)
729 { 717 {
730 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment")); 718 char *desc = _source_desc_get(eolian_function_description_get(fn, EOLIAN_METHOD));
731 eo_op_desc_generate(class, fn, EOLIAN_CTOR, desc, tmpbuf); 719 eo_op_desc_generate(class, fn, EOLIAN_CTOR, desc, tmpbuf);
732 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf)); 720 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
733 free(desc); 721 free(desc);
@@ -749,7 +737,7 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
749 737
750 if (prop_write) 738 if (prop_write)
751 { 739 {
752 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment_set")); 740 char *desc = _source_desc_get(eolian_function_description_get(fn, EOLIAN_PROP_SET));
753 741
754 sprintf(tmpstr, "%s_set", funcname); 742 sprintf(tmpstr, "%s_set", funcname);
755 eo_op_desc_generate(class, fn, EOLIAN_PROP_SET, desc, tmpbuf); 743 eo_op_desc_generate(class, fn, EOLIAN_PROP_SET, desc, tmpbuf);
@@ -758,7 +746,7 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
758 } 746 }
759 if (prop_read) 747 if (prop_read)
760 { 748 {
761 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment_get")); 749 char *desc = _source_desc_get(eolian_function_description_get(fn, EOLIAN_PROP_GET));
762 750
763 sprintf(tmpstr, "%s_get", funcname); 751 sprintf(tmpstr, "%s_get", funcname);
764 eo_op_desc_generate(class, fn, EOLIAN_PROP_GET, desc, tmpbuf); 752 eo_op_desc_generate(class, fn, EOLIAN_PROP_GET, desc, tmpbuf);
@@ -772,7 +760,7 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
772 itr = eolian_class_functions_get(class, EOLIAN_METHOD); 760 itr = eolian_class_functions_get(class, EOLIAN_METHOD);
773 EINA_ITERATOR_FOREACH(itr, fn) 761 EINA_ITERATOR_FOREACH(itr, fn)
774 { 762 {
775 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment")); 763 char *desc = _source_desc_get(eolian_function_description_get(fn, EOLIAN_METHOD));
776 eo_op_desc_generate(class, fn, EOLIAN_METHOD, desc, tmpbuf); 764 eo_op_desc_generate(class, fn, EOLIAN_METHOD, desc, tmpbuf);
777 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf)); 765 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
778 free(desc); 766 free(desc);
diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c
index 42046a261b..fc323449a7 100644
--- a/src/bin/eolian/legacy_generator.c
+++ b/src/bin/eolian/legacy_generator.c
@@ -44,13 +44,11 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
44{ 44{
45 _eolian_class_func_vars func_env; 45 _eolian_class_func_vars func_env;
46 const char *funcname = eolian_function_name_get(funcid); 46 const char *funcname = eolian_function_name_get(funcid);
47 const char *suffix = "";
48 const Eolian_Type *rettypet = NULL; 47 const Eolian_Type *rettypet = NULL;
49 const char *rettype = NULL; 48 const char *rettype = NULL;
50 Eina_Bool var_as_ret = EINA_FALSE; 49 Eina_Bool var_as_ret = EINA_FALSE;
51 Eina_Bool add_star = EINA_FALSE; 50 Eina_Bool add_star = EINA_FALSE;
52 Eina_Bool ret_const = EINA_FALSE; 51 Eina_Bool ret_const = EINA_FALSE;
53 char tmpstr[0xFF];
54 Eina_Iterator *itr; 52 Eina_Iterator *itr;
55 void *data, *data2; 53 void *data, *data2;
56 Eina_Strbuf *flags = NULL; 54 Eina_Strbuf *flags = NULL;
@@ -64,7 +62,6 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
64 rettypet = eolian_function_return_type_get(funcid, ftype); 62 rettypet = eolian_function_return_type_get(funcid, ftype);
65 if (ftype == EOLIAN_PROP_GET) 63 if (ftype == EOLIAN_PROP_GET)
66 { 64 {
67 suffix = "_get";
68 add_star = EINA_TRUE; 65 add_star = EINA_TRUE;
69 if (!rettypet) 66 if (!rettypet)
70 { 67 {
@@ -80,8 +77,6 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
80 } 77 }
81 } 78 }
82 79
83 if (ftype == EOLIAN_PROP_SET) suffix = "_set";
84
85 if (func_env.legacy_func[0] == '\0') goto end; 80 if (func_env.legacy_func[0] == '\0') goto end;
86 eina_strbuf_append_printf(fbody, tmpl_eapi_funcdef, func_env.legacy_func); 81 eina_strbuf_append_printf(fbody, tmpl_eapi_funcdef, func_env.legacy_func);
87 82
@@ -91,8 +86,7 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
91 eina_strbuf_append(fparam, "const "); 86 eina_strbuf_append(fparam, "const ");
92 eina_strbuf_append_printf(fparam, "%s *obj", class_env.full_classname); 87 eina_strbuf_append_printf(fparam, "%s *obj", class_env.full_classname);
93 } 88 }
94 sprintf (tmpstr, "comment%s", suffix); 89 const char *desc = eolian_function_description_get(funcid, ftype);
95 const char *desc = eolian_function_description_get(funcid, tmpstr);
96 Eina_Strbuf *linedesc = eina_strbuf_new(); 90 Eina_Strbuf *linedesc = eina_strbuf_new();
97 eina_strbuf_append(linedesc, desc ? desc : "No description supplied."); 91 eina_strbuf_append(linedesc, desc ? desc : "No description supplied.");
98 if (eina_strbuf_length_get(linedesc)) 92 if (eina_strbuf_length_get(linedesc))
diff --git a/src/bin/eolian_cxx/convert_comments.cc b/src/bin/eolian_cxx/convert_comments.cc
index 87b0f350c5..c520eb887a 100644
--- a/src/bin/eolian_cxx/convert_comments.cc
+++ b/src/bin/eolian_cxx/convert_comments.cc
@@ -38,11 +38,10 @@ _comment_parameters_list(Eina_Iterator *params)
38} 38}
39 39
40static std::string 40static std::string
41_comment_brief_and_params(Eolian_Function const& function, 41_comment_brief_and_params(Eolian_Function const& function, Eolian_Function_Type ftype = EOLIAN_METHOD)
42 const char *key = EOLIAN_COMMENT)
43{ 42{
44 std::string doc = ""; 43 std::string doc = "";
45 std::string func = safe_str(::eolian_function_description_get(&function, key)); 44 std::string func = safe_str(::eolian_function_description_get(&function, ftype));
46 if (func != "") 45 if (func != "")
47 { 46 {
48 doc += "@brief " + func + "\n\n"; 47 doc += "@brief " + func + "\n\n";