diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-06 14:05:10 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-06 14:05:10 +0000 |
commit | 0658871ee2651f61458a9b707e8832d264feb8c6 (patch) | |
tree | d0e84110a08867d79b379adaa1089dd9485a430c /enc | |
parent | b3fa723cff16a5ffa4e9cb342283714dd66c7cd2 (diff) | |
download | ruby-0658871ee2651f61458a9b707e8832d264feb8c6.tar.gz ruby-0658871ee2651f61458a9b707e8832d264feb8c6.tar.xz ruby-0658871ee2651f61458a9b707e8832d264feb8c6.zip |
* include/ruby/encoding.h (ECONV_XML_TEXT_ENCODER): renamed from
ECONV_HTML_TEXT_ENCODER.
(ECONV_XML_ATTR_ENCODER): renamed from ECONV_HTML_ATTR_ENCODER.
* enc/trans/escape.trans: follow the renaming.
* transcode.c: ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc')
-rw-r--r-- | enc/trans/escape.trans | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/enc/trans/escape.trans b/enc/trans/escape.trans index b2aefbb19..0641c6e25 100644 --- a/enc/trans/escape.trans +++ b/enc/trans/escape.trans @@ -1,7 +1,7 @@ #include "transcode_data.h" static int -fun_so_escape_html_chref(void *statep, const unsigned char *s, size_t l, unsigned char *o) +fun_so_escape_xml_chref(void *statep, const unsigned char *s, size_t l, unsigned char *o) { switch (*s) { case '&': @@ -45,16 +45,16 @@ fun_so_escape_html_chref(void *statep, const unsigned char *s, size_t l, unsigne map_amp["26"] = :func_so transcode_generate_node(ActionMap.parse(map_amp), "escape_amp_as_chref") - map_html_text = {} - map_html_text["{00-25,27-3B,3D,3F-FF}"] = :nomap - map_html_text["26"] = :func_so - map_html_text["3C"] = :func_so - map_html_text["3E"] = :func_so - transcode_generate_node(ActionMap.parse(map_html_text), "escape_html_text") + map_xml_text = {} + map_xml_text["{00-25,27-3B,3D,3F-FF}"] = :nomap + map_xml_text["26"] = :func_so + map_xml_text["3C"] = :func_so + map_xml_text["3E"] = :func_so + transcode_generate_node(ActionMap.parse(map_xml_text), "escape_xml_text") - map_html_attr = {} - map_html_attr["{00-FF}"] = :func_so - transcode_generate_node(ActionMap.parse(map_html_attr), "escape_html_attr") + map_xml_attr = {} + map_xml_attr["{00-FF}"] = :func_so + transcode_generate_node(ActionMap.parse(map_xml_attr), "escape_xml_attr") %> <%= transcode_generated_code %> @@ -68,26 +68,26 @@ rb_escape_amp_as_chref = { 5, /* max_output */ stateless_converter, /* stateful_type */ 0, NULL, NULL, - NULL, NULL, NULL, &fun_so_escape_html_chref + NULL, NULL, NULL, &fun_so_escape_xml_chref }; static const rb_transcoder -rb_escape_html_text = { - "", "html-text-escaped", escape_html_text, +rb_escape_xml_text = { + "", "xml-text-escaped", escape_xml_text, TRANSCODE_TABLE_INFO, 1, /* input_unit_length */ 1, /* max_input */ 5, /* max_output */ stateless_converter, /* stateful_type */ 0, NULL, NULL, - NULL, NULL, NULL, &fun_so_escape_html_chref + NULL, NULL, NULL, &fun_so_escape_xml_chref }; #define END 0 #define NORMAL 1 static int -escape_html_attr_init(void *statep) +escape_xml_attr_init(void *statep) { unsigned char *sp = statep; *sp = END; @@ -95,7 +95,7 @@ escape_html_attr_init(void *statep) } static int -fun_so_escape_html_attr(void *statep, const unsigned char *s, size_t l, unsigned char *o) +fun_so_escape_xml_attr(void *statep, const unsigned char *s, size_t l, unsigned char *o) { unsigned char *sp = statep; int n = 0; @@ -108,7 +108,7 @@ fun_so_escape_html_attr(void *statep, const unsigned char *s, size_t l, unsigned case '<': case '>': case '"': - n += fun_so_escape_html_chref(statep, s, l, o+n); + n += fun_so_escape_xml_chref(statep, s, l, o+n); break; default: @@ -119,7 +119,7 @@ fun_so_escape_html_attr(void *statep, const unsigned char *s, size_t l, unsigned } static int -escape_html_attr_finish(void *statep, unsigned char *o) +escape_xml_attr_finish(void *statep, unsigned char *o) { unsigned char *sp = statep; int n = 0; @@ -135,23 +135,23 @@ escape_html_attr_finish(void *statep, unsigned char *o) } static const rb_transcoder -rb_escape_html_attr = { - "", "html-attr-escaped", escape_html_attr, +rb_escape_xml_attr = { + "", "xml-attr-escaped", escape_xml_attr, TRANSCODE_TABLE_INFO, 1, /* input_unit_length */ 1, /* max_input */ 7, /* max_output */ stateful_encoder, /* stateful_type */ - 1, escape_html_attr_init, escape_html_attr_init, - NULL, NULL, NULL, fun_so_escape_html_attr, - escape_html_attr_finish + 1, escape_xml_attr_init, escape_xml_attr_init, + NULL, NULL, NULL, fun_so_escape_xml_attr, + escape_xml_attr_finish }; void Init_escape(void) { rb_register_transcoder(&rb_escape_amp_as_chref); - rb_register_transcoder(&rb_escape_html_text); - rb_register_transcoder(&rb_escape_html_attr); + rb_register_transcoder(&rb_escape_xml_text); + rb_register_transcoder(&rb_escape_xml_attr); } |