D-Bus: dbus-server.h Source File

D-Bus 1.10.10

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List

dbus-server.h
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* dbus-server.h DBusServer object
3 *
4 * Copyright (C) 2002, 2003 Red Hat Inc.
5 *
6 * Licensed under the Academic Free License version 2.1
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 *
22 */
23 #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
24 #error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
25 #endif
26
27 #ifndef DBUS_SERVER_H
28 #define DBUS_SERVER_H
29
30 #include <dbus/dbus-errors.h>
31 #include <dbus/dbus-message.h>
32 #include <dbus/dbus-connection.h>
33 #include <dbus/dbus-protocol.h>
34
35 DBUS_BEGIN_DECLS
36
42 typedef struct DBusServer DBusServer;
43
47 typedef void (* DBusNewConnectionFunction) (DBusServer *server,
48 DBusConnection *new_connection,
49 void *data);
50
51 DBUS_EXPORT
52 DBusServer* dbus_server_listen (const char *address,
53 DBusError *error);
54 DBUS_EXPORT
55 DBusServer* dbus_server_ref (DBusServer *server);
56 DBUS_EXPORT
57 void dbus_server_unref (DBusServer *server);
58 DBUS_EXPORT
59 void dbus_server_disconnect (DBusServer *server);
60 DBUS_EXPORT
61 dbus_bool_t dbus_server_get_is_connected (DBusServer *server);
62 DBUS_EXPORT
63 char* dbus_server_get_address (DBusServer *server);
64 DBUS_EXPORT
65 char* dbus_server_get_id (DBusServer *server);
66 DBUS_EXPORT
67 void dbus_server_set_new_connection_function (DBusServer *server,
68 DBusNewConnectionFunction function,
69 void *data,
70 DBusFreeFunction free_data_function);
71 DBUS_EXPORT
72 dbus_bool_t dbus_server_set_watch_functions (DBusServer *server,
73 DBusAddWatchFunction add_function,
74 DBusRemoveWatchFunction remove_function,
75 DBusWatchToggledFunction toggled_function,
76 void *data,
77 DBusFreeFunction free_data_function);
78 DBUS_EXPORT
79 dbus_bool_t dbus_server_set_timeout_functions (DBusServer *server,
80 DBusAddTimeoutFunction add_function,
81 DBusRemoveTimeoutFunction remove_function,
82 DBusTimeoutToggledFunction toggled_function,
83 void *data,
84 DBusFreeFunction free_data_function);
85 DBUS_EXPORT
86 dbus_bool_t dbus_server_set_auth_mechanisms (DBusServer *server,
87 const char **mechanisms);
88
89 DBUS_EXPORT
90 dbus_bool_t dbus_server_allocate_data_slot (dbus_int32_t *slot_p);
91 DBUS_EXPORT
92 void dbus_server_free_data_slot (dbus_int32_t *slot_p);
93 DBUS_EXPORT
94 dbus_bool_t dbus_server_set_data (DBusServer *server,
95 int slot,
96 void *data,
97 DBusFreeFunction free_data_func);
98 DBUS_EXPORT
99 void* dbus_server_get_data (DBusServer *server,
100 int slot);
101
104 DBUS_END_DECLS
105
106 #endif /* DBUS_SERVER_H */
dbus_server_free_data_slot
void dbus_server_free_data_slot(dbus_int32_t *slot_p)
Deallocates a global ID for server data slots.
Definition: dbus-server.c:1106
DBusFreeFunction
void(* DBusFreeFunction)(void *memory)
The type of a function which frees a block of memory.
Definition: dbus-memory.h:64
DBUS_BEGIN_DECLS
#define DBUS_BEGIN_DECLS
Macro used prior to declaring functions in the D-Bus header files.
DBusWatchToggledFunction
void(* DBusWatchToggledFunction)(DBusWatch *watch, void *data)
Called when dbus_watch_get_enabled() may return a different value than it did before.
Definition: dbus-connection.h:97
dbus_server_set_data
dbus_bool_t dbus_server_set_data(DBusServer *server, int slot, void *data, DBusFreeFunction free_data_func)
Stores a pointer on a DBusServer, along with an optional function to be used for freeing the data whe...
Definition: dbus-server.c:1127
DBusServer
Internals of DBusServer object.
Definition: dbus-server-protected.h:56
DBusConnection
Implementation details of DBusConnection.
Definition: dbus-connection.c:256
DBusNewConnectionFunction
void(* DBusNewConnectionFunction)(DBusServer *server, DBusConnection *new_connection, void *data)
Called when a new connection to the server is available.
Definition: dbus-server.h:47
DBusRemoveTimeoutFunction
void(* DBusRemoveTimeoutFunction)(DBusTimeout *timeout, void *data)
Called when libdbus no longer needs a timeout to be monitored by the main loop.
Definition: dbus-connection.h:123
dbus_server_listen
DBusServer * dbus_server_listen(const char *address, DBusError *error)
Listens for new connections on the given address.
Definition: dbus-server.c:557
dbus_bool_t
dbus_uint32_t dbus_bool_t
A boolean, valid values are TRUE and FALSE.
Definition: dbus-types.h:35
DBusAddTimeoutFunction
dbus_bool_t(* DBusAddTimeoutFunction)(DBusTimeout *timeout, void *data)
Called when libdbus needs a new timeout to be monitored by the main loop.
Definition: dbus-connection.h:110
dbus_server_ref
DBusServer * dbus_server_ref(DBusServer *server)
Increments the reference count of a DBusServer.
Definition: dbus-server.c:695
dbus_server_allocate_data_slot
dbus_bool_t dbus_server_allocate_data_slot(dbus_int32_t *slot_p)
Allocates an integer ID to be used for storing application-specific data on any DBusServer.
Definition: dbus-server.c:1088
DBusError
Object representing an exception.
Definition: dbus-errors.h:48
dbus_server_set_new_connection_function
void dbus_server_set_new_connection_function(DBusServer *server, DBusNewConnectionFunction function, void *data, DBusFreeFunction free_data_function)
Sets a function to be used for handling new connections.
Definition: dbus-server.c:897
dbus_server_get_data
void * dbus_server_get_data(DBusServer *server, int slot)
Retrieves data previously set with dbus_server_set_data().
Definition: dbus-server.c:1167
dbus_server_disconnect
void dbus_server_disconnect(DBusServer *server)
Releases the server&#39;s address and stops listening for new clients.
Definition: dbus-server.c:778
dbus_server_unref
void dbus_server_unref(DBusServer *server)
Decrements the reference count of a DBusServer.
Definition: dbus-server.c:728
DBusTimeoutToggledFunction
void(* DBusTimeoutToggledFunction)(DBusTimeout *timeout, void *data)
Called when dbus_timeout_get_enabled() may return a different value than it did before.
Definition: dbus-connection.h:117
DBusServer::address
char * address
Address this server is listening on.
Definition: dbus-server-protected.h:69
DBusAddWatchFunction
dbus_bool_t(* DBusAddWatchFunction)(DBusWatch *watch, void *data)
Called when libdbus needs a new watch to be monitored by the main loop.
Definition: dbus-connection.h:91
DBusRemoveWatchFunction
void(* DBusRemoveWatchFunction)(DBusWatch *watch, void *data)
Called when libdbus no longer needs a watch to be monitored by the main loop.
Definition: dbus-connection.h:103
dbus_server_set_auth_mechanisms
dbus_bool_t dbus_server_set_auth_mechanisms(DBusServer *server, const char **mechanisms)
Sets the authentication mechanisms that this server offers to clients, as a NULL-terminated array of ...
Definition: dbus-server.c:1041
dbus_server_get_is_connected
dbus_bool_t dbus_server_get_is_connected(DBusServer *server)
Returns TRUE if the server is still listening for new connections.
Definition: dbus-server.c:805
dbus_server_get_address
char * dbus_server_get_address(DBusServer *server)
Returns the address of the server, as a newly-allocated string which must be freed by the caller...
Definition: dbus-server.c:826
dbus_server_set_watch_functions
dbus_bool_t dbus_server_set_watch_functions(DBusServer *server, DBusAddWatchFunction add_function, DBusRemoveWatchFunction remove_function, DBusWatchToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function)
Sets the watch functions for the server.
Definition: dbus-server.c:937
dbus_server_set_timeout_functions
dbus_bool_t dbus_server_set_timeout_functions(DBusServer *server, DBusAddTimeoutFunction add_function, DBusRemoveTimeoutFunction remove_function, DBusTimeoutToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function)
Sets the timeout functions for the server.
Definition: dbus-server.c:990
dbus_int32_t
int dbus_int32_t
A 32-bit signed integer on all platforms.
Definition: dbus-arch-deps.h:42
dbus_server_get_id
char * dbus_server_get_id(DBusServer *server)
Returns the unique ID of the server, as a newly-allocated string which must be freed by the caller...
Definition: dbus-server.c:862
DBUS_END_DECLS
#define DBUS_END_DECLS
Macro used after declaring functions in the D-Bus header files.