summaryrefslogtreecommitdiff
path: root/src/bin/eolian
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-27 10:04:56 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-28 16:11:52 +0100
commit3555029f9f9e60959d049cd3cc118ec05badfd4b (patch)
tree0513a39755ab33911a2cecada19e37baa72f8f42 /src/bin/eolian
parentf78be36dfea490e62943a751dfee6347f3212a97 (diff)
eolian_gen: fix generation of legacy class functions
we forgot to generate the legacy function. This no now added back. ref D8029 Reviewed-by: YeongJong Lee <yj34.lee@samsung.com> Differential Revision: https://phab.enlightenment.org/D8037
Diffstat (limited to 'src/bin/eolian')
-rw-r--r--src/bin/eolian/sources.c65
1 files changed, 38 insertions, 27 deletions
diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c
index e7a4612..fe0413d 100644
--- a/src/bin/eolian/sources.c
+++ b/src/bin/eolian/sources.c
@@ -437,6 +437,39 @@ _gen_reflect_set(Eina_Strbuf *buf, const char *cnamel, const Eolian_Type *valt,
437} 437}
438 438
439static void 439static void
440_emit_class_function(Eina_Strbuf *buf, const Eolian_Function *fid, const Eolian_Type *rtp, Eina_Strbuf *params_full,
441 const char *ocnamel, const char *func_suffix, Eina_Strbuf *params, const char *function_name)
442{
443 eina_strbuf_append(buf, "EOAPI ");
444 if (rtp)
445 eina_strbuf_append(buf, eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN));
446 else
447 eina_strbuf_append(buf, "void");
448 eina_strbuf_append(buf, " ");
449 eina_strbuf_append(buf, function_name);
450 eina_strbuf_append(buf, "(");
451 if (eina_strbuf_length_get(params_full) == 0)
452 eina_strbuf_append(buf, "void");
453 else
454 eina_strbuf_append_buffer(buf, params_full);
455 eina_strbuf_append(buf, ")\n");
456 eina_strbuf_append(buf, "{\n");
457 eina_strbuf_append_printf(buf, " %s();\n", eolian_class_c_get_function_name_get(eolian_function_class_get(fid)));
458 if (rtp)
459 eina_strbuf_append(buf, " return ");
460 else
461 eina_strbuf_append(buf, " ");
462 eina_strbuf_append_printf(buf, "_%s", ocnamel);
463 eina_strbuf_append_char(buf, '_');
464 eina_strbuf_append(buf, eolian_function_name_get(fid));
465 eina_strbuf_append(buf, func_suffix);
466 eina_strbuf_append(buf, "(");
467 eina_strbuf_append_buffer(buf, params);
468 eina_strbuf_append(buf, ");\n");
469 eina_strbuf_append(buf, "}\n");
470}
471
472static void
440_gen_func(const Eolian_Class *cl, const Eolian_Function *fid, 473_gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
441 Eolian_Function_Type ftype, Eina_Strbuf *buf, 474 Eolian_Function_Type ftype, Eina_Strbuf *buf,
442 const Eolian_Implement *impl, Eina_Strbuf *lbuf, 475 const Eolian_Implement *impl, Eina_Strbuf *lbuf,
@@ -901,33 +934,11 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
901 } 934 }
902 if (impl_same_class && eolian_function_is_class(fid)) 935 if (impl_same_class && eolian_function_is_class(fid))
903 { 936 {
904 eina_strbuf_append(buf, "EOAPI "); 937 const char *legacy_name = eolian_function_full_c_name_get(fid, ftype, EINA_TRUE);
905 if (rtp) 938
906 eina_strbuf_append(buf, eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN)); 939 _emit_class_function(buf, fid, rtp, params_full, ocnamel, func_suffix, params, eolian_function_full_c_name_get(fid, ftype, EINA_FALSE));
907 else 940 if (legacy_name)
908 eina_strbuf_append(buf, "void"); 941 _emit_class_function(buf, fid, rtp, params_full, ocnamel, func_suffix, params, legacy_name);
909 eina_strbuf_append(buf, " ");
910 eina_strbuf_append(buf, eolian_function_full_c_name_get(fid, ftype, EINA_FALSE));
911 eina_strbuf_append(buf, "(");
912 if (eina_strbuf_length_get(params_full) == 0)
913 eina_strbuf_append(buf, "void");
914 else
915 eina_strbuf_append_buffer(buf, params_full);
916 eina_strbuf_append(buf, ")\n");
917 eina_strbuf_append(buf, "{\n");
918 eina_strbuf_append_printf(buf, " %s();\n", eolian_class_c_get_function_name_get(cl));
919 if (rtp)
920 eina_strbuf_append(buf, " return ");
921 else
922 eina_strbuf_append(buf, " ");
923 eina_strbuf_append_printf(buf, "_%s", ocnamel);
924 eina_strbuf_append_char(buf, '_');
925 eina_strbuf_append(buf, eolian_function_name_get(fid));
926 eina_strbuf_append(buf, func_suffix);
927 eina_strbuf_append(buf, "(");
928 eina_strbuf_append_buffer(buf, params);
929 eina_strbuf_append(buf, ");\n");
930 eina_strbuf_append(buf, "}\n");
931 } 942 }
932 943
933 free(cname); 944 free(cname);