ext/ox/sax.h in ox-2.1.4 vs ext/ox/sax.h in ox-2.1.5
- old
+ new
@@ -68,54 +68,8 @@
extern void ox_sax_drive_error(SaxDrive dr, const char *msg);
extern int ox_sax_collapse_special(SaxDrive dr, char *str, int line, int col);
extern VALUE ox_sax_value_class;
-inline static VALUE
-str2sym(SaxDrive dr, const char *str, char **strp) {
- VALUE *slot;
- VALUE sym;
-
- if (dr->options.symbolize) {
- if (Qundef == (sym = ox_cache_get(ox_symbol_cache, str, &slot, strp))) {
-#if HAS_ENCODING_SUPPORT
- if (0 != dr->encoding) {
- VALUE rstr = rb_str_new2(str);
-
- rb_enc_associate(rstr, dr->encoding);
- sym = rb_funcall(rstr, ox_to_sym_id, 0);
- } else {
- sym = ID2SYM(rb_intern(str));
- }
-#elif HAS_PRIVATE_ENCODING
- if (Qnil != dr->encoding) {
- VALUE rstr = rb_str_new2(str);
-
- rb_funcall(rstr, ox_force_encoding_id, 1, dr->encoding);
- sym = rb_funcall(rstr, ox_to_sym_id, 0);
- } else {
- sym = ID2SYM(rb_intern(str));
- }
-#else
- sym = ID2SYM(rb_intern(str));
-#endif
- *slot = sym;
- }
- } else {
- sym = rb_str_new2(str);
-#if HAS_ENCODING_SUPPORT
- if (0 != dr->encoding) {
- rb_enc_associate(sym, dr->encoding);
- }
-#elif HAS_PRIVATE_ENCODING
- if (Qnil != dr->encoding) {
- rb_funcall(sym, ox_force_encoding_id, 1, dr->encoding);
- }
-#endif
- if (0 != strp) {
- *strp = StringValuePtr(sym);
- }
- }
- return sym;
-}
+extern VALUE str2sym(SaxDrive dr, const char *str, const char **strp);
#endif /* __OX_SAX_H__ */