[Pkg-telepathy-commits] [telepathy-glib-1] 91/212: Rename core-util.c to value-array.c and put it in the -dbus library

Simon McVittie smcv at debian.org
Wed May 14 12:08:55 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-glib-1.

commit 56d7499fda89d7c81c93142f148db1511c338987
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Mon Mar 31 14:36:18 2014 +0100

    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
---
 .../telepathy-glib/telepathy-glib-docs.sgml        |  1 +
 .../telepathy-glib/telepathy-glib-sections.txt     | 12 +++--
 telepathy-glib/Makefile.am                         |  3 +-
 telepathy-glib/account-request.c                   |  1 +
 telepathy-glib/account.c                           |  1 +
 telepathy-glib/base-call-channel.c                 |  1 +
 telepathy-glib/base-call-content.c                 |  1 +
 telepathy-glib/base-call-stream.c                  |  1 +
 telepathy-glib/base-client.c                       |  1 +
 telepathy-glib/base-connection.c                   |  1 +
 telepathy-glib/base-contact-list.c                 |  1 +
 telepathy-glib/base-media-call-content.c           |  1 +
 telepathy-glib/base-media-call-stream.c            |  1 +
 telepathy-glib/base-protocol.c                     |  1 +
 telepathy-glib/call-channel.c                      |  1 +
 telepathy-glib/call-content-media-description.c    |  1 +
 telepathy-glib/call-stream-endpoint.c              |  1 +
 telepathy-glib/capabilities.c                      |  1 +
 telepathy-glib/channel-group.c                     |  1 +
 telepathy-glib/cli-channel.c                       |  1 +
 telepathy-glib/cli-connection.c                    |  1 +
 telepathy-glib/cli-misc.c                          |  1 +
 telepathy-glib/connection-contact-info.c           |  1 +
 telepathy-glib/connection.c                        |  1 +
 telepathy-glib/contact-search.c                    |  1 +
 telepathy-glib/contact.c                           |  1 +
 telepathy-glib/debug-client.c                      |  1 +
 telepathy-glib/gnio-util.c                         |  1 +
 telepathy-glib/presence-mixin.c                    |  1 +
 telepathy-glib/protocol.c                          |  1 +
 telepathy-glib/reentrants.c                        |  1 +
 telepathy-glib/room-info.c                         |  1 +
 telepathy-glib/telepathy-glib-dbus.h               |  3 ++
 telepathy-glib/tls-certificate.c                   |  1 +
 telepathy-glib/util.h                              | 23 ---------
 telepathy-glib/{core-util.c => value-array.c}      | 17 ++++++-
 telepathy-glib/value-array.h                       | 59 ++++++++++++++++++++++
 telepathy-glib/versions/core-1.0.abi               |  3 --
 telepathy-glib/versions/dbus-1.0.abi               |  3 ++
 tests/capabilities.c                               |  1 +
 tests/dbus/connection-balance.c                    |  1 +
 tests/dbus/contact-lists.c                         |  1 +
 tests/dbus/contacts.c                              |  1 +
 tests/util.c                                       |  1 +
 tools/glib-ginterface-gen.py                       |  2 +
 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 d6f1222..6e99cc2 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 f45ed8a..52eaee8 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 3f42c92..25aa52c 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 97fd9b4..183eb55 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 2d920d5..d34ebb9 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 875348b..b87d4d6 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 fd5c5ee..0f48fcb 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 4bc5d87..dcb2c40 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 e2cb1d9..436df35 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 eabe3fd..3ca13dd 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 47e6d75..d9ed45a 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 cfa0aff..fc51156 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 f042612..d6aa3db 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 b232faa..6a2595c 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 fa93b17..e5670a0 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 4813ef7..09baa59 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 f2d96f0..50872c7 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 7ba7d5d..d620696 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 f388190..df09cd8 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 b29fed1..c137692 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 62ddc88..809c43e 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 b9b7016..a2a23d3 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 611ad1d..87b7e11 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 692bde3..6a14838 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 0aeb5f0..c5e6aeb 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 e127f74..d72d4b9 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 4edb4e5..4eb2811 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 9b49e08..3146654 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 7c36feb..789c1c4 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 17573e7..a07423b 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 e51a29a..b7c7663 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 10942dc..df0dee2 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 7a7e825..9e533b7 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 8ea47c7..ed766f2 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 ab02827..02a392d 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
similarity index 90%
rename from telepathy-glib/core-util.c
rename to telepathy-glib/value-array.c
index 91f4cb6..f72d211 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 0000000..07ea778
--- /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 1ff4850..3b0e683 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 300860e..d53a2d1 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 0ecfc0e..4745609 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 5f8188f..d5502b2 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 7031170..645c96b 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 44ba184..9b196c1 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 cd359ca..fb28ee2 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 d5a786f..d48ef17 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:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-glib-1.git



More information about the Pkg-telepathy-commits mailing list