eolian: use newly created implicit typedefs in legacy API
authorDaniel Kolesa <d.kolesa@samsung.com>
Fri, 1 Aug 2014 14:20:02 +0000 (15:20 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Thu, 21 Aug 2014 08:26:03 +0000 (09:26 +0100)
Also update tests accordingly.

src/bin/eolian/legacy_generator.c
src/tests/eolian/data/struct_ref.c
src/tests/eolian/data/typedef_ref.c

index 52303a5..8e0efbd 100644 (file)
@@ -89,7 +89,7 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
      {
         if (ftype == EOLIAN_PROP_GET || eolian_function_object_is_const(funcid))
            eina_strbuf_append(fparam, "const ");
-        eina_strbuf_append(fparam, "Eo *obj");
+        eina_strbuf_append_printf(fparam, "%s *obj", class_env.full_classname);
      }
    sprintf (tmpstr, "comment%s", suffix);
    const char *desc = eolian_function_description_get(funcid, tmpstr);
@@ -263,8 +263,10 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
      {
         if (ftype == EOLIAN_PROP_GET || eolian_function_object_is_const(funcid))
            eina_strbuf_append(fparam, "const ");
-        eina_strbuf_append(fparam, "Eo *obj");
-        eina_strbuf_replace_all(fbody, "@#eo_obj", "(Eo *)obj");
+        eina_strbuf_append_printf(fparam, "%s *obj", class_env.full_classname);
+        char buf[256];
+        snprintf(buf, sizeof(buf), "(%s *)obj", class_env.full_classname);
+        eina_strbuf_replace_all(fbody, "@#eo_obj", buf);
      }
    else
      {
index 75e3a90..4dfb2d8 100644 (file)
@@ -1,6 +1,13 @@
 #ifndef _TYPES_OUTPUT_C_
 #define _TYPES_OUTPUT_C_
 
+#ifndef _STRUCT_EO_CLASS_TYPE
+#define _STRUCT_EO_CLASS_TYPE
+
+typedef Eo Struct;
+
+#endif
+
 #ifndef _STRUCT_EO_TYPES
 #define _STRUCT_EO_TYPES
 
index d7a8c86..2c0c1d3 100644 (file)
@@ -1,6 +1,13 @@
 #ifndef _TYPES_OUTPUT_C_
 #define _TYPES_OUTPUT_C_
 
+#ifndef _TYPEDEF_EO_CLASS_TYPE
+#define _TYPEDEF_EO_CLASS_TYPE
+
+typedef Eo Typedef;
+
+#endif
+
 #ifndef _TYPEDEF_EO_TYPES
 #define _TYPEDEF_EO_TYPES