| 488 | | gchar *id, *name; |
|---|
| 489 | | xmlrpc_parse_value(fault, retval, "{s:s,s:s,*}", |
|---|
| 490 | | "categoryId", &id, |
|---|
| 491 | | "description", &name); |
|---|
| 492 | | printf("Found category: %s / %s\n", id, name); |
|---|
| 493 | | if (id && name) { |
|---|
| 494 | | BlogCategory *category = g_new0(BlogCategory, 1); |
|---|
| 495 | | category->id = g_strdup(id); |
|---|
| 496 | | category->name = g_strdup(name); |
|---|
| 497 | | |
|---|
| 498 | | clo->blog->categories = g_slist_append(clo->blog->categories, category); |
|---|
| | 487 | size = xmlrpc_struct_size(fault, retval); |
|---|
| | 488 | die_if_fault_occurred(fault); |
|---|
| | 489 | |
|---|
| | 490 | for (i = 0; i < size; i++) { |
|---|
| | 491 | xmlrpc_value *key = NULL, *val = NULL; |
|---|
| | 492 | const gchar *id = NULL, *name = NULL; |
|---|
| | 493 | |
|---|
| | 494 | xmlrpc_struct_read_member(fault, retval, i, |
|---|
| | 495 | &key, &val); |
|---|
| | 496 | |
|---|
| | 497 | xmlrpc_read_string(fault, key, |
|---|
| | 498 | &id); |
|---|
| | 499 | xmlrpc_parse_value(fault, val, "{s:s,*}", |
|---|
| | 500 | "description", &name); |
|---|
| | 501 | if (id && name) { |
|---|
| | 502 | BlogCategory *category = |
|---|
| | 503 | g_new0(BlogCategory, 1); |
|---|
| | 504 | category->id = g_strdup(id); |
|---|
| | 505 | category->name = g_strdup(name); |
|---|
| | 506 | |
|---|
| | 507 | clo->blog->categories = g_slist_append(clo->blog->categories, category); |
|---|
| | 508 | } |
|---|
| 557 | | post = xmlrpc_struct_get_value(fault, post, (char *)"categories"); |
|---|
| | 567 | if (xmlrpc_struct_has_key(fault, post, "categories")) { |
|---|
| | 568 | post = xmlrpc_struct_get_value(fault, post, (char *)"categories"); |
|---|
| | 569 | } else if (xmlrpc_struct_has_key(fault, post, "category")) { |
|---|
| | 570 | post = xmlrpc_struct_get_value(fault, post, (char *)"category"); |
|---|
| | 571 | } else { |
|---|
| | 572 | post = NULL; |
|---|
| | 573 | } |
|---|