ox 2.14.13 → 2.14.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +1 -1
- data/ext/ox/attr.h +33 -39
- data/ext/ox/base64.c +48 -42
- data/ext/ox/base64.h +4 -4
- data/ext/ox/buf.h +80 -86
- data/ext/ox/builder.c +378 -423
- data/ext/ox/cache.c +2 -2
- data/ext/ox/cache8.c +37 -40
- data/ext/ox/cache8.h +7 -7
- data/ext/ox/dump.c +838 -867
- data/ext/ox/err.c +16 -13
- data/ext/ox/err.h +11 -12
- data/ext/ox/extconf.rb +5 -5
- data/ext/ox/gen_load.c +135 -137
- data/ext/ox/hash_load.c +130 -148
- data/ext/ox/helper.h +32 -39
- data/ext/ox/intern.c +1 -2
- data/ext/ox/obj_load.c +590 -644
- data/ext/ox/ox.c +2 -2
- data/ext/ox/ox.h +5 -5
- data/ext/ox/parse.c +836 -874
- data/ext/ox/sax.c +38 -23
- data/ext/ox/sax.h +2 -2
- data/ext/ox/sax_as.c +78 -94
- data/ext/ox/sax_buf.c +85 -94
- data/ext/ox/sax_buf.h +101 -120
- data/ext/ox/sax_hint.c +175 -184
- data/ext/ox/sax_hint.h +19 -19
- data/ext/ox/sax_stack.h +59 -45
- data/ext/ox/slotcache.c +2 -2
- data/ext/ox/slotcache.h +4 -4
- data/ext/ox/special.c +320 -327
- data/ext/ox/special.h +2 -2
- data/ext/ox/type.h +19 -19
- data/lib/ox/bag.rb +13 -9
- data/lib/ox/cdata.rb +0 -2
- data/lib/ox/comment.rb +0 -2
- data/lib/ox/doctype.rb +0 -2
- data/lib/ox/document.rb +3 -5
- data/lib/ox/element.rb +41 -26
- data/lib/ox/error.rb +0 -3
- data/lib/ox/hasattrs.rb +7 -8
- data/lib/ox/instruct.rb +4 -6
- data/lib/ox/node.rb +3 -4
- data/lib/ox/raw.rb +0 -2
- data/lib/ox/sax.rb +20 -36
- data/lib/ox/version.rb +1 -2
- data/lib/ox/xmlrpc_adapter.rb +4 -6
- data/lib/ox.rb +15 -16
- metadata +6 -5
data/ext/ox/ox.c
CHANGED
@@ -23,7 +23,7 @@
|
|
23
23
|
typedef struct _yesNoOpt {
|
24
24
|
VALUE sym;
|
25
25
|
char *attr;
|
26
|
-
} *
|
26
|
+
} *YesNoOpt;
|
27
27
|
|
28
28
|
void Init_ox();
|
29
29
|
|
@@ -107,7 +107,7 @@ VALUE ox_struct_class;
|
|
107
107
|
VALUE ox_syntax_error_class;
|
108
108
|
VALUE ox_time_class;
|
109
109
|
|
110
|
-
SlotCache ox_class_cache
|
110
|
+
SlotCache ox_class_cache = 0;
|
111
111
|
|
112
112
|
static VALUE abort_sym;
|
113
113
|
static VALUE active_sym;
|
data/ext/ox/ox.h
CHANGED
@@ -94,14 +94,14 @@ typedef struct _parseCallbacks {
|
|
94
94
|
void (*add_element)(PInfo pi, const char *ename, Attr attrs, int hasChildren);
|
95
95
|
void (*end_element)(PInfo pi, const char *ename);
|
96
96
|
void (*finish)(PInfo pi);
|
97
|
-
} *
|
97
|
+
} *ParseCallbacks;
|
98
98
|
|
99
99
|
typedef struct _circArray {
|
100
100
|
VALUE obj_array[1024];
|
101
101
|
VALUE *objs;
|
102
102
|
unsigned long size; /* allocated size or initial array size */
|
103
103
|
unsigned long cnt;
|
104
|
-
} *
|
104
|
+
} *CircArray;
|
105
105
|
|
106
106
|
typedef struct _options {
|
107
107
|
char encoding[64]; // encoding, stored in the option to avoid GC invalidation in default values
|
@@ -128,8 +128,8 @@ typedef struct _options {
|
|
128
128
|
struct _hints *html_hints; // html hints
|
129
129
|
VALUE attr_key_mod;
|
130
130
|
VALUE element_key_mod;
|
131
|
-
rb_encoding
|
132
|
-
} *
|
131
|
+
rb_encoding *rb_enc;
|
132
|
+
} *Options;
|
133
133
|
|
134
134
|
// parse information structure
|
135
135
|
struct _pInfo {
|
@@ -146,7 +146,7 @@ struct _pInfo {
|
|
146
146
|
VALUE *marked;
|
147
147
|
int mark_size; // allocated size
|
148
148
|
int mark_cnt;
|
149
|
-
char last;
|
149
|
+
char last; // last character read, rarely set
|
150
150
|
};
|
151
151
|
|
152
152
|
extern VALUE ox_parse(char *xml, size_t len, ParseCallbacks pcb, char **endp, Options options, Err err);
|