2 * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include "chxj_chtml30.h"
19 #include "chxj_hdml.h"
20 #include "chxj_str_util.h"
21 #include "chxj_dump.h"
22 #include "chxj_img_conv.h"
23 #include "chxj_qr_code.h"
24 #include "chxj_encoding.h"
26 #define GET_CHTML30(X) ((chtml30_t*)(X))
29 #define W_L(X) do { chtml30->out = BUFFERED_WRITE_LITERAL(chtml30->out, &doc->buf, (X)); } while(0)
30 #define W_V(X) do { chtml30->out = (X) ? BUFFERED_WRITE_VALUE(chtml30->out, &doc->buf, (X)) \
31 : BUFFERED_WRITE_LITERAL(chtml30->out, &doc->buf, ""); } while(0)
32 extern tag_handler chtml20_handler[];
34 static char *s_chtml30_start_html_tag (void *pdoc, Node *node);
35 static char *s_chtml30_end_html_tag (void *pdoc, Node *node);
36 static char *s_chtml30_start_meta_tag (void *pdoc, Node *node);
37 static char *s_chtml30_end_meta_tag (void *pdoc, Node *node);
38 static char *s_chtml30_start_textarea_tag (void *pdoc, Node *node);
39 static char *s_chtml30_end_textarea_tag (void *pdoc, Node *node);
40 static char *s_chtml30_start_p_tag (void *pdoc, Node *node);
41 static char *s_chtml30_end_p_tag (void *pdoc, Node *node);
42 static char *s_chtml30_start_pre_tag (void *pdoc, Node *node);
43 static char *s_chtml30_end_pre_tag (void *pdoc, Node *node);
44 static char *s_chtml30_start_h1_tag (void *pdoc, Node *node);
45 static char *s_chtml30_end_h1_tag (void *pdoc, Node *node);
46 static char *s_chtml30_start_h2_tag (void *pdoc, Node *node);
47 static char *s_chtml30_end_h2_tag (void *pdoc, Node *node);
48 static char *s_chtml30_start_h3_tag (void *pdoc, Node *node);
49 static char *s_chtml30_end_h3_tag (void *pdoc, Node *node);
50 static char *s_chtml30_start_h4_tag (void *pdoc, Node *node);
51 static char *s_chtml30_end_h4_tag (void *pdoc, Node *node);
52 static char *s_chtml30_start_h5_tag (void *pdoc, Node *node);
53 static char *s_chtml30_end_h5_tag (void *pdoc, Node *node);
54 static char *s_chtml30_start_h6_tag (void *pdoc, Node *node);
55 static char *s_chtml30_end_h6_tag (void *pdoc, Node *node);
56 static char *s_chtml30_start_ul_tag (void *pdoc, Node *node);
57 static char *s_chtml30_end_ul_tag (void *pdoc, Node *node);
58 static char *s_chtml30_start_ol_tag (void *pdoc, Node *node);
59 static char *s_chtml30_end_ol_tag (void *pdoc, Node *node);
60 static char *s_chtml30_start_li_tag (void *pdoc, Node *node);
61 static char *s_chtml30_end_li_tag (void *pdoc, Node *node);
62 static char *s_chtml30_start_head_tag (void *pdoc, Node *node);
63 static char *s_chtml30_end_head_tag (void *pdoc, Node *node);
64 static char *s_chtml30_start_title_tag (void *pdoc, Node *node);
65 static char *s_chtml30_end_title_tag (void *pdoc, Node *node);
66 static char *s_chtml30_start_base_tag (void *pdoc, Node *node);
67 static char *s_chtml30_end_base_tag (void *pdoc, Node *node);
68 static char *s_chtml30_start_body_tag (void *pdoc, Node *node);
69 static char *s_chtml30_end_body_tag (void *pdoc, Node *node);
70 static char *s_chtml30_start_a_tag (void *pdoc, Node *node);
71 static char *s_chtml30_end_a_tag (void *pdoc, Node *node);
72 static char *s_chtml30_start_br_tag (void *pdoc, Node *node);
73 static char *s_chtml30_end_br_tag (void *pdoc, Node *node);
74 static char *s_chtml30_start_tr_tag (void *pdoc, Node *node);
75 static char *s_chtml30_end_tr_tag (void *pdoc, Node *node);
76 static char *s_chtml30_start_font_tag (void *pdoc, Node *node);
77 static char *s_chtml30_end_font_tag (void *pdoc, Node *node);
78 static char *s_chtml30_start_form_tag (void *pdoc, Node *node);
79 static char *s_chtml30_end_form_tag (void *pdoc, Node *node);
80 static char *s_chtml30_start_input_tag (void *pdoc, Node *node);
81 static char *s_chtml30_end_input_tag (void *pdoc, Node *node);
82 static char *s_chtml30_start_center_tag (void *pdoc, Node *node);
83 static char *s_chtml30_end_center_tag (void *pdoc, Node *node);
84 static char *s_chtml30_start_hr_tag (void *pdoc, Node *node);
85 static char *s_chtml30_end_hr_tag (void *pdoc, Node *node);
86 static char *s_chtml30_start_img_tag (void *pdoc, Node *node);
87 static char *s_chtml30_end_img_tag (void *pdoc, Node *node);
88 static char *s_chtml30_start_select_tag (void *pdoc, Node *node);
89 static char *s_chtml30_end_select_tag (void *pdoc, Node *node);
90 static char *s_chtml30_start_option_tag (void *pdoc, Node *node);
91 static char *s_chtml30_end_option_tag (void *pdoc, Node *node);
92 static char *s_chtml30_start_div_tag (void *pdoc, Node *node);
93 static char *s_chtml30_end_div_tag (void *pdoc, Node *node);
94 static char *s_chtml30_chxjif_tag (void *pdoc, Node *node);
95 static char *s_chtml30_text_tag (void *pdoc, Node *node);
96 static char *s_chtml30_start_blockquote_tag(void *pdoc, Node *node);
97 static char *s_chtml30_end_blockquote_tag (void *pdoc, Node *node);
98 static char *s_chtml30_start_dir_tag(void *pdoc, Node *node);
99 static char *s_chtml30_end_dir_tag (void *pdoc, Node *node);
100 static char *s_chtml30_start_dl_tag(void *pdoc, Node *node);
101 static char *s_chtml30_end_dl_tag (void *pdoc, Node *node);
102 static char *s_chtml30_start_dt_tag(void *pdoc, Node *node);
103 static char *s_chtml30_end_dt_tag (void *pdoc, Node *node);
104 static char *s_chtml30_start_dd_tag(void *pdoc, Node *node);
105 static char *s_chtml30_end_dd_tag (void *pdoc, Node *node);
106 static char *s_chtml30_start_marquee_tag(void *pdoc, Node *node);
107 static char *s_chtml30_end_marquee_tag (void *pdoc, Node *node);
108 static char *s_chtml30_start_blink_tag (void *pdoc, Node *node);
109 static char *s_chtml30_end_blink_tag (void *pdoc, Node *node);
110 static char *s_chtml30_start_menu_tag (void *pdoc, Node *node);
111 static char *s_chtml30_end_menu_tag (void *pdoc, Node *node);
112 static char *s_chtml30_start_plaintext_tag (void *pdoc, Node *node);
113 static char *s_chtml30_start_plaintext_tag_inner (void *pdoc, Node *node);
114 static char *s_chtml30_end_plaintext_tag (void *pdoc, Node *node);
116 static void s_init_chtml30(chtml30_t *chtml, Doc *doc, request_rec *r, device_table *spec);
118 static int s_chtml30_search_emoji(chtml30_t *chtml, char *txt, char **rslt);
121 tag_handler chtml30_handler[] = {
124 s_chtml30_start_html_tag,
125 s_chtml30_end_html_tag,
129 s_chtml30_start_meta_tag,
130 s_chtml30_end_meta_tag,
134 s_chtml30_start_textarea_tag,
135 s_chtml30_end_textarea_tag,
139 s_chtml30_start_p_tag,
144 s_chtml30_start_pre_tag,
145 s_chtml30_end_pre_tag,
149 s_chtml30_start_ul_tag,
150 s_chtml30_end_ul_tag,
154 s_chtml30_start_li_tag,
155 s_chtml30_end_li_tag,
159 s_chtml30_start_ol_tag,
160 s_chtml30_end_ol_tag,
164 s_chtml30_start_h1_tag,
165 s_chtml30_end_h1_tag,
169 s_chtml30_start_h2_tag,
170 s_chtml30_end_h2_tag,
174 s_chtml30_start_h3_tag,
175 s_chtml30_end_h3_tag,
179 s_chtml30_start_h4_tag,
180 s_chtml30_end_h4_tag,
184 s_chtml30_start_h5_tag,
185 s_chtml30_end_h5_tag,
189 s_chtml30_start_h6_tag,
190 s_chtml30_end_h6_tag,
194 s_chtml30_start_head_tag,
195 s_chtml30_end_head_tag,
199 s_chtml30_start_title_tag,
200 s_chtml30_end_title_tag,
204 s_chtml30_start_base_tag,
205 s_chtml30_end_base_tag,
209 s_chtml30_start_body_tag,
210 s_chtml30_end_body_tag,
214 s_chtml30_start_a_tag,
219 s_chtml30_start_br_tag,
220 s_chtml30_end_br_tag,
229 s_chtml30_start_tr_tag,
230 s_chtml30_end_tr_tag,
244 s_chtml30_start_font_tag,
245 s_chtml30_end_font_tag,
249 s_chtml30_start_form_tag,
250 s_chtml30_end_form_tag,
254 s_chtml30_start_input_tag,
255 s_chtml30_end_input_tag,
259 s_chtml30_start_center_tag,
260 s_chtml30_end_center_tag,
264 s_chtml30_start_hr_tag,
265 s_chtml30_end_hr_tag,
269 s_chtml30_start_img_tag,
270 s_chtml30_end_img_tag,
274 s_chtml30_start_select_tag,
275 s_chtml30_end_select_tag,
279 s_chtml30_start_option_tag,
280 s_chtml30_end_option_tag,
284 s_chtml30_start_div_tag,
285 s_chtml30_end_div_tag,
289 s_chtml30_chxjif_tag,
334 s_chtml30_start_dt_tag,
335 s_chtml30_end_dt_tag,
349 s_chtml30_start_blockquote_tag,
350 s_chtml30_end_blockquote_tag,
354 s_chtml30_start_dir_tag,
355 s_chtml30_end_dir_tag,
359 s_chtml30_start_dl_tag,
360 s_chtml30_end_dl_tag,
364 s_chtml30_start_dd_tag,
365 s_chtml30_end_dd_tag,
369 s_chtml30_start_menu_tag,
370 s_chtml30_end_menu_tag,
374 s_chtml30_start_plaintext_tag,
375 s_chtml30_end_plaintext_tag,
379 s_chtml30_start_blink_tag,
380 s_chtml30_end_blink_tag,
384 s_chtml30_start_marquee_tag,
385 s_chtml30_end_marquee_tag,
391 * converts from CHTML5.0 to CHTML3.0.
393 * @param r [i] Requet_rec is appointed.
394 * @param spec [i] The result of the device specification processing which
395 * was done in advance is appointed.
396 * @param src [i] The character string before the converting is appointed.
397 * @return The character string after the converting is returned.
400 chxj_exchange_chtml30(
406 chxjconvrule_entry* entryp,
415 DBG(r, "start chxj_exchange_chtml30()");
417 /*--------------------------------------------------------------------------*/
419 /*--------------------------------------------------------------------------*/
421 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
423 DBG(r,"i found qrcode xml");
424 DBG(r, "end chxj_exchange_chtml30()");
427 DBG(r,"not found qrcode xml");
429 /*--------------------------------------------------------------------------*/
430 /* The CHTML structure is initialized. */
431 /*--------------------------------------------------------------------------*/
432 s_init_chtml30(&chtml30, &doc, r, spec);
434 chtml30.entryp = entryp;
435 chtml30.cookie = cookie;
437 chxj_set_content_type(r, "text/html; charset=Windows-31J");
439 /*--------------------------------------------------------------------------*/
440 /* The character string of the input is analyzed. */
441 /*--------------------------------------------------------------------------*/
442 qs_init_malloc(&doc);
443 qs_init_root_node(&doc);
445 ss = apr_pcalloc(r->pool, srclen + 1);
446 memset(ss, 0, srclen + 1);
447 memcpy(ss, src, srclen);
450 chxj_dump_out("[src] CHTML -> CHTML3.0", ss, srclen);
452 chxj_buffered_write_init(r->pool, &doc.buf);
454 qs_parse_string(&doc,ss, strlen(ss));
456 /*--------------------------------------------------------------------------*/
457 /* It converts it from CHTML to CHTML. */
458 /*--------------------------------------------------------------------------*/
459 chxj_node_exchange(spec,r,(void*)&chtml30, &doc, qs_get_root(&doc), 0);
460 chtml30.out = chxj_buffered_write_flush(chtml30.out, &doc.buf);
461 dst = apr_pstrdup(r->pool, chtml30.out);
462 chxj_buffered_write_terminate(&doc.buf);
464 qs_all_free(&doc,QX_LOGMARK);
467 dst = apr_pstrdup(r->pool,ss);
469 if (strlen(dst) == 0) {
470 dst = apr_psprintf(r->pool, "\n");
473 *dstlen = strlen(dst);
476 chxj_dump_out("[src] CHTML -> CHTML3.0", dst, *dstlen);
479 DBG(r, "end chxj_exchange_chtml30()");
485 * The CHTML structure is initialized.
487 * @param chtml30 [i/o] The pointer to the HDML structure that wants to be
488 * initialized is specified.
489 * @param doc [i] The Doc structure that should be set to the initialized
490 * HDML structure is specified.
491 * @param r [i] To use POOL, the pointer to request_rec is specified.
492 * @param spec [i] The pointer to the device_table
495 s_init_chtml30(chtml30_t* chtml30, Doc* doc, request_rec* r, device_table* spec)
497 memset(doc, 0, sizeof(Doc));
498 memset(chtml30, 0, sizeof(chtml30_t));
502 chtml30->spec = spec;
503 chtml30->out = qs_alloc_zero_byte_string(r);
504 chtml30->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
505 chtml30->doc->parse_mode = PARSE_MODE_CHTML;
510 * Corresponding EMOJI to a current character-code is retrieved.
511 * The substitution character string is stored in the rslt pointer if agreeing.
513 * @param chtml30 [i] The pointer to the CHTML structure is specified.
514 * @param txt [i] The character string to want to examine whether it is
515 * EMOJI is specified.
516 * @param rslt [o] The pointer to the pointer that stores the result is
518 * @return When corresponding EMOJI exists, it returns it excluding 0.
521 s_chtml30_search_emoji(chtml30_t* chtml30, char* txt, char** rslt)
528 spec = chtml30->spec;
534 DBG(r,"spec is NULL");
536 for (ee = chtml30->conf->emoji;
540 if (ee->imode == NULL) {
541 DBG(r, "emoji->imode is NULL");
545 if (ee->imode->string != NULL
546 && strlen(ee->imode->string) > 0
547 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
549 if (spec == NULL || spec->emoji_type == NULL) {
550 *rslt = apr_palloc(r->pool, 3);
551 (*rslt)[0] = ee->imode->hex1byte & 0xff;
552 (*rslt)[1] = ee->imode->hex2byte & 0xff;
554 return strlen(ee->imode->string);
566 * It is a handler who processes the HTML tag.
568 * @param pdoc [i/o] The pointer to the CHTML structure at the output
569 * destination is specified.
570 * @param node [i] The HTML tag node is specified.
571 * @return The conversion result is returned.
574 s_chtml30_start_html_tag(void* pdoc, Node* UNUSED(node))
580 chtml30 = GET_CHTML30(pdoc);
584 /*--------------------------------------------------------------------------*/
586 /*--------------------------------------------------------------------------*/
593 * It is a handler who processes the HTML tag.
595 * @param pdoc [i/o] The pointer to the CHTML structure at the output
596 * destination is specified.
597 * @param node [i] The HTML tag node is specified.
598 * @return The conversion result is returned.
601 s_chtml30_end_html_tag(void* pdoc, Node* UNUSED(child))
607 chtml30 = GET_CHTML30(pdoc);
617 * It is a handler who processes the META tag.
619 * @param pdoc [i/o] The pointer to the CHTML structure at the output
620 * destination is specified.
621 * @param node [i] The META tag node is specified.
622 * @return The conversion result is returned.
625 s_chtml30_start_meta_tag(void* pdoc, Node* node)
631 int content_type_flag;
634 chtml30 = GET_CHTML30(pdoc);
638 content_type_flag = 0;
643 /*--------------------------------------------------------------------------*/
645 /*--------------------------------------------------------------------------*/
646 for (attr = qs_get_attr(doc,node);
648 attr = qs_get_next_attr(doc,attr)) {
653 name = qs_get_attr_name(doc,attr);
654 value = qs_get_attr_value(doc,attr);
659 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
660 /*----------------------------------------------------------------------*/
662 /*----------------------------------------------------------------------*/
663 W_L(" http-equiv=\"");
666 if (STRCASEEQ('c','C',"content-type", value))
667 content_type_flag = 1;
669 if (STRCASEEQ('r','R',"refresh", value))
676 if (strcasecmp(name, "content") == 0 && value && *value) {
677 if (content_type_flag) {
680 W_L("=\"text/html; charset=Windows-31J\"");
688 buf = apr_pstrdup(r->pool, value);
690 url = strchr(buf, ';');
692 sec = apr_pstrdup(r->pool, buf);
695 url = chxj_encoding_parameter(r, url);
696 url = chxj_add_cookie_parameter(r, url, chtml30->cookie);
728 * It is a handler who processes the META tag.
730 * @param pdoc [i/o] The pointer to the CHTML structure at the output
731 * destination is specified.
732 * @param node [i] The META tag node is specified.
733 * @return The conversion result is returned.
736 s_chtml30_end_meta_tag(void* pdoc, Node* UNUSED(child))
740 chtml30 = GET_CHTML30(pdoc);
747 * It is a handler who processes the HEAD tag.
749 * @param pdoc [i/o] The pointer to the CHTML structure at the output
750 * destination is specified.
751 * @param node [i] The HEAD tag node is specified.
752 * @return The conversion result is returned.
755 s_chtml30_start_head_tag(void* pdoc, Node* UNUSED(node))
761 chtml30 = GET_CHTML30(pdoc);
772 * It is a handler who processes the HEAD tag.
774 * @param pdoc [i/o] The pointer to the CHTML structure at the output
775 * destination is specified.
776 * @param node [i] The HEAD tag node is specified.
777 * @return The conversion result is returned.
780 s_chtml30_end_head_tag(void *pdoc, Node *UNUSED(node))
786 chtml30 = GET_CHTML30(pdoc);
797 * It is a handler who processes the TITLE tag.
799 * @param pdoc [i/o] The pointer to the CHTML structure at the output
800 * destination is specified.
801 * @param node [i] The TITLE tag node is specified.
802 * @return The conversion result is returned.
805 s_chtml30_start_title_tag(void* pdoc, Node* UNUSED(node))
811 chtml30 = GET_CHTML30(pdoc);
822 * It is a handler who processes the TITLE tag.
824 * @param pdoc [i/o] The pointer to the CHTML structure at the output
825 * destination is specified.
826 * @param node [i] The TITLE tag node is specified.
827 * @return The conversion result is returned.
830 s_chtml30_end_title_tag(void* pdoc, Node* UNUSED(child))
836 chtml30 = GET_CHTML30(pdoc);
847 * It is a handler who processes the BASE tag.
849 * @param pdoc [i/o] The pointer to the CHTML structure at the output
850 * destination is specified.
851 * @param node [i] The BASE tag node is specified.
852 * @return The conversion result is returned.
855 s_chtml30_start_base_tag(void *pdoc, Node *node)
862 chtml30 = GET_CHTML30(pdoc);
867 /*--------------------------------------------------------------------------*/
869 /*--------------------------------------------------------------------------*/
870 for (attr = qs_get_attr(doc,node);
872 attr = qs_get_next_attr(doc,attr)) {
873 char *name = qs_get_attr_name(doc,attr);
874 char *value = qs_get_attr_value(doc,attr);
875 if (STRCASEEQ('h','H',"href", name)) {
887 * It is a handler who processes the BASE tag.
889 * @param pdoc [i/o] The pointer to the CHTML structure at the output
890 * destination is specified.
891 * @param node [i] The BASE tag node is specified.
892 * @return The conversion result is returned.
895 s_chtml30_end_base_tag(void* pdoc, Node* UNUSED(child))
899 chtml30 = GET_CHTML30(pdoc);
906 * It is a handler who processes the BODY tag.
908 * @param pdoc [i/o] The pointer to the CHTML structure at the output
909 * destination is specified.
910 * @param node [i] The BODY tag node is specified.
911 * @return The conversion result is returned.
914 s_chtml30_start_body_tag(void *pdoc, Node *node)
921 chtml30 = GET_CHTML30(pdoc);
927 /*--------------------------------------------------------------------------*/
929 /*--------------------------------------------------------------------------*/
930 for (attr = qs_get_attr(doc,node);
932 attr = qs_get_next_attr(doc,attr)) {
933 char *name = qs_get_attr_name(doc,attr);
934 char *value = qs_get_attr_value(doc,attr);
935 if (STRCASEEQ('b','B', "bgcolor", name) && value && *value) {
936 /*----------------------------------------------------------------------*/
938 /*----------------------------------------------------------------------*/
943 else if (STRCASEEQ('t','T', "text", name) && value && *value) {
944 /*----------------------------------------------------------------------*/
946 /*----------------------------------------------------------------------*/
951 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
952 /*----------------------------------------------------------------------*/
954 /*----------------------------------------------------------------------*/
959 else if (STRCASEEQ('a','A',"alink", name)) {
960 /*----------------------------------------------------------------------*/
962 /*----------------------------------------------------------------------*/
965 else if (STRCASEEQ('v','V',"vlink", name)) {
966 /*----------------------------------------------------------------------*/
968 /*----------------------------------------------------------------------*/
978 * It is a handler who processes the BODY tag.
980 * @param pdoc [i/o] The pointer to the CHTML structure at the output
981 * destination is specified.
982 * @param node [i] The BODY tag node is specified.
983 * @return The conversion result is returned.
986 s_chtml30_end_body_tag(void *pdoc, Node *UNUSED(child))
992 chtml30 = GET_CHTML30(pdoc);
1003 * It is a handler who processes the A tag.
1005 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1006 * destination is specified.
1007 * @param node [i] The A tag node is specified.
1008 * @return The conversion result is returned.
1011 s_chtml30_start_a_tag(void* pdoc, Node* node)
1018 chtml30 = GET_CHTML30(pdoc);
1024 /*--------------------------------------------------------------------------*/
1025 /* Get Attributes */
1026 /*--------------------------------------------------------------------------*/
1027 for (attr = qs_get_attr(doc,node);
1029 attr = qs_get_next_attr(doc,attr)) {
1034 name = qs_get_attr_name(doc,attr);
1035 value = qs_get_attr_value(doc,attr);
1037 if (STRCASEEQ('n','N',"name", name)) {
1038 /*----------------------------------------------------------------------*/
1040 /*----------------------------------------------------------------------*/
1045 else if (STRCASEEQ('h','H',"href", name)) {
1046 /*----------------------------------------------------------------------*/
1048 /*----------------------------------------------------------------------*/
1049 value = chxj_encoding_parameter(r, value);
1050 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1055 else if (STRCASEEQ('a','A',"accesskey", name)) {
1056 /*----------------------------------------------------------------------*/
1058 /*----------------------------------------------------------------------*/
1059 W_L(" accesskey=\"");
1063 else if (STRCASEEQ('c','C',"cti", name)) {
1064 /*----------------------------------------------------------------------*/
1066 /*----------------------------------------------------------------------*/
1071 else if (STRCASEEQ('i','I',"ijam", name)) {
1072 /*----------------------------------------------------------------------*/
1074 /*----------------------------------------------------------------------*/
1077 else if (STRCASEEQ('u','U',"utn", name)) {
1078 /*----------------------------------------------------------------------*/
1080 /* It is special only for CHTML. */
1081 /*----------------------------------------------------------------------*/
1084 else if (STRCASEEQ('t','T',"telbook", name)) {
1085 /*----------------------------------------------------------------------*/
1087 /*----------------------------------------------------------------------*/
1090 else if (STRCASEEQ('k','K',"kana", name)) {
1091 /*----------------------------------------------------------------------*/
1093 /*----------------------------------------------------------------------*/
1096 else if (STRCASEEQ('e','E',"email", name)) {
1097 /*----------------------------------------------------------------------*/
1099 /*----------------------------------------------------------------------*/
1102 else if (STRCASEEQ('i','I',"ista", name)) {
1103 /*----------------------------------------------------------------------*/
1105 /*----------------------------------------------------------------------*/
1108 else if (STRCASEEQ('i','I',"ilet", name)) {
1109 /*----------------------------------------------------------------------*/
1111 /*----------------------------------------------------------------------*/
1114 else if (STRCASEEQ('i','I',"iswf", name)) {
1115 /*----------------------------------------------------------------------*/
1117 /*----------------------------------------------------------------------*/
1120 else if (STRCASEEQ('i','I',"irst", name)) {
1121 /*----------------------------------------------------------------------*/
1123 /*----------------------------------------------------------------------*/
1130 return chtml30->out;
1135 * It is a handler who processes the A tag.
1137 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1138 * destination is specified.
1139 * @param node [i] The A tag node is specified.
1140 * @return The conversion result is returned.
1143 s_chtml30_end_a_tag(void* pdoc, Node* UNUSED(child))
1149 chtml30 = GET_CHTML30(pdoc);
1155 return chtml30->out;
1160 * It is a handler who processes the BR tag.
1162 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1163 * destination is specified.
1164 * @param node [i] The BR tag node is specified.
1165 * @return The conversion result is returned.
1168 s_chtml30_start_br_tag(void *pdoc, Node *node)
1175 chtml30 = GET_CHTML30(pdoc);
1179 /*--------------------------------------------------------------------------*/
1180 /* Get Attributes */
1181 /*--------------------------------------------------------------------------*/
1182 for (attr = qs_get_attr(doc,node);
1184 attr = qs_get_next_attr(doc,attr)) {
1188 name = qs_get_attr_name(doc,attr);
1189 value = qs_get_attr_value(doc,attr);
1191 if (STRCASEEQ('c','C',"clear",name)) {
1192 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1200 return chtml30->out;
1205 * It is a handler who processes the BR tag.
1207 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1208 * destination is specified.
1209 * @param node [i] The BR tag node is specified.
1210 * @return The conversion result is returned.
1213 s_chtml30_end_br_tag(void *pdoc, Node *UNUSED(child))
1215 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1216 return chtml30->out;
1221 * It is a handler who processes the TR tag.
1223 * @param chtml30 [i/o] The pointer to the CHTML structure at the output
1224 * destination is specified.
1225 * @param node [i] The TR tag node is specified.
1226 * @return The conversion result is returned.
1229 s_chtml30_start_tr_tag(void* pdoc, Node* UNUSED(node))
1233 chtml30 = GET_CHTML30(pdoc);
1235 return chtml30->out;
1240 * It is a handler who processes the TR tag.
1242 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1243 * destination is specified.
1244 * @param node [i] The TR tag node is specified.
1245 * @return The conversion result is returned.
1248 s_chtml30_end_tr_tag(void* pdoc, Node* UNUSED(child))
1254 chtml30 = GET_CHTML30(pdoc);
1260 return chtml30->out;
1265 * It is a handler who processes the FONT tag.
1267 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1268 * destination is specified.
1269 * @param node [i] The FONT tag node is specified.
1270 * @return The conversion result is returned.
1273 s_chtml30_start_font_tag(void* pdoc, Node* node)
1280 chtml30 = GET_CHTML30(pdoc);
1286 /*--------------------------------------------------------------------------*/
1287 /* Get Attributes */
1288 /*--------------------------------------------------------------------------*/
1289 for (attr = qs_get_attr(doc,node);
1291 attr = qs_get_next_attr(doc,attr)) {
1296 name = qs_get_attr_name(doc,attr);
1297 value = qs_get_attr_value(doc,attr);
1299 if (STRCASEEQ('c','C',"color", name)) {
1304 else if (STRCASEEQ('s','S',"size", name)) {
1305 /*----------------------------------------------------------------------*/
1307 /*----------------------------------------------------------------------*/
1314 return chtml30->out;
1319 * It is a handler who processes the FONT tag.
1321 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1322 * destination is specified.
1323 * @param node [i] The FONT tag node is specified.
1324 * @return The conversion result is returned.
1327 s_chtml30_end_font_tag(void* pdoc, Node* UNUSED(child))
1333 chtml30 = GET_CHTML30(pdoc);
1339 return chtml30->out;
1344 * It is a handler who processes the FORM tag.
1346 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1347 * destination is specified.
1348 * @param node [i] The FORM tag node is specified.
1349 * @return The conversion result is returned.
1352 s_chtml30_start_form_tag(void *pdoc, Node *node)
1359 chtml30 = GET_CHTML30(pdoc);
1364 /*--------------------------------------------------------------------------*/
1365 /* Get Attributes */
1366 /*--------------------------------------------------------------------------*/
1367 for (attr = qs_get_attr(doc,node);
1369 attr = qs_get_next_attr(doc,attr)) {
1370 char *name = qs_get_attr_name(doc,attr);
1371 char *value = qs_get_attr_value(doc,attr);
1372 if (STRCASEEQ('a','A',"action", name)) {
1373 /*----------------------------------------------------------------------*/
1375 /*----------------------------------------------------------------------*/
1376 value = chxj_encoding_parameter(r, value);
1377 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1382 else if (STRCASEEQ('m','M',"method", name)) {
1383 /*----------------------------------------------------------------------*/
1385 /*----------------------------------------------------------------------*/
1390 else if (STRCASEEQ('u','U',"utn", name)) {
1391 /*----------------------------------------------------------------------*/
1393 /* It is special only for CHTML. */
1394 /*----------------------------------------------------------------------*/
1399 return chtml30->out;
1404 * It is a handler who processes the FORM tag.
1406 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1407 * destination is specified.
1408 * @param node [i] The FORM tag node is specified.
1409 * @return The conversion result is returned.
1412 s_chtml30_end_form_tag(void* pdoc, Node* UNUSED(child))
1418 chtml30 = GET_CHTML30(pdoc);
1424 return chtml30->out;
1429 * It is a handler who processes the INPUT tag.
1431 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1432 * destination is specified.
1433 * @param node [i] The INPUT tag node is specified.
1434 * @return The conversion result is returned.
1437 s_chtml30_start_input_tag(void *pdoc, Node *node)
1442 char *max_length = NULL;
1446 char *istyle = NULL;
1448 char *checked = NULL;
1449 char *accesskey = NULL;
1451 chtml30 = GET_CHTML30(pdoc);
1455 /*--------------------------------------------------------------------------*/
1456 /* Get Attributes */
1457 /*--------------------------------------------------------------------------*/
1458 type = qs_get_type_attr(doc, node, r);
1459 name = qs_get_name_attr(doc, node, r);
1460 value = qs_get_value_attr(doc,node,r);
1461 istyle = qs_get_istyle_attr(doc,node,r);
1462 max_length = qs_get_maxlength_attr(doc,node,r);
1463 checked = qs_get_checked_attr(doc,node,r);
1464 accesskey = qs_get_accesskey_attr(doc, node, r);
1465 size = qs_get_size_attr(doc, node, r);
1468 type = qs_trim_string(doc->buf.pool, type);
1469 if (type && (STRCASEEQ('t','T',"text", type) ||
1470 STRCASEEQ('p','P',"password",type) ||
1471 STRCASEEQ('c','C',"checkbox",type) ||
1472 STRCASEEQ('r','R',"radio", type) ||
1473 STRCASEEQ('h','H',"hidden", type) ||
1474 STRCASEEQ('s','S',"submit", type) ||
1475 STRCASEEQ('r','R',"reset", type))) {
1481 if (size && *size) {
1486 if (name && *name) {
1491 if (value && *value) {
1496 if (accesskey && *accesskey) {
1497 W_L(" accesskey=\"");
1502 /*------------------------------------------------------------------------*/
1504 /*------------------------------------------------------------------------*/
1505 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1512 /*--------------------------------------------------------------------------*/
1513 /* The figure is default for the password. */
1514 /*--------------------------------------------------------------------------*/
1515 if (max_length && *max_length) {
1516 if (chxj_chk_numeric(max_length) != 0) {
1517 max_length = apr_psprintf(r->pool, "0");
1519 if (istyle != NULL && *istyle == '1') {
1520 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1524 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1532 return chtml30->out;
1537 * It is a handler who processes the INPUT tag.
1539 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1540 * destination is specified.
1541 * @param node [i] The INPUT tag node is specified.
1542 * @return The conversion result is returned.
1545 s_chtml30_end_input_tag(void* pdoc, Node* UNUSED(child))
1549 chtml30 = GET_CHTML30(pdoc);
1551 return chtml30->out;
1556 * It is a handler who processes the CENTER tag.
1558 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1559 * destination is specified.
1560 * @param node [i] The CENTER tag node is specified.
1561 * @return The conversion result is returned.
1564 s_chtml30_start_center_tag(void* pdoc, Node* UNUSED(node))
1570 chtml30 = GET_CHTML30(pdoc);
1576 return chtml30->out;
1581 * It is a handler who processes the CENTER tag.
1583 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1584 * destination is specified.
1585 * @param node [i] The CENTER tag node is specified.
1586 * @return The conversion result is returned.
1589 s_chtml30_end_center_tag(void* pdoc, Node* UNUSED(child))
1595 chtml30 = GET_CHTML30(pdoc);
1601 return chtml30->out;
1606 * It is a handler who processes the HR tag.
1608 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1609 * destination is specified.
1610 * @param node [i] The HR tag node is specified.
1611 * @return The conversion result is returned.
1614 s_chtml30_start_hr_tag(void* pdoc, Node* node)
1621 chtml30 = GET_CHTML30(pdoc);
1627 for (attr = qs_get_attr(doc,node);
1629 attr = qs_get_next_attr(doc,attr)) {
1630 char* name = qs_get_attr_name(doc,attr);
1631 char* value = qs_get_attr_value(doc,attr);
1633 if (STRCASEEQ('a','A',"align", name)) {
1634 /*----------------------------------------------------------------------*/
1636 /*----------------------------------------------------------------------*/
1637 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1643 else if (STRCASEEQ('s','S',"size", name)) {
1644 /*----------------------------------------------------------------------*/
1646 /*----------------------------------------------------------------------*/
1647 if (value && *value) {
1653 else if (STRCASEEQ('w','W',"width", name)) {
1654 /*----------------------------------------------------------------------*/
1656 /*----------------------------------------------------------------------*/
1657 if (value && *value) {
1663 else if (STRCASEEQ('n','N',"noshade", name)) {
1664 /*----------------------------------------------------------------------*/
1666 /*----------------------------------------------------------------------*/
1669 else if (STRCASEEQ('c','C',"color", name)) {
1670 /*----------------------------------------------------------------------*/
1672 /*----------------------------------------------------------------------*/
1679 return chtml30->out;
1684 * It is a handler who processes the HR tag.
1686 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1687 * destination is specified.
1688 * @param node [i] The HR tag node is specified.
1689 * @return The conversion result is returned.
1692 s_chtml30_end_hr_tag(void* pdoc, Node* UNUSED(child))
1696 chtml30 = GET_CHTML30(pdoc);
1698 return chtml30->out;
1703 * It is a handler who processes the IMG tag.
1705 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1706 * destination is specified.
1707 * @param node [i] The IMG tag node is specified.
1708 * @return The conversion result is returned.
1711 s_chtml30_start_img_tag(void *pdoc, Node *node)
1713 #ifndef IMG_NOT_CONVERT_FILENAME
1721 chtml30 = GET_CHTML30(pdoc);
1724 #ifndef IMG_NOT_CONVERT_FILENAME
1725 spec = chtml30->spec;
1729 /*--------------------------------------------------------------------------*/
1730 /* Get Attributes */
1731 /*--------------------------------------------------------------------------*/
1732 for (attr = qs_get_attr(doc,node);
1734 attr = qs_get_next_attr(doc,attr)) {
1735 char* name = qs_get_attr_name(doc,attr);
1736 char* value = qs_get_attr_value(doc,attr);
1738 if (STRCASEEQ('s','S',"src", name)) {
1739 /*----------------------------------------------------------------------*/
1741 /*----------------------------------------------------------------------*/
1742 #ifdef IMG_NOT_CONVERT_FILENAME
1743 value = chxj_encoding_parameter(r, value);
1744 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1746 value = apr_psprintf(r->pool,
1749 (strchr(value, '?')) ? '&' : '?',
1750 CHXJ_COOKIE_NOUPDATE_PARAM);
1757 value = chxj_img_conv(r,spec,value);
1758 value = chxj_encoding_parameter(r, value);
1759 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1761 value = apr_psprintf(r->pool,
1764 (strchr(value, '?')) ? '&' : '?',
1765 CHXJ_COOKIE_NOUPDATE_PARAM);
1772 else if (STRCASEEQ('a','A',"align", name)) {
1773 /*----------------------------------------------------------------------*/
1775 /*----------------------------------------------------------------------*/
1776 if (value && (STRCASEEQ('t','T',"top", value) ||
1777 STRCASEEQ('m','M',"middle",value) ||
1778 STRCASEEQ('b','B',"bottom",value) ||
1779 STRCASEEQ('l','L',"left", value) ||
1780 STRCASEEQ('r','R',"right", value))) {
1786 else if (STRCASEEQ('w','W',"width", name) && value && *value) {
1787 /*----------------------------------------------------------------------*/
1789 /*----------------------------------------------------------------------*/
1794 else if (STRCASEEQ('h','H', "height", name) && value && *value) {
1795 /*----------------------------------------------------------------------*/
1797 /*----------------------------------------------------------------------*/
1802 else if (STRCASEEQ('h','H',"hspace", name) && value && *value) {
1803 /*----------------------------------------------------------------------*/
1805 /*----------------------------------------------------------------------*/
1810 else if (STRCASEEQ('v','V',"vspace", name) && value && *value) {
1811 /*----------------------------------------------------------------------*/
1813 /*----------------------------------------------------------------------*/
1818 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
1819 /*----------------------------------------------------------------------*/
1821 /*----------------------------------------------------------------------*/
1826 else if (STRCASEEQ('a','A',"align", name) && value && *value) {
1827 /*----------------------------------------------------------------------*/
1829 /*----------------------------------------------------------------------*/
1836 return chtml30->out;
1841 * It is a handler who processes the IMG tag.
1843 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1844 * destination is specified.
1845 * @param node [i] The IMG tag node is specified.
1846 * @return The conversion result is returned.
1849 s_chtml30_end_img_tag(void* pdoc, Node* UNUSED(child))
1853 chtml30 = GET_CHTML30(pdoc);
1855 return chtml30->out;
1860 * It is a handler who processes the SELECT tag.
1862 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1863 * destination is specified.
1864 * @param node [i] The SELECT tag node is specified.
1865 * @return The conversion result is returned.
1868 s_chtml30_start_select_tag(void* pdoc, Node* child)
1870 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1871 Doc *doc = chtml30->doc;
1874 char *multiple = NULL;
1879 for (attr = qs_get_attr(doc,child);
1881 attr = qs_get_next_attr(doc,attr)) {
1882 char *nm = qs_get_attr_name(doc,attr);
1883 char *val = qs_get_attr_value(doc,attr);
1884 if (STRCASEEQ('s','S',"size", nm)) {
1885 /*----------------------------------------------------------------------*/
1886 /* CHTML 1.0 version 2.0 */
1887 /*----------------------------------------------------------------------*/
1888 size = apr_pstrdup(doc->buf.pool, val);
1890 else if (STRCASEEQ('n','N',"name", nm)) {
1891 /*----------------------------------------------------------------------*/
1892 /* CHTML 1.0 version 2.0 */
1893 /*----------------------------------------------------------------------*/
1894 name = apr_pstrdup(doc->buf.pool, val);
1896 else if (STRCASEEQ('m','M',"multiple", nm)) {
1897 /*----------------------------------------------------------------------*/
1898 /* CHTML 1.0 version 2.0 */
1899 /*----------------------------------------------------------------------*/
1900 multiple = apr_pstrdup(doc->buf.pool, val);
1903 if (size && *size) {
1908 if (name && *name) {
1917 return chtml30->out;
1922 * It is a handler who processes the SELECT tag.
1924 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1925 * destination is specified.
1926 * @param node [i] The SELECT tag node is specified.
1927 * @return The conversion result is returned.
1930 s_chtml30_end_select_tag(void* pdoc, Node* UNUSED(child))
1936 chtml30 = GET_CHTML30(pdoc);
1940 return chtml30->out;
1945 * It is a handler who processes the OPTION tag.
1947 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1948 * destination is specified.
1949 * @param node [i] The OPTION tag node is specified.
1950 * @return The conversion result is returned.
1953 s_chtml30_start_option_tag(void *pdoc, Node *child)
1962 chtml30 = GET_CHTML30(pdoc);
1969 for (attr = qs_get_attr(doc,child);
1971 attr = qs_get_next_attr(doc,attr)) {
1972 char *nm = qs_get_attr_name(doc,attr);
1973 char *val = qs_get_attr_value(doc,attr);
1974 if (STRCASEEQ('s','S',"selected", nm)) {
1975 /*----------------------------------------------------------------------*/
1976 /* CHTML 1.0 version 2.0 */
1977 /*----------------------------------------------------------------------*/
1978 selected = apr_pstrdup(doc->buf.pool, val);
1980 else if (STRCASEEQ('v','V',"value", nm)) {
1981 /*----------------------------------------------------------------------*/
1982 /* CHTML 1.0 version 2.0 */
1983 /*----------------------------------------------------------------------*/
1984 value = apr_pstrdup(doc->buf.pool, val);
1987 if (value && *value) {
1997 return chtml30->out;
2002 * It is a handler who processes the OPTION tag.
2004 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2005 * destination is specified.
2006 * @param node [i] The OPTION tag node is specified.
2007 * @return The conversion result is returned.
2010 s_chtml30_end_option_tag(void* pdoc, Node* UNUSED(child))
2014 chtml30 = GET_CHTML30(pdoc);
2018 return chtml30->out;
2023 * It is a handler who processes the DIV tag.
2025 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2026 * destination is specified.
2027 * @param node [i] The DIV tag node is specified.
2028 * @return The conversion result is returned.
2031 s_chtml30_start_div_tag(void *pdoc, Node *child)
2039 chtml30 = GET_CHTML30(pdoc);
2046 for (attr = qs_get_attr(doc,child);
2048 attr = qs_get_next_attr(doc,attr)) {
2049 char* nm = qs_get_attr_name(doc,attr);
2050 char* val = qs_get_attr_value(doc,attr);
2052 if (STRCASEEQ('a','A',"align", nm)) {
2053 /*----------------------------------------------------------------------*/
2054 /* CHTML 1.0 (W3C version 3.2) */
2055 /*----------------------------------------------------------------------*/
2056 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2057 align = apr_pstrdup(doc->buf.pool, val);
2070 return chtml30->out;
2075 * It is a handler who processes the DIV tag.
2077 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2078 * destination is specified.
2079 * @param node [i] The DIV tag node is specified.
2080 * @return The conversion result is returned.
2083 s_chtml30_end_div_tag(void* pdoc, Node* UNUSED(node))
2089 chtml30 = GET_CHTML30(pdoc);
2095 return chtml30->out;
2100 * It is a handler who processes the UL tag.
2102 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2103 * destination is specified.
2104 * @param node [i] The UL tag node is specified.
2105 * @return The conversion result is returned.
2108 s_chtml30_start_ul_tag(void* pdoc, Node* UNUSED(node))
2114 chtml30 = GET_CHTML30(pdoc);
2120 return chtml30->out;
2125 * It is a handler who processes the UL tag.
2127 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2128 * destination is specified.
2129 * @param node [i] The UL tag node is specified.
2130 * @return The conversion result is returned.
2133 s_chtml30_end_ul_tag(void *pdoc, Node *UNUSED(child))
2139 chtml30 = GET_CHTML30(pdoc);
2145 return chtml30->out;
2150 * It is a handler who processes the PRE tag.
2152 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2153 * destination is specified.
2154 * @param node [i] The PRE tag node is specified.
2155 * @return The conversion result is returned.
2158 s_chtml30_start_pre_tag(void *pdoc, Node *UNUSED(node))
2164 chtml30 = GET_CHTML30(pdoc);
2168 chtml30->pre_flag++;
2171 return chtml30->out;
2176 * It is a handler who processes the PRE tag.
2178 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2179 * destination is specified.
2180 * @param node [i] The PRE tag node is specified.
2181 * @return The conversion result is returned.
2184 s_chtml30_end_pre_tag(void *pdoc, Node *UNUSED(child))
2190 chtml30 = GET_CHTML30(pdoc);
2195 chtml30->pre_flag--;
2197 return chtml30->out;
2202 * It is a handler who processes the P tag.
2204 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2205 * destination is specified.
2206 * @param node [i] The P tag node is specified.
2207 * @return The conversion result is returned.
2210 s_chtml30_start_p_tag(void *pdoc, Node *node)
2218 chtml30 = GET_CHTML30(pdoc);
2223 for (attr = qs_get_attr(doc,node);
2225 attr = qs_get_next_attr(doc,attr)) {
2226 char *nm = qs_get_attr_name(doc,attr);
2227 char *val = qs_get_attr_value(doc,attr);
2228 if (STRCASEEQ('a','A',"align", nm)) {
2229 /*----------------------------------------------------------------------*/
2230 /* CHTML 1.0 (W3C version 3.2) */
2231 /*----------------------------------------------------------------------*/
2232 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2233 align = apr_pstrdup(doc->buf.pool, val);
2245 return chtml30->out;
2250 * It is a handler who processes the P tag.
2252 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2253 * destination is specified.
2254 * @param node [i] The P tag node is specified.
2255 * @return The conversion result is returned.
2258 s_chtml30_end_p_tag(void* pdoc, Node* UNUSED(child))
2264 chtml30 = GET_CHTML30(pdoc);
2270 return chtml30->out;
2275 * It is a handler who processes the OL tag.
2277 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2278 * destination is specified.
2279 * @param node [i] The OL tag node is specified.
2280 * @return The conversion result is returned.
2283 s_chtml30_start_ol_tag(void *pdoc, Node *node)
2290 chtml30 = GET_CHTML30(pdoc);
2295 /*--------------------------------------------------------------------------*/
2296 /* Get Attributes */
2297 /*--------------------------------------------------------------------------*/
2298 for (attr = qs_get_attr(doc,node);
2300 attr = qs_get_next_attr(doc,attr)) {
2301 char *name = qs_get_attr_name(doc,attr);
2302 char *value = qs_get_attr_value(doc,attr);
2303 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2308 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2316 return chtml30->out;
2321 * It is a handler who processes the OL tag.
2323 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2324 * destination is specified.
2325 * @param node [i] The OL tag node is specified.
2326 * @return The conversion result is returned.
2329 s_chtml30_end_ol_tag(void *pdoc, Node *UNUSED(node))
2335 chtml30 = GET_CHTML30(pdoc);
2341 return chtml30->out;
2346 * It is a handler who processes the LI tag.
2348 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2349 * destination is specified.
2350 * @param node [i] The LI tag node is specified.
2351 * @return The conversion result is returned.
2354 s_chtml30_start_li_tag(void *pdoc, Node *node)
2361 chtml30 = GET_CHTML30(pdoc);
2366 /*--------------------------------------------------------------------------*/
2367 /* Get Attributes */
2368 /*--------------------------------------------------------------------------*/
2369 for (attr = qs_get_attr(doc,node);
2371 attr = qs_get_next_attr(doc,attr)) {
2372 char *name = qs_get_attr_name(doc,attr);
2373 char *value = qs_get_attr_value(doc,attr);
2374 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2379 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2387 return chtml30->out;
2392 * It is a handler who processes the LI tag.
2394 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2395 * destination is specified.
2396 * @param node [i] The LI tag node is specified.
2397 * @return The conversion result is returned.
2400 s_chtml30_end_li_tag(void *pdoc, Node *UNUSED(child))
2402 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2403 return chtml30->out;
2408 * It is a handler who processes the H1 tag.
2410 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2411 * destination is specified.
2412 * @param node [i] The H1 tag node is specified.
2413 * @return The conversion result is returned.
2416 s_chtml30_start_h1_tag(void *pdoc, Node *node)
2423 chtml30 = GET_CHTML30(pdoc);
2428 for (attr = qs_get_attr(doc,node);
2430 attr = qs_get_next_attr(doc,attr)) {
2431 char *name = qs_get_attr_name(doc,attr);
2432 char *value = qs_get_attr_value(doc,attr);
2433 if (STRCASEEQ('a','A',"align", name)) {
2434 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2444 return chtml30->out;
2449 * It is a handler who processes the H1 tag.
2451 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2452 * destination is specified.
2453 * @param node [i] The H1 tag node is specified.
2454 * @return The conversion result is returned.
2457 s_chtml30_end_h1_tag(void *pdoc, Node *UNUSED(child))
2463 chtml30 = GET_CHTML30(pdoc);
2469 return chtml30->out;
2474 * It is a handler who processes the H2 tag.
2476 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2477 * destination is specified.
2478 * @param node [i] The H2 tag node is specified.
2479 * @return The conversion result is returned.
2482 s_chtml30_start_h2_tag(void *pdoc, Node *node)
2489 chtml30 = GET_CHTML30(pdoc);
2494 for (attr = qs_get_attr(doc,node);
2496 attr = qs_get_next_attr(doc,attr)) {
2499 name = qs_get_attr_name(doc,attr);
2500 value = qs_get_attr_value(doc,attr);
2501 if (STRCASEEQ('a','A',"align", name)) {
2502 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2511 return chtml30->out;
2516 * It is a handler who processes the H2 tag.
2518 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2519 * destination is specified.
2520 * @param node [i] The H2 tag node is specified.
2521 * @return The conversion result is returned.
2524 s_chtml30_end_h2_tag(void *pdoc, Node *UNUSED(child))
2530 chtml30 = GET_CHTML30(pdoc);
2536 return chtml30->out;
2541 * It is a handler who processes the H3 tag.
2543 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2544 * destination is specified.
2545 * @param node [i] The H3 tag node is specified.
2546 * @return The conversion result is returned.
2549 s_chtml30_start_h3_tag(void *pdoc, Node *node)
2556 chtml30 = GET_CHTML30(pdoc);
2561 for (attr = qs_get_attr(doc,node);
2563 attr = qs_get_next_attr(doc,attr)) {
2566 name = qs_get_attr_name(doc,attr);
2567 value = qs_get_attr_value(doc,attr);
2568 if (STRCASEEQ('a','A',"align", name)) {
2569 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2579 return chtml30->out;
2584 * It is a handler who processes the H3 tag.
2586 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2587 * destination is specified.
2588 * @param node [i] The H3 tag node is specified.
2589 * @return The conversion result is returned.
2592 s_chtml30_end_h3_tag(void *pdoc, Node *UNUSED(child))
2598 chtml30 = GET_CHTML30(pdoc);
2604 return chtml30->out;
2609 * It is a handler who processes the H4 tag.
2611 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2612 * destination is specified.
2613 * @param node [i] The H4 tag node is specified.
2614 * @return The conversion result is returned.
2617 s_chtml30_start_h4_tag(void *pdoc, Node *node)
2624 chtml30 = GET_CHTML30(pdoc);
2629 for (attr = qs_get_attr(doc,node);
2631 attr = qs_get_next_attr(doc,attr)) {
2634 name = qs_get_attr_name(doc,attr);
2635 value = qs_get_attr_value(doc,attr);
2636 if (STRCASEEQ('a','A',"align", name)) {
2637 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2646 return chtml30->out;
2651 * It is a handler who processes the H4 tag.
2653 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2654 * destination is specified.
2655 * @param node [i] The H4 tag node is specified.
2656 * @return The conversion result is returned.
2659 s_chtml30_end_h4_tag(void *pdoc, Node *UNUSED(child))
2665 chtml30 = GET_CHTML30(pdoc);
2671 return chtml30->out;
2676 * It is a handler who processes the H5 tag.
2678 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2679 * destination is specified.
2680 * @param node [i] The H5 tag node is specified.
2681 * @return The conversion result is returned.
2684 s_chtml30_start_h5_tag(void *pdoc, Node *node)
2691 chtml30 = GET_CHTML30(pdoc);
2696 for (attr = qs_get_attr(doc,node);
2698 attr = qs_get_next_attr(doc,attr)) {
2701 name = qs_get_attr_name(doc,attr);
2702 value = qs_get_attr_value(doc,attr);
2703 if (STRCASEEQ('a','A',"align", name)) {
2704 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2713 return chtml30->out;
2718 * It is a handler who processes the H5 tag.
2720 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2721 * destination is specified.
2722 * @param node [i] The H5 tag node is specified.
2723 * @return The conversion result is returned.
2726 s_chtml30_end_h5_tag(void* pdoc, Node* UNUSED(child))
2732 chtml30 = GET_CHTML30(pdoc);
2738 return chtml30->out;
2743 * It is a handler who processes the H6 tag.
2745 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2746 * destination is specified.
2747 * @param node [i] The H6 tag node is specified.
2748 * @return The conversion result is returned.
2751 s_chtml30_start_h6_tag(void *pdoc, Node *node)
2758 chtml30 = GET_CHTML30(pdoc);
2763 for (attr = qs_get_attr(doc,node);
2765 attr = qs_get_next_attr(doc,attr)) {
2768 name = qs_get_attr_name(doc,attr);
2769 value = qs_get_attr_value(doc,attr);
2770 if (STRCASEEQ('a','A',"align", name)) {
2771 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2780 return chtml30->out;
2785 * It is a handler who processes the H6 tag.
2787 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2788 * destination is specified.
2789 * @param node [i] The H6 tag node is specified.
2790 * @return The conversion result is returned.
2793 s_chtml30_end_h6_tag(void* pdoc, Node* UNUSED(child))
2799 chtml30 = GET_CHTML30(pdoc);
2805 return chtml30->out;
2810 * It is a handler who processes the TEXTARE tag.
2812 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2813 * destination is specified.
2814 * @param node [i] The TEXTAREA tag node is specified.
2815 * @return The conversion result is returned.
2818 s_chtml30_start_textarea_tag(void *pdoc, Node *node)
2825 chtml30 = GET_CHTML30(pdoc);
2829 chtml30->textarea_flag++;
2832 for (attr = qs_get_attr(doc,node);
2834 attr = qs_get_next_attr(doc,attr)) {
2835 char *name = qs_get_attr_name(doc,attr);
2836 char *value = qs_get_attr_value(doc,attr);
2837 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2838 W_L(" accesskey=\"");
2842 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2847 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2852 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2857 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2866 return chtml30->out;
2871 * It is a handler who processes the TEXTAREA tag.
2873 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2874 * destination is specified.
2875 * @param node [i] The TEXTAREA tag node is specified.
2876 * @return The conversion result is returned.
2879 s_chtml30_end_textarea_tag(void* pdoc, Node* UNUSED(child))
2885 chtml30 = GET_CHTML30(pdoc);
2890 chtml30->textarea_flag--;
2892 return chtml30->out;
2897 s_chtml30_chxjif_tag(void* pdoc, Node* node)
2904 chtml30 = GET_CHTML30(pdoc);
2908 for (child = qs_get_child_node(doc, node);
2910 child = qs_get_next_node(doc, child)) {
2912 s_chtml30_chxjif_tag(chtml30, child);
2919 s_chtml30_text_tag(void *pdoc, Node *child)
2932 chtml30 = GET_CHTML30(pdoc);
2936 textval = qs_get_node_value(doc,child);
2937 if (strlen(textval) == 0) {
2938 return chtml30->out;
2941 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2942 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2944 tdst = qs_alloc_zero_byte_string(r);
2945 memset(one_byte, 0, sizeof(one_byte));
2948 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2950 int rtn = s_chtml30_search_emoji(chtml30, &textval[ii], &out);
2952 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2957 if (is_sjis_kanji(textval[ii])) {
2958 one_byte[0] = textval[ii+0];
2959 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2960 one_byte[0] = textval[ii+1];
2961 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2964 else if (chtml30->pre_flag) {
2965 one_byte[0] = textval[ii+0];
2966 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2968 else if (chtml30->textarea_flag) {
2969 one_byte[0] = textval[ii+0];
2970 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2972 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2973 one_byte[0] = textval[ii+0];
2974 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2979 return chtml30->out;
2984 * It is a handler who processes the BLOCKQUOTE tag.
2986 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2987 * destination is specified.
2988 * @param node [i] The BLOCKQUOTE tag node is specified.
2989 * @return The conversion result is returned.
2992 s_chtml30_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2996 chtml30 = GET_CHTML30(pdoc);
2998 W_L("<blockquote>");
2999 return chtml30->out;
3004 * It is a handler who processes the BLOCKQUOTE tag.
3006 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3007 * destination is specified.
3008 * @param node [i] The BLOCKQUOTE tag node is specified.
3009 * @return The conversion result is returned.
3012 s_chtml30_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3017 chtml30 = GET_CHTML30(pdoc);
3019 W_L("</blockquote>");
3020 return chtml30->out;
3025 * It is a handler who processes the DIR tag.
3027 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3028 * destination is specified.
3029 * @param node [i] The DIR tag node is specified.
3030 * @return The conversion result is returned.
3033 s_chtml30_start_dir_tag(void *pdoc, Node *UNUSED(child))
3035 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3036 Doc *doc = chtml30->doc;
3038 return chtml30->out;
3043 * It is a handler who processes the DIR tag.
3045 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3046 * destination is specified.
3047 * @param node [i] The DIR tag node is specified.
3048 * @return The conversion result is returned.
3051 s_chtml30_end_dir_tag(void *pdoc, Node *UNUSED(child))
3053 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3054 Doc *doc = chtml30->doc;
3056 return chtml30->out;
3061 * It is a handler who processes the DL tag.
3063 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3064 * destination is specified.
3065 * @param node [i] The DL tag node is specified.
3066 * @return The conversion result is returned.
3069 s_chtml30_start_dl_tag(void *pdoc, Node *UNUSED(child))
3071 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3072 Doc *doc = chtml30->doc;
3074 return chtml30->out;
3079 * It is a handler who processes the DL tag.
3081 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3082 * destination is specified.
3083 * @param node [i] The DL tag node is specified.
3084 * @return The conversion result is returned.
3087 s_chtml30_end_dl_tag(void *pdoc, Node *UNUSED(child))
3089 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3090 Doc *doc = chtml30->doc;
3092 return chtml30->out;
3097 * It is a handler who processes the DT tag.
3099 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3100 * destination is specified.
3101 * @param node [i] The DT tag node is specified.
3102 * @return The conversion result is returned.
3105 s_chtml30_start_dt_tag(void *pdoc, Node *UNUSED(child))
3109 chtml30 = GET_CHTML30(pdoc);
3112 return chtml30->out;
3117 * It is a handler who processes the DT tag.
3119 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3120 * destination is specified.
3121 * @param node [i] The DT tag node is specified.
3122 * @return The conversion result is returned.
3125 s_chtml30_end_dt_tag(void *pdoc, Node *UNUSED(child))
3128 chtml30 = GET_CHTML30(pdoc);
3129 return chtml30->out;
3134 * It is a handler who processes the DD tag.
3136 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3137 * destination is specified.
3138 * @param node [i] The DD tag node is specified.
3139 * @return The conversion result is returned.
3142 s_chtml30_start_dd_tag(void *pdoc, Node *UNUSED(child))
3144 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3145 Doc *doc = chtml30->doc;
3147 return chtml30->out;
3152 * It is a handler who processes the DD tag.
3154 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3155 * destination is specified.
3156 * @param node [i] The DD tag node is specified.
3157 * @return The conversion result is returned.
3160 s_chtml30_end_dd_tag(void *pdoc, Node *UNUSED(child))
3162 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3163 return chtml30->out;
3168 * It is a handler who processes the MARQUEE tag.
3170 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3171 * destination is specified.
3172 * @param node [i] The MARQUEE tag node is specified.
3173 * @return The conversion result is returned.
3176 s_chtml30_start_marquee_tag(void *pdoc, Node *node)
3178 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3179 Doc *doc = chtml30->doc;
3182 /*--------------------------------------------------------------------------*/
3183 /* Get Attributes */
3184 /*--------------------------------------------------------------------------*/
3185 for (attr = qs_get_attr(doc,node);
3187 attr = qs_get_next_attr(doc,attr)) {
3188 char *name = qs_get_attr_name(doc,attr);
3189 char *value = qs_get_attr_value(doc,attr);
3190 if (STRCASEEQ('d','D',"direction", name)) {
3191 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3192 W_L(" direction=\"");
3197 else if (STRCASEEQ('b','B',"behavior",name)) {
3198 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3199 W_L(" behavior=\"");
3204 else if (STRCASEEQ('l','L',"loop",name)) {
3205 if (value && *value) {
3213 return chtml30->out;
3218 * It is a handler who processes the MARQUEE tag.
3220 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3221 * destination is specified.
3222 * @param node [i] The MARQUEE tag node is specified.
3223 * @return The conversion result is returned.
3226 s_chtml30_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3228 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3229 Doc *doc = chtml30->doc;
3231 return chtml30->out;
3236 * It is a handler who processes the BLINK tag.
3238 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3239 * destination is specified.
3240 * @param node [i] The BLINK tag node is specified.
3241 * @return The conversion result is returned.
3244 s_chtml30_start_blink_tag(void *pdoc, Node *UNUSED(child))
3246 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3247 Doc *doc = chtml30->doc;
3249 return chtml30->out;
3254 * It is a handler who processes the BLINK tag.
3256 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3257 * destination is specified.
3258 * @param node [i] The BLINK tag node is specified.
3259 * @return The conversion result is returned.
3262 s_chtml30_end_blink_tag(void *pdoc, Node *UNUSED(child))
3264 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3265 Doc *doc = chtml30->doc;
3267 return chtml30->out;
3272 * It is a handler who processes the MENU tag.
3274 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3275 * destination is specified.
3276 * @param node [i] The MENU tag node is specified.
3277 * @return The conversion result is returned.
3280 s_chtml30_start_menu_tag(void *pdoc, Node *UNUSED(child))
3284 chtml30 = GET_CHTML30(pdoc);
3287 return chtml30->out;
3292 * It is a handler who processes the MENU tag.
3294 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3295 * destination is specified.
3296 * @param node [i] The MENU tag node is specified.
3297 * @return The conversion result is returned.
3300 s_chtml30_end_menu_tag(void *pdoc, Node *UNUSED(child))
3302 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3303 Doc *doc = chtml30->doc;
3305 return chtml30->out;
3310 * It is a handler who processes the PLAINTEXT tag.
3312 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3313 * destination is specified.
3314 * @param node [i] The PLAINTEXT tag node is specified.
3315 * @return The conversion result is returned.
3318 s_chtml30_start_plaintext_tag(void *pdoc, Node *node)
3323 chtml30 = GET_CHTML30(pdoc);
3326 s_chtml30_start_plaintext_tag_inner(pdoc,node);
3327 return chtml30->out;
3331 s_chtml30_start_plaintext_tag_inner(void *pdoc, Node *node)
3336 chtml30 = GET_CHTML30(pdoc);
3338 for (child = qs_get_child_node(doc, node);
3340 child = qs_get_next_node(doc, child)) {
3342 s_chtml30_start_plaintext_tag_inner(pdoc, child);
3344 return chtml30->out;
3349 * It is a handler who processes the PLAINTEXT tag.
3351 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3352 * destination is specified.
3353 * @param node [i] The PLAINTEXT tag node is specified.
3354 * @return The conversion result is returned.
3357 s_chtml30_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3359 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3360 return chtml30->out;