summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorJosé Roberto de Souza <zehortigoza@profusion.mobi>2012-10-09 15:23:13 +0000
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2012-10-09 15:23:13 +0000
commit90ee430ce5c095760d1818f113fbc0b7a8d6f96e (patch)
treee73121e5091de2de18be885e1f77105e382054c9 /legacy
parent188ce7d9e1bbb84341773503f8855ac5efb95d3f (diff)
edbus: Fix example of double container
Patch by: José Roberto de Souza <zehortigoza@profusion.mobi> SVN revision: 77655
Diffstat (limited to 'legacy')
-rw-r--r--legacy/edbus/src/examples/complex_types.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/legacy/edbus/src/examples/complex_types.c b/legacy/edbus/src/examples/complex_types.c
index b9aef034aa..359dead7a2 100644
--- a/legacy/edbus/src/examples/complex_types.c
+++ b/legacy/edbus/src/examples/complex_types.c
@@ -206,7 +206,7 @@ main(void)
206 array_of_string = edbus_message_iter_container_new(iter, 'a',"s"); 206 array_of_string = edbus_message_iter_container_new(iter, 'a',"s");
207 if (!array_of_string) printf("array_of_string == NULL\n\n"); 207 if (!array_of_string) printf("array_of_string == NULL\n\n");
208 for (i = 0; i < 5; i++) 208 for (i = 0; i < 5; i++)
209 edbus_message_iter_append_basic(array_of_string, 's', array[i]); 209 edbus_message_iter_basic_append(array_of_string, 's', array[i]);
210 edbus_message_iter_container_close(iter, array_of_string); 210 edbus_message_iter_container_close(iter, array_of_string);
211 pending = edbus_proxy_send(test2_proxy, msg, on_receive_array, NULL, -1); 211 pending = edbus_proxy_send(test2_proxy, msg, on_receive_array, NULL, -1);
212 if (!pending) printf("Error in edbus_proxy_send()\n\n"); 212 if (!pending) printf("Error in edbus_proxy_send()\n\n");
@@ -230,7 +230,7 @@ main(void)
230 msg = edbus_proxy_method_call_new(test2_proxy, "SendVariantData"); 230 msg = edbus_proxy_method_call_new(test2_proxy, "SendVariantData");
231 iter = edbus_message_iter_get(msg); 231 iter = edbus_message_iter_get(msg);
232 variant = edbus_message_iter_container_new(iter, 'v', "s"); 232 variant = edbus_message_iter_container_new(iter, 'v', "s");
233 edbus_message_iter_append_basic(variant, 's', "test"); 233 edbus_message_iter_basic_append(variant, 's', "test");
234 edbus_message_iter_container_close(iter, variant); 234 edbus_message_iter_container_close(iter, variant);
235 pending = edbus_proxy_send(test2_proxy, msg, on_send_variant, NULL, -1); 235 pending = edbus_proxy_send(test2_proxy, msg, on_send_variant, NULL, -1);
236 edbus_message_unref(msg); 236 edbus_message_unref(msg);
@@ -242,17 +242,21 @@ main(void)
242 * this will cause a error, we could not open another container until 242 * this will cause a error, we could not open another container until
243 * we close the first one 243 * we close the first one
244 */ 244 */
245 array_itr = edbus_message_iter_container_new(iter, 'a', "(ii)"); 245 edbus_message_iter_arguments_set(iter, "a(ii)", &array_itr);
246 edbus_message_iter_arguments_set(array_itr, "(ii)", &structure);
247 for (i = 0; i < 5; i++) 246 for (i = 0; i < 5; i++)
248 edbus_message_iter_arguments_set(structure, "ii", i, i*i); 247 {
249 edbus_message_iter_container_close(array_itr, structure); 248 edbus_message_iter_arguments_set(array_itr, "(ii)", &structure);
249 edbus_message_iter_arguments_set(structure, "ii", i, i*i);
250 edbus_message_iter_container_close(array_itr, structure);
251 }
250 edbus_message_iter_container_close(iter, array_itr); 252 edbus_message_iter_container_close(iter, array_itr);
251 array_itr = edbus_message_iter_container_new(iter, 'a', "(ii)"); 253 edbus_message_iter_arguments_set(iter, "a(ii)", &array_itr);
252 edbus_message_iter_arguments_set(array_itr, "(ii)", &structure);
253 for (i = 0; i < 7; i++) 254 for (i = 0; i < 7; i++)
254 edbus_message_iter_arguments_set(structure, "ii", i, i*i*i); 255 {
255 edbus_message_iter_container_close(array_itr, structure); 256 edbus_message_iter_arguments_set(array_itr, "(ii)", &structure);
257 edbus_message_iter_arguments_set(structure, "ii", i, i*i*i);
258 edbus_message_iter_container_close(array_itr, structure);
259 }
256 edbus_message_iter_container_close(iter, array_itr); 260 edbus_message_iter_container_close(iter, array_itr);
257 edbus_proxy_send(test2_proxy, msg, NULL, NULL, -1); 261 edbus_proxy_send(test2_proxy, msg, NULL, NULL, -1);
258 edbus_message_unref(msg); 262 edbus_message_unref(msg);