comparison libpurple/xmlnode.c @ 25218:bdd00a7113d7

propagate from branch 'im.pidgin.pidgin' (head f3891f3348abfe90fbe60a054833c12075aa8df4) to branch 'im.pidgin.cpw.malu.xmpp.attention' (head d235bb23dbe13535f85e071d6c4f42e07ac6e0ce)
author Marcus Lundblad <ml@update.uu.se>
date Sun, 16 Nov 2008 15:39:46 +0000
parents 4152b5c1c051
children 667b8ae0fcee adf153852bcf 94fa7211eb98
comparison
equal deleted inserted replaced
25217:2f01775c81d5 25218:bdd00a7113d7
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)) {