Mercurial > pidgin
comparison libpurple/xmlnode.c @ 25834:94fa7211eb98
propagate from branch 'im.pidgin.pidgin' (head 5be7104ff151004112ce3f9c34446335024d06d8)
to branch 'im.pidgin.pidgin.next.minor' (head 111d22afa901c48464e4da4d37d1cca3381ae162)
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Fri, 14 Nov 2008 06:45:16 +0000 |
| parents | 9525fb966efb 4152b5c1c051 |
| children | 43b721aa4b76 |
comparison
equal
deleted
inserted
replaced
| 25833:9290eb3e07bf | 25834:94fa7211eb98 |
|---|---|
| 247 xmlnode_get_attrib(xmlnode *node, const char *attr) | 247 xmlnode_get_attrib(xmlnode *node, const char *attr) |
| 248 { | 248 { |
| 249 xmlnode *x; | 249 xmlnode *x; |
| 250 | 250 |
| 251 g_return_val_if_fail(node != NULL, NULL); | 251 g_return_val_if_fail(node != NULL, NULL); |
| 252 g_return_val_if_fail(attr != NULL, NULL); | |
| 252 | 253 |
| 253 for(x = node->child; x; x = x->next) { | 254 for(x = node->child; x; x = x->next) { |
| 254 if(x->type == XMLNODE_TYPE_ATTRIB && !strcmp(attr, x->name)) { | 255 if(x->type == XMLNODE_TYPE_ATTRIB && !strcmp(attr, x->name)) { |
| 255 return x->data; | 256 return x->data; |
| 256 } | 257 } |
| 263 xmlnode_get_attrib_with_namespace(xmlnode *node, const char *attr, const char *xmlns) | 264 xmlnode_get_attrib_with_namespace(xmlnode *node, const char *attr, const char *xmlns) |
| 264 { | 265 { |
| 265 xmlnode *x; | 266 xmlnode *x; |
| 266 | 267 |
| 267 g_return_val_if_fail(node != NULL, NULL); | 268 g_return_val_if_fail(node != NULL, NULL); |
| 269 g_return_val_if_fail(attr != NULL, NULL); | |
| 268 | 270 |
| 269 for(x = node->child; x; x = x->next) { | 271 for(x = node->child; x; x = x->next) { |
| 270 if(x->type == XMLNODE_TYPE_ATTRIB && | 272 if(x->type == XMLNODE_TYPE_ATTRIB && |
| 271 !strcmp(attr, x->name) && | 273 !strcmp(attr, x->name) && |
| 272 _xmlnode_compare_xmlns(xmlns, x->xmlns)) { | 274 _xmlnode_compare_xmlns(xmlns, x->xmlns)) { |
