Back to index

unity  6.0.0
ubus-server.h
Go to the documentation of this file.
00001 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
00002 /*
00003  * u-bus-server.h
00004  * Copyright (C) 2010 Canonical, Ltd.
00005  *
00006  * This library is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License
00008  * version 3.0 as published by the Free Software Foundation.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU Lesser General Public License version 3.0 for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library. If not, see
00017  * <http://www.gnu.org/licenses/>.
00018  *
00019  * Authored by Gordon Allott <gord.allott@canonical.com>
00020  */
00021 
00022 #ifndef _U_BUS_SERVER_H_
00023 #define _U_BUS_SERVER_H_
00024 
00025 #include <glib-object.h>
00026 #include <glib.h>
00027 G_BEGIN_DECLS
00028 
00029 #define UBUS_TYPE_SERVER             (ubus_server_get_type ())
00030 #define UBUS_SERVER(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), UBUS_TYPE_SERVER, UBusServer))
00031 #define UBUS_SERVER_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), UBUS_TYPE_SERVER, UBusServerClass))
00032 #define UBUS_IS_SERVER(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UBUS_TYPE_SERVER))
00033 #define UBUS_IS_SERVER_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), UBUS_TYPE_SERVER))
00034 #define UBUS_SERVER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), UBUS_TYPE_SERVER, UBusServerClass))
00035 
00036 typedef struct _UBusServerClass UBusServerClass;
00037 typedef struct _UBusServer UBusServer;
00038 typedef struct _UBusServerPrivate  UBusServerPrivate;
00039 
00040 struct _UBusServerClass
00041 {
00042   GObjectClass parent_class;
00043 
00044   /* padding */
00045   void (*_unity_padding1)(void);
00046   void (*_unity_padding2)(void);
00047   void (*_unity_padding3)(void);
00048   void (*_unity_padding4)(void);
00049   void (*_unity_padding5)(void);
00050   void (*_unity_padding6)(void);
00051 };
00052 
00053 struct _UBusServer
00054 {
00055   GObject parent_instance;
00056 
00057   UBusServerPrivate* priv;
00058 };
00059 
00060 typedef void (*UBusCallback)(GVariant*     data,
00061                              gpointer      user_data);
00062 
00063 GType        ubus_server_get_type(void) G_GNUC_CONST;
00064 UBusServer*  ubus_server_get_default();
00065 void         ubus_server_prime_context(UBusServer*   server,
00066                                        GMainContext* context);
00067 guint        ubus_server_register_interest(UBusServer*   server,
00068                                            const gchar*  message,
00069                                            UBusCallback  callback,
00070                                            gpointer      user_data);
00071 void         ubus_server_send_message(UBusServer*   server,
00072                                       const gchar*  message,
00073                                       GVariant*     data);
00074 void         ubus_server_unregister_interest(UBusServer*   server,
00075                                              guint handle);
00076 void         ubus_server_force_message_pump(UBusServer*   server);
00077 
00078 G_END_DECLS
00079 
00080 #endif /* _U_BUS_SERVER_H_ */