summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-31 14:36:18 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-03 15:46:45 +0100
commit56d7499fda89d7c81c93142f148db1511c338987 (patch)
tree9cb30e8bd6ed83e694b048719c13e2d023873a81
parenta4410fb8aec74ec600fe4eb31a9e8a4fabc5af32 (diff)
downloadtelepathy-glib-56d7499fda89d7c81c93142f148db1511c338987.tar.gz
Rename core-util.c to value-array.c and put it in the -dbus library
This is basically only useful for the dbus-glib type system. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=76855 Reviewed-by: Xavier Claessens
-rw-r--r--docs/reference/telepathy-glib/telepathy-glib-docs.sgml1
-rw-r--r--docs/reference/telepathy-glib/telepathy-glib-sections.txt12
-rw-r--r--telepathy-glib/Makefile.am3
-rw-r--r--telepathy-glib/account-request.c1
-rw-r--r--telepathy-glib/account.c1
-rw-r--r--telepathy-glib/base-call-channel.c1
-rw-r--r--telepathy-glib/base-call-content.c1
-rw-r--r--telepathy-glib/base-call-stream.c1
-rw-r--r--telepathy-glib/base-client.c1
-rw-r--r--telepathy-glib/base-connection.c1
-rw-r--r--telepathy-glib/base-contact-list.c1
-rw-r--r--telepathy-glib/base-media-call-content.c1
-rw-r--r--telepathy-glib/base-media-call-stream.c1
-rw-r--r--telepathy-glib/base-protocol.c1
-rw-r--r--telepathy-glib/call-channel.c1
-rw-r--r--telepathy-glib/call-content-media-description.c1
-rw-r--r--telepathy-glib/call-stream-endpoint.c1
-rw-r--r--telepathy-glib/capabilities.c1
-rw-r--r--telepathy-glib/channel-group.c1
-rw-r--r--telepathy-glib/cli-channel.c1
-rw-r--r--telepathy-glib/cli-connection.c1
-rw-r--r--telepathy-glib/cli-misc.c1
-rw-r--r--telepathy-glib/connection-contact-info.c1
-rw-r--r--telepathy-glib/connection.c1
-rw-r--r--telepathy-glib/contact-search.c1
-rw-r--r--telepathy-glib/contact.c1
-rw-r--r--telepathy-glib/debug-client.c1
-rw-r--r--telepathy-glib/gnio-util.c1
-rw-r--r--telepathy-glib/presence-mixin.c1
-rw-r--r--telepathy-glib/protocol.c1
-rw-r--r--telepathy-glib/reentrants.c1
-rw-r--r--telepathy-glib/room-info.c1
-rw-r--r--telepathy-glib/telepathy-glib-dbus.h3
-rw-r--r--telepathy-glib/tls-certificate.c1
-rw-r--r--telepathy-glib/util.h23
-rw-r--r--telepathy-glib/value-array.c (renamed from telepathy-glib/core-util.c)17
-rw-r--r--telepathy-glib/value-array.h59
-rw-r--r--telepathy-glib/versions/core-1.0.abi3
-rw-r--r--telepathy-glib/versions/dbus-1.0.abi3
-rw-r--r--tests/capabilities.c1
-rw-r--r--tests/dbus/connection-balance.c1
-rw-r--r--tests/dbus/contact-lists.c1
-rw-r--r--tests/dbus/contacts.c1
-rw-r--r--tests/util.c1
-rw-r--r--tools/glib-ginterface-gen.py2
45 files changed, 129 insertions, 32 deletions
diff --git a/docs/reference/telepathy-glib/telepathy-glib-docs.sgml b/docs/reference/telepathy-glib/telepathy-glib-docs.sgml
index d6f1222c3..6e99cc2f2 100644
--- a/docs/reference/telepathy-glib/telepathy-glib-docs.sgml
+++ b/docs/reference/telepathy-glib/telepathy-glib-docs.sgml
@@ -21,6 +21,7 @@
<xi:include href="xml/variant-util.xml"/>
<xi:include href="xml/vardict.xml"/>
<xi:include href="xml/proxy-subclass.xml"/>
+ <xi:include href="xml/value-array.xml"/>
</chapter>
<chapter id="ch-protocol">
<title>The Telepathy protocol</title>
diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
index f45ed8a42..52eaee84f 100644
--- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
@@ -1315,9 +1315,6 @@ tp_mixin_instance_get_offset
tp_escape_as_identifier
tp_strv_contains
tp_g_signal_connect_object
-tp_value_array_build
-tp_value_array_unpack
-tp_value_array_free
TpWeakRef
tp_weak_ref_new
tp_weak_ref_dup_object
@@ -1333,6 +1330,15 @@ tp_utf8_make_valid
</SECTION>
<SECTION>
+<FILE>value-array</FILE>
+<TITLE>value-array</TITLE>
+<INCLUDE>telepathy-glib/telepathy-glib-dbus.h</INCLUDE>
+tp_value_array_build
+tp_value_array_unpack
+tp_value_array_free
+</SECTION>
+
+<SECTION>
<FILE>gnio-util</FILE>
<TITLE>gnio-util</TITLE>
<INCLUDE>telepathy-glib/telepathy-glib.h</INCLUDE>
diff --git a/telepathy-glib/Makefile.am b/telepathy-glib/Makefile.am
index 3f42c9269..25aa52c9d 100644
--- a/telepathy-glib/Makefile.am
+++ b/telepathy-glib/Makefile.am
@@ -158,6 +158,7 @@ tpgdbusinclude_HEADERS = \
svc-tls.h \
svc-logger.h \
telepathy-glib-dbus.h \
+ value-array.h \
$(NULL)
BUILT_SOURCES = $(codegen_sources)
@@ -191,7 +192,6 @@ libtelepathy_glib_core_internal_la_SOURCES = \
core-dbus.c \
core-proxy.c \
core-svc-interface.c \
- core-util.c \
errors.c \
$(NULL)
@@ -205,6 +205,7 @@ libtelepathy_glib_dbus_internal_la_SOURCES = \
cli-misc.c \
gtypes.c \
interfaces.c \
+ value-array.c \
$(NULL)
libtelepathy_glib_main_internal_la_LIBADD = \
diff --git a/telepathy-glib/account-request.c b/telepathy-glib/account-request.c
index 97fd9b4cc..183eb55ed 100644
--- a/telepathy-glib/account-request.c
+++ b/telepathy-glib/account-request.c
@@ -28,6 +28,7 @@
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#include <telepathy-glib/client-factory.h>
#define DEBUG_FLAG TP_DEBUG_ACCOUNTS
diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c
index 2d920d50b..d34ebb9ea 100644
--- a/telepathy-glib/account.c
+++ b/telepathy-glib/account.c
@@ -36,6 +36,7 @@
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/proxy-subclass.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_ACCOUNTS
#include "telepathy-glib/connection-internal.h"
diff --git a/telepathy-glib/base-call-channel.c b/telepathy-glib/base-call-channel.c
index 875348bd1..b87d4d6d0 100644
--- a/telepathy-glib/base-call-channel.c
+++ b/telepathy-glib/base-call-channel.c
@@ -119,6 +119,7 @@
#include "telepathy-glib/svc-channel.h"
#include "telepathy-glib/svc-properties-interface.h"
#include "telepathy-glib/util.h"
+#include <telepathy-glib/value-array.h>
static void call_iface_init (gpointer, gpointer);
diff --git a/telepathy-glib/base-call-content.c b/telepathy-glib/base-call-content.c
index fd5c5eebf..0f48fcbb8 100644
--- a/telepathy-glib/base-call-content.c
+++ b/telepathy-glib/base-call-content.c
@@ -140,6 +140,7 @@
#include "telepathy-glib/svc-generic.h"
#include "telepathy-glib/util.h"
#include "telepathy-glib/util-internal.h"
+#include <telepathy-glib/value-array.h>
static void call_content_iface_init (gpointer g_iface, gpointer iface_data);
static void call_content_dtmf_iface_init (gpointer g_iface,
diff --git a/telepathy-glib/base-call-stream.c b/telepathy-glib/base-call-stream.c
index 4bc5d87f3..dcb2c40ff 100644
--- a/telepathy-glib/base-call-stream.c
+++ b/telepathy-glib/base-call-stream.c
@@ -110,6 +110,7 @@
#include "telepathy-glib/svc-call.h"
#include "telepathy-glib/svc-generic.h"
#include "telepathy-glib/util.h"
+#include <telepathy-glib/value-array.h>
static void call_stream_iface_init (gpointer g_iface, gpointer iface_data);
diff --git a/telepathy-glib/base-client.c b/telepathy-glib/base-client.c
index e2cb1d9ec..436df35a9 100644
--- a/telepathy-glib/base-client.c
+++ b/telepathy-glib/base-client.c
@@ -189,6 +189,7 @@
#include <telepathy-glib/svc-client.h>
#include <telepathy-glib/svc-generic.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_CLIENT
#include "telepathy-glib/connection-internal.h"
diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index eabe3fd43..3ca13dd68 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -250,6 +250,7 @@
#include <telepathy-glib/svc-connection.h>
#include <telepathy-glib/svc-generic.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_CONNECTION
#include "telepathy-glib/debug-internal.h"
diff --git a/telepathy-glib/base-contact-list.c b/telepathy-glib/base-contact-list.c
index 47e6d7506..d9ed45aaf 100644
--- a/telepathy-glib/base-contact-list.c
+++ b/telepathy-glib/base-contact-list.c
@@ -30,6 +30,7 @@
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/svc-connection.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#include <telepathy-glib/base-connection-internal.h>
#include <telepathy-glib/handle-repo-internal.h>
diff --git a/telepathy-glib/base-media-call-content.c b/telepathy-glib/base-media-call-content.c
index cfa0aff4e..fc511566c 100644
--- a/telepathy-glib/base-media-call-content.c
+++ b/telepathy-glib/base-media-call-content.c
@@ -72,6 +72,7 @@
#include "telepathy-glib/svc-properties-interface.h"
#include "telepathy-glib/util.h"
#include "telepathy-glib/util-internal.h"
+#include <telepathy-glib/value-array.h>
#define DTMF_PAUSE_MS (3000)
diff --git a/telepathy-glib/base-media-call-stream.c b/telepathy-glib/base-media-call-stream.c
index f04261253..d6aa3dbc8 100644
--- a/telepathy-glib/base-media-call-stream.c
+++ b/telepathy-glib/base-media-call-stream.c
@@ -164,6 +164,7 @@
#include "telepathy-glib/svc-call.h"
#include "telepathy-glib/util.h"
#include "telepathy-glib/util-internal.h"
+#include <telepathy-glib/value-array.h>
static void call_stream_media_iface_init (gpointer, gpointer);
diff --git a/telepathy-glib/base-protocol.c b/telepathy-glib/base-protocol.c
index b232faa04..6a2595c2b 100644
--- a/telepathy-glib/base-protocol.c
+++ b/telepathy-glib/base-protocol.c
@@ -30,6 +30,7 @@
#include <telepathy-glib/svc-generic.h>
#include <telepathy-glib/svc-protocol.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_PARAMS
#include "telepathy-glib/debug-internal.h"
diff --git a/telepathy-glib/call-channel.c b/telepathy-glib/call-channel.c
index fa93b172c..e5670a025 100644
--- a/telepathy-glib/call-channel.c
+++ b/telepathy-glib/call-channel.c
@@ -57,6 +57,7 @@
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_CALL
#include "telepathy-glib/automatic-client-factory-internal.h"
diff --git a/telepathy-glib/call-content-media-description.c b/telepathy-glib/call-content-media-description.c
index 4813ef77d..09baa59f5 100644
--- a/telepathy-glib/call-content-media-description.c
+++ b/telepathy-glib/call-content-media-description.c
@@ -63,6 +63,7 @@
#include "telepathy-glib/svc-properties-interface.h"
#include "telepathy-glib/util.h"
#include "telepathy-glib/util-internal.h"
+#include <telepathy-glib/value-array.h>
static void call_content_media_description_iface_init (gpointer iface,
gpointer data);
diff --git a/telepathy-glib/call-stream-endpoint.c b/telepathy-glib/call-stream-endpoint.c
index f2d96f0de..50872c7fa 100644
--- a/telepathy-glib/call-stream-endpoint.c
+++ b/telepathy-glib/call-stream-endpoint.c
@@ -67,6 +67,7 @@
#include "telepathy-glib/svc-properties-interface.h"
#include "telepathy-glib/util.h"
#include "telepathy-glib/util-internal.h"
+#include <telepathy-glib/value-array.h>
static void call_stream_endpoint_iface_init (gpointer, gpointer);
diff --git a/telepathy-glib/capabilities.c b/telepathy-glib/capabilities.c
index 7ba7d5d7a..d6206962d 100644
--- a/telepathy-glib/capabilities.c
+++ b/telepathy-glib/capabilities.c
@@ -28,6 +28,7 @@
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_CONNECTION
#include "telepathy-glib/debug-internal.h"
diff --git a/telepathy-glib/channel-group.c b/telepathy-glib/channel-group.c
index f388190af..df09cd8cd 100644
--- a/telepathy-glib/channel-group.c
+++ b/telepathy-glib/channel-group.c
@@ -31,6 +31,7 @@
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/proxy.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_GROUPS
#include "telepathy-glib/connection-internal.h"
diff --git a/telepathy-glib/cli-channel.c b/telepathy-glib/cli-channel.c
index b29fed1d0..c1376929d 100644
--- a/telepathy-glib/cli-channel.c
+++ b/telepathy-glib/cli-channel.c
@@ -28,5 +28,6 @@
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/proxy-subclass.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#include "_gen/tp-cli-channel-body.h"
diff --git a/telepathy-glib/cli-connection.c b/telepathy-glib/cli-connection.c
index 62ddc8845..809c43e08 100644
--- a/telepathy-glib/cli-connection.c
+++ b/telepathy-glib/cli-connection.c
@@ -28,5 +28,6 @@
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/proxy-subclass.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#include "_gen/tp-cli-connection-body.h"
diff --git a/telepathy-glib/cli-misc.c b/telepathy-glib/cli-misc.c
index b9b701628..a2a23d323 100644
--- a/telepathy-glib/cli-misc.c
+++ b/telepathy-glib/cli-misc.c
@@ -29,6 +29,7 @@
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/proxy-subclass.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#include "telepathy-glib/_gen/tp-cli-account-body.h"
#include "telepathy-glib/_gen/tp-cli-account-manager-body.h"
diff --git a/telepathy-glib/connection-contact-info.c b/telepathy-glib/connection-contact-info.c
index 611ad1d2b..87b7e1192 100644
--- a/telepathy-glib/connection-contact-info.c
+++ b/telepathy-glib/connection-contact-info.c
@@ -32,6 +32,7 @@
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_CONNECTION
#include "telepathy-glib/connection-internal.h"
diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c
index 692bde34e..6a14838dd 100644
--- a/telepathy-glib/connection.c
+++ b/telepathy-glib/connection.c
@@ -39,6 +39,7 @@
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/proxy-subclass.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_CONNECTION
#include "telepathy-glib/capabilities-internal.h"
diff --git a/telepathy-glib/contact-search.c b/telepathy-glib/contact-search.c
index 0aeb5f0e5..c5e6aebd0 100644
--- a/telepathy-glib/contact-search.c
+++ b/telepathy-glib/contact-search.c
@@ -29,6 +29,7 @@
#include <telepathy-glib/channel.h>
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_CHANNEL
#include "telepathy-glib/channel-internal.h"
diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c
index e127f7488..d72d4b9e7 100644
--- a/telepathy-glib/contact.c
+++ b/telepathy-glib/contact.c
@@ -32,6 +32,7 @@
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_CONTACTS
#include "telepathy-glib/base-contact-list-internal.h"
diff --git a/telepathy-glib/debug-client.c b/telepathy-glib/debug-client.c
index 4edb4e5ff..4eb2811f1 100644
--- a/telepathy-glib/debug-client.c
+++ b/telepathy-glib/debug-client.c
@@ -29,6 +29,7 @@
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/proxy-subclass.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_DEBUGGER
#include "telepathy-glib/client-factory-internal.h"
diff --git a/telepathy-glib/gnio-util.c b/telepathy-glib/gnio-util.c
index 9b49e08f7..31466543f 100644
--- a/telepathy-glib/gnio-util.c
+++ b/telepathy-glib/gnio-util.c
@@ -44,6 +44,7 @@
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/errors.h>
#include <telepathy-glib/util-internal.h>
+#include <telepathy-glib/value-array.h>
#include <string.h>
diff --git a/telepathy-glib/presence-mixin.c b/telepathy-glib/presence-mixin.c
index 7c36feb52..789c1c4e5 100644
--- a/telepathy-glib/presence-mixin.c
+++ b/telepathy-glib/presence-mixin.c
@@ -275,6 +275,7 @@
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/svc-connection.h>
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_PRESENCE
diff --git a/telepathy-glib/protocol.c b/telepathy-glib/protocol.c
index 17573e738..a07423ba2 100644
--- a/telepathy-glib/protocol.c
+++ b/telepathy-glib/protocol.c
@@ -43,6 +43,7 @@
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/proxy-subclass.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_PARAMS
#include "telepathy-glib/capabilities-internal.h"
diff --git a/telepathy-glib/reentrants.c b/telepathy-glib/reentrants.c
index e51a29a98..b7c766326 100644
--- a/telepathy-glib/reentrants.c
+++ b/telepathy-glib/reentrants.c
@@ -4,6 +4,7 @@
#include "telepathy-glib/reentrants.h"
#include <dbus/dbus-glib.h>
+#include <telepathy-glib/value-array.h>
#include <telepathy-glib/_gen/tp-cli-account-reentrant-body.h>
#include <telepathy-glib/_gen/tp-cli-account-manager-reentrant-body.h>
diff --git a/telepathy-glib/room-info.c b/telepathy-glib/room-info.c
index 10942dcf6..df0dee2a1 100644
--- a/telepathy-glib/room-info.c
+++ b/telepathy-glib/room-info.c
@@ -26,6 +26,7 @@
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
/**
* SECTION: room-info
diff --git a/telepathy-glib/telepathy-glib-dbus.h b/telepathy-glib/telepathy-glib-dbus.h
index 7a7e82514..9e533b780 100644
--- a/telepathy-glib/telepathy-glib-dbus.h
+++ b/telepathy-glib/telepathy-glib-dbus.h
@@ -25,6 +25,9 @@
#define _TP_GLIB_DBUS_H_INSIDE
+/* utilities for the dbus-glib type system */
+#include <telepathy-glib/value-array.h>
+
/* common */
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/interfaces.h>
diff --git a/telepathy-glib/tls-certificate.c b/telepathy-glib/tls-certificate.c
index 8ea47c74b..ed766f251 100644
--- a/telepathy-glib/tls-certificate.c
+++ b/telepathy-glib/tls-certificate.c
@@ -40,6 +40,7 @@
#include <telepathy-glib/util-internal.h>
#include <telepathy-glib/tls-certificate-rejection-internal.h>
#include "telepathy-glib/variant-util.h"
+#include <telepathy-glib/value-array.h>
#define DEBUG_FLAG TP_DEBUG_TLS
#include "debug-internal.h"
diff --git a/telepathy-glib/util.h b/telepathy-glib/util.h
index ab0282728..02a392d73 100644
--- a/telepathy-glib/util.h
+++ b/telepathy-glib/util.h
@@ -98,29 +98,6 @@ gulong tp_g_signal_connect_object (gpointer instance,
const gchar *detailed_signal, GCallback c_handler, gpointer gobject,
GConnectFlags connect_flags);
-GValueArray *tp_value_array_build (gsize length,
- GType type,
- ...) G_GNUC_WARN_UNUSED_RESULT;
-void tp_value_array_unpack (GValueArray *array,
- gsize len,
- ...);
-
-/* Work around GLib having deprecated something that is part of our API. */
-_TP_AVAILABLE_IN_0_24
-void tp_value_array_free (GValueArray *va);
-#if TP_VERSION_MAX_ALLOWED >= TP_VERSION_0_24
-#define tp_value_array_free(va) _tp_value_array_free_inline (va)
-#ifndef __GTK_DOC_IGNORE__ /* gtk-doc can't parse this */
-static inline void
-_tp_value_array_free_inline (GValueArray *va)
-{
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- g_value_array_free (va);
- G_GNUC_END_IGNORE_DEPRECATIONS
-}
-#endif
-#endif
-
/* See https://bugzilla.gnome.org/show_bug.cgi?id=680813 for glib inclusion */
typedef struct _TpWeakRef TpWeakRef;
TpWeakRef *tp_weak_ref_new (gpointer object,
diff --git a/telepathy-glib/core-util.c b/telepathy-glib/value-array.c
index 91f4cb610..f72d2119d 100644
--- a/telepathy-glib/core-util.c
+++ b/telepathy-glib/value-array.c
@@ -1,5 +1,6 @@
/*
- * util.c - Source for telepathy-glib utility functions
+ * value-array.c - GValueArray utilities
+ *
* Copyright © 2006-2014 Collabora Ltd. <http://www.collabora.co.uk/>
* Copyright © 2006-2008 Nokia Corporation
*
@@ -19,12 +20,13 @@
*/
#include <config.h>
-#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#include <string.h>
#include <gobject/gvaluecollector.h>
#include <telepathy-glib/defs.h>
+#include <telepathy-glib/util.h>
/* this is the core library, we don't have debug infrastructure yet */
#define CRITICAL(format, ...) \
@@ -35,6 +37,17 @@
G_STRFUNC, ##__VA_ARGS__)
/**
+ * SECTION:value-array
+ * @title: GValueArray utilities
+ * @short_description: Functions to manipulate #GValueArray as used in
+ * dbus-glib, despite its deprecation in GLib
+ *
+ * dbus-glib uses #GValueArray to represent a D-Bus struct/tuple, even
+ * though it's now deprecated in GLib. These utility functions pack/unpack
+ * #GValueArray structures and avoid some of the deprecation warnings.
+ */
+
+/**
* tp_value_array_build: (skip)
* @length: The number of elements that should be in the array
* @type: The type of the first argument.
diff --git a/telepathy-glib/value-array.h b/telepathy-glib/value-array.h
new file mode 100644
index 000000000..07ea778e0
--- /dev/null
+++ b/telepathy-glib/value-array.h
@@ -0,0 +1,59 @@
+/*
+ * value-array.h - GValueArray utility functions
+ *
+ * Copyright © 2006-2010 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright © 2006-2008 Nokia Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#if !defined (_TP_GLIB_DBUS_H_INSIDE) && !defined (_TP_COMPILATION)
+#error "Only <telepathy-glib/telepathy-glib-dbus.h> can be included directly."
+#endif
+
+#ifndef __TP_VALUE_ARRAY_H__
+#define __TP_VALUE_ARRAY_H__
+
+#include <gio/gio.h>
+#include <telepathy-glib/telepathy-glib.h>
+
+G_BEGIN_DECLS
+
+GValueArray *tp_value_array_build (gsize length,
+ GType type,
+ ...) G_GNUC_WARN_UNUSED_RESULT;
+void tp_value_array_unpack (GValueArray *array,
+ gsize len,
+ ...);
+
+/* Work around GLib having deprecated something that is part of our API. */
+_TP_AVAILABLE_IN_0_24
+void tp_value_array_free (GValueArray *va);
+#if TP_VERSION_MAX_ALLOWED >= TP_VERSION_0_24
+#define tp_value_array_free(va) _tp_value_array_free_inline (va)
+#ifndef __GTK_DOC_IGNORE__ /* gtk-doc can't parse this */
+static inline void
+_tp_value_array_free_inline (GValueArray *va)
+{
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+ g_value_array_free (va);
+ G_GNUC_END_IGNORE_DEPRECATIONS
+}
+#endif
+#endif
+
+G_END_DECLS
+
+#endif /* single-inclusion guard */
diff --git a/telepathy-glib/versions/core-1.0.abi b/telepathy-glib/versions/core-1.0.abi
index 1ff4850cb..3b0e683e9 100644
--- a/telepathy-glib/versions/core-1.0.abi
+++ b/telepathy-glib/versions/core-1.0.abi
@@ -19,6 +19,3 @@ tp_proxy_signal_connection_v1_new
tp_svc_interface_peek_dbus_interface_info
tp_svc_interface_set_dbus_interface_info
tp_svc_interface_set_dbus_properties_info
-tp_value_array_build
-tp_value_array_free
-tp_value_array_unpack
diff --git a/telepathy-glib/versions/dbus-1.0.abi b/telepathy-glib/versions/dbus-1.0.abi
index 300860e52..d53a2d127 100644
--- a/telepathy-glib/versions/dbus-1.0.abi
+++ b/telepathy-glib/versions/dbus-1.0.abi
@@ -918,3 +918,6 @@ tp_type_dbus_struct_uus
tp_type_dbus_struct_uuss
tp_type_dbus_struct_uuus
tp_type_dbus_struct_uv
+tp_value_array_build
+tp_value_array_free
+tp_value_array_unpack
diff --git a/tests/capabilities.c b/tests/capabilities.c
index 0ecfc0ef7..4745609f6 100644
--- a/tests/capabilities.c
+++ b/tests/capabilities.c
@@ -12,6 +12,7 @@
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
#include "tests/lib/util.h"
diff --git a/tests/dbus/connection-balance.c b/tests/dbus/connection-balance.c
index 5f8188f1a..d5502b211 100644
--- a/tests/dbus/connection-balance.c
+++ b/tests/dbus/connection-balance.c
@@ -18,6 +18,7 @@
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/proxy-subclass.h>
#include <telepathy-glib/svc-connection.h>
+#include <telepathy-glib/value-array.h>
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
diff --git a/tests/dbus/contact-lists.c b/tests/dbus/contact-lists.c
index 7031170bf..645c96b00 100644
--- a/tests/dbus/contact-lists.c
+++ b/tests/dbus/contact-lists.c
@@ -14,6 +14,7 @@
#include <telepathy-glib/connection.h>
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/interfaces.h>
+#include <telepathy-glib/value-array.h>
#include "telepathy-glib/reentrants.h"
diff --git a/tests/dbus/contacts.c b/tests/dbus/contacts.c
index 44ba184d4..9b196c1b1 100644
--- a/tests/dbus/contacts.c
+++ b/tests/dbus/contacts.c
@@ -32,6 +32,7 @@
#include <telepathy-glib/debug.h>
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/interfaces.h>
+#include <telepathy-glib/value-array.h>
#include "telepathy-glib/reentrants.h"
diff --git a/tests/util.c b/tests/util.c
index cd359ca54..fb28ee257 100644
--- a/tests/util.c
+++ b/tests/util.c
@@ -5,6 +5,7 @@
#include <glib.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/value-array.h>
typedef struct {
int dummy;
diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py
index d5a786f35..d48ef17d8 100644
--- a/tools/glib-ginterface-gen.py
+++ b/tools/glib-ginterface-gen.py
@@ -745,8 +745,10 @@ class Generator(object):
self.b('#include <telepathy-glib/dbus.h>')
self.b('#include <telepathy-glib/dbus-properties-mixin.h>')
self.b('#include <telepathy-glib/util.h>')
+ self.b('#include <telepathy-glib/value-array.h>')
else:
self.b('#include <telepathy-glib/telepathy-glib.h>')
+ self.b('#include <telepathy-glib/telepathy-glib-dbus.h>')
self.b('')
for header in self.headers: