Main Page   Modules   Data Structures   File List   Data Fields   Related Pages  

connection.h

00001 /* -*- mode: C; c-file-style: "gnu" -*- */
00002 /* connection.h  Client connections
00003  *
00004  * Copyright (C) 2003  Red Hat, Inc.
00005  *
00006  * Licensed under the Academic Free License version 1.2
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 #ifndef BUS_CONNECTION_H
00025 #define BUS_CONNECTION_H
00026 
00027 #include <dbus/dbus.h>
00028 #include <dbus/dbus-list.h>
00029 #include "bus.h"
00030 
00031 typedef dbus_bool_t (* BusConnectionForeachFunction) (DBusConnection *connection, 
00032                                                       void           *data);
00033 
00034 
00035 BusConnections* bus_connections_new               (BusContext                   *context);
00036 void            bus_connections_ref               (BusConnections               *connections);
00037 void            bus_connections_unref             (BusConnections               *connections);
00038 dbus_bool_t     bus_connections_setup_connection  (BusConnections               *connections,
00039                                                    DBusConnection               *connection);
00040 void            bus_connections_foreach           (BusConnections               *connections,
00041                                                    BusConnectionForeachFunction  function,
00042                                                    void                         *data);
00043 void            bus_connections_foreach_active    (BusConnections               *connections,
00044                                                    BusConnectionForeachFunction  function,
00045                                                    void                         *data);
00046 BusContext*     bus_connections_get_context       (BusConnections               *connections);
00047 BusContext*     bus_connection_get_context        (DBusConnection               *connection);
00048 BusConnections* bus_connection_get_connections    (DBusConnection               *connection);
00049 BusRegistry*    bus_connection_get_registry       (DBusConnection               *connection);
00050 BusActivation*  bus_connection_get_activation     (DBusConnection               *connection);
00051 dbus_bool_t     bus_connections_check_limits      (BusConnections               *connections,
00052                                                    DBusConnection               *requesting_completion,
00053                                                    DBusError                    *error);
00054 void            bus_connections_expire_incomplete (BusConnections               *connections);
00055 
00056 
00057 
00058 dbus_bool_t bus_connection_is_active (DBusConnection *connection);
00059 const char *bus_connection_get_name  (DBusConnection *connection);
00060 
00061 dbus_bool_t bus_connection_preallocate_oom_error (DBusConnection *connection);
00062 void        bus_connection_send_oom_error        (DBusConnection *connection,
00063                                                   DBusMessage    *in_reply_to);
00064 
00065 
00066 /* called by services.c */
00067 dbus_bool_t bus_connection_add_owned_service      (DBusConnection *connection,
00068                                                    BusService     *service);
00069 void        bus_connection_remove_owned_service   (DBusConnection *connection,
00070                                                    BusService     *service);
00071 void        bus_connection_add_owned_service_link (DBusConnection *connection,
00072                                                    DBusList       *link);
00073 int         bus_connection_get_n_services_owned   (DBusConnection *connection);
00074 
00075 /* called by driver.c */
00076 dbus_bool_t bus_connection_complete (DBusConnection               *connection,
00077                                      const DBusString             *name,
00078                                      DBusError                    *error);
00079 
00080 /* called by dispatch.c when the connection is dropped */
00081 void        bus_connection_disconnected (DBusConnection *connection);
00082 
00083 dbus_bool_t      bus_connection_is_in_group (DBusConnection       *connection,
00084                                              unsigned long         gid);
00085 dbus_bool_t      bus_connection_get_groups  (DBusConnection       *connection,
00086                                              unsigned long       **groups,
00087                                              int                  *n_groups,
00088                                              DBusError            *error);
00089 BusClientPolicy* bus_connection_get_policy  (DBusConnection       *connection);
00090 
00091 /* transaction API so we can send or not send a block of messages as a whole */
00092 
00093 typedef void (* BusTransactionCancelFunction) (void *data);
00094 
00095 BusTransaction* bus_transaction_new              (BusContext                   *context);
00096 BusContext*     bus_transaction_get_context      (BusTransaction               *transaction);
00097 BusConnections* bus_transaction_get_connections  (BusTransaction               *transaction);
00098 dbus_bool_t     bus_transaction_send             (BusTransaction               *transaction,
00099                                                   DBusConnection               *connection,
00100                                                   DBusMessage                  *message);
00101 dbus_bool_t     bus_transaction_send_from_driver (BusTransaction               *transaction,
00102                                                   DBusConnection               *connection,
00103                                                   DBusMessage                  *message);
00104 dbus_bool_t     bus_transaction_send_error_reply (BusTransaction               *transaction,
00105                                                   DBusConnection               *connection,
00106                                                   const DBusError              *error,
00107                                                   DBusMessage                  *in_reply_to);
00108 void            bus_transaction_cancel_and_free  (BusTransaction               *transaction);
00109 void            bus_transaction_execute_and_free (BusTransaction               *transaction);
00110 dbus_bool_t     bus_transaction_add_cancel_hook  (BusTransaction               *transaction,
00111                                                   BusTransactionCancelFunction  cancel_function,
00112                                                   void                         *data,
00113                                                   DBusFreeFunction              free_data_function);
00114 
00115 #endif /* BUS_CONNECTION_H */

Generated on Wed Oct 22 14:05:00 2003 for D-BUS by doxygen1.3-rc3