index.html
Main Page
|
modules.html
Modules
|
namespaces.html
Namespace List
|
hierarchy.html
Class Hierarchy
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
namespacemembers.html
Namespace Members
|
functions.html
Data Fields
|
pages.html
Related Pages
dir_000005.html
glib
dbus-glib.c
00001
/* -*- mode: C; c-file-style: "gnu" -*- */
00002
/* dbus-glib.c General GLib binding stuff
00003
*
00004
* Copyright (C) 2004 Red Hat, Inc.
00005
*
00006
* Licensed under the Academic Free License version 2.1
00007
*
00008
* This program is free software; you can redistribute it and/or modify
00009
* it under the terms of the GNU General Public License as published by
00010
* the Free Software Foundation; either version 2 of the License, or
00011
* (at your option) any later version.
00012
*
00013
* This program is distributed in the hope that it will be useful,
00014
* but WITHOUT ANY WARRANTY; without even the implied warranty of
00015
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016
* GNU General Public License for more details.
00017
*
00018
* You should have received a copy of the GNU General Public License
00019
* along with this program; if not, write to the Free Software
00020
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021
*
00022
*/
00023
00024
#include <config.h>
00025
#include <dbus/dbus-glib.h>
00026
#include <dbus/dbus-glib-lowlevel.h>
00027
#include "dbus-gtest.h"
00028
#include "dbus-gutils.h"
00029
#include "dbus-gobject.h"
00030
#include <string.h>
00031
00032
#include <libintl.h>
00033
#define _(x) dgettext (GETTEXT_PACKAGE, x)
00034
#define N_(x) x
00035
00046
void
group__DBusGLib.html#ga0
00047
group__DBusGLib.html#ga0
dbus_g_connection_flush
(DBusGConnection *connection)
00048 {
00049
group__DBusConnection.html#ga27
dbus_connection_flush
(DBUS_CONNECTION_FROM_G_CONNECTION (connection));
00050 }
00051
00058 DBusGConnection*
group__DBusGLib.html#ga1
00059
group__DBusGLib.html#ga1
dbus_g_connection_ref
(DBusGConnection *gconnection)
00060 {
00061
structDBusConnection.html
DBusConnection
*c;
00062
00063   c = DBUS_CONNECTION_FROM_G_CONNECTION (gconnection);
00064
group__DBusConnection.html#ga3
dbus_connection_ref
(c);
00065
return
gconnection;
00066 }
00067
00068
00074
void
group__DBusGLib.html#ga2
00075
group__DBusGLib.html#ga2
dbus_g_connection_unref
(DBusGConnection *gconnection)
00076 {
00077
structDBusConnection.html
DBusConnection
*c;
00078
00079   c = DBUS_CONNECTION_FROM_G_CONNECTION (gconnection);
00080
group__DBusConnection.html#ga5
dbus_connection_unref
(c);
00081 }
00082
00083
00090 DBusGMessage*
group__DBusGLib.html#ga3
00091
group__DBusGLib.html#ga3
dbus_g_message_ref
(DBusGMessage *gmessage)
00092 {
00093
structDBusMessage.html
DBusMessage
*c;
00094
00095   c = DBUS_MESSAGE_FROM_G_MESSAGE (gmessage);
00096
group__DBusMessage.html#ga19
dbus_message_ref
(c);
00097
return
gmessage;
00098 }
00099
00105
void
group__DBusGLib.html#ga4
00106
group__DBusGLib.html#ga4
dbus_g_message_unref
(DBusGMessage *gmessage)
00107 {
00108
structDBusMessage.html
DBusMessage
*c;
00109
00110   c = DBUS_MESSAGE_FROM_G_MESSAGE (gmessage);
00111
group__DBusMessage.html#ga20
dbus_message_unref
(c);
00112 }
00113
00120 GQuark
group__DBusGLib.html#ga5
00121
group__DBusGLib.html#ga5
dbus_g_error_quark
(
void
)
00122 {
00123
static
GQuark quark = 0;
00124
if
(quark == 0)
00125     quark = g_quark_from_static_string (
"g-exec-error-quark"
);
00126
return
quark;
00127 }
00128
00143 gboolean
group__DBusGLib.html#ga6
00144
group__DBusGLib.html#ga6
dbus_g_error_has_name
(GError *error,
const
char
*name)
00145 {
00146   g_return_val_if_fail (error !=
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga3
FALSE
);
00147
00148
if
(error->domain != DBUS_GERROR
00149       || error->code != DBUS_GERROR_REMOTE_EXCEPTION)
00150
return
group__DBusMacros.html#ga3
FALSE
;
00151
00152
return
!strcmp (
group__DBusGLib.html#ga7
dbus_g_error_get_name
(error), name);
00153 }
00154
00167
const
char
*
group__DBusGLib.html#ga7
00168
group__DBusGLib.html#ga7
dbus_g_error_get_name
(GError *error)
00169 {
00170   g_return_val_if_fail (error !=
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga4
NULL
);
00171   g_return_val_if_fail (error->domain == DBUS_GERROR,
group__DBusMacros.html#ga4
NULL
);
00172   g_return_val_if_fail (error->code == DBUS_GERROR_REMOTE_EXCEPTION,
group__DBusMacros.html#ga4
NULL
);
00173
00174
return
error->message + strlen (error->message) + 1;
00175 }
00176
00182 GType
group__DBusGLib.html#ga8
00183
group__DBusGLib.html#ga8
dbus_connection_get_g_type
(
void
)
00184 {
00185
static
GType our_type = 0;
00186
00187
if
(our_type == 0)
00188     our_type = g_boxed_type_register_static (
"DBusConnection"
,
00189                                              (GBoxedCopyFunc)
group__DBusConnection.html#ga3
dbus_connection_ref
,
00190                                              (GBoxedFreeFunc)
group__DBusConnection.html#ga5
dbus_connection_unref
);
00191
00192
return
our_type;
00193 }
00194
00200 GType
group__DBusGLib.html#ga9
00201
group__DBusGLib.html#ga9
dbus_message_get_g_type
(
void
)
00202 {
00203
static
GType our_type = 0;
00204
00205
if
(our_type == 0)
00206     our_type = g_boxed_type_register_static (
"DBusMessage"
,
00207                                              (GBoxedCopyFunc)
group__DBusMessage.html#ga19
dbus_message_ref
,
00208                                              (GBoxedFreeFunc)
group__DBusMessage.html#ga20
dbus_message_unref
);
00209
00210
return
our_type;
00211 }
00212
00218 GType
group__DBusGLib.html#ga10
00219
group__DBusGLib.html#ga10
dbus_g_connection_get_g_type
(
void
)
00220 {
00221
static
GType our_type = 0;
00222
00223
if
(our_type == 0)
00224     our_type = g_boxed_type_register_static (
"DBusGConnection"
,
00225                                              (GBoxedCopyFunc)
group__DBusGLib.html#ga1
dbus_g_connection_ref
,
00226                                              (GBoxedFreeFunc)
group__DBusGLib.html#ga2
dbus_g_connection_unref
);
00227
00228
return
our_type;
00229 }
00230
00236 GType
group__DBusGLib.html#ga11
00237
group__DBusGLib.html#ga11
dbus_g_message_get_g_type
(
void
)
00238 {
00239
static
GType our_type = 0;
00240
00241
if
(our_type == 0)
00242     our_type = g_boxed_type_register_static (
"DBusGMessage"
,
00243                                              (GBoxedCopyFunc)
group__DBusGLib.html#ga3
dbus_g_message_ref
,
00244                                              (GBoxedFreeFunc)
group__DBusGLib.html#ga4
dbus_g_message_unref
);
00245
00246
return
our_type;
00247 }
00248
00255
structDBusConnection.html
DBusConnection
*
group__DBusGLib.html#ga12
00256
group__DBusGLib.html#ga12
dbus_g_connection_get_connection
(DBusGConnection *gconnection)
00257 {
00258
return
DBUS_CONNECTION_FROM_G_CONNECTION (gconnection);
00259 }
00260
00267
structDBusMessage.html
DBusMessage
*
group__DBusGLib.html#ga13
00268
group__DBusGLib.html#ga13
dbus_g_message_get_message
(DBusGMessage *gmessage)
00269 {
00270
return
DBUS_MESSAGE_FROM_G_MESSAGE (gmessage);
00271 }
00272
/* end of public API */
00274
00275
00276
#ifdef DBUS_BUILD_TESTS
00277
00283 gboolean
00284 _dbus_glib_test (
const
char
*test_data_dir)
00285 {
00286
structDBusError.html
DBusError
err;
00287   GError *gerror =
group__DBusMacros.html#ga4
NULL
;
00288
00289
group__DBusErrors.html#ga0
dbus_error_init
(&err);
00290
group__DBusErrors.html#ga2
dbus_set_error_const
(&err, DBUS_ERROR_NO_MEMORY,
"Out of memory!"
);
00291
00292
group__DBusGLibInternals.html#ga70
dbus_set_g_error
(&gerror, &err);
00293   g_assert (gerror !=
group__DBusMacros.html#ga4
NULL
);
00294   g_assert (gerror->domain == DBUS_GERROR);
00295   g_assert (gerror->code == DBUS_GERROR_NO_MEMORY);
00296   g_assert (!strcmp (gerror->message,
"Out of memory!"
));
00297
00298
group__DBusErrors.html#ga0
dbus_error_init
(&err);
00299   g_clear_error (&gerror);
00300
00301
return
group__DBusMacros.html#ga2
TRUE
;
00302 }
00303
00304
#endif
/* DBUS_BUILD_TESTS */
Generated on Tue Sep 13 01:28:06 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
