D-Bus  1.12.16
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-macros.h>
32 #include <dbus/dbus-message.h>
33 #include <dbus/dbus-connection.h>
34 #include <dbus/dbus-protocol.h>
35 
37 
43 typedef struct DBusServer DBusServer;
44 
48 typedef void (* DBusNewConnectionFunction) (DBusServer *server,
49  DBusConnection *new_connection,
50  void *data);
51 
52 DBUS_EXPORT
54  DBusError *error);
55 DBUS_EXPORT
57 DBUS_EXPORT
58 void dbus_server_unref (DBusServer *server);
59 DBUS_EXPORT
60 void dbus_server_disconnect (DBusServer *server);
61 DBUS_EXPORT
63 DBUS_EXPORT
64 char* dbus_server_get_address (DBusServer *server);
65 DBUS_EXPORT
66 char* dbus_server_get_id (DBusServer *server);
67 DBUS_EXPORT
70  void *data,
71  DBusFreeFunction free_data_function);
72 DBUS_EXPORT
74  DBusAddWatchFunction add_function,
75  DBusRemoveWatchFunction remove_function,
76  DBusWatchToggledFunction toggled_function,
77  void *data,
78  DBusFreeFunction free_data_function);
79 DBUS_EXPORT
81  DBusAddTimeoutFunction add_function,
82  DBusRemoveTimeoutFunction remove_function,
83  DBusTimeoutToggledFunction toggled_function,
84  void *data,
85  DBusFreeFunction free_data_function);
86 DBUS_EXPORT
88  const char **mechanisms);
89 
90 DBUS_EXPORT
92 DBUS_EXPORT
94 DBUS_EXPORT
96  int slot,
97  void *data,
98  DBusFreeFunction free_data_func);
99 DBUS_EXPORT
100 void* dbus_server_get_data (DBusServer *server,
101  int slot);
102 
115 static inline void
116 dbus_clear_server (DBusServer **pointer_to_server)
117 {
118  _dbus_clear_pointer_impl (DBusServer, pointer_to_server, dbus_server_unref);
119 }
120 
124 
125 #endif /* DBUS_SERVER_H */