walters 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +28 -0
- data/README.md +20 -0
- data/Rakefile +6 -0
- data/ext/Rakefile +5 -0
- data/ext/houdini/buffer.c +249 -0
- data/ext/houdini/buffer.h +113 -0
- data/ext/houdini/houdini.h +44 -0
- data/ext/houdini/houdini_href_e.c +115 -0
- data/ext/houdini/houdini_html_e.c +90 -0
- data/ext/houdini/houdini_html_u.c +122 -0
- data/ext/houdini/houdini_js_e.c +90 -0
- data/ext/houdini/houdini_js_u.c +60 -0
- data/ext/houdini/houdini_uri_e.c +101 -0
- data/ext/houdini/houdini_uri_u.c +65 -0
- data/ext/houdini/houdini_xml_e.c +136 -0
- data/ext/houdini/html_unescape.h +754 -0
- data/ext/walters.cpp +105 -0
- data/ext/walters_buffer.cpp +113 -0
- data/ext/x86_64-darwin/__xni_walters.cpp +450 -0
- data/ext/x86_64-darwin/walters.h +43 -0
- data/lib/walters.rb +2 -0
- data/lib/walters/version.rb +3 -0
- data/lib/walters/walters.rb +87 -0
- data/walters.gemspec +21 -0
- metadata +134 -0
data/ext/walters.cpp
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
#include <stdlib.h>
|
2
|
+
#include <xni.h>
|
3
|
+
|
4
|
+
extern "C" {
|
5
|
+
#include "houdini/buffer.h"
|
6
|
+
#include "houdini/houdini.h"
|
7
|
+
}
|
8
|
+
|
9
|
+
#include "walters.h"
|
10
|
+
|
11
|
+
XNI_EXPORT void
|
12
|
+
walters_free_cstring(RubyEnv *rb, void *cstr)
|
13
|
+
{
|
14
|
+
free(cstr);
|
15
|
+
}
|
16
|
+
|
17
|
+
XNI_EXPORT const char *
|
18
|
+
walters_read_cstring(RubyEnv *rb, void *ptr)
|
19
|
+
{
|
20
|
+
return (const char *) ptr;
|
21
|
+
}
|
22
|
+
static inline void*
|
23
|
+
houdini(int (*fn)(gh_buf*, const uint8_t *, size_t size), const char* cstr, unsigned int size)
|
24
|
+
{
|
25
|
+
gh_buf gh = GH_BUF_INIT;
|
26
|
+
|
27
|
+
if (!(*fn)(&gh, (const uint8_t *) cstr, size)) {
|
28
|
+
gh_buf_free(&gh);
|
29
|
+
return NULL;
|
30
|
+
}
|
31
|
+
|
32
|
+
if (gh_buf_oom(&gh)) {
|
33
|
+
throw xni::runtime_error("out of memory");
|
34
|
+
}
|
35
|
+
|
36
|
+
return gh_buf_detach(&gh);
|
37
|
+
}
|
38
|
+
|
39
|
+
XNI_EXPORT void *
|
40
|
+
walters__escape_html(RubyEnv *rb, const char *cstr, unsigned int size, bool secure)
|
41
|
+
{
|
42
|
+
gh_buf gh = GH_BUF_INIT;
|
43
|
+
|
44
|
+
if (houdini_escape_html0(&gh, (const uint8_t *) cstr, size, secure)) {
|
45
|
+
return gh_buf_detach(&gh);
|
46
|
+
}
|
47
|
+
|
48
|
+
gh_buf_free(&gh);
|
49
|
+
|
50
|
+
return NULL;
|
51
|
+
}
|
52
|
+
|
53
|
+
XNI_EXPORT void *
|
54
|
+
walters__unescape_html(RubyEnv *rb, const char *cstr, unsigned int size)
|
55
|
+
{
|
56
|
+
return houdini(houdini_unescape_html, cstr, size);
|
57
|
+
}
|
58
|
+
|
59
|
+
XNI_EXPORT void *
|
60
|
+
walters__escape_xml(RubyEnv *rb, const char *cstr, unsigned int size)
|
61
|
+
{
|
62
|
+
return houdini(houdini_escape_xml, cstr, size);
|
63
|
+
}
|
64
|
+
|
65
|
+
XNI_EXPORT void *
|
66
|
+
walters__escape_uri(RubyEnv *rb, const char *cstr, unsigned int size)
|
67
|
+
{
|
68
|
+
return houdini(houdini_escape_uri, cstr, size);
|
69
|
+
}
|
70
|
+
|
71
|
+
XNI_EXPORT void *
|
72
|
+
walters__escape_url(RubyEnv *rb, const char *cstr, unsigned int size)
|
73
|
+
{
|
74
|
+
return houdini(houdini_escape_url, cstr, size);
|
75
|
+
}
|
76
|
+
|
77
|
+
XNI_EXPORT void *
|
78
|
+
walters__escape_href(RubyEnv *rb, const char *cstr, unsigned int size)
|
79
|
+
{
|
80
|
+
return houdini(houdini_escape_href, cstr, size);
|
81
|
+
}
|
82
|
+
|
83
|
+
XNI_EXPORT void *
|
84
|
+
walters__unescape_uri(RubyEnv *rb, const char *cstr, unsigned int size)
|
85
|
+
{
|
86
|
+
return houdini(houdini_unescape_uri, cstr, size);
|
87
|
+
}
|
88
|
+
|
89
|
+
XNI_EXPORT void *
|
90
|
+
walters__unescape_url(RubyEnv *rb, const char *cstr, unsigned int size)
|
91
|
+
{
|
92
|
+
return houdini(houdini_unescape_url, cstr, size);
|
93
|
+
}
|
94
|
+
|
95
|
+
XNI_EXPORT void *
|
96
|
+
walters__escape_js(RubyEnv *rb, const char *cstr, unsigned int size)
|
97
|
+
{
|
98
|
+
return houdini(houdini_escape_js, cstr, size);
|
99
|
+
}
|
100
|
+
|
101
|
+
XNI_EXPORT void *
|
102
|
+
walters__unescape_js(RubyEnv *rb, const char *cstr, unsigned int size)
|
103
|
+
{
|
104
|
+
return houdini(houdini_unescape_js, cstr, size);
|
105
|
+
}
|
@@ -0,0 +1,113 @@
|
|
1
|
+
#include <stdlib.h>
|
2
|
+
#include <xni.h>
|
3
|
+
|
4
|
+
extern "C" {
|
5
|
+
#include "houdini/buffer.h"
|
6
|
+
#include "houdini/houdini.h"
|
7
|
+
}
|
8
|
+
|
9
|
+
#include "walters.h"
|
10
|
+
|
11
|
+
struct Walters_Buffer {
|
12
|
+
gh_buf gh;
|
13
|
+
};
|
14
|
+
|
15
|
+
|
16
|
+
XNI_EXPORT int
|
17
|
+
walters_sizeof_buffer(void)
|
18
|
+
{
|
19
|
+
return sizeof(struct Walters_Buffer);
|
20
|
+
}
|
21
|
+
|
22
|
+
XNI_EXPORT void
|
23
|
+
walters_buffer_initialize(RubyEnv *rb, struct Walters_Buffer *buf, unsigned int size)
|
24
|
+
{
|
25
|
+
gh_buf_init(&buf->gh, (size_t) size);
|
26
|
+
}
|
27
|
+
|
28
|
+
XNI_EXPORT void
|
29
|
+
walters_buffer_finalize(RubyEnv *rb, struct Walters_Buffer *buf)
|
30
|
+
{
|
31
|
+
gh_buf_free(&buf->gh);
|
32
|
+
}
|
33
|
+
|
34
|
+
XNI_EXPORT const char *
|
35
|
+
walters_buffer_cstring(RubyEnv *rb, struct Walters_Buffer *buf)
|
36
|
+
{
|
37
|
+
return gh_buf_cstr(&buf->gh);
|
38
|
+
}
|
39
|
+
|
40
|
+
static inline bool check_oom(struct Walters_Buffer *buf, int retval)
|
41
|
+
{
|
42
|
+
if (gh_buf_oom(&buf->gh)) {
|
43
|
+
throw xni::runtime_error("out of memory");
|
44
|
+
}
|
45
|
+
|
46
|
+
return retval != 0;
|
47
|
+
}
|
48
|
+
|
49
|
+
XNI_EXPORT bool
|
50
|
+
walters_buffer_escape_html(RubyEnv *rb, struct Walters_Buffer *buf, const char *cstr, unsigned int size)
|
51
|
+
{
|
52
|
+
return check_oom(buf, houdini_escape_html(&buf->gh, (const uint8_t *) cstr, size));
|
53
|
+
}
|
54
|
+
|
55
|
+
XNI_EXPORT bool
|
56
|
+
walters_buffer_escape_html0(RubyEnv *rb, struct Walters_Buffer *buf, const char *cstr, unsigned int size, bool secure)
|
57
|
+
{
|
58
|
+
return check_oom(buf, houdini_escape_html0(&buf->gh, (const uint8_t *) cstr, size, secure));
|
59
|
+
}
|
60
|
+
|
61
|
+
XNI_EXPORT bool
|
62
|
+
walters_buffer_unescape_html(RubyEnv *rb, struct Walters_Buffer *buf, const char *cstr, unsigned int size)
|
63
|
+
{
|
64
|
+
return check_oom(buf, houdini_unescape_html(&buf->gh, (const uint8_t *) cstr, size));
|
65
|
+
}
|
66
|
+
|
67
|
+
XNI_EXPORT bool
|
68
|
+
walters_buffer_escape_xml(RubyEnv *rb, struct Walters_Buffer *buf, const char *cstr, unsigned int size)
|
69
|
+
{
|
70
|
+
return check_oom(buf, houdini_escape_xml(&buf->gh, (const uint8_t *) cstr, size));
|
71
|
+
}
|
72
|
+
|
73
|
+
XNI_EXPORT bool
|
74
|
+
walters_buffer_escape_uri(RubyEnv *rb, struct Walters_Buffer *buf, const char *cstr, unsigned int size)
|
75
|
+
{
|
76
|
+
return check_oom(buf, houdini_escape_uri(&buf->gh, (const uint8_t *) cstr, size));
|
77
|
+
}
|
78
|
+
|
79
|
+
XNI_EXPORT bool
|
80
|
+
walters_buffer_escape_url(RubyEnv *rb, struct Walters_Buffer *buf, const char *cstr, unsigned int size)
|
81
|
+
{
|
82
|
+
return check_oom(buf, houdini_escape_url(&buf->gh, (const uint8_t *) cstr, size));
|
83
|
+
}
|
84
|
+
|
85
|
+
XNI_EXPORT bool
|
86
|
+
walters_buffer_escape_href(RubyEnv *rb, struct Walters_Buffer *buf, const char *cstr, unsigned int size)
|
87
|
+
{
|
88
|
+
return check_oom(buf, houdini_escape_href(&buf->gh, (const uint8_t *) cstr, size));
|
89
|
+
}
|
90
|
+
|
91
|
+
XNI_EXPORT bool
|
92
|
+
walters_buffer_unescape_uri(RubyEnv *rb, struct Walters_Buffer *buf, const char *cstr, unsigned int size)
|
93
|
+
{
|
94
|
+
return check_oom(buf, houdini_unescape_uri(&buf->gh, (const uint8_t *) cstr, size));
|
95
|
+
}
|
96
|
+
|
97
|
+
XNI_EXPORT bool
|
98
|
+
walters_buffer_unescape_url(RubyEnv *rb, struct Walters_Buffer *buf, const char *cstr, unsigned int size)
|
99
|
+
{
|
100
|
+
return check_oom(buf, houdini_unescape_url(&buf->gh, (const uint8_t *) cstr, size));
|
101
|
+
}
|
102
|
+
|
103
|
+
XNI_EXPORT bool
|
104
|
+
walters_buffer_escape_js(RubyEnv *rb, struct Walters_Buffer *buf, const char *cstr, unsigned int size)
|
105
|
+
{
|
106
|
+
return check_oom(buf, houdini_escape_js(&buf->gh, (const uint8_t *) cstr, size));
|
107
|
+
}
|
108
|
+
|
109
|
+
XNI_EXPORT bool
|
110
|
+
walters_buffer_unescape_js(RubyEnv *rb, struct Walters_Buffer *buf, const char *cstr, unsigned int size)
|
111
|
+
{
|
112
|
+
return check_oom(buf, houdini_unescape_js(&buf->gh, (const uint8_t *) cstr, size));
|
113
|
+
}
|
@@ -0,0 +1,450 @@
|
|
1
|
+
#include <xni.h>
|
2
|
+
#include "walters.h"
|
3
|
+
#include "/Users/wayne/.rvm/gems/ruby-2.0.0-p0/gems/xni-0.1.0/runtime/xni_runtime.h"
|
4
|
+
extern "C" void xni_walters_buffer_finalize(void* ext_data, struct Walters_Buffer * a0);
|
5
|
+
|
6
|
+
extern "C" void
|
7
|
+
xni_walters_buffer_finalize(void* ext_data, struct Walters_Buffer * a0)
|
8
|
+
{
|
9
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
10
|
+
try {
|
11
|
+
walters_buffer_finalize(&rb, a0);
|
12
|
+
|
13
|
+
} catch (xni::exception& xni_exc) {
|
14
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
15
|
+
|
16
|
+
} catch (std::exception& std_exc) {
|
17
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
extern "C" void xni_walters_buffer_initialize(void* ext_data, struct Walters_Buffer * a0, unsigned int a1);
|
22
|
+
|
23
|
+
extern "C" void
|
24
|
+
xni_walters_buffer_initialize(void* ext_data, struct Walters_Buffer * a0, unsigned int a1)
|
25
|
+
{
|
26
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
27
|
+
try {
|
28
|
+
walters_buffer_initialize(&rb, a0, a1);
|
29
|
+
|
30
|
+
} catch (xni::exception& xni_exc) {
|
31
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
32
|
+
|
33
|
+
} catch (std::exception& std_exc) {
|
34
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
extern "C" const char * xni_walters_buffer_cstring(void* ext_data, struct Walters_Buffer * a0);
|
39
|
+
|
40
|
+
extern "C" const char *
|
41
|
+
xni_walters_buffer_cstring(void* ext_data, struct Walters_Buffer * a0)
|
42
|
+
{
|
43
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
44
|
+
try {
|
45
|
+
return walters_buffer_cstring(&rb, a0);
|
46
|
+
|
47
|
+
} catch (xni::exception& xni_exc) {
|
48
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
49
|
+
|
50
|
+
} catch (std::exception& std_exc) {
|
51
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
extern "C" bool xni_walters_buffer_escape_html(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2);
|
56
|
+
|
57
|
+
extern "C" bool
|
58
|
+
xni_walters_buffer_escape_html(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2)
|
59
|
+
{
|
60
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
61
|
+
try {
|
62
|
+
return walters_buffer_escape_html(&rb, a0, a1, a2);
|
63
|
+
|
64
|
+
} catch (xni::exception& xni_exc) {
|
65
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
66
|
+
|
67
|
+
} catch (std::exception& std_exc) {
|
68
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
extern "C" bool xni_walters_buffer_escape_html0(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2, bool a3);
|
73
|
+
|
74
|
+
extern "C" bool
|
75
|
+
xni_walters_buffer_escape_html0(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2, bool a3)
|
76
|
+
{
|
77
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
78
|
+
try {
|
79
|
+
return walters_buffer_escape_html0(&rb, a0, a1, a2, a3);
|
80
|
+
|
81
|
+
} catch (xni::exception& xni_exc) {
|
82
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
83
|
+
|
84
|
+
} catch (std::exception& std_exc) {
|
85
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
extern "C" bool xni_walters_buffer_unescape_html(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2);
|
90
|
+
|
91
|
+
extern "C" bool
|
92
|
+
xni_walters_buffer_unescape_html(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2)
|
93
|
+
{
|
94
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
95
|
+
try {
|
96
|
+
return walters_buffer_unescape_html(&rb, a0, a1, a2);
|
97
|
+
|
98
|
+
} catch (xni::exception& xni_exc) {
|
99
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
100
|
+
|
101
|
+
} catch (std::exception& std_exc) {
|
102
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
extern "C" bool xni_walters_buffer_escape_xml(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2);
|
107
|
+
|
108
|
+
extern "C" bool
|
109
|
+
xni_walters_buffer_escape_xml(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2)
|
110
|
+
{
|
111
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
112
|
+
try {
|
113
|
+
return walters_buffer_escape_xml(&rb, a0, a1, a2);
|
114
|
+
|
115
|
+
} catch (xni::exception& xni_exc) {
|
116
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
117
|
+
|
118
|
+
} catch (std::exception& std_exc) {
|
119
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
extern "C" bool xni_walters_buffer_escape_uri(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2);
|
124
|
+
|
125
|
+
extern "C" bool
|
126
|
+
xni_walters_buffer_escape_uri(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2)
|
127
|
+
{
|
128
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
129
|
+
try {
|
130
|
+
return walters_buffer_escape_uri(&rb, a0, a1, a2);
|
131
|
+
|
132
|
+
} catch (xni::exception& xni_exc) {
|
133
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
134
|
+
|
135
|
+
} catch (std::exception& std_exc) {
|
136
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
extern "C" bool xni_walters_buffer_escape_url(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2);
|
141
|
+
|
142
|
+
extern "C" bool
|
143
|
+
xni_walters_buffer_escape_url(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2)
|
144
|
+
{
|
145
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
146
|
+
try {
|
147
|
+
return walters_buffer_escape_url(&rb, a0, a1, a2);
|
148
|
+
|
149
|
+
} catch (xni::exception& xni_exc) {
|
150
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
151
|
+
|
152
|
+
} catch (std::exception& std_exc) {
|
153
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
extern "C" bool xni_walters_buffer_escape_href(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2);
|
158
|
+
|
159
|
+
extern "C" bool
|
160
|
+
xni_walters_buffer_escape_href(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2)
|
161
|
+
{
|
162
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
163
|
+
try {
|
164
|
+
return walters_buffer_escape_href(&rb, a0, a1, a2);
|
165
|
+
|
166
|
+
} catch (xni::exception& xni_exc) {
|
167
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
168
|
+
|
169
|
+
} catch (std::exception& std_exc) {
|
170
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
171
|
+
}
|
172
|
+
}
|
173
|
+
|
174
|
+
extern "C" bool xni_walters_buffer_unescape_uri(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2);
|
175
|
+
|
176
|
+
extern "C" bool
|
177
|
+
xni_walters_buffer_unescape_uri(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2)
|
178
|
+
{
|
179
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
180
|
+
try {
|
181
|
+
return walters_buffer_unescape_uri(&rb, a0, a1, a2);
|
182
|
+
|
183
|
+
} catch (xni::exception& xni_exc) {
|
184
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
185
|
+
|
186
|
+
} catch (std::exception& std_exc) {
|
187
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
188
|
+
}
|
189
|
+
}
|
190
|
+
|
191
|
+
extern "C" bool xni_walters_buffer_unescape_url(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2);
|
192
|
+
|
193
|
+
extern "C" bool
|
194
|
+
xni_walters_buffer_unescape_url(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2)
|
195
|
+
{
|
196
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
197
|
+
try {
|
198
|
+
return walters_buffer_unescape_url(&rb, a0, a1, a2);
|
199
|
+
|
200
|
+
} catch (xni::exception& xni_exc) {
|
201
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
202
|
+
|
203
|
+
} catch (std::exception& std_exc) {
|
204
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
205
|
+
}
|
206
|
+
}
|
207
|
+
|
208
|
+
extern "C" bool xni_walters_buffer_escape_js(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2);
|
209
|
+
|
210
|
+
extern "C" bool
|
211
|
+
xni_walters_buffer_escape_js(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2)
|
212
|
+
{
|
213
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
214
|
+
try {
|
215
|
+
return walters_buffer_escape_js(&rb, a0, a1, a2);
|
216
|
+
|
217
|
+
} catch (xni::exception& xni_exc) {
|
218
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
219
|
+
|
220
|
+
} catch (std::exception& std_exc) {
|
221
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
222
|
+
}
|
223
|
+
}
|
224
|
+
|
225
|
+
extern "C" bool xni_walters_buffer_unescape_js(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2);
|
226
|
+
|
227
|
+
extern "C" bool
|
228
|
+
xni_walters_buffer_unescape_js(void* ext_data, struct Walters_Buffer * a0, const char * a1, unsigned int a2)
|
229
|
+
{
|
230
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
231
|
+
try {
|
232
|
+
return walters_buffer_unescape_js(&rb, a0, a1, a2);
|
233
|
+
|
234
|
+
} catch (xni::exception& xni_exc) {
|
235
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
236
|
+
|
237
|
+
} catch (std::exception& std_exc) {
|
238
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
239
|
+
}
|
240
|
+
}
|
241
|
+
|
242
|
+
extern "C" void xni_walters_free_cstring(void* ext_data, void * a0);
|
243
|
+
|
244
|
+
extern "C" void
|
245
|
+
xni_walters_free_cstring(void* ext_data, void * a0)
|
246
|
+
{
|
247
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
248
|
+
try {
|
249
|
+
walters_free_cstring(&rb, a0);
|
250
|
+
|
251
|
+
} catch (xni::exception& xni_exc) {
|
252
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
253
|
+
|
254
|
+
} catch (std::exception& std_exc) {
|
255
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
256
|
+
}
|
257
|
+
}
|
258
|
+
|
259
|
+
extern "C" const char * xni_walters_read_cstring(void* ext_data, void * a0);
|
260
|
+
|
261
|
+
extern "C" const char *
|
262
|
+
xni_walters_read_cstring(void* ext_data, void * a0)
|
263
|
+
{
|
264
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
265
|
+
try {
|
266
|
+
return walters_read_cstring(&rb, a0);
|
267
|
+
|
268
|
+
} catch (xni::exception& xni_exc) {
|
269
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
270
|
+
|
271
|
+
} catch (std::exception& std_exc) {
|
272
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
273
|
+
}
|
274
|
+
}
|
275
|
+
|
276
|
+
extern "C" void * xni_walters__escape_html(void* ext_data, const char * a0, unsigned int a1, bool a2);
|
277
|
+
|
278
|
+
extern "C" void *
|
279
|
+
xni_walters__escape_html(void* ext_data, const char * a0, unsigned int a1, bool a2)
|
280
|
+
{
|
281
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
282
|
+
try {
|
283
|
+
return walters__escape_html(&rb, a0, a1, a2);
|
284
|
+
|
285
|
+
} catch (xni::exception& xni_exc) {
|
286
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
287
|
+
|
288
|
+
} catch (std::exception& std_exc) {
|
289
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
290
|
+
}
|
291
|
+
}
|
292
|
+
|
293
|
+
extern "C" void * xni_walters__unescape_html(void* ext_data, const char * a0, unsigned int a1);
|
294
|
+
|
295
|
+
extern "C" void *
|
296
|
+
xni_walters__unescape_html(void* ext_data, const char * a0, unsigned int a1)
|
297
|
+
{
|
298
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
299
|
+
try {
|
300
|
+
return walters__unescape_html(&rb, a0, a1);
|
301
|
+
|
302
|
+
} catch (xni::exception& xni_exc) {
|
303
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
304
|
+
|
305
|
+
} catch (std::exception& std_exc) {
|
306
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
307
|
+
}
|
308
|
+
}
|
309
|
+
|
310
|
+
extern "C" void * xni_walters__escape_xml(void* ext_data, const char * a0, unsigned int a1);
|
311
|
+
|
312
|
+
extern "C" void *
|
313
|
+
xni_walters__escape_xml(void* ext_data, const char * a0, unsigned int a1)
|
314
|
+
{
|
315
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
316
|
+
try {
|
317
|
+
return walters__escape_xml(&rb, a0, a1);
|
318
|
+
|
319
|
+
} catch (xni::exception& xni_exc) {
|
320
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
321
|
+
|
322
|
+
} catch (std::exception& std_exc) {
|
323
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
324
|
+
}
|
325
|
+
}
|
326
|
+
|
327
|
+
extern "C" void * xni_walters__escape_uri(void* ext_data, const char * a0, unsigned int a1);
|
328
|
+
|
329
|
+
extern "C" void *
|
330
|
+
xni_walters__escape_uri(void* ext_data, const char * a0, unsigned int a1)
|
331
|
+
{
|
332
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
333
|
+
try {
|
334
|
+
return walters__escape_uri(&rb, a0, a1);
|
335
|
+
|
336
|
+
} catch (xni::exception& xni_exc) {
|
337
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
338
|
+
|
339
|
+
} catch (std::exception& std_exc) {
|
340
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
341
|
+
}
|
342
|
+
}
|
343
|
+
|
344
|
+
extern "C" void * xni_walters__escape_url(void* ext_data, const char * a0, unsigned int a1);
|
345
|
+
|
346
|
+
extern "C" void *
|
347
|
+
xni_walters__escape_url(void* ext_data, const char * a0, unsigned int a1)
|
348
|
+
{
|
349
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
350
|
+
try {
|
351
|
+
return walters__escape_url(&rb, a0, a1);
|
352
|
+
|
353
|
+
} catch (xni::exception& xni_exc) {
|
354
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
355
|
+
|
356
|
+
} catch (std::exception& std_exc) {
|
357
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
358
|
+
}
|
359
|
+
}
|
360
|
+
|
361
|
+
extern "C" void * xni_walters__escape_href(void* ext_data, const char * a0, unsigned int a1);
|
362
|
+
|
363
|
+
extern "C" void *
|
364
|
+
xni_walters__escape_href(void* ext_data, const char * a0, unsigned int a1)
|
365
|
+
{
|
366
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
367
|
+
try {
|
368
|
+
return walters__escape_href(&rb, a0, a1);
|
369
|
+
|
370
|
+
} catch (xni::exception& xni_exc) {
|
371
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
372
|
+
|
373
|
+
} catch (std::exception& std_exc) {
|
374
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
375
|
+
}
|
376
|
+
}
|
377
|
+
|
378
|
+
extern "C" void * xni_walters__unescape_uri(void* ext_data, const char * a0, unsigned int a1);
|
379
|
+
|
380
|
+
extern "C" void *
|
381
|
+
xni_walters__unescape_uri(void* ext_data, const char * a0, unsigned int a1)
|
382
|
+
{
|
383
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
384
|
+
try {
|
385
|
+
return walters__unescape_uri(&rb, a0, a1);
|
386
|
+
|
387
|
+
} catch (xni::exception& xni_exc) {
|
388
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
389
|
+
|
390
|
+
} catch (std::exception& std_exc) {
|
391
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
392
|
+
}
|
393
|
+
}
|
394
|
+
|
395
|
+
extern "C" void * xni_walters__unescape_url(void* ext_data, const char * a0, unsigned int a1);
|
396
|
+
|
397
|
+
extern "C" void *
|
398
|
+
xni_walters__unescape_url(void* ext_data, const char * a0, unsigned int a1)
|
399
|
+
{
|
400
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
401
|
+
try {
|
402
|
+
return walters__unescape_url(&rb, a0, a1);
|
403
|
+
|
404
|
+
} catch (xni::exception& xni_exc) {
|
405
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
406
|
+
|
407
|
+
} catch (std::exception& std_exc) {
|
408
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
409
|
+
}
|
410
|
+
}
|
411
|
+
|
412
|
+
extern "C" void * xni_walters__escape_js(void* ext_data, const char * a0, unsigned int a1);
|
413
|
+
|
414
|
+
extern "C" void *
|
415
|
+
xni_walters__escape_js(void* ext_data, const char * a0, unsigned int a1)
|
416
|
+
{
|
417
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
418
|
+
try {
|
419
|
+
return walters__escape_js(&rb, a0, a1);
|
420
|
+
|
421
|
+
} catch (xni::exception& xni_exc) {
|
422
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
423
|
+
|
424
|
+
} catch (std::exception& std_exc) {
|
425
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
426
|
+
}
|
427
|
+
}
|
428
|
+
|
429
|
+
extern "C" void * xni_walters__unescape_js(void* ext_data, const char * a0, unsigned int a1);
|
430
|
+
|
431
|
+
extern "C" void *
|
432
|
+
xni_walters__unescape_js(void* ext_data, const char * a0, unsigned int a1)
|
433
|
+
{
|
434
|
+
RubyEnv_ rb(&xni::ruby_functions, (ExtensionData *) ext_data);
|
435
|
+
try {
|
436
|
+
return walters__unescape_js(&rb, a0, a1);
|
437
|
+
|
438
|
+
} catch (xni::exception& xni_exc) {
|
439
|
+
xni::handle_exception((ExtensionData *) ext_data, xni_exc);
|
440
|
+
|
441
|
+
} catch (std::exception& std_exc) {
|
442
|
+
xni::handle_exception((ExtensionData *) ext_data, std_exc);
|
443
|
+
}
|
444
|
+
}
|
445
|
+
|
446
|
+
extern "C" int xni_walters_sizeof_buffer(void);
|
447
|
+
extern "C" int xni_walters_sizeof_buffer(void)
|
448
|
+
{
|
449
|
+
return walters_sizeof_buffer();
|
450
|
+
}
|