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 void            bus_connections_increment_stamp   (BusConnections               *connections);
00048 BusContext*     bus_connection_get_context        (DBusConnection               *connection);
00049 BusConnections* bus_connection_get_connections    (DBusConnection               *connection);
00050 BusRegistry*    bus_connection_get_registry       (DBusConnection               *connection);
00051 BusActivation*  bus_connection_get_activation     (DBusConnection               *connection);
00052 BusMatchmaker*  bus_connection_get_matchmaker     (DBusConnection               *connection);
00053 dbus_bool_t     bus_connections_check_limits      (BusConnections               *connections,
00054                                                    DBusConnection               *requesting_completion,
00055                                                    DBusError                    *error);
00056 void            bus_connections_expire_incomplete (BusConnections               *connections);
00057 
00058 dbus_bool_t     bus_connection_mark_stamp         (DBusConnection               *connection);
00059 
00060 dbus_bool_t bus_connection_is_active (DBusConnection *connection);
00061 const char *bus_connection_get_name  (DBusConnection *connection);
00062 
00063 dbus_bool_t bus_connection_preallocate_oom_error (DBusConnection *connection);
00064 void        bus_connection_send_oom_error        (DBusConnection *connection,
00065                                                   DBusMessage    *in_reply_to);
00066 
00067 /* called by signals.c */
00068 dbus_bool_t bus_connection_add_match_rule      (DBusConnection *connection,
00069                                                 BusMatchRule   *rule);
00070 void        bus_connection_add_match_rule_link (DBusConnection *connection,
00071                                                 DBusList       *link);
00072 void        bus_connection_remove_match_rule   (DBusConnection *connection,
00073                                                 BusMatchRule   *rule);
00074 int         bus_connection_get_n_match_rules   (DBusConnection *connection);
00075 
00076 
00077 /* called by services.c */
00078 dbus_bool_t bus_connection_add_owned_service      (DBusConnection *connection,
00079                                                    BusService     *service);
00080 void        bus_connection_remove_owned_service   (DBusConnection *connection,
00081                                                    BusService     *service);
00082 void        bus_connection_add_owned_service_link (DBusConnection *connection,
00083                                                    DBusList       *link);
00084 int         bus_connection_get_n_services_owned   (DBusConnection *connection);
00085 
00086 /* called by driver.c */
00087 dbus_bool_t bus_connection_complete (DBusConnection               *connection,
00088                                      const DBusString             *name,
00089                                      DBusError                    *error);
00090 
00091 /* called by dispatch.c when the connection is dropped */
00092 void        bus_connection_disconnected (DBusConnection *connection);
00093 
00094 dbus_bool_t      bus_connection_is_in_group (DBusConnection       *connection,
00095                                              unsigned long         gid);
00096 dbus_bool_t      bus_connection_get_groups  (DBusConnection       *connection,
00097                                              unsigned long       **groups,
00098                                              int                  *n_groups,
00099                                              DBusError            *error);
00100 BusClientPolicy* bus_connection_get_policy  (DBusConnection       *connection);
00101 
00102 /* transaction API so we can send or not send a block of messages as a whole */
00103 
00104 typedef void (* BusTransactionCancelFunction) (void *data);
00105 
00106 BusTransaction* bus_transaction_new              (BusContext                   *context);
00107 BusContext*     bus_transaction_get_context      (BusTransaction               *transaction);
00108 BusConnections* bus_transaction_get_connections  (BusTransaction               *transaction);
00109 dbus_bool_t     bus_transaction_send             (BusTransaction               *transaction,
00110                                                   DBusConnection               *connection,
00111                                                   DBusMessage                  *message);
00112 dbus_bool_t     bus_transaction_send_from_driver (BusTransaction               *transaction,
00113                                                   DBusConnection               *connection,
00114                                                   DBusMessage                  *message);
00115 dbus_bool_t     bus_transaction_send_error_reply (BusTransaction               *transaction,
00116                                                   DBusConnection               *connection,
00117                                                   const DBusError              *error,
00118                                                   DBusMessage                  *in_reply_to);
00119 void            bus_transaction_cancel_and_free  (BusTransaction               *transaction);
00120 void            bus_transaction_execute_and_free (BusTransaction               *transaction);
00121 dbus_bool_t     bus_transaction_add_cancel_hook  (BusTransaction               *transaction,
00122                                                   BusTransactionCancelFunction  cancel_function,
00123                                                   void                         *data,
00124                                                   DBusFreeFunction              free_data_function);
00125 
00126 #endif /* BUS_CONNECTION_H */

Generated on Mon Sep 29 21:30:59 2003 for D-BUS by doxygen1.2.15