[vala/staging] gidl: Add time_t and GType to basic-types
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] gidl: Add time_t and GType to basic-types
- Date: Thu, 5 Jul 2018 09:03:14 +0000 (UTC)
commit 9f68c3627a9b729687bf0cce9caa5ff9daa53147
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Fri Oct 6 08:07:26 2017 +0200
gidl: Add time_t and GType to basic-types
gobject-introspection/gidl.vapi | 2 ++
gobject-introspection/gidlnode.c | 16 +++++++++-------
gobject-introspection/gidlparser.c | 2 ++
gobject-introspection/girepository.h | 20 ++++++++++++--------
gobject-introspection/gmetadata.h | 20 ++++++++++++--------
vapigen/valagidlparser.vala | 4 ++++
6 files changed, 41 insertions(+), 23 deletions(-)
---
diff --git a/gobject-introspection/gidl.vapi b/gobject-introspection/gidl.vapi
index 98b155cae..9159a14c4 100644
--- a/gobject-introspection/gidl.vapi
+++ b/gobject-introspection/gidl.vapi
@@ -270,6 +270,8 @@ namespace GLib {
SIZE,
FLOAT,
DOUBLE,
+ TIME_T,
+ GTYPE,
UTF8,
FILENAME,
ARRAY,
diff --git a/gobject-introspection/gidlnode.c b/gobject-introspection/gidlnode.c
index 8ad5c965b..b63932146 100644
--- a/gobject-introspection/gidlnode.c
+++ b/gobject-introspection/gidlnode.c
@@ -978,16 +978,18 @@ serialize_type (GIdlModule *module,
"gsize",
"gfloat",
"gdouble",
+ "time_t",
+ "GType",
"utf8",
"filename"
};
- if (node->tag < 20)
+ if (node->tag < 22)
{
g_string_append_printf (str, "%s%s",
basic[node->tag], node->is_pointer ? "*" : "");
}
- else if (node->tag == 20)
+ else if (node->tag == 22)
{
serialize_type (module, modules, node->parameter_type1, str);
g_string_append (str, "[");
@@ -1001,7 +1003,7 @@ serialize_type (GIdlModule *module,
g_string_append (str, "]");
}
- else if (node->tag == 21)
+ else if (node->tag == 23)
{
GIdlNode *iface;
gchar *name;
@@ -1017,7 +1019,7 @@ serialize_type (GIdlModule *module,
g_string_append_printf (str, "%s%s", name, node->is_pointer ? "*" : "");
}
- else if (node->tag == 22)
+ else if (node->tag == 24)
{
g_string_append (str, "GList");
if (node->parameter_type1)
@@ -1027,7 +1029,7 @@ serialize_type (GIdlModule *module,
g_string_append (str, ">");
}
}
- else if (node->tag == 23)
+ else if (node->tag == 25)
{
g_string_append (str, "GSList");
if (node->parameter_type1)
@@ -1037,7 +1039,7 @@ serialize_type (GIdlModule *module,
g_string_append (str, ">");
}
}
- else if (node->tag == 24)
+ else if (node->tag == 26)
{
g_string_append (str, "GHashTable<");
if (node->parameter_type1)
@@ -1049,7 +1051,7 @@ serialize_type (GIdlModule *module,
g_string_append (str, ">");
}
}
- else if (node->tag == 25)
+ else if (node->tag == 27)
{
g_string_append (str, "GError");
if (node->errors)
diff --git a/gobject-introspection/gidlparser.c b/gobject-introspection/gidlparser.c
index 6a76b2ca7..e4f45e6a3 100644
--- a/gobject-introspection/gidlparser.c
+++ b/gobject-introspection/gidlparser.c
@@ -139,6 +139,8 @@ parse_type_internal (gchar *str, gchar **rest)
{ "gfloat", TYPE_TAG_FLOAT, 0 },
{ "double", TYPE_TAG_DOUBLE, 0 },
{ "gdouble", TYPE_TAG_DOUBLE, 0 },
+ { "time_t", TYPE_TAG_TIME_T, 0 },
+ { "GType", TYPE_TAG_GTYPE, 0 },
{ "utf8", TYPE_TAG_UTF8, 1 },
{ "gchar*", TYPE_TAG_UTF8, 1 },
{ "filename", TYPE_TAG_FILENAME,1 }
diff --git a/gobject-introspection/girepository.h b/gobject-introspection/girepository.h
index 7ad1067a1..09a30785f 100644
--- a/gobject-introspection/girepository.h
+++ b/gobject-introspection/girepository.h
@@ -257,6 +257,7 @@ GITypeInfo * g_arg_info_get_type (GIArgInfo *info);
/* GITypeInfo */
typedef enum {
+ /* Basic types */
GI_TYPE_TAG_VOID = 0,
GI_TYPE_TAG_BOOLEAN = 1,
GI_TYPE_TAG_INT8 = 2,
@@ -275,14 +276,17 @@ typedef enum {
GI_TYPE_TAG_SIZE = 15,
GI_TYPE_TAG_FLOAT = 16,
GI_TYPE_TAG_DOUBLE = 17,
- GI_TYPE_TAG_UTF8 = 18,
- GI_TYPE_TAG_FILENAME = 19,
- GI_TYPE_TAG_ARRAY = 20,
- GI_TYPE_TAG_INTERFACE = 21,
- GI_TYPE_TAG_GLIST = 22,
- GI_TYPE_TAG_GSLIST = 23,
- GI_TYPE_TAG_GHASH = 24,
- GI_TYPE_TAG_ERROR = 25
+ GI_TYPE_TAG_TIME_T = 18,
+ GI_TYPE_TAG_GTYPE = 19,
+ GI_TYPE_TAG_UTF8 = 20,
+ GI_TYPE_TAG_FILENAME = 21,
+ /* Non-basic types */
+ GI_TYPE_TAG_ARRAY = 22,
+ GI_TYPE_TAG_INTERFACE = 23,
+ GI_TYPE_TAG_GLIST = 24,
+ GI_TYPE_TAG_GSLIST = 25,
+ GI_TYPE_TAG_GHASH = 26,
+ GI_TYPE_TAG_ERROR = 27
} GITypeTag;
gboolean g_type_info_is_pointer (GITypeInfo *info);
diff --git a/gobject-introspection/gmetadata.h b/gobject-introspection/gmetadata.h
index a22ee235e..621fe3d0b 100644
--- a/gobject-introspection/gmetadata.h
+++ b/gobject-introspection/gmetadata.h
@@ -101,6 +101,7 @@ typedef struct
typedef enum
{
+ /* Basic types */
TYPE_TAG_VOID = 0,
TYPE_TAG_BOOLEAN = 1,
TYPE_TAG_INT8 = 2,
@@ -119,14 +120,17 @@ typedef enum
TYPE_TAG_SIZE = 15,
TYPE_TAG_FLOAT = 16,
TYPE_TAG_DOUBLE = 17,
- TYPE_TAG_UTF8 = 18,
- TYPE_TAG_FILENAME = 19,
- TYPE_TAG_ARRAY = 20,
- TYPE_TAG_INTERFACE = 21,
- TYPE_TAG_LIST = 22,
- TYPE_TAG_SLIST = 23,
- TYPE_TAG_HASH = 24,
- TYPE_TAG_ERROR = 25
+ TYPE_TAG_TIME_T = 18,
+ TYPE_TAG_GTYPE = 19,
+ TYPE_TAG_UTF8 = 20,
+ TYPE_TAG_FILENAME = 21,
+ /* Non-basic types */
+ TYPE_TAG_ARRAY = 22,
+ TYPE_TAG_INTERFACE = 23,
+ TYPE_TAG_LIST = 24,
+ TYPE_TAG_SLIST = 25,
+ TYPE_TAG_HASH = 26,
+ TYPE_TAG_ERROR = 27
} TypeTag;
typedef union
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index e0ffca52b..b25e91248 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -1878,6 +1878,10 @@ public class Vala.GIdlParser : CodeVisitor {
type.unresolved_symbol = new UnresolvedSymbol (null, "double");
} else if (type_node.tag == TypeTag.UTF8) {
type.unresolved_symbol = new UnresolvedSymbol (null, "string");
+ } else if (type_node.tag == TypeTag.TIME_T) {
+ type.unresolved_symbol = new UnresolvedSymbol (null, "time_t");
+ } else if (type_node.tag == TypeTag.GTYPE) {
+ type.unresolved_symbol = new UnresolvedSymbol (new UnresolvedSymbol (null, "GLib"),
"Type");
} else if (type_node.tag == TypeTag.FILENAME) {
type.unresolved_symbol = new UnresolvedSymbol (null, "string");
} else if (type_node.tag == TypeTag.ARRAY) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]