D-Bus  1.8.2
dbus-connection.h
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* dbus-connection.h DBusConnection 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_CONNECTION_H
28 #define DBUS_CONNECTION_H
29 
30 #include <dbus/dbus-errors.h>
31 #include <dbus/dbus-memory.h>
32 #include <dbus/dbus-message.h>
33 #include <dbus/dbus-shared.h>
34 
36 
42 /* documented in dbus-watch.c */
43 typedef struct DBusWatch DBusWatch;
44 /* documented in dbus-timeout.c */
45 typedef struct DBusTimeout DBusTimeout;
54 
58 typedef enum
59 {
62  DBUS_WATCH_ERROR = 1 << 2,
72  /* Internal to libdbus, there is also _DBUS_WATCH_NVAL in dbus-watch.h */
74 
79 typedef enum
80 {
85 
92  void *data);
97 typedef void (* DBusWatchToggledFunction) (DBusWatch *watch,
98  void *data);
103 typedef void (* DBusRemoveWatchFunction) (DBusWatch *watch,
104  void *data);
111  void *data);
117 typedef void (* DBusTimeoutToggledFunction) (DBusTimeout *timeout,
118  void *data);
123 typedef void (* DBusRemoveTimeoutFunction) (DBusTimeout *timeout,
124  void *data);
128 typedef void (* DBusDispatchStatusFunction) (DBusConnection *connection,
129  DBusDispatchStatus new_status,
130  void *data);
135 typedef void (* DBusWakeupMainFunction) (void *data);
136 
144  unsigned long uid,
145  void *data);
146 
154  const char *user_sid,
155  void *data);
156 
157 
163  void *user_data);
164 
170  DBusMessage *message,
171  void *user_data);
172 DBUS_EXPORT
173 DBusConnection* dbus_connection_open (const char *address,
174  DBusError *error);
175 DBUS_EXPORT
176 DBusConnection* dbus_connection_open_private (const char *address,
177  DBusError *error);
178 DBUS_EXPORT
180 DBUS_EXPORT
181 void dbus_connection_unref (DBusConnection *connection);
182 DBUS_EXPORT
183 void dbus_connection_close (DBusConnection *connection);
184 DBUS_EXPORT
186 DBUS_EXPORT
188 DBUS_EXPORT
190 DBUS_EXPORT
192 DBUS_EXPORT
194  int type);
195 
196 DBUS_EXPORT
198  dbus_bool_t exit_on_disconnect);
199 DBUS_EXPORT
200 void dbus_connection_flush (DBusConnection *connection);
201 DBUS_EXPORT
203  int timeout_milliseconds);
204 DBUS_EXPORT
206  int timeout_milliseconds);
207 DBUS_EXPORT
209 DBUS_EXPORT
211  DBusMessage *message);
212 DBUS_EXPORT
214  DBusMessage *message);
215 DBUS_EXPORT
217 DBUS_EXPORT
219 DBUS_EXPORT
221 DBUS_EXPORT
223 DBUS_EXPORT
225  DBusMessage *message,
226  dbus_uint32_t *client_serial);
227 DBUS_EXPORT
229  DBusMessage *message,
230  DBusPendingCall **pending_return,
231  int timeout_milliseconds);
232 DBUS_EXPORT
234  DBusMessage *message,
235  int timeout_milliseconds,
236  DBusError *error);
237 DBUS_EXPORT
239  DBusAddWatchFunction add_function,
240  DBusRemoveWatchFunction remove_function,
241  DBusWatchToggledFunction toggled_function,
242  void *data,
243  DBusFreeFunction free_data_function);
244 DBUS_EXPORT
246  DBusAddTimeoutFunction add_function,
247  DBusRemoveTimeoutFunction remove_function,
248  DBusTimeoutToggledFunction toggled_function,
249  void *data,
250  DBusFreeFunction free_data_function);
251 DBUS_EXPORT
253  DBusWakeupMainFunction wakeup_main_function,
254  void *data,
255  DBusFreeFunction free_data_function);
256 DBUS_EXPORT
259  void *data,
260  DBusFreeFunction free_data_function);
261 DBUS_EXPORT
263  unsigned long *uid);
264 DBUS_EXPORT
266  unsigned long *pid);
267 #ifdef DBUS_ENABLE_SMACK
268 DBUS_EXPORT
269 dbus_bool_t dbus_connection_get_smack_label (DBusConnection *connection,
270  const char **label);
271 #endif
272 DBUS_EXPORT
274  void **data,
275  dbus_int32_t *data_size);
276 DBUS_EXPORT
278  DBusAllowUnixUserFunction function,
279  void *data,
280  DBusFreeFunction free_data_function);
281 DBUS_EXPORT
283  char **windows_sid_p);
284 DBUS_EXPORT
287  void *data,
288  DBusFreeFunction free_data_function);
289 DBUS_EXPORT
291  dbus_bool_t value);
292 DBUS_EXPORT
294  dbus_bool_t value);
295 
296 
297 /* Filters */
298 
299 DBUS_EXPORT
301  DBusHandleMessageFunction function,
302  void *user_data,
303  DBusFreeFunction free_data_function);
304 DBUS_EXPORT
306  DBusHandleMessageFunction function,
307  void *user_data);
308 
309 
310 /* Other */
311 DBUS_EXPORT
313 DBUS_EXPORT
315 DBUS_EXPORT
317  dbus_int32_t slot,
318  void *data,
319  DBusFreeFunction free_data_func);
320 DBUS_EXPORT
321 void* dbus_connection_get_data (DBusConnection *connection,
322  dbus_int32_t slot);
323 
324 DBUS_EXPORT
325 void dbus_connection_set_change_sigpipe (dbus_bool_t will_modify_sigpipe);
326 
327 DBUS_EXPORT
329  long size);
330 DBUS_EXPORT
332 DBUS_EXPORT
334  long size);
335 DBUS_EXPORT
337 
338 DBUS_EXPORT
340  long n);
341 DBUS_EXPORT
343 DBUS_EXPORT
345  long n);
346 DBUS_EXPORT
348 
349 DBUS_EXPORT
351 DBUS_EXPORT
353 
354 DBUS_EXPORT
356 DBUS_EXPORT
358  DBusPreallocatedSend *preallocated);
359 DBUS_EXPORT
361  DBusPreallocatedSend *preallocated,
362  DBusMessage *message,
363  dbus_uint32_t *client_serial);
364 
365 
366 /* Object tree functionality */
367 
372 typedef void (* DBusObjectPathUnregisterFunction) (DBusConnection *connection,
373  void *user_data);
380  DBusMessage *message,
381  void *user_data);
382 
390 {
394  void (* dbus_internal_pad1) (void *);
395  void (* dbus_internal_pad2) (void *);
396  void (* dbus_internal_pad3) (void *);
397  void (* dbus_internal_pad4) (void *);
398 };
399 
400 DBUS_EXPORT
402  const char *path,
403  const DBusObjectPathVTable *vtable,
404  void *user_data,
405  DBusError *error);
406 
407 DBUS_EXPORT
409  const char *path,
410  const DBusObjectPathVTable *vtable,
411  void *user_data);
412 
413 DBUS_EXPORT
415  const char *path,
416  const DBusObjectPathVTable *vtable,
417  void *user_data,
418  DBusError *error);
419 
420 DBUS_EXPORT
422  const char *path,
423  const DBusObjectPathVTable *vtable,
424  void *user_data);
425 DBUS_EXPORT
427  const char *path);
428 
429 DBUS_EXPORT
431  const char *path,
432  void **data_p);
433 
434 DBUS_EXPORT
436  const char *parent_path,
437  char ***child_entries);
438 
439 DBUS_EXPORT
441  int *fd);
442 DBUS_EXPORT
444  int *fd);
445 
454 #ifndef DBUS_DISABLE_DEPRECATED
455 DBUS_EXPORT
457 #endif
458 
459 DBUS_EXPORT
460 int dbus_watch_get_unix_fd (DBusWatch *watch);
461 DBUS_EXPORT
462 int dbus_watch_get_socket (DBusWatch *watch);
463 DBUS_EXPORT
464 unsigned int dbus_watch_get_flags (DBusWatch *watch);
465 DBUS_EXPORT
466 void* dbus_watch_get_data (DBusWatch *watch);
467 DBUS_EXPORT
468 void dbus_watch_set_data (DBusWatch *watch,
469  void *data,
470  DBusFreeFunction free_data_function);
471 DBUS_EXPORT
473  unsigned int flags);
474 DBUS_EXPORT
476 
484 DBUS_EXPORT
486 DBUS_EXPORT
487 void* dbus_timeout_get_data (DBusTimeout *timeout);
488 DBUS_EXPORT
489 void dbus_timeout_set_data (DBusTimeout *timeout,
490  void *data,
491  DBusFreeFunction free_data_function);
492 DBUS_EXPORT
494 DBUS_EXPORT
496 
500 
501 #endif /* DBUS_CONNECTION_H */