D-Bus
1.4.16
|
00001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 00002 /* dbus-server.h DBusServer object 00003 * 00004 * Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00021 * 00022 */ 00023 #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) 00024 #error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents." 00025 #endif 00026 00027 #ifndef DBUS_SERVER_H 00028 #define DBUS_SERVER_H 00029 00030 #include <dbus/dbus-errors.h> 00031 #include <dbus/dbus-message.h> 00032 #include <dbus/dbus-connection.h> 00033 #include <dbus/dbus-protocol.h> 00034 00035 DBUS_BEGIN_DECLS 00036 00042 typedef struct DBusServer DBusServer; 00043 00047 typedef void (* DBusNewConnectionFunction) (DBusServer *server, 00048 DBusConnection *new_connection, 00049 void *data); 00050 00051 DBUS_EXPORT 00052 DBusServer* dbus_server_listen (const char *address, 00053 DBusError *error); 00054 DBUS_EXPORT 00055 DBusServer* dbus_server_ref (DBusServer *server); 00056 DBUS_EXPORT 00057 void dbus_server_unref (DBusServer *server); 00058 DBUS_EXPORT 00059 void dbus_server_disconnect (DBusServer *server); 00060 DBUS_EXPORT 00061 dbus_bool_t dbus_server_get_is_connected (DBusServer *server); 00062 DBUS_EXPORT 00063 char* dbus_server_get_address (DBusServer *server); 00064 DBUS_EXPORT 00065 char* dbus_server_get_id (DBusServer *server); 00066 DBUS_EXPORT 00067 void dbus_server_set_new_connection_function (DBusServer *server, 00068 DBusNewConnectionFunction function, 00069 void *data, 00070 DBusFreeFunction free_data_function); 00071 DBUS_EXPORT 00072 dbus_bool_t dbus_server_set_watch_functions (DBusServer *server, 00073 DBusAddWatchFunction add_function, 00074 DBusRemoveWatchFunction remove_function, 00075 DBusWatchToggledFunction toggled_function, 00076 void *data, 00077 DBusFreeFunction free_data_function); 00078 DBUS_EXPORT 00079 dbus_bool_t dbus_server_set_timeout_functions (DBusServer *server, 00080 DBusAddTimeoutFunction add_function, 00081 DBusRemoveTimeoutFunction remove_function, 00082 DBusTimeoutToggledFunction toggled_function, 00083 void *data, 00084 DBusFreeFunction free_data_function); 00085 DBUS_EXPORT 00086 dbus_bool_t dbus_server_set_auth_mechanisms (DBusServer *server, 00087 const char **mechanisms); 00088 00089 DBUS_EXPORT 00090 dbus_bool_t dbus_server_allocate_data_slot (dbus_int32_t *slot_p); 00091 DBUS_EXPORT 00092 void dbus_server_free_data_slot (dbus_int32_t *slot_p); 00093 DBUS_EXPORT 00094 dbus_bool_t dbus_server_set_data (DBusServer *server, 00095 int slot, 00096 void *data, 00097 DBusFreeFunction free_data_func); 00098 DBUS_EXPORT 00099 void* dbus_server_get_data (DBusServer *server, 00100 int slot); 00101 00104 DBUS_END_DECLS 00105 00106 #endif /* DBUS_SERVER_H */