1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
/*
* util-internal.h - Headers for non-public telepathy-glib utility functions
*
* Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
*
* 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
*/
#ifndef __TP_UTIL_INTERNAL_H__
#define __TP_UTIL_INTERNAL_H__
#include "config.h"
#include <glib.h>
#include <gio/gio.h>
#include <telepathy-glib/channel-request.h>
#include <telepathy-glib/connection.h>
#include <telepathy-glib/contact.h>
GArray *_tp_quark_array_copy (const GQuark *quarks) G_GNUC_WARN_UNUSED_RESULT;
void _tp_quark_array_merge (GArray *array, const GQuark *quarks, gssize n);
#ifdef HAVE_GIO_UNIX
GSocketAddress * _tp_create_temp_unix_socket (GSocketService *service,
GError **error);
#endif /* HAVE_GIO_UNIX */
GList * _tp_create_channel_request_list (TpDBusDaemon *dbus,
GHashTable *request_props);
/* Copied from wocky/wocky-utils.h */
#define _tp_implement_finish_void(source, tag) \
if (g_simple_async_result_propagate_error (\
G_SIMPLE_ASYNC_RESULT (result), error)) \
return FALSE; \
g_return_val_if_fail (g_simple_async_result_is_valid (result, \
G_OBJECT(source), tag), \
FALSE); \
return TRUE;
#define _tp_implement_finish_copy_pointer(source, tag, copy_func, \
out_param) \
GSimpleAsyncResult *_simple; \
_simple = (GSimpleAsyncResult *) result; \
if (g_simple_async_result_propagate_error (_simple, error)) \
return FALSE; \
g_return_val_if_fail (g_simple_async_result_is_valid (result, \
G_OBJECT (source), tag), \
FALSE); \
if (out_param != NULL) \
*out_param = copy_func ( \
g_simple_async_result_get_op_res_gpointer (_simple)); \
return TRUE;
#define _tp_implement_finish_return_copy_pointer(source, tag, copy_func) \
GSimpleAsyncResult *_simple; \
_simple = (GSimpleAsyncResult *) result; \
if (g_simple_async_result_propagate_error (_simple, error)) \
return NULL; \
g_return_val_if_fail (g_simple_async_result_is_valid (result, \
G_OBJECT (source), tag), \
NULL); \
return copy_func (g_simple_async_result_get_op_res_gpointer (_simple));
gboolean _tp_bind_connection_status_to_boolean (GBinding *binding,
const GValue *src_value, GValue *dest_value, gpointer user_data);
/* Suggested to include in GLib: bug #654450 */
GPtrArray *_tp_g_ptr_array_sized_new_with_free_func (guint reserved_size,
GDestroyNotify element_free_func);
gboolean _tp_set_socket_address_type_and_access_control_type (
GHashTable *supported_sockets,
TpSocketAddressType *address_type,
TpSocketAccessControl *access_control,
GError **error);
GSocket * _tp_create_client_socket (TpSocketAddressType socket_type,
GError **error);
gboolean _tp_contacts_to_handles (TpConnection *connection,
guint n_contacts,
TpContact * const *contacts,
GArray **handles);
#endif /* __TP_UTIL_INTERNAL_H__ */
|