ox 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ox might be problematic. Click here for more details.
- data/README.md +10 -10
- data/ext/ox/buf.h +160 -0
- data/ext/ox/builder.c +685 -0
- data/ext/ox/ox.c +117 -100
- data/ext/ox/ox.h +11 -4
- data/ext/ox/sax_as.c +37 -0
- data/lib/ox.rb +1 -0
- data/lib/ox/bag.rb +21 -14
- data/lib/ox/cdata.rb +1 -1
- data/lib/ox/comment.rb +1 -1
- data/lib/ox/doctype.rb +1 -1
- data/lib/ox/document.rb +4 -4
- data/lib/ox/element.rb +17 -16
- data/lib/ox/error.rb +2 -0
- data/lib/ox/hasattrs.rb +7 -8
- data/lib/ox/instruct.rb +3 -4
- data/lib/ox/node.rb +2 -2
- data/lib/ox/raw.rb +1 -1
- data/lib/ox/sax.rb +8 -6
- data/lib/ox/version.rb +1 -1
- data/lib/ox/xmlrpc_adapter.rb +3 -1
- metadata +52 -47
- checksums.yaml +0 -7
- data/ext/ox/cache8_test.c +0 -44
- data/ext/ox/cache_test.c +0 -55
- data/ext/ox/encode.h +0 -26
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 1bf8bb0abb35f28192d986125010bca5dac84737
|
4
|
-
data.tar.gz: edfeba0e9a4b9892f4de6b127d7717795a01f007
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 9428e17927f1e89e3704401f27c40523c84ad9900826beef3df85af5f71411be9bd6a450a339dff24de28de36ece8c335235b055281b21dd4ca22a2859922dc0
|
7
|
-
data.tar.gz: 853e58cc23f118defd6eafb1c64483cf0a922572a9befde6edb54e4be72d6671ddfc97c4093afa31590f6c239a1cda852c5980d2e27d39e9eb33984492258bc5
|
data/ext/ox/cache8_test.c
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
/* cache8_test.c
|
2
|
-
* Copyright (c) 2011, Peter Ohler
|
3
|
-
* All rights reserved.
|
4
|
-
*/
|
5
|
-
|
6
|
-
#include <stdio.h>
|
7
|
-
#include "cache8.h"
|
8
|
-
|
9
|
-
static slot_t data[] = {
|
10
|
-
0x000000A0A0A0A0A0ULL,
|
11
|
-
0x0000000000ABCDEFULL,
|
12
|
-
0x0123456789ABCDEFULL,
|
13
|
-
0x0000000000000001ULL,
|
14
|
-
0x0000000000000002ULL,
|
15
|
-
0x0000000000000003ULL,
|
16
|
-
0x0000000000000004ULL,
|
17
|
-
0
|
18
|
-
};
|
19
|
-
|
20
|
-
void
|
21
|
-
ox_cache8_test() {
|
22
|
-
Cache8 c;
|
23
|
-
slot_t v;
|
24
|
-
slot_t *d;
|
25
|
-
slot_t cnt = 1;
|
26
|
-
slot_t *slot = 0;
|
27
|
-
|
28
|
-
ox_cache8_new(&c);
|
29
|
-
for (d = data; 0 != *d; d++) {
|
30
|
-
v = ox_cache8_get(c, *d, &slot);
|
31
|
-
if (0 == v) {
|
32
|
-
if (0 == slot) {
|
33
|
-
printf("*** failed to get a slot for 0x%016llx\n", (unsigned long long)*d);
|
34
|
-
} else {
|
35
|
-
printf("*** adding 0x%016llx to cache with value %llu\n", (unsigned long long)*d, (unsigned long long)cnt);
|
36
|
-
*slot = cnt++;
|
37
|
-
}
|
38
|
-
} else {
|
39
|
-
printf("*** get on 0x%016llx returned %llu\n", (unsigned long long)*d, (unsigned long long)v);
|
40
|
-
}
|
41
|
-
/*ox_cache8_print(c); */
|
42
|
-
}
|
43
|
-
ox_cache8_print(c);
|
44
|
-
}
|
data/ext/ox/cache_test.c
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
/* cache_test.c
|
2
|
-
* Copyright (c) 2011, Peter Ohler
|
3
|
-
* All rights reserved.
|
4
|
-
*/
|
5
|
-
|
6
|
-
#include "cache.h"
|
7
|
-
|
8
|
-
static const char *data[] = {
|
9
|
-
#if 1
|
10
|
-
"one",
|
11
|
-
"two",
|
12
|
-
"one",
|
13
|
-
"onex",
|
14
|
-
"oney",
|
15
|
-
"one",
|
16
|
-
"tw",
|
17
|
-
"onexyzabcdefgh",
|
18
|
-
#else
|
19
|
-
"abc",
|
20
|
-
"abcd",
|
21
|
-
"ab",
|
22
|
-
"a",
|
23
|
-
"abcdefghijklmnop",
|
24
|
-
#endif
|
25
|
-
0
|
26
|
-
};
|
27
|
-
|
28
|
-
void
|
29
|
-
ox_cache_test() {
|
30
|
-
Cache c;
|
31
|
-
const char **d;
|
32
|
-
VALUE v;
|
33
|
-
VALUE *slot = 0;;
|
34
|
-
|
35
|
-
ox_cache_new(&c);
|
36
|
-
for (d = data; 0 != *d; d++) {
|
37
|
-
/*printf("*** cache_get on %s\n", *d);*/
|
38
|
-
v = ox_cache_get(c, *d, &slot, 0);
|
39
|
-
if (Qundef == v) {
|
40
|
-
if (0 == slot) {
|
41
|
-
/*printf("*** failed to get a slot for %s\n", *d); */
|
42
|
-
} else {
|
43
|
-
/*printf("*** added '%s' to cache\n", *d); */
|
44
|
-
v = ID2SYM(rb_intern(*d));
|
45
|
-
*slot = v;
|
46
|
-
}
|
47
|
-
} else {
|
48
|
-
VALUE rs = rb_funcall2(v, rb_intern("to_s"), 0, 0);
|
49
|
-
|
50
|
-
printf("*** get on '%s' returned '%s' (%s)\n", *d, StringValuePtr(rs), rb_class2name(rb_obj_class(v)));
|
51
|
-
}
|
52
|
-
/*ox_cache_print(c);*/
|
53
|
-
}
|
54
|
-
ox_cache_print(c);
|
55
|
-
}
|
data/ext/ox/encode.h
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
/* encode.h
|
2
|
-
* Copyright (c) 2011, Peter Ohler
|
3
|
-
* All rights reserved.
|
4
|
-
*/
|
5
|
-
|
6
|
-
#ifndef __OX_ENCODE_H__
|
7
|
-
#define __OX_ENCODE_H__
|
8
|
-
|
9
|
-
#include "ruby.h"
|
10
|
-
#if HAS_ENCODING_SUPPORT
|
11
|
-
#include "ruby/encoding.h"
|
12
|
-
#endif
|
13
|
-
|
14
|
-
static inline VALUE
|
15
|
-
ox_encode(VALUE rstr) {
|
16
|
-
#if HAS_ENCODING_SUPPORT
|
17
|
-
rb_enc_associate(rstr, ox_utf8_encoding);
|
18
|
-
#else
|
19
|
-
if (Qnil != ox_utf8_encoding) {
|
20
|
-
rstr = rb_funcall(ox_utf8_encoding, ox_iconv_id, 1, rstr);
|
21
|
-
}
|
22
|
-
#endif
|
23
|
-
return rstr;
|
24
|
-
}
|
25
|
-
|
26
|
-
#endif /* __OX_ENCODE_H__ */
|