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.
17 #include "chxj_chtml10.h"
18 #include "chxj_hdml.h"
19 #include "chxj_dump.h"
20 #include "chxj_img_conv.h"
21 #include "chxj_qr_code.h"
22 #include "chxj_cookie.h"
23 #include "chxj_encoding.h"
24 #include "chxj_buffered_write.h"
26 #define GET_CHTML10(X) ((chtml10_t*)(X))
27 #define W10_L(X) do { chtml10->out = BUFFERED_WRITE_LITERAL(chtml10->out, &doc->buf, (X)); } while(0)
28 #define W10_V(X) do { chtml10->out = (X) ? BUFFERED_WRITE_VALUE(chtml10->out, &doc->buf, (X)) \
29 : BUFFERED_WRITE_LITERAL(chtml10->out, &doc->buf, ""); } while(0)
31 static char* s_chtml10_start_html_tag (void* pdoc, Node* node);
32 static char* s_chtml10_end_html_tag (void* pdoc, Node* node);
33 static char* s_chtml10_start_meta_tag (void* pdoc, Node* node);
34 static char* s_chtml10_end_meta_tag (void* pdoc, Node* node);
35 static char* s_chtml10_start_textarea_tag (void* pdoc, Node* node);
36 static char* s_chtml10_end_textarea_tag (void* pdoc, Node* node);
37 static char* s_chtml10_start_p_tag (void* pdoc, Node* node);
38 static char* s_chtml10_end_p_tag (void* pdoc, Node* node);
39 static char* s_chtml10_start_pre_tag (void* pdoc, Node* node);
40 static char* s_chtml10_end_pre_tag (void* pdoc, Node* node);
41 static char* s_chtml10_start_ul_tag (void* pdoc, Node* node);
42 static char* s_chtml10_end_ul_tag (void* pdoc, Node* node);
43 static char* s_chtml10_start_li_tag (void* pdoc, Node* node);
44 static char* s_chtml10_end_li_tag (void* pdoc, Node* node);
45 static char* s_chtml10_start_ol_tag (void* pdoc, Node* node);
46 static char* s_chtml10_end_ol_tag (void* pdoc, Node* node);
47 static char* s_chtml10_start_h1_tag (void* pdoc, Node* node);
48 static char* s_chtml10_end_h1_tag (void* pdoc, Node* node);
49 static char* s_chtml10_start_h2_tag (void* pdoc, Node* node);
50 static char* s_chtml10_end_h2_tag (void* pdoc, Node* node);
51 static char* s_chtml10_start_h3_tag (void* pdoc, Node* node);
52 static char* s_chtml10_end_h3_tag (void* pdoc, Node* node);
53 static char* s_chtml10_start_h4_tag (void* pdoc, Node* node);
54 static char* s_chtml10_end_h4_tag (void* pdoc, Node* node);
55 static char* s_chtml10_start_h5_tag (void* pdoc, Node* node);
56 static char* s_chtml10_end_h5_tag (void* pdoc, Node* node);
57 static char* s_chtml10_start_h6_tag (void* pdoc, Node* node);
58 static char* s_chtml10_end_h6_tag (void* pdoc, Node* node);
59 static char* s_chtml10_start_head_tag (void* pdoc, Node* node);
60 static char* s_chtml10_end_head_tag (void* pdoc, Node* node);
61 static char* s_chtml10_start_title_tag (void* pdoc, Node* node);
62 static char* s_chtml10_end_title_tag (void* pdoc, Node* node);
63 static char* s_chtml10_start_base_tag (void* pdoc, Node* node);
64 static char* s_chtml10_end_base_tag (void* pdoc, Node* node);
65 static char* s_chtml10_start_body_tag (void* pdoc, Node* node);
66 static char* s_chtml10_end_body_tag (void* pdoc, Node* node);
67 static char* s_chtml10_start_a_tag (void* pdoc, Node* node);
68 static char* s_chtml10_end_a_tag (void* pdoc, Node* node);
69 static char* s_chtml10_start_br_tag (void* pdoc, Node* node);
70 static char* s_chtml10_end_br_tag (void* pdoc, Node* node);
71 static char* s_chtml10_start_tr_tag (void* pdoc, Node* node);
72 static char* s_chtml10_end_tr_tag (void* pdoc, Node* node);
73 static char* s_chtml10_start_font_tag (void* pdoc, Node* node);
74 static char* s_chtml10_end_font_tag (void* pdoc, Node* node);
75 static char* s_chtml10_start_input_tag (void* pdoc, Node* node);
76 static char* s_chtml10_end_input_tag (void* pdoc, Node* node);
77 static char* s_chtml10_start_form_tag (void* pdoc, Node* node);
78 static char* s_chtml10_end_form_tag (void* pdoc, Node* node);
79 static char* s_chtml10_start_center_tag (void* pdoc, Node* node);
80 static char* s_chtml10_end_center_tag (void* pdoc, Node* node);
81 static char* s_chtml10_start_hr_tag (void* pdoc, Node* node);
82 static char* s_chtml10_end_hr_tag (void* pdoc, Node* node);
83 static char* s_chtml10_start_img_tag (void* pdoc, Node* node);
84 static char* s_chtml10_end_img_tag (void* pdoc, Node* node);
85 static char* s_chtml10_start_select_tag (void* pdoc, Node* node);
86 static char* s_chtml10_end_select_tag (void* pdoc, Node* node);
87 static char* s_chtml10_start_option_tag (void* pdoc, Node* node);
88 static char* s_chtml10_end_option_tag (void* pdoc, Node* node);
89 static char* s_chtml10_start_div_tag (void* pdoc, Node* node);
90 static char* s_chtml10_end_div_tag (void* pdoc, Node* node);
92 static void s_init_chtml10(chtml10_t* chtml, Doc* doc, request_rec* r, device_table* spec);
94 static int s_chtml10_search_emoji(chtml10_t* chtml, char* txt, char** rslt);
95 static char* s_chtml10_chxjif_tag (void* pdoc, Node* node);
96 static char* s_chtml10_text (void* pdoc, Node* node);
98 tag_handler chtml10_handler[] = {
101 s_chtml10_start_html_tag,
102 s_chtml10_end_html_tag,
106 s_chtml10_start_meta_tag,
107 s_chtml10_end_meta_tag,
111 s_chtml10_start_textarea_tag,
112 s_chtml10_end_textarea_tag,
116 s_chtml10_start_p_tag,
121 s_chtml10_start_pre_tag,
122 s_chtml10_end_pre_tag,
126 s_chtml10_start_ul_tag,
127 s_chtml10_end_ul_tag,
131 s_chtml10_start_li_tag,
132 s_chtml10_end_li_tag,
136 s_chtml10_start_ol_tag,
137 s_chtml10_end_ol_tag,
141 s_chtml10_start_h1_tag,
142 s_chtml10_end_h1_tag,
146 s_chtml10_start_h2_tag,
147 s_chtml10_end_h2_tag,
151 s_chtml10_start_h3_tag,
152 s_chtml10_end_h3_tag,
156 s_chtml10_start_h4_tag,
157 s_chtml10_end_h4_tag,
161 s_chtml10_start_h5_tag,
162 s_chtml10_end_h5_tag,
166 s_chtml10_start_h6_tag,
167 s_chtml10_end_h6_tag,
171 s_chtml10_start_head_tag,
172 s_chtml10_end_head_tag,
176 s_chtml10_start_title_tag,
177 s_chtml10_end_title_tag,
181 s_chtml10_start_base_tag,
182 s_chtml10_end_base_tag,
186 s_chtml10_start_body_tag,
187 s_chtml10_end_body_tag,
191 s_chtml10_start_a_tag,
196 s_chtml10_start_br_tag,
197 s_chtml10_end_br_tag,
206 s_chtml10_start_tr_tag,
207 s_chtml10_end_tr_tag,
221 s_chtml10_start_font_tag,
222 s_chtml10_end_font_tag,
226 s_chtml10_start_form_tag,
227 s_chtml10_end_form_tag,
231 s_chtml10_start_input_tag,
232 s_chtml10_end_input_tag,
236 s_chtml10_start_center_tag,
237 s_chtml10_end_center_tag,
241 s_chtml10_start_hr_tag,
242 s_chtml10_end_hr_tag,
246 s_chtml10_start_img_tag,
247 s_chtml10_end_img_tag,
251 s_chtml10_start_select_tag,
252 s_chtml10_end_select_tag,
256 s_chtml10_start_option_tag,
257 s_chtml10_end_option_tag,
261 s_chtml10_start_div_tag,
262 s_chtml10_end_div_tag,
266 s_chtml10_chxjif_tag,
328 * converts from CHTML5.0 to CHTML1.0.
330 * @param r [i] Requet_rec is appointed.
331 * @param spec [i] The result of the device specification processing which
332 * was done in advance is appointed.
333 * @param src [i] The character string before the converting is appointed.
334 * @return The character string after the converting is returned.
337 chxj_exchange_chtml10(
343 chxjconvrule_entry* entryp,
356 DBG(r, "start chxj_exchange_chtml10() cookie_id=[%s]", (cookie) ? cookie->cookie_id : "");
358 /*--------------------------------------------------------------------------*/
360 /*--------------------------------------------------------------------------*/
362 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
364 DBG(r,"i found qrcode xml");
367 DBG(r,"not found qrcode xml");
369 /*--------------------------------------------------------------------------*/
370 /* The CHTML structure is initialized. */
371 /*--------------------------------------------------------------------------*/
372 s_init_chtml10(&chtml10, &doc, r, spec);
373 chtml10.entryp = entryp;
374 chtml10.cookie = cookie;
376 chxj_set_content_type(r, "text/html; charset=Windows-31J");
378 /*--------------------------------------------------------------------------*/
379 /* The character string of the input is analyzed. */
380 /*--------------------------------------------------------------------------*/
381 qs_init_malloc(&doc);
382 qs_init_root_node(&doc);
384 ss = apr_pcalloc(r->pool, srclen + 1);
385 memset(ss, 0, srclen + 1);
386 memcpy(ss, src, srclen);
389 chxj_dump_out("[src] CHTML -> CHTML1.0", ss, srclen);
392 qs_parse_string(&doc,ss, strlen(ss));
394 chxj_buffered_write_init(r->pool, &doc.buf);
395 /*--------------------------------------------------------------------------*/
396 /* It converts it from CHTML to CHTML. */
397 /*--------------------------------------------------------------------------*/
398 chxj_node_exchange(spec,r,(void*)&chtml10, &doc, qs_get_root(&doc), 0);
399 chtml10.out = chxj_buffered_write_flush(chtml10.out, &doc.buf);
400 dst = apr_pstrdup(r->pool, chtml10.out);
401 chxj_buffered_write_terminate(&doc.buf);
403 qs_all_free(&doc,QX_LOGMARK);
406 return apr_pstrdup(r->pool,ss);
409 if (strlen(dst) == 0) {
410 dst = apr_psprintf(r->pool, "\n");
412 *dstlen = strlen(dst);
415 chxj_dump_out("[dst] CHTML -> CHTML1.0", dst, *dstlen);
418 DBG(r, "end chxj_exchange_chtml10() cookie_id=[%s] time=[%lld]", (cookie) ? cookie->cookie_id : "", apr_time_now() - t);
425 * The CHTML structure is initialized.
427 * @param chtml10 [i/o] The pointer to the HDML structure that wants to be
428 * initialized is specified.
429 * @param doc [i] The Doc structure that should be set to the initialized
430 * HDML structure is specified.
431 * @param r [i] To use POOL, the pointer to request_rec is specified.
432 * @param spec [i] The pointer to the device_table
441 memset(doc, 0, sizeof(Doc));
442 memset(chtml10, 0, sizeof(chtml10_t));
446 chtml10->spec = spec;
447 chtml10->out = qs_alloc_zero_byte_string(r);
448 chtml10->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
449 chtml10->doc->parse_mode = PARSE_MODE_CHTML;
454 * Corresponding EMOJI to a current character-code is retrieved.
455 * The substitution character string is stored in the rslt pointer if agreeing.
457 * @param chtml10 [i] The pointer to the CHTML structure is specified.
458 * @param txt [i] The character string to want to examine whether it is
459 * EMOJI is specified.
460 * @param rslt [o] The pointer to the pointer that stores the result is
462 * @return When corresponding EMOJI exists, it returns it excluding 0.
465 s_chtml10_search_emoji(chtml10_t* chtml10, char* txt, char** rslt)
472 spec = chtml10->spec;
478 DBG(r,"spec is NULL");
481 for (ee = chtml10->conf->emoji;
486 DBG(r,"emoji->imode is NULL");
490 if (ee->imode->string
492 && strlen(ee->imode->string) > 0
493 && *ee->imode->string == *txt
494 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
495 if (!spec || !spec->emoji_type) {
496 *rslt = apr_palloc(r->pool, 3);
497 (*rslt)[0] = ee->imode->hex1byte & 0xff;
498 (*rslt)[1] = ee->imode->hex2byte & 0xff;
500 return strlen(ee->imode->string);
511 * It is a handler who processes the HTML tag.
513 * @param chtml10 [i/o] The pointer to the CHTML structure at the output
514 * destination is specified.
515 * @param node [i] The HTML tag node is specified.
516 * @return The conversion result is returned.
519 s_chtml10_start_html_tag(void* pdoc, Node* UNUSED(node))
525 chtml10 = GET_CHTML10(pdoc);
529 /*--------------------------------------------------------------------------*/
531 /*--------------------------------------------------------------------------*/
539 * It is a handler who processes the HTML tag.
541 * @param pdoc [i/o] The pointer to the CHTML structure at the output
542 * destination is specified.
543 * @param node [i] The HTML tag node is specified.
544 * @return The conversion result is returned.
547 s_chtml10_end_html_tag(void* pdoc, Node* UNUSED(child))
554 chtml10 = GET_CHTML10(pdoc);
565 * It is a handler who processes the META tag.
567 * @param pdoc [i/o] The pointer to the CHTML structure at the output
568 * destination is specified.
569 * @param node [i] The META tag node is specified.
570 * @return The conversion result is returned.
573 s_chtml10_start_meta_tag(void* pdoc, Node* UNUSED(node))
577 chtml10 = GET_CHTML10(pdoc);
586 * It is a handler who processes the META tag.
588 * @param pdoc [i/o] The pointer to the CHTML structure at the output
589 * destination is specified.
590 * @param node [i] The META tag node is specified.
591 * @return The conversion result is returned.
594 s_chtml10_end_meta_tag(void* pdoc, Node* UNUSED(child))
598 chtml10 = GET_CHTML10(pdoc);
605 * It is a handler who processes the HEAD tag.
607 * @param pdoc [i/o] The pointer to the CHTML structure at the output
608 * destination is specified.
609 * @param node [i] The HEAD tag node is specified.
610 * @return The conversion result is returned.
613 s_chtml10_start_head_tag(void* pdoc, Node* UNUSED(node))
619 chtml10 = GET_CHTML10(pdoc);
630 * It is a handler who processes the HEAD tag.
632 * @param pdoc [i/o] The pointer to the CHTML structure at the output
633 * destination is specified.
634 * @param node [i] The HEAD tag node is specified.
635 * @return The conversion result is returned.
638 s_chtml10_end_head_tag(void* pdoc, Node* UNUSED(child))
644 chtml10 = GET_CHTML10(pdoc);
648 W10_L("</head>\r\n");
655 * It is a handler who processes the OL tag.
657 * @param pdoc [i/o] The pointer to the CHTML structure at the output
658 * destination is specified.
659 * @param node [i] The OL tag node is specified.
660 * @return The conversion result is returned.
663 s_chtml10_start_ol_tag(void* pdoc, Node* UNUSED(node))
669 chtml10 = GET_CHTML10(pdoc);
680 * It is a handler who processes the OL tag.
682 * @param pdoc [i/o] The pointer to the CHTML structure at the output
683 * destination is specified.
684 * @param node [i] The OL tag node is specified.
685 * @return The conversion result is returned.
688 s_chtml10_end_ol_tag(void* pdoc, Node* UNUSED(child))
694 chtml10 = GET_CHTML10(pdoc);
705 * It is a handler who processes the UL tag.
707 * @param pdoc [i/o] The pointer to the CHTML structure at the output
708 * destination is specified.
709 * @param node [i] The UL tag node is specified.
710 * @return The conversion result is returned.
713 s_chtml10_start_ul_tag(void* pdoc, Node* UNUSED(node))
719 chtml10 = GET_CHTML10(pdoc);
730 * It is a handler who processes the UL tag.
732 * @param pdoc [i/o] The pointer to the CHTML structure at the output
733 * destination is specified.
734 * @param node [i] The UL tag node is specified.
735 * @return The conversion result is returned.
738 s_chtml10_end_ul_tag(void* pdoc, Node* UNUSED(child))
744 chtml10 = GET_CHTML10(pdoc);
755 * It is a handler who processes the LI tag.
757 * @param pdoc [i/o] The pointer to the CHTML structure at the output
758 * destination is specified.
759 * @param node [i] The LI tag node is specified.
760 * @return The conversion result is returned.
763 s_chtml10_start_li_tag(void* pdoc, Node* UNUSED(node))
769 chtml10 = GET_CHTML10(pdoc);
780 * It is a handler who processes the LI tag.
782 * @param pdoc [i/o] The pointer to the CHTML structure at the output
783 * destination is specified.
784 * @param node [i] The LI tag node is specified.
785 * @return The conversion result is returned.
788 s_chtml10_end_li_tag(void* pdoc, Node* UNUSED(child))
794 chtml10 = GET_CHTML10(pdoc);
805 * It is a handler who processes the H1 tag.
807 * @param pdoc [i/o] The pointer to the CHTML structure at the output
808 * destination is specified.
809 * @param node [i] The H1 tag node is specified.
810 * @return The conversion result is returned.
813 s_chtml10_start_h1_tag(void* pdoc, Node* UNUSED(node))
819 chtml10 = GET_CHTML10(pdoc);
830 * It is a handler who processes the H1 tag.
832 * @param pdoc [i/o] The pointer to the CHTML structure at the output
833 * destination is specified.
834 * @param node [i] The H1 tag node is specified.
835 * @return The conversion result is returned.
838 s_chtml10_end_h1_tag(void* pdoc, Node* UNUSED(child))
844 chtml10 = GET_CHTML10(pdoc);
855 * It is a handler who processes the H2 tag.
857 * @param pdoc [i/o] The pointer to the CHTML structure at the output
858 * destination is specified.
859 * @param node [i] The H2 tag node is specified.
860 * @return The conversion result is returned.
863 s_chtml10_start_h2_tag(void* pdoc, Node* UNUSED(node))
869 chtml10 = GET_CHTML10(pdoc);
880 * It is a handler who processes the H2 tag.
882 * @param pdoc [i/o] The pointer to the CHTML structure at the output
883 * destination is specified.
884 * @param node [i] The H2 tag node is specified.
885 * @return The conversion result is returned.
888 s_chtml10_end_h2_tag(void* pdoc, Node* UNUSED(child))
894 chtml10 = GET_CHTML10(pdoc);
905 * It is a handler who processes the H3 tag.
907 * @param pdoc [i/o] The pointer to the CHTML structure at the output
908 * destination is specified.
909 * @param node [i] The H3 tag node is specified.
910 * @return The conversion result is returned.
913 s_chtml10_start_h3_tag(void* pdoc, Node* UNUSED(node))
919 chtml10 = GET_CHTML10(pdoc);
930 * It is a handler who processes the H3 tag.
932 * @param pdoc [i/o] The pointer to the CHTML structure at the output
933 * destination is specified.
934 * @param node [i] The H3 tag node is specified.
935 * @return The conversion result is returned.
938 s_chtml10_end_h3_tag(void* pdoc, Node* UNUSED(child))
944 chtml10 = GET_CHTML10(pdoc);
955 * It is a handler who processes the H4 tag.
957 * @param pdoc [i/o] The pointer to the CHTML structure at the output
958 * destination is specified.
959 * @param node [i] The H4 tag node is specified.
960 * @return The conversion result is returned.
963 s_chtml10_start_h4_tag(void* pdoc, Node* UNUSED(node))
969 chtml10 = GET_CHTML10(pdoc);
980 * It is a handler who processes the H4 tag.
982 * @param pdoc [i/o] The pointer to the CHTML structure at the output
983 * destination is specified.
984 * @param node [i] The H4 tag node is specified.
985 * @return The conversion result is returned.
988 s_chtml10_end_h4_tag(void* pdoc, Node* UNUSED(child))
994 chtml10 = GET_CHTML10(pdoc);
1000 return chtml10->out;
1005 * It is a handler who processes the H5 tag.
1007 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1008 * destination is specified.
1009 * @param node [i] The H5 tag node is specified.
1010 * @return The conversion result is returned.
1013 s_chtml10_start_h5_tag(void* pdoc, Node* UNUSED(node))
1019 chtml10 = GET_CHTML10(pdoc);
1025 return chtml10->out;
1030 * It is a handler who processes the H5 tag.
1032 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1033 * destination is specified.
1034 * @param node [i] The H5 tag node is specified.
1035 * @return The conversion result is returned.
1038 s_chtml10_end_h5_tag(void* pdoc, Node* UNUSED(child))
1044 chtml10 = GET_CHTML10(pdoc);
1050 return chtml10->out;
1055 * It is a handler who processes the H6 tag.
1057 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1058 * destination is specified.
1059 * @param node [i] The H6 tag node is specified.
1060 * @return The conversion result is returned.
1063 s_chtml10_start_h6_tag(void* pdoc, Node* UNUSED(node))
1069 chtml10 = GET_CHTML10(pdoc);
1075 return chtml10->out;
1080 * It is a handler who processes the H6 tag.
1082 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1083 * destination is specified.
1084 * @param node [i] The H6 tag node is specified.
1085 * @return The conversion result is returned.
1088 s_chtml10_end_h6_tag(void* pdoc, Node* UNUSED(child))
1094 chtml10 = GET_CHTML10(pdoc);
1100 return chtml10->out;
1105 * It is a handler who processes the TITLE tag.
1107 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1108 * destination is specified.
1109 * @param node [i] The TITLE tag node is specified.
1110 * @return The conversion result is returned.
1113 s_chtml10_start_title_tag(void* pdoc, Node* UNUSED(node))
1119 chtml10 = GET_CHTML10(pdoc);
1125 return chtml10->out;
1130 * It is a handler who processes the TITLE tag.
1132 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1133 * destination is specified.
1134 * @param node [i] The TITLE tag node is specified.
1135 * @return The conversion result is returned.
1138 s_chtml10_end_title_tag(void* pdoc, Node* UNUSED(child))
1144 chtml10 = GET_CHTML10(pdoc);
1148 W10_L("</title>\r\n");
1150 return chtml10->out;
1155 * It is a handler who processes the BASE tag.
1157 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1158 * destination is specified.
1159 * @param node [i] The BASE tag node is specified.
1160 * @return The conversion result is returned.
1163 s_chtml10_start_base_tag(void* pdoc, Node* node)
1170 chtml10 = GET_CHTML10(pdoc);
1176 /*--------------------------------------------------------------------------*/
1177 /* Get Attributes */
1178 /*--------------------------------------------------------------------------*/
1179 for (attr = qs_get_attr(doc,node);
1181 attr = qs_get_next_attr(doc,attr)) {
1185 name = qs_get_attr_name(doc,attr);
1186 value = qs_get_attr_value(doc,attr);
1188 if (STRCASEEQ('h','H',"href", name)) {
1197 return chtml10->out;
1202 * It is a handler who processes the BASE tag.
1204 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1205 * destination is specified.
1206 * @param node [i] The BASE tag node is specified.
1207 * @return The conversion result is returned.
1210 s_chtml10_end_base_tag(void* pdoc, Node* UNUSED(child))
1212 chtml10_t* chtml10 = GET_CHTML10(pdoc);
1214 return chtml10->out;
1219 * It is a handler who processes the BODY tag.
1221 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1222 * destination is specified.
1223 * @param node [i] The BODY tag node is specified.
1224 * @return The conversion result is returned.
1227 s_chtml10_start_body_tag(void* pdoc, Node* node)
1234 chtml10 = GET_CHTML10(pdoc);
1241 /*--------------------------------------------------------------------------*/
1242 /* Get Attributes */
1243 /*--------------------------------------------------------------------------*/
1244 for (attr = qs_get_attr(doc,node);
1246 attr = qs_get_next_attr(doc,attr)) {
1250 name = qs_get_attr_name(doc,attr);
1255 if (strcasecmp(name, "alink") == 0) {
1256 /*----------------------------------------------------------------------*/
1258 /*----------------------------------------------------------------------*/
1265 if (strcasecmp(name, "bgcolor") == 0) {
1266 /*----------------------------------------------------------------------*/
1268 /*----------------------------------------------------------------------*/
1275 if (strcasecmp(name, "text") == 0) {
1276 /*----------------------------------------------------------------------*/
1278 /*----------------------------------------------------------------------*/
1285 if (strcasecmp(name, "link") == 0) {
1286 /*----------------------------------------------------------------------*/
1288 /*----------------------------------------------------------------------*/
1295 if (strcasecmp(name, "vlink") == 0) {
1296 /*----------------------------------------------------------------------*/
1298 /*----------------------------------------------------------------------*/
1310 return chtml10->out;
1315 * It is a handler who processes the BODY tag.
1317 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1318 * destination is specified.
1319 * @param node [i] The BODY tag node is specified.
1320 * @return The conversion result is returned.
1323 s_chtml10_end_body_tag(void* pdoc, Node* UNUSED(child))
1329 chtml10 = GET_CHTML10(pdoc);
1333 W10_L("</body>\r\n");
1335 return chtml10->out;
1340 * It is a handler who processes the A tag.
1342 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1343 * destination is specified.
1344 * @param node [i] The A tag node is specified.
1345 * @return The conversion result is returned.
1348 s_chtml10_start_a_tag(void *pdoc, Node *node)
1355 chtml10 = GET_CHTML10(pdoc);
1361 /*--------------------------------------------------------------------------*/
1362 /* Get Attributes */
1363 /*--------------------------------------------------------------------------*/
1364 for (attr = qs_get_attr(doc,node);
1366 attr = qs_get_next_attr(doc,attr)) {
1371 name = qs_get_attr_name(doc,attr);
1372 value = qs_get_attr_value(doc,attr);
1377 if (strcasecmp(name, "name") == 0) {
1378 /*--------------------------------------------------------------------*/
1380 /*--------------------------------------------------------------------*/
1389 if (strcasecmp(name, "href") == 0) {
1390 /*--------------------------------------------------------------------*/
1392 /*--------------------------------------------------------------------*/
1393 value = chxj_encoding_parameter(r, value);
1394 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
1403 if (strcasecmp(name, "accesskey") == 0) {
1404 /*--------------------------------------------------------------------*/
1406 /*--------------------------------------------------------------------*/
1407 W10_L(" accesskey=\"");
1415 if (strcasecmp(name, "cti") == 0) {
1416 /*--------------------------------------------------------------------*/
1418 /*--------------------------------------------------------------------*/
1425 if (strcasecmp(name, "utn") == 0) {
1426 /*--------------------------------------------------------------------*/
1428 /*--------------------------------------------------------------------*/
1435 if (strcasecmp(name, "telbook") == 0) {
1436 /*--------------------------------------------------------------------*/
1438 /*--------------------------------------------------------------------*/
1445 if (strcasecmp(name, "kana") == 0) {
1446 /*--------------------------------------------------------------------*/
1448 /*--------------------------------------------------------------------*/
1455 if (strcasecmp(name, "email") == 0) {
1456 /*--------------------------------------------------------------------*/
1458 /*--------------------------------------------------------------------*/
1465 if (strcasecmp(name, "ista") == 0) {
1466 /*--------------------------------------------------------------------*/
1468 /*--------------------------------------------------------------------*/
1472 if (strcasecmp(name, "ilet") == 0) {
1473 /*--------------------------------------------------------------------*/
1475 /*--------------------------------------------------------------------*/
1479 if (strcasecmp(name, "iswf") == 0) {
1480 /*--------------------------------------------------------------------*/
1482 /*--------------------------------------------------------------------*/
1486 if (strcasecmp(name, "irst") == 0) {
1487 /*--------------------------------------------------------------------*/
1489 /*--------------------------------------------------------------------*/
1493 if (strcasecmp(name, "ijam") == 0) {
1494 /*--------------------------------------------------------------------*/
1496 /*--------------------------------------------------------------------*/
1507 return chtml10->out;
1512 * It is a handler who processes the A tag.
1514 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1515 * destination is specified.
1516 * @param node [i] The A tag node is specified.
1517 * @return The conversion result is returned.
1520 s_chtml10_end_a_tag(void *pdoc, Node *UNUSED(child))
1526 chtml10 = GET_CHTML10(pdoc);
1531 return chtml10->out;
1536 * It is a handler who processes the BR tag.
1538 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1539 * destination is specified.
1540 * @param node [i] The BR tag node is specified.
1541 * @return The conversion result is returned.
1544 s_chtml10_start_br_tag(void *pdoc, Node *UNUSED(node))
1550 chtml10 = GET_CHTML10(pdoc);
1555 return chtml10->out;
1560 * It is a handler who processes the BR tag.
1562 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1563 * destination is specified.
1564 * @param node [i] The BR tag node is specified.
1565 * @return The conversion result is returned.
1568 s_chtml10_end_br_tag(void *pdoc, Node *UNUSED(child))
1570 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1572 return chtml10->out;
1577 * It is a handler who processes the TR tag.
1579 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1580 * destination is specified.
1581 * @param node [i] The TR tag node is specified.
1582 * @return The conversion result is returned.
1585 s_chtml10_start_tr_tag(void *pdoc, Node *UNUSED(node))
1587 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1589 return chtml10->out;
1594 * It is a handler who processes the TR tag.
1596 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1597 * destination is specified.
1598 * @param node [i] The TR tag node is specified.
1599 * @return The conversion result is returned.
1602 s_chtml10_end_tr_tag(void *pdoc, Node *UNUSED(child))
1608 chtml10 = GET_CHTML10(pdoc);
1614 return chtml10->out;
1619 * It is a handler who processes the FONT tag.
1621 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1622 * destination is specified.
1623 * @param node [i] The FONT tag node is specified.
1624 * @return The conversion result is returned.
1627 s_chtml10_start_font_tag(void *pdoc, Node *UNUSED(node))
1629 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1633 return chtml10->out;
1638 * It is a handler who processes the FONT tag.
1640 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1641 * destination is specified.
1642 * @param node [i] The FONT tag node is specified.
1643 * @return The conversion result is returned.
1646 s_chtml10_end_font_tag(void *pdoc, Node *UNUSED(child))
1648 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1652 return chtml10->out;
1657 * It is a handler who processes the FORM tag.
1659 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1660 * destination is specified.
1661 * @param node [i] The FORM tag node is specified.
1662 * @return The conversion result is returned.
1665 s_chtml10_start_form_tag(void *pdoc, Node *node)
1672 chtml10 = GET_CHTML10(pdoc);
1678 /*--------------------------------------------------------------------------*/
1679 /* Get Attributes */
1680 /*--------------------------------------------------------------------------*/
1681 for (attr = qs_get_attr(doc,node);
1683 attr = qs_get_next_attr(doc,attr)) {
1687 name = qs_get_attr_name(doc,attr);
1688 value = qs_get_attr_value(doc,attr);
1693 if (strcasecmp(name, "action") == 0) {
1694 /*--------------------------------------------------------------------*/
1696 /*--------------------------------------------------------------------*/
1697 value = chxj_encoding_parameter(r, value);
1698 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
1700 W10_L(" action=\"");
1708 if (strcasecmp(name, "method") == 0) {
1709 /*--------------------------------------------------------------------*/
1711 /*--------------------------------------------------------------------*/
1712 W10_L(" method=\"");
1720 if (strcasecmp(name, "utn") == 0) {
1721 /*--------------------------------------------------------------------*/
1723 /*--------------------------------------------------------------------*/
1735 return chtml10->out;
1740 * It is a handler who processes the FORM tag.
1742 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1743 * destination is specified.
1744 * @param node [i] The FORM tag node is specified.
1745 * @return The conversion result is returned.
1748 s_chtml10_end_form_tag(void* pdoc, Node* UNUSED(child))
1754 chtml10 = GET_CHTML10(pdoc);
1760 return chtml10->out;
1765 * It is a handler who processes the INPUT tag.
1767 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1768 * destination is specified.
1769 * @param node [i] The INPUT tag node is specified.
1770 * @return The conversion result is returned.
1773 s_chtml10_start_input_tag(void* pdoc, Node* node)
1787 chtml10 = GET_CHTML10(pdoc);
1802 /*--------------------------------------------------------------------------*/
1803 /* Get Attributes */
1804 /*--------------------------------------------------------------------------*/
1806 type = qs_get_type_attr(doc, node, r);
1807 name = qs_get_name_attr(doc, node, r);
1808 value = qs_get_value_attr(doc,node,r);
1809 istyle = qs_get_istyle_attr(doc,node,r);
1810 max_length = qs_get_maxlength_attr(doc,node,r);
1811 checked = qs_get_checked_attr(doc,node,r);
1812 accesskey = qs_get_accesskey_attr(doc, node, r);
1813 size = qs_get_size_attr(doc, node, r);
1840 W10_L(" accesskey=\"");
1846 /*------------------------------------------------------------------------*/
1848 /*------------------------------------------------------------------------*/
1851 /*--------------------------------------------------------------------------*/
1852 /* The figure is default for the password. */
1853 /*--------------------------------------------------------------------------*/
1855 W10_L(" maxlength=\"");
1865 return chtml10->out;
1870 * It is a handler who processes the INPUT tag.
1872 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1873 * destination is specified.
1874 * @param node [i] The INPUT tag node is specified.
1875 * @return The conversion result is returned.
1878 s_chtml10_end_input_tag(void* pdoc, Node* UNUSED(child))
1880 chtml10_t* chtml10 = GET_CHTML10(pdoc);
1882 return chtml10->out;
1887 * It is a handler who processes the CENTER tag.
1889 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1890 * destination is specified.
1891 * @param node [i] The CENTER tag node is specified.
1892 * @return The conversion result is returned.
1895 s_chtml10_start_center_tag(void* pdoc, Node* UNUSED(node))
1901 chtml10 = GET_CHTML10(pdoc);
1907 return chtml10->out;
1912 * It is a handler who processes the CENTER tag.
1914 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1915 * destination is specified.
1916 * @param node [i] The CENTER tag node is specified.
1917 * @return The conversion result is returned.
1920 s_chtml10_end_center_tag(void* pdoc, Node* UNUSED(child))
1926 chtml10 = GET_CHTML10(pdoc);
1932 return chtml10->out;
1937 * It is a handler who processes the HR tag.
1939 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1940 * destination is specified.
1941 * @param node [i] The HR tag node is specified.
1942 * @return The conversion result is returned.
1945 s_chtml10_start_hr_tag(void* pdoc, Node* node)
1952 chtml10 = GET_CHTML10(pdoc);
1958 for (attr = qs_get_attr(doc,node);
1960 attr = qs_get_next_attr(doc,attr)) {
1965 name = qs_get_attr_name (doc,attr);
1966 value = qs_get_attr_value(doc,attr);
1971 if (strcasecmp(name, "align") == 0) {
1972 /*--------------------------------------------------------------------*/
1974 /*--------------------------------------------------------------------*/
1983 if (strcasecmp(name, "size") == 0) {
1984 /*--------------------------------------------------------------------*/
1986 /*--------------------------------------------------------------------*/
1995 if (strcasecmp(name, "width") == 0) {
1996 /*--------------------------------------------------------------------*/
1998 /*--------------------------------------------------------------------*/
2007 if (strcasecmp(name, "noshade") == 0) {
2008 /*--------------------------------------------------------------------*/
2010 /*--------------------------------------------------------------------*/
2017 if (strcasecmp(name, "color") == 0) {
2018 /*--------------------------------------------------------------------*/
2020 /*--------------------------------------------------------------------*/
2032 return chtml10->out;
2037 * It is a handler who processes the HR tag.
2039 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2040 * destination is specified.
2041 * @param node [i] The HR tag node is specified.
2042 * @return The conversion result is returned.
2045 s_chtml10_end_hr_tag(void* pdoc, Node* UNUSED(child))
2049 chtml10 = GET_CHTML10(pdoc);
2051 return chtml10->out;
2056 * It is a handler who processes the IMG tag.
2058 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2059 * destination is specified.
2060 * @param node [i] The IMG tag node is specified.
2061 * @return The conversion result is returned.
2064 s_chtml10_start_img_tag(void* pdoc, Node* node)
2070 #ifndef IMG_NOT_CONVERT_FILENAME
2074 chtml10 = GET_CHTML10(pdoc);
2075 #ifndef IMG_NOT_CONVERT_FILENAME
2076 spec = chtml10->spec;
2082 /*--------------------------------------------------------------------------*/
2083 /* Get Attributes */
2084 /*--------------------------------------------------------------------------*/
2085 for (attr = qs_get_attr(doc,node);
2087 attr = qs_get_next_attr(doc,attr)) {
2092 name = qs_get_attr_name (doc,attr);
2093 value = qs_get_attr_value(doc,attr);
2098 if (strcasecmp(name, "src") == 0) {
2099 /*--------------------------------------------------------------------*/
2101 /*--------------------------------------------------------------------*/
2102 #ifdef IMG_NOT_CONVERT_FILENAME
2103 value = chxj_encoding_parameter(r, value);
2104 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
2106 value = apr_psprintf(r->pool,
2109 (strchr(value, '?')) ? '&' : '?',
2110 CHXJ_COOKIE_NOUPDATE_PARAM);
2116 value = chxj_img_conv(r, spec, value);
2117 value = chxj_encoding_parameter(r, value);
2118 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
2120 value = apr_psprintf(r->pool,
2123 (strchr(value, '?')) ? '&' : '?',
2124 CHXJ_COOKIE_NOUPDATE_PARAM);
2135 if (strcasecmp(name, "align" ) == 0) {
2136 /*--------------------------------------------------------------------*/
2138 /*--------------------------------------------------------------------*/
2139 /*--------------------------------------------------------------------*/
2141 /*--------------------------------------------------------------------*/
2147 if (strcasecmp(name, "alt" ) == 0) {
2148 /*--------------------------------------------------------------------*/
2150 /*--------------------------------------------------------------------*/
2159 if (strcasecmp(name, "width" ) == 0) {
2160 /*--------------------------------------------------------------------*/
2162 /*--------------------------------------------------------------------*/
2171 if (strcasecmp(name, "height") == 0) {
2172 /*--------------------------------------------------------------------*/
2174 /*--------------------------------------------------------------------*/
2175 W10_L(" height=\"");
2180 if (strcasecmp(name, "hspace") == 0) {
2181 /*--------------------------------------------------------------------*/
2183 /*--------------------------------------------------------------------*/
2184 W10_L(" hspace=\"");
2192 if (strcasecmp(name, "vspace") == 0) {
2193 /*--------------------------------------------------------------------*/
2195 /*--------------------------------------------------------------------*/
2196 W10_L(" vspace=\"");
2208 return chtml10->out;
2213 * It is a handler who processes the IMG tag.
2215 * @param chtml10 [i/o] The pointer to the CHTML structure at the output
2216 * destination is specified.
2217 * @param node [i] The IMG tag node is specified.
2218 * @return The conversion result is returned.
2221 s_chtml10_end_img_tag(void *pdoc, Node *UNUSED(child))
2225 chtml10 = GET_CHTML10(pdoc);
2227 return chtml10->out;
2232 * It is a handler who processes the SELECT tag.
2234 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2235 * destination is specified.
2236 * @param node [i] The SELECT tag node is specified.
2237 * @return The conversion result is returned.
2240 s_chtml10_start_select_tag(void *pdoc, Node *child)
2250 chtml10 = GET_CHTML10(pdoc);
2258 for (attr = qs_get_attr(doc,child);
2260 attr = qs_get_next_attr(doc,attr)) {
2264 nm = qs_get_attr_name (doc,attr);
2265 val = qs_get_attr_value(doc,attr);
2270 if (strcasecmp(nm, "size") == 0) {
2271 /*--------------------------------------------------------------------*/
2272 /* CHTML 1.0 version 2.0 */
2273 /*--------------------------------------------------------------------*/
2274 size = apr_pstrdup(doc->buf.pool, val);
2280 if (strcasecmp(nm, "name") == 0) {
2281 /*--------------------------------------------------------------------*/
2282 /* CHTML 1.0 version 2.0 */
2283 /*--------------------------------------------------------------------*/
2284 name = apr_pstrdup(doc->buf.pool, val);
2290 if (strcasecmp(nm, "multiple") == 0) {
2291 /*--------------------------------------------------------------------*/
2292 /* CHTML 1.0 version 2.0 */
2293 /*--------------------------------------------------------------------*/
2316 return chtml10->out;
2321 * It is a handler who processes the SELECT tag.
2323 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2324 * destination is specified.
2325 * @param node [i] The SELECT tag node is specified.
2326 * @return The conversion result is returned.
2329 s_chtml10_end_select_tag(void *pdoc, Node *UNUSED(child))
2335 chtml10 = GET_CHTML10(pdoc);
2339 W10_L("</select>\r\n");
2340 return chtml10->out;
2345 * It is a handler who processes the OPTION tag.
2347 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2348 * destination is specified.
2349 * @param node [i] The OPTION tag node is specified.
2350 * @return The conversion result is returned.
2353 s_chtml10_start_option_tag(void *pdoc, Node *child)
2363 chtml10 = GET_CHTML10(pdoc);
2372 for (attr = qs_get_attr(doc,child);
2374 attr = qs_get_next_attr(doc,attr)) {
2378 nm = qs_get_attr_name (doc,attr);
2379 val = qs_get_attr_value(doc,attr);
2384 if (strcasecmp(nm, "selected") == 0) {
2385 /*--------------------------------------------------------------------*/
2386 /* CHTML 1.0 version 2.0 */
2387 /*--------------------------------------------------------------------*/
2388 selected = apr_pstrdup(doc->buf.pool, val);
2394 if (strcasecmp(nm, "value") == 0) {
2395 /*--------------------------------------------------------------------*/
2396 /* CHTML 1.0 version 2.0 */
2397 /*--------------------------------------------------------------------*/
2398 value = apr_pstrdup(doc->buf.pool, val);
2413 W10_L(" value=\"\"");
2417 W10_L(" selected ");
2421 return chtml10->out;
2426 * It is a handler who processes the OPTION tag.
2428 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2429 * destination is specified.
2430 * @param node [i] The OPTION tag node is specified.
2431 * @return The conversion result is returned.
2434 s_chtml10_end_option_tag(void *pdoc, Node *UNUSED(child))
2438 chtml10 = GET_CHTML10(pdoc);
2442 return chtml10->out;
2447 * It is a handler who processes the DIV tag.
2449 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2450 * destination is specified.
2451 * @param node [i] The DIV tag node is specified.
2452 * @return The conversion result is returned.
2455 s_chtml10_start_div_tag(void *pdoc, Node *child)
2464 chtml10 = GET_CHTML10(pdoc);
2472 for (attr = qs_get_attr(doc,child);
2474 attr = qs_get_next_attr(doc,attr)) {
2479 nm = qs_get_attr_name(doc,attr);
2480 val = qs_get_attr_value(doc,attr);
2482 if (STRCASEEQ('a','A',"align", nm)) {
2483 /*----------------------------------------------------------------------*/
2484 /* CHTML 1.0 (W3C version 3.2) */
2485 /*----------------------------------------------------------------------*/
2486 align = apr_pstrdup(doc->buf.pool, val);
2497 return chtml10->out;
2502 * It is a handler who processes the DIV tag.
2504 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2505 * destination is specified.
2506 * @param node [i] The DIV tag node is specified.
2507 * @return The conversion result is returned.
2510 s_chtml10_end_div_tag(void *pdoc, Node *UNUSED(child))
2516 chtml10 = GET_CHTML10(pdoc);
2520 W10_L("</div>\r\n");
2521 return chtml10->out;
2526 * It is a handler who processes the CHXJ:IF tag.
2528 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2529 * destination is specified.
2530 * @param node [i] The CHXJ:IF tag node is specified.
2531 * @return The conversion result is returned.
2534 s_chtml10_chxjif_tag(void *pdoc, Node *node)
2541 chtml10 = GET_CHTML10(pdoc);
2545 for (child = qs_get_child_node(doc, node);
2547 child = qs_get_next_node(doc, child)) {
2548 W10_V(child->otext);
2549 s_chtml10_chxjif_tag(chtml10, child);
2552 return chtml10->out;
2557 * It is a handler who processes the PRE tag.
2559 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2560 * destination is specified.
2561 * @param node [i] The PRE tag node is specified.
2562 * @return The conversion result is returned.
2565 s_chtml10_start_pre_tag(void *pdoc, Node *UNUSED(node))
2571 chtml10 = GET_CHTML10(pdoc);
2575 chtml10->pre_flag++;
2577 return chtml10->out;
2582 * It is a handler who processes the PRE tag.
2584 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2585 * destination is specified.
2586 * @param node [i] The PRE tag node is specified.
2587 * @return The conversion result is returned.
2590 s_chtml10_end_pre_tag(void *pdoc, Node *UNUSED(child))
2596 chtml10 = GET_CHTML10(pdoc);
2601 chtml10->pre_flag--;
2603 return chtml10->out;
2608 * It is a handler who processes the P tag.
2610 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2611 * destination is specified.
2612 * @param node [i] The P tag node is specified.
2613 * @return The conversion result is returned.
2616 s_chtml10_start_p_tag(void *pdoc, Node *UNUSED(node))
2622 chtml10 = GET_CHTML10(pdoc);
2627 return chtml10->out;
2632 * It is a handler who processes the P tag.
2634 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2635 * destination is specified.
2636 * @param node [i] The P tag node is specified.
2637 * @return The conversion result is returned.
2640 s_chtml10_end_p_tag(void *pdoc, Node *UNUSED(child))
2646 chtml10 = GET_CHTML10(pdoc);
2651 return chtml10->out;
2656 * It is a handler who processes the TEXTARE tag.
2658 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2659 * destination is specified.
2660 * @param node [i] The TEXTAREA tag node is specified.
2661 * @return The conversion result is returned.
2664 s_chtml10_start_textarea_tag(void *pdoc, Node *node)
2671 chtml10 = GET_CHTML10(pdoc);
2676 chtml10->textarea_flag++;
2678 W10_L("<textarea ");
2680 for (attr = qs_get_attr(doc,node);
2682 attr = qs_get_next_attr(doc,attr)) {
2687 name = qs_get_attr_name (doc,attr);
2688 value = qs_get_attr_value(doc,attr);
2693 if (strcasecmp(name, "name") == 0) {
2702 if (strcasecmp(name, "rows") == 0) {
2711 if (strcasecmp(name, "cols") == 0) {
2724 return chtml10->out;
2729 * It is a handler who processes the TEXTAREA tag.
2731 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2732 * destination is specified.
2733 * @param node [i] The TEXTAREA tag node is specified.
2734 * @return The conversion result is returned.
2737 s_chtml10_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2743 chtml10 = GET_CHTML10(pdoc);
2747 W10_L("</textarea>\r\n");
2748 chtml10->textarea_flag--;
2750 return chtml10->out;
2755 s_chtml10_text(void *pdoc, Node *child)
2767 chtml10 = GET_CHTML10(pdoc);
2771 textval = qs_get_node_value(doc,child);
2772 textval = qs_trim_string(r, textval);
2774 if (strlen(textval) == 0)
2775 return chtml10->out;
2777 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2778 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2780 tdst = qs_alloc_zero_byte_string(r);
2781 memset(one_byte, 0, sizeof(one_byte));
2784 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2788 rtn = s_chtml10_search_emoji(chtml10, &textval[ii], &out);
2790 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2795 if (is_sjis_kanji(textval[ii])) {
2796 one_byte[0] = textval[ii+0];
2797 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2798 one_byte[0] = textval[ii+1];
2799 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2803 if (chtml10->pre_flag) {
2804 one_byte[0] = textval[ii+0];
2805 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2808 if (chtml10->textarea_flag) {
2809 one_byte[0] = textval[ii+0];
2810 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2813 if (textval[ii] != '\r' && textval[ii] != '\n') {
2814 one_byte[0] = textval[ii+0];
2815 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2820 return chtml10->out;