diff options
author | Timm Bäder <mail@baedert.org> | 2016-04-22 14:01:09 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2016-06-20 12:39:44 +0200 |
commit | f8c2ab720de6f7741f4af10f43b95d27c27ecc8e (patch) | |
tree | cb9654e290547d4a832da37a5db6e884ef5b5467 /examples/test-raw.c | |
parent | 9cca799e77aaf60561c303dbb0dac3ce9d78a3dc (diff) | |
download | librest-f8c2ab720de6f7741f4af10f43b95d27c27ecc8e.tar.gz |
Adapt tests and examples to API change
Diffstat (limited to 'examples/test-raw.c')
-rw-r--r-- | examples/test-raw.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/examples/test-raw.c b/examples/test-raw.c index d8daa93..3e6a437 100644 --- a/examples/test-raw.c +++ b/examples/test-raw.c @@ -4,7 +4,7 @@ * * Authors: Rob Bradford <rob@linux.intel.com> * Ross Burton <ross@linux.intel.com> - * + * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, * version 2.1, as published by the Free Software Foundation. @@ -24,18 +24,18 @@ #include <unistd.h> static void -proxy_call_async_cb (RestProxyCall *call, - const GError *error, - GObject *weak_object, - gpointer userdata) +proxy_call_async_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { + RestProxyCall *call = REST_PROXY_CALL (source_object); const gchar *payload; goffset len; payload = rest_proxy_call_get_payload (call); len = rest_proxy_call_get_payload_length (call); write (1, payload, len); - g_main_loop_quit ((GMainLoop *)userdata); + g_main_loop_quit ((GMainLoop *)user_data); } gint @@ -56,15 +56,14 @@ main (gint argc, gchar **argv) "api_key", "314691be2e63a4d58994b2be01faacfb", "format", "json", NULL); - rest_proxy_call_async (call, - proxy_call_async_cb, - NULL, - loop, - NULL); + rest_proxy_call_invoke_async (call, + NULL, + proxy_call_async_cb, + loop); g_main_loop_run (loop); - rest_proxy_call_run (call, NULL, NULL); + rest_proxy_call_sync (call, NULL); payload = rest_proxy_call_get_payload (call); len = rest_proxy_call_get_payload_length (call); |