[Galago-commits] r2835 - in trunk/libgalago: . docs/reference/tmpl
libgalago tests
galago-commits at freedesktop.org
galago-commits at freedesktop.org
Mon Jun 12 00:27:02 PDT 2006
Author: chipx86
Date: 2006-06-12 00:26:58 -0700 (Mon, 12 Jun 2006)
New Revision: 2835
Modified:
trunk/libgalago/ChangeLog
trunk/libgalago/docs/reference/tmpl/galago-service.sgml
trunk/libgalago/libgalago/galago-service.c
trunk/libgalago/libgalago/galago-service.h
trunk/libgalago/tests/check-libgalago.c
Log:
- Added a GalagoServiceAccountCb function typedef.
- Extend galago_service_get_account_async() to take a GFreeFunc and change its GCallback parameter to a GalagoServiceAccountCb.
Modified: trunk/libgalago/ChangeLog
===================================================================
--- trunk/libgalago/ChangeLog 2006-06-12 05:16:50 UTC (rev 2834)
+++ trunk/libgalago/ChangeLog 2006-06-12 07:26:58 UTC (rev 2835)
@@ -1,3 +1,13 @@
+Mon Jun 12 00:25:24 PDT 2006 Christian Hammond <chipx86 at chipx86.com>
+
+ * docs/reference/tmpl/galago-service.sgml:
+ * libgalago/galago-service.c:
+ * libgalago/galago-service.h:
+ * tests/check-libgalago.c:
+ - Added a GalagoServiceAccountCb function typedef.
+ - Extend galago_service_get_account_async() to take a GFreeFunc and
+ change its GCallback parameter to a GalagoServiceAccountCb.
+
Sun Jun 11 22:15:48 PDT 2006 Christian Hammond <chipx86 at chipx86.com>
* libgalago/galago-dbus.c:
Modified: trunk/libgalago/docs/reference/tmpl/galago-service.sgml
===================================================================
--- trunk/libgalago/docs/reference/tmpl/galago-service.sgml 2006-06-12 05:16:50 UTC (rev 2834)
+++ trunk/libgalago/docs/reference/tmpl/galago-service.sgml 2006-06-12 07:26:58 UTC (rev 2835)
@@ -229,7 +229,7 @@
@username:
@cb:
@user_data:
- at error:
+ at free_func:
@Returns:
Modified: trunk/libgalago/libgalago/galago-service.c
===================================================================
--- trunk/libgalago/libgalago/galago-service.c 2006-06-12 05:16:50 UTC (rev 2834)
+++ trunk/libgalago/libgalago/galago-service.c 2006-06-12 07:26:58 UTC (rev 2835)
@@ -669,7 +669,7 @@
* <informalexample>
* <programlisting>
* static void
- * account_received_cb(const GalagoService *service,
+ * account_received_cb(GalagoService *service,
* GalagoAccount *account,
* gpointer user_data)
* {
@@ -694,8 +694,9 @@
GalagoCallHandle
galago_service_get_account_async(const GalagoService *service,
const char *username,
- GCallback cb,
- gpointer user_data)
+ GalagoServiceAccountCb cb,
+ gpointer user_data,
+ GFreeFunc free_func)
{
GalagoAccount *account;
GalagoCallHandle handle = GALAGO_CALL_HANDLE_INVALID;
@@ -709,8 +710,7 @@
if (account != NULL)
{
- ((void (*)(const GalagoService *, GalagoAccount *, gpointer))cb)(
- service, account, user_data);
+ cb((GalagoService *)service, account, user_data);
//handle = galago_calls_request_dummy_handle();
handle = 1;
}
@@ -718,8 +718,8 @@
galago_is_connected())
{
handle = galago_dbus_send_message_with_reply_async(
- GALAGO_OBJECT(service), "GetAccount", cb, user_data, NULL,
- g_cclosure_marshal_VOID__POINTER,
+ GALAGO_OBJECT(service), "GetAccount", G_CALLBACK(cb),
+ user_data, free_func, g_cclosure_marshal_VOID__POINTER,
galago_value_new_object(GALAGO_TYPE_ACCOUNT, NULL),
galago_value_new(GALAGO_VALUE_TYPE_STRING, &username, NULL),
NULL);
Modified: trunk/libgalago/libgalago/galago-service.h
===================================================================
--- trunk/libgalago/libgalago/galago-service.h 2006-06-12 05:16:50 UTC (rev 2834)
+++ trunk/libgalago/libgalago/galago-service.h 2006-06-12 07:26:58 UTC (rev 2835)
@@ -41,6 +41,9 @@
#include <libgalago/galago-object.h>
#include <libgalago/galago-status.h>
+typedef void (*GalagoServiceAccountCb)(GalagoService *, GalagoAccount *,
+ gpointer);
+
struct _GalagoService
{
GalagoObject parent_object;
@@ -127,10 +130,12 @@
GalagoAccount *galago_service_get_account(const GalagoService *service,
const char *username,
gboolean query);
-GalagoCallHandle galago_service_get_account_async(const GalagoService *service,
- const char *username,
- GCallback cb,
- gpointer user_data);
+GalagoCallHandle galago_service_get_account_async(
+ const GalagoService *service,
+ const char *username,
+ GalagoServiceAccountCb cb,
+ gpointer user_data,
+ GFreeFunc free_func);
GList *galago_service_get_accounts(const GalagoService *service,
gboolean query);
Modified: trunk/libgalago/tests/check-libgalago.c
===================================================================
--- trunk/libgalago/tests/check-libgalago.c 2006-06-12 05:16:50 UTC (rev 2834)
+++ trunk/libgalago/tests/check-libgalago.c 2006-06-12 07:26:58 UTC (rev 2835)
@@ -380,8 +380,10 @@
**************************************************************************/
static void
account_received_cb(GalagoService *service, GalagoAccount *account,
- GMainLoop *loop)
+ gpointer user_data)
{
+ GMainLoop *loop = (GMainLoop *)user_data;
+
fail_unless(service != NULL && GALAGO_IS_SERVICE(service) &&
!strcmp(galago_service_get_id(service), "aim"),
"Retrieved incorrect service parameter.");
@@ -407,7 +409,7 @@
"Couldn't fetch aim service. Is presence-feed running?");
galago_service_get_account_async(service, "GalagoAIMUser",
- G_CALLBACK(account_received_cb), loop);
+ account_received_cb, loop, NULL);
g_main_loop_run(loop);
}
More information about the galago-commits
mailing list