Home | History | Annotate | Download | only in bus
      1 /* -*- mode: C; c-file-style: "gnu" -*- */
      2 /* services.h  Service management
      3  *
      4  * Copyright (C) 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     21  *
     22  */
     23 
     24 #ifndef BUS_SERVICES_H
     25 #define BUS_SERVICES_H
     26 
     27 #include <dbus/dbus.h>
     28 #include <dbus/dbus-string.h>
     29 #include <dbus/dbus-hash.h>
     30 #include "connection.h"
     31 #include "bus.h"
     32 
     33 typedef void (* BusServiceForeachFunction) (BusService       *service,
     34                                             void             *data);
     35 
     36 BusRegistry* bus_registry_new             (BusContext                  *context);
     37 BusRegistry* bus_registry_ref             (BusRegistry                 *registry);
     38 void         bus_registry_unref           (BusRegistry                 *registry);
     39 BusService*  bus_registry_lookup          (BusRegistry                 *registry,
     40                                            const DBusString            *service_name);
     41 BusService*  bus_registry_ensure          (BusRegistry                 *registry,
     42                                            const DBusString            *service_name,
     43                                            DBusConnection              *owner_connection_if_created,
     44 					   dbus_uint32_t                flags,
     45                                            BusTransaction              *transaction,
     46                                            DBusError                   *error);
     47 void         bus_registry_foreach         (BusRegistry                 *registry,
     48                                            BusServiceForeachFunction    function,
     49                                            void                        *data);
     50 dbus_bool_t  bus_registry_list_services   (BusRegistry                 *registry,
     51                                            char                      ***listp,
     52                                            int                         *array_len);
     53 dbus_bool_t  bus_registry_acquire_service (BusRegistry                 *registry,
     54                                            DBusConnection              *connection,
     55                                            const DBusString            *service_name,
     56                                            dbus_uint32_t                flags,
     57                                            dbus_uint32_t               *result,
     58                                            BusTransaction              *transaction,
     59                                            DBusError                   *error);
     60 dbus_bool_t  bus_registry_release_service (BusRegistry                 *registry,
     61                                            DBusConnection              *connection,
     62                                            const DBusString            *service_name,
     63                                            dbus_uint32_t               *result,
     64                                            BusTransaction              *transaction,
     65                                            DBusError                   *error);
     66 dbus_bool_t  bus_registry_set_service_context_table (BusRegistry           *registry,
     67 						     DBusHashTable         *table);
     68 
     69 BusService*     bus_service_ref                       (BusService     *service);
     70 void            bus_service_unref                     (BusService     *service);
     71 dbus_bool_t     bus_service_add_owner                 (BusService     *service,
     72                                                        DBusConnection *connection,
     73 						       dbus_uint32_t   flags,
     74                                                        BusTransaction *transaction,
     75                                                        DBusError      *error);
     76 dbus_bool_t     bus_service_swap_owner                (BusService     *service,
     77                                                        DBusConnection *connection,
     78                                                        BusTransaction *transaction,
     79                                                        DBusError      *error);
     80 dbus_bool_t     bus_service_remove_owner              (BusService     *service,
     81                                                        DBusConnection *connection,
     82                                                        BusTransaction *transaction,
     83                                                        DBusError      *error);
     84 dbus_bool_t     bus_service_has_owner                 (BusService     *service,
     85                                                        DBusConnection *connection);
     86 BusOwner*       bus_service_get_primary_owner         (BusService     *service);
     87 dbus_bool_t     bus_service_get_allow_replacement     (BusService     *service);
     88 const char*     bus_service_get_name                  (BusService     *service);
     89 dbus_bool_t     bus_service_list_queued_owners        (BusService *service,
     90                                                        DBusList  **return_list,
     91                                                        DBusError  *error);
     92 
     93 DBusConnection* bus_service_get_primary_owners_connection (BusService     *service);
     94 #endif /* BUS_SERVICES_H */
     95