summaryrefslogtreecommitdiff
path: root/src/lib/eolian
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-05-30 17:00:52 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-05-30 17:01:27 +0200
commitba8e4dc17f08c4dd367b71a3342703dd1ec5eec6 (patch)
tree4af56c66d1e544af53a3d259f88f9d2a2e69c26c /src/lib/eolian
parent2f28d0c593ee302c79ec3c25eb8626472917bcac (diff)
eolian: use c_name when building complex C symbol names
Diffstat (limited to 'src/lib/eolian')
-rw-r--r--src/lib/eolian/database_class_api.c8
-rw-r--r--src/lib/eolian/database_function_api.c4
2 files changed, 4 insertions, 8 deletions
diff --git a/src/lib/eolian/database_class_api.c b/src/lib/eolian/database_class_api.c
index 5733d6c6ff..07e781db7a 100644
--- a/src/lib/eolian/database_class_api.c
+++ b/src/lib/eolian/database_class_api.c
@@ -155,7 +155,7 @@ eolian_class_c_get_function_name_get(const Eolian_Class *cl)
155 Eina_Stringshare *ret; 155 Eina_Stringshare *ret;
156 Eina_Strbuf *buf = eina_strbuf_new(); 156 Eina_Strbuf *buf = eina_strbuf_new();
157 char *bufp; 157 char *bufp;
158 eina_strbuf_append(buf, cl->base.name); 158 eina_strbuf_append(buf, cl->base.c_name);
159 switch (cl->type) 159 switch (cl->type)
160 { 160 {
161 case EOLIAN_CLASS_INTERFACE: 161 case EOLIAN_CLASS_INTERFACE:
@@ -168,7 +168,6 @@ eolian_class_c_get_function_name_get(const Eolian_Class *cl)
168 eina_strbuf_append(buf, "_class_get"); 168 eina_strbuf_append(buf, "_class_get");
169 break; 169 break;
170 } 170 }
171 eina_strbuf_replace_all(buf, ".", "_");
172 bufp = eina_strbuf_string_steal(buf); 171 bufp = eina_strbuf_string_steal(buf);
173 eina_str_tolower(&bufp); 172 eina_str_tolower(&bufp);
174 ret = eina_stringshare_add(bufp); 173 ret = eina_stringshare_add(bufp);
@@ -184,7 +183,7 @@ eolian_class_c_macro_get(const Eolian_Class *cl)
184 Eina_Stringshare *ret; 183 Eina_Stringshare *ret;
185 Eina_Strbuf *buf = eina_strbuf_new(); 184 Eina_Strbuf *buf = eina_strbuf_new();
186 char *bufp; 185 char *bufp;
187 eina_strbuf_append(buf, cl->base.name); 186 eina_strbuf_append(buf, cl->base.c_name);
188 switch (cl->type) 187 switch (cl->type)
189 { 188 {
190 case EOLIAN_CLASS_INTERFACE: 189 case EOLIAN_CLASS_INTERFACE:
@@ -197,7 +196,6 @@ eolian_class_c_macro_get(const Eolian_Class *cl)
197 eina_strbuf_append(buf, "_CLASS"); 196 eina_strbuf_append(buf, "_CLASS");
198 break; 197 break;
199 } 198 }
200 eina_strbuf_replace_all(buf, ".", "_");
201 bufp = eina_strbuf_string_steal(buf); 199 bufp = eina_strbuf_string_steal(buf);
202 eina_str_toupper(&bufp); 200 eina_str_toupper(&bufp);
203 ret = eina_stringshare_add(bufp); 201 ret = eina_stringshare_add(bufp);
@@ -212,7 +210,7 @@ eolian_class_c_data_type_get(const Eolian_Class *cl)
212 char buf[512]; 210 char buf[512];
213 EINA_SAFETY_ON_NULL_RETURN_VAL(cl, NULL); 211 EINA_SAFETY_ON_NULL_RETURN_VAL(cl, NULL);
214 if (!cl->data_type) 212 if (!cl->data_type)
215 snprintf(buf, sizeof(buf), "%s_Data", cl->base.name); 213 snprintf(buf, sizeof(buf), "%s_Data", cl->base.c_name);
216 else if (!strcmp(cl->data_type, "null")) 214 else if (!strcmp(cl->data_type, "null"))
217 return eina_stringshare_add("void"); 215 return eina_stringshare_add("void");
218 else 216 else
diff --git a/src/lib/eolian/database_function_api.c b/src/lib/eolian/database_function_api.c
index 9b67624dba..123b99b4c4 100644
--- a/src/lib/eolian/database_function_api.c
+++ b/src/lib/eolian/database_function_api.c
@@ -40,12 +40,10 @@ eolian_function_type_get(const Eolian_Function *fid)
40static const char * 40static const char *
41_get_c_prefix(const Eolian_Function *foo_id, char *buf) 41_get_c_prefix(const Eolian_Function *foo_id, char *buf)
42{ 42{
43 char *tmp = buf;
44 if (foo_id->klass->c_prefix) 43 if (foo_id->klass->c_prefix)
45 return foo_id->klass->c_prefix; 44 return foo_id->klass->c_prefix;
46 strcpy(buf, foo_id->klass->base.name); 45 strcpy(buf, foo_id->klass->base.c_name);
47 eina_str_tolower(&buf); 46 eina_str_tolower(&buf);
48 while ((tmp = strchr(tmp, '.'))) *tmp = '_';
49 return buf; 47 return buf;
50} 48}
51 49