src/xmlnode.h

Tue, 06 Jul 2004 12:58:29 +0000

author
Stu Tomlinson <nosnilmot@pidgin.im>
date
Tue, 06 Jul 2004 12:58:29 +0000
changeset 9459
72399a7d7e29
parent 8262
fa907a654af9
child 9837
789d33edcda8
permissions
-rw-r--r--

[gaim-migrate @ 10283]
(08:24:24) LSchiere: nosnilmot:
https://sourceforge.net/tracker/?func=detail&atid=100235&aid=972285&group_id=235
(08:37:39) nosnilmot: LSchiere: the only way I can reproduce anything like
what's reported in that bug is by having the formatting toolbar disabled in
prefs, and manually enabling it each time I start a new conversation
(08:38:12) LSchiere: nosnilmot: can you fix that case? ;-)
(08:38:34) nosnilmot: LSchiere: I doubt it
(08:38:42) LSchiere: :-/
(08:39:00) nosnilmot: that would seem to be a stupid case to support, if
the user really wants the formatting toolbar then they should just enable
it in prefs!
(08:39:51) LSchiere: now that's not quite so true. i've got it globally
disabled and i've been known to enable it just long enough to remember the
code to a smiley i've forgotten
(08:40:52) nosnilmot: actually... how about if I try to check if the
formatting toolbar is present, and if it's presence doesn't match
preferences, don't save the conv size?
(08:41:10) LSchiere: that works

committer: Luke Schierer <lschiere@pidgin.im>

7131
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
1 /**
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
2 * @file xmlnode.h XML DOM functions
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
3 *
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
4 * gaim
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
5 *
8046
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7642
diff changeset
6 * Gaim is the legal property of its developers, whose names are too numerous
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7642
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7642
diff changeset
8 * source distribution.
7131
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
9 *
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
13 * (at your option) any later version.
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
14 *
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
18 * GNU General Public License for more details.
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
19 *
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
23 */
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
24 #ifndef _GAIM_XMLNODE_H_
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
25 #define _GAIM_XMLNODE_H_
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
26
8135
d4df7d1821a5 [gaim-migrate @ 8840]
Nathan Walp <nwalp@pidgin.im>
parents: 8046
diff changeset
27 typedef enum _XMLNodeType
7131
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
28 {
8135
d4df7d1821a5 [gaim-migrate @ 8840]
Nathan Walp <nwalp@pidgin.im>
parents: 8046
diff changeset
29 XMLNODE_TYPE_TAG,
d4df7d1821a5 [gaim-migrate @ 8840]
Nathan Walp <nwalp@pidgin.im>
parents: 8046
diff changeset
30 XMLNODE_TYPE_ATTRIB,
d4df7d1821a5 [gaim-migrate @ 8840]
Nathan Walp <nwalp@pidgin.im>
parents: 8046
diff changeset
31 XMLNODE_TYPE_DATA
d4df7d1821a5 [gaim-migrate @ 8840]
Nathan Walp <nwalp@pidgin.im>
parents: 8046
diff changeset
32 } XMLNodeType;
7131
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
33
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
34 typedef struct _xmlnode
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
35 {
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
36 char *name;
8135
d4df7d1821a5 [gaim-migrate @ 8840]
Nathan Walp <nwalp@pidgin.im>
parents: 8046
diff changeset
37 XMLNodeType type;
7131
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
38 char *data;
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
39 size_t data_sz;
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
40 struct _xmlnode *parent;
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
41 struct _xmlnode *child;
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
42 struct _xmlnode *next;
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
43 } xmlnode;
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
44
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
45 xmlnode *xmlnode_new(const char *name);
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
46 xmlnode *xmlnode_new_child(xmlnode *parent, const char *name);
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
47 void xmlnode_insert_child(xmlnode *parent, xmlnode *child);
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
48 xmlnode *xmlnode_get_child(xmlnode *parent, const char *name);
8262
fa907a654af9 [gaim-migrate @ 8985]
Nathan Walp <nwalp@pidgin.im>
parents: 8167
diff changeset
49 xmlnode *xmlnode_get_child_with_namespace(xmlnode *parent, const char *name, const char *xmlns);
8135
d4df7d1821a5 [gaim-migrate @ 8840]
Nathan Walp <nwalp@pidgin.im>
parents: 8046
diff changeset
50 xmlnode *xmlnode_get_next_twin(xmlnode *node);
7131
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
51 void xmlnode_insert_data(xmlnode *parent, const char *data, size_t size);
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
52 char *xmlnode_get_data(xmlnode *node);
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
53 void xmlnode_set_attrib(xmlnode *node, const char *attr, const char *value);
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
54 const char *xmlnode_get_attrib(xmlnode *node, const char *attr);
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
55 void xmlnode_remove_attrib(xmlnode *node, const char *attr);
7642
4e1735a499f5 [gaim-migrate @ 8285]
Nathan Walp <nwalp@pidgin.im>
parents: 7131
diff changeset
56 char *xmlnode_to_str(xmlnode *node, int *len);
7131
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
57 xmlnode *xmlnode_from_str(const char *str, size_t size);
8167
deae0da446a9 [gaim-migrate @ 8880]
Nathan Walp <nwalp@pidgin.im>
parents: 8135
diff changeset
58 xmlnode *xmlnode_copy(xmlnode *src);
7131
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
59
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
60 void xmlnode_free(xmlnode *node);
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
61
bde45b2e6bf3 [gaim-migrate @ 7698]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
62 #endif /* _GAIM_XMLNODE_H_ */

mercurial