[gobject-introspection] tests: Add a struct with fixed-size gchar
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] tests: Add a struct with fixed-size gchar
- Date: Fri, 19 Apr 2013 23:13:12 +0000 (UTC)
commit a09072bd1f75dfc7497ed599e03e331bff411fd4
Author: Colin Walters <walters verbum org>
Date: Fri Apr 19 19:12:14 2013 -0400
tests: Add a struct with fixed-size gchar
See https://bugzilla.redhat.com/920595
tests/scanner/Regress-1.0-expected.gir | 21 +++++++++++++++++++++
tests/scanner/regress.c | 8 ++++++++
tests/scanner/regress.h | 7 +++++++
3 files changed, 36 insertions(+)
---
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 2d8091b..0dadc59 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -1946,6 +1946,27 @@ exposed to language bindings.</doc>
<type name="gdouble" c:type="double"/>
</field>
</record>
+ <record name="LikeXklConfigItem" c:type="RegressLikeXklConfigItem">
+ <field name="name" writable="1">
+ <array zero-terminated="0" c:type="gchar" fixed-size="32">
+ <type name="gchar" c:type="gchar"/>
+ </array>
+ </field>
+ <method name="set_name"
+ c:identifier="regress_like_xkl_config_item_set_name">
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <instance-parameter name="self" transfer-ownership="none">
+ <type name="LikeXklConfigItem" c:type="RegressLikeXklConfigItem*"/>
+ </instance-parameter>
+ <parameter name="name" transfer-ownership="none">
+ <type name="utf8" c:type="const char*"/>
+ </parameter>
+ </parameters>
+ </method>
+ </record>
<constant name="MAXUINT64"
value="18446744073709551615"
c:type="REGRESS_MAXUINT64">
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index f54c2f9..d32c52b 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -4007,3 +4007,11 @@ void
regress_test_versioning (void)
{
}
+
+void
+regress_like_xkl_config_item_set_name (RegressLikeXklConfigItem *self,
+ const char *name)
+{
+ strncpy (self->name, name, sizeof (self->name) - 1);
+ self->name[sizeof(self->name)-1] = '\0';
+}
diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h
index ba82ca8..adc05db 100644
--- a/tests/scanner/regress.h
+++ b/tests/scanner/regress.h
@@ -905,6 +905,13 @@ typedef struct {
void regress_test_struct_fixed_array_frob (RegressTestStructFixedArray *str);
+typedef struct {
+ gchar name[32];
+} RegressLikeXklConfigItem;
+
+void regress_like_xkl_config_item_set_name (RegressLikeXklConfigItem *self,
+ const char *name);
+
#define REGRESS_UTF8_CONSTANT "const \xe2\x99\xa5 utf8"
#ifdef __GNUC__
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]