libpurple/plugins/perl/common/XMLNode.xs

Wed, 26 Jun 2013 03:08:58 +0530

author
Ankit Vani <a@nevitus.org>
date
Wed, 26 Jun 2013 03:08:58 +0530
branch
soc.2013.gobjectification
changeset 34646
e7f4631e93f7
parent 28393
1f319c8ff5cb
child 34935
686fa55b0deb
permissions
-rw-r--r--

Begun adding GObject code to conversation sources

11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
1 #include "module.h"
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
2
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
3 MODULE = Purple::XMLNode PACKAGE = Purple::XMLNode PREFIX = xmlnode_
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
4 PROTOTYPES: ENABLE
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
5
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
6 Purple::XMLNode
28223
928e9c958b31 Fix the Perl XMLNode API so that calls don't need to explicitly pass
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
7 xmlnode_copy(src)
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
8 Purple::XMLNode src
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
9
12773
1f635f83d71f [gaim-migrate @ 15120]
Etan Reisner <deryni@pidgin.im>
parents: 12364
diff changeset
10 void
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
11 xmlnode_free(node)
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
12 Purple::XMLNode node
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
13
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
14 Purple::XMLNode
28223
928e9c958b31 Fix the Perl XMLNode API so that calls don't need to explicitly pass
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
15 xmlnode_from_str(const char *str, gssize length(str))
928e9c958b31 Fix the Perl XMLNode API so that calls don't need to explicitly pass
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
16 PROTOTYPE: $
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
17
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
18 const char *
28224
315ba0216ae0 Add Purple::XMLNode::get_name()
Paul Aurich <darkrain42@pidgin.im>
parents: 28223
diff changeset
19 xmlnode_get_name(node)
315ba0216ae0 Add Purple::XMLNode::get_name()
Paul Aurich <darkrain42@pidgin.im>
parents: 28223
diff changeset
20 Purple::XMLNode node
315ba0216ae0 Add Purple::XMLNode::get_name()
Paul Aurich <darkrain42@pidgin.im>
parents: 28223
diff changeset
21 CODE:
315ba0216ae0 Add Purple::XMLNode::get_name()
Paul Aurich <darkrain42@pidgin.im>
parents: 28223
diff changeset
22 RETVAL = node->name;
315ba0216ae0 Add Purple::XMLNode::get_name()
Paul Aurich <darkrain42@pidgin.im>
parents: 28223
diff changeset
23 OUTPUT:
315ba0216ae0 Add Purple::XMLNode::get_name()
Paul Aurich <darkrain42@pidgin.im>
parents: 28223
diff changeset
24 RETVAL
315ba0216ae0 Add Purple::XMLNode::get_name()
Paul Aurich <darkrain42@pidgin.im>
parents: 28223
diff changeset
25
315ba0216ae0 Add Purple::XMLNode::get_name()
Paul Aurich <darkrain42@pidgin.im>
parents: 28223
diff changeset
26 const char *
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
27 xmlnode_get_attrib(node, attr)
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
28 Purple::XMLNode node
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
29 const char *attr
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
30
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
31 Purple::XMLNode
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
32 xmlnode_get_child(parent, name)
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
33 Purple::XMLNode parent
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
34 const char *name
28393
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
35 PREINIT:
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
36 xmlnode *tmp;
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
37 CODE:
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
38 if (!name || *name == '\0') {
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
39 tmp = parent->child;
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
40 while (tmp && tmp->type != XMLNODE_TYPE_TAG)
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
41 tmp = tmp->next;
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
42 RETVAL = tmp;
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
43 } else
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
44 RETVAL = xmlnode_get_child(parent, name);
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
45 OUTPUT:
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
46 RETVAL
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
47
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
48 Purple::XMLNode
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
49 xmlnode_get_child_with_namespace(parent, name, xmlns)
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
50 Purple::XMLNode parent
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
51 const char *name
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
52 const char *xmlns
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
53
15165
0ff631dfbbca [gaim-migrate @ 17889]
Daniel Atallah <datallah@pidgin.im>
parents: 14779
diff changeset
54 gchar_own *
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
55 xmlnode_get_data(node)
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
56 Purple::XMLNode node
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
57
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
58 Purple::XMLNode
28393
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
59 xmlnode_get_next(node)
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
60 Purple::XMLNode node
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
61 PREINIT:
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
62 xmlnode *tmp;
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
63 CODE:
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
64 tmp = node->next;
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
65 while (tmp && tmp->type != XMLNODE_TYPE_TAG)
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
66 tmp = tmp->next;
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
67 RETVAL = tmp;
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
68 OUTPUT:
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
69 RETVAL
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
70
1f319c8ff5cb Add two XMLNode accessors for iterating through the children of an XMLNode.
Paul Aurich <darkrain42@pidgin.im>
parents: 28224
diff changeset
71 Purple::XMLNode
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
72 xmlnode_get_next_twin(node)
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
73 Purple::XMLNode node
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
74
12773
1f635f83d71f [gaim-migrate @ 15120]
Etan Reisner <deryni@pidgin.im>
parents: 12364
diff changeset
75 void
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
76 xmlnode_insert_child(parent, child)
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
77 Purple::XMLNode parent
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
78 Purple::XMLNode child
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
79
12773
1f635f83d71f [gaim-migrate @ 15120]
Etan Reisner <deryni@pidgin.im>
parents: 12364
diff changeset
80 void
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
81 xmlnode_insert_data(node, data, size)
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
82 Purple::XMLNode node
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
83 const char *data
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
84 gssize size
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
85
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
86 Purple::XMLNode
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
87 xmlnode_new(class, name)
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
88 const char *name
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
89 C_ARGS:
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
90 name
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
91
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
92 Purple::XMLNode
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
93 xmlnode_new_child(parent, name)
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
94 Purple::XMLNode parent
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
95 const char *name
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
96
12773
1f635f83d71f [gaim-migrate @ 15120]
Etan Reisner <deryni@pidgin.im>
parents: 12364
diff changeset
97 void
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
98 xmlnode_remove_attrib(node, attr)
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
99 Purple::XMLNode node
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
100 const char *attr
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
101
12773
1f635f83d71f [gaim-migrate @ 15120]
Etan Reisner <deryni@pidgin.im>
parents: 12364
diff changeset
102 void
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
103 xmlnode_set_attrib(node, attr, value)
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
104 Purple::XMLNode node
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
105 const char *attr
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
106 const char *value
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
107
15165
0ff631dfbbca [gaim-migrate @ 17889]
Daniel Atallah <datallah@pidgin.im>
parents: 14779
diff changeset
108 gchar_own *
28223
928e9c958b31 Fix the Perl XMLNode API so that calls don't need to explicitly pass
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
109 xmlnode_to_formatted_str(node)
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
110 Purple::XMLNode node
28223
928e9c958b31 Fix the Perl XMLNode API so that calls don't need to explicitly pass
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
111 CODE:
928e9c958b31 Fix the Perl XMLNode API so that calls don't need to explicitly pass
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
112 RETVAL = xmlnode_to_formatted_str(node, NULL);
928e9c958b31 Fix the Perl XMLNode API so that calls don't need to explicitly pass
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
113 OUTPUT:
928e9c958b31 Fix the Perl XMLNode API so that calls don't need to explicitly pass
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
114 RETVAL
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
115
15165
0ff631dfbbca [gaim-migrate @ 17889]
Daniel Atallah <datallah@pidgin.im>
parents: 14779
diff changeset
116 gchar_own *
28223
928e9c958b31 Fix the Perl XMLNode API so that calls don't need to explicitly pass
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
117 xmlnode_to_str(node)
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
118 Purple::XMLNode node
28223
928e9c958b31 Fix the Perl XMLNode API so that calls don't need to explicitly pass
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
119 CODE:
928e9c958b31 Fix the Perl XMLNode API so that calls don't need to explicitly pass
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
120 RETVAL = xmlnode_to_str(node, NULL);
928e9c958b31 Fix the Perl XMLNode API so that calls don't need to explicitly pass
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
121 OUTPUT:
928e9c958b31 Fix the Perl XMLNode API so that calls don't need to explicitly pass
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
122 RETVAL

mercurial