Mercurial > pidgin.yaz
comparison libpurple/xmlnode.c @ 25052:efde7e6ed5f2
There's no reason for these to not be const is there? This doesn't
break API compatibility in my mind. Does anyone think it does?
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 03 Feb 2009 18:56:17 +0000 |
parents | 667b8ae0fcee |
children | 4b8c4870b13a f424f26dd329 af42303654a5 |
comparison
equal
deleted
inserted
replaced
25051:cd7aa76faef6 | 25052:efde7e6ed5f2 |
---|---|
301 | 301 |
302 g_free(node->prefix); | 302 g_free(node->prefix); |
303 node->prefix = g_strdup(prefix); | 303 node->prefix = g_strdup(prefix); |
304 } | 304 } |
305 | 305 |
306 const char *xmlnode_get_prefix(xmlnode *node) | 306 const char *xmlnode_get_prefix(const xmlnode *node) |
307 { | 307 { |
308 g_return_val_if_fail(node != NULL, NULL); | 308 g_return_val_if_fail(node != NULL, NULL); |
309 return node->prefix; | 309 return node->prefix; |
310 } | 310 } |
311 | 311 |
441 g_string_append_printf(buf, " xmlns='%s'", value); | 441 g_string_append_printf(buf, " xmlns='%s'", value); |
442 } | 442 } |
443 } | 443 } |
444 | 444 |
445 static char * | 445 static char * |
446 xmlnode_to_str_helper(xmlnode *node, int *len, gboolean formatting, int depth) | 446 xmlnode_to_str_helper(const xmlnode *node, int *len, gboolean formatting, int depth) |
447 { | 447 { |
448 GString *text = g_string_new(""); | 448 GString *text = g_string_new(""); |
449 const char *prefix; | 449 const char *prefix; |
450 xmlnode *c; | 450 const xmlnode *c; |
451 char *node_name, *esc, *esc2, *tab = NULL; | 451 char *node_name, *esc, *esc2, *tab = NULL; |
452 gboolean need_end = FALSE, pretty = formatting; | 452 gboolean need_end = FALSE, pretty = formatting; |
453 | 453 |
454 g_return_val_if_fail(node != NULL, NULL); | 454 g_return_val_if_fail(node != NULL, NULL); |
455 | 455 |
535 | 535 |
536 return g_string_free(text, FALSE); | 536 return g_string_free(text, FALSE); |
537 } | 537 } |
538 | 538 |
539 char * | 539 char * |
540 xmlnode_to_str(xmlnode *node, int *len) | 540 xmlnode_to_str(const xmlnode *node, int *len) |
541 { | 541 { |
542 return xmlnode_to_str_helper(node, len, FALSE, 0); | 542 return xmlnode_to_str_helper(node, len, FALSE, 0); |
543 } | 543 } |
544 | 544 |
545 char * | 545 char * |
546 xmlnode_to_formatted_str(xmlnode *node, int *len) | 546 xmlnode_to_formatted_str(const xmlnode *node, int *len) |
547 { | 547 { |
548 char *xml, *xml_with_declaration; | 548 char *xml, *xml_with_declaration; |
549 | 549 |
550 g_return_val_if_fail(node != NULL, NULL); | 550 g_return_val_if_fail(node != NULL, NULL); |
551 | 551 |