[7/8] widl: move is_user_type from typegen to header

Michael Karcher wine at mkarcher.dialup.fu-berlin.de
Sat Jan 10 15:38:30 CST 2009


---
 tools/widl/header.c  |   24 ++++++++++++++++++++++++
 tools/widl/header.h  |    2 ++
 tools/widl/typegen.c |   24 ------------------------
 tools/widl/typegen.h |    1 -
 4 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/tools/widl/header.c b/tools/widl/header.c
index a3d2250..da42e95 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -119,6 +119,30 @@ int is_conformant_array(const type_t *t)
     return is_array(t) && type_array_has_conformance(t);
 }
 
+type_t *get_user_type(const type_t *t, const char **pname)
+{
+    for (;;)
+    {
+        type_t *ut = get_attrp(t->attrs, ATTR_WIREMARSHAL);
+        if (ut)
+        {
+            if (pname)
+                *pname = t->name;
+            return ut;
+        }
+
+        if (type_is_alias(t))
+            t = t->orig;
+        else
+            return 0;
+    }
+}
+
+int is_user_type(const type_t *t)
+{
+    return get_user_type(t, NULL) != NULL;
+}
+
 void write_guid(FILE *f, const char *guid_prefix, const char *name, const UUID *uuid)
 {
   if (!uuid) return;
diff --git a/tools/widl/header.h b/tools/widl/header.h
index 89583e1..3f0eec1 100644
--- a/tools/widl/header.h
+++ b/tools/widl/header.h
@@ -32,6 +32,8 @@ extern int is_void(const type_t *t);
 extern int is_conformant_array(const type_t *t);
 extern int is_declptr(const type_t *t);
 extern type_t * get_deref_type(const type_t * t);
+extern int is_user_type(const type_t *t);
+extern type_t *get_user_type(const type_t *t, const char **pname);
 extern const char* get_name(const var_t *v);
 extern void write_type_left(FILE *h, type_t *t, int declonly);
 extern void write_type_right(FILE *h, type_t *t, int is_field);
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 9256bba..a7b7d0f 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -502,30 +502,6 @@ static void guard_rec(type_t *type)
         type->typestring_offset = 1;
 }
 
-static type_t *get_user_type(const type_t *t, const char **pname)
-{
-    for (;;)
-    {
-        type_t *ut = get_attrp(t->attrs, ATTR_WIREMARSHAL);
-        if (ut)
-        {
-            if (pname)
-                *pname = t->name;
-            return ut;
-        }
-
-        if (type_is_alias(t))
-            t = t->orig;
-        else
-            return 0;
-    }
-}
-
-int is_user_type(const type_t *t)
-{
-    return get_user_type(t, NULL) != NULL;
-}
-
 static int is_embedded_complex(const type_t *type)
 {
     unsigned char tc = type->type;
diff --git a/tools/widl/typegen.h b/tools/widl/typegen.h
index b2c48df..f790d49 100644
--- a/tools/widl/typegen.h
+++ b/tools/widl/typegen.h
@@ -61,7 +61,6 @@ int decl_indirect(const type_t *t);
 void write_parameters_init(FILE *file, int indent, const var_t *func, const char *local_var_prefix);
 void print(FILE *file, int indent, const char *format, va_list ap);
 int get_padding(const var_list_t *fields);
-int is_user_type(const type_t *t);
 expr_t *get_size_is_expr(const type_t *t, const char *name);
 int is_full_pointer_function(const var_t *func);
 void write_full_pointer_init(FILE *file, int indent, const var_t *func, int is_server);
-- 
1.5.6.5





More information about the wine-devel mailing list