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);
91 static char* s_chtml10_start_blockquote_tag (void* pdoc, Node* node);
92 static char* s_chtml10_end_blockquote_tag (void* pdoc, Node* node);
93 static char* s_chtml10_start_dir_tag (void* pdoc, Node* node);
94 static char* s_chtml10_end_dir_tag (void* pdoc, Node* node);
95 static char* s_chtml10_start_dl_tag (void* pdoc, Node* node);
96 static char* s_chtml10_end_dl_tag (void* pdoc, Node* node);
97 static char* s_chtml10_start_dt_tag (void* pdoc, Node* node);
98 static char* s_chtml10_end_dt_tag (void* pdoc, Node* node);
99 static char* s_chtml10_start_dd_tag (void* pdoc, Node* node);
100 static char* s_chtml10_end_dd_tag (void* pdoc, Node* node);
102 static void s_init_chtml10(chtml10_t* chtml, Doc* doc, request_rec* r, device_table* spec);
104 static int s_chtml10_search_emoji(chtml10_t* chtml, char* txt, char** rslt);
105 static char* s_chtml10_chxjif_tag (void* pdoc, Node* node);
106 static char* s_chtml10_text (void* pdoc, Node* node);
108 tag_handler chtml10_handler[] = {
111 s_chtml10_start_html_tag,
112 s_chtml10_end_html_tag,
116 s_chtml10_start_meta_tag,
117 s_chtml10_end_meta_tag,
121 s_chtml10_start_textarea_tag,
122 s_chtml10_end_textarea_tag,
126 s_chtml10_start_p_tag,
131 s_chtml10_start_pre_tag,
132 s_chtml10_end_pre_tag,
136 s_chtml10_start_ul_tag,
137 s_chtml10_end_ul_tag,
141 s_chtml10_start_li_tag,
142 s_chtml10_end_li_tag,
146 s_chtml10_start_ol_tag,
147 s_chtml10_end_ol_tag,
151 s_chtml10_start_h1_tag,
152 s_chtml10_end_h1_tag,
156 s_chtml10_start_h2_tag,
157 s_chtml10_end_h2_tag,
161 s_chtml10_start_h3_tag,
162 s_chtml10_end_h3_tag,
166 s_chtml10_start_h4_tag,
167 s_chtml10_end_h4_tag,
171 s_chtml10_start_h5_tag,
172 s_chtml10_end_h5_tag,
176 s_chtml10_start_h6_tag,
177 s_chtml10_end_h6_tag,
181 s_chtml10_start_head_tag,
182 s_chtml10_end_head_tag,
186 s_chtml10_start_title_tag,
187 s_chtml10_end_title_tag,
191 s_chtml10_start_base_tag,
192 s_chtml10_end_base_tag,
196 s_chtml10_start_body_tag,
197 s_chtml10_end_body_tag,
201 s_chtml10_start_a_tag,
206 s_chtml10_start_br_tag,
207 s_chtml10_end_br_tag,
216 s_chtml10_start_tr_tag,
217 s_chtml10_end_tr_tag,
231 s_chtml10_start_font_tag,
232 s_chtml10_end_font_tag,
236 s_chtml10_start_form_tag,
237 s_chtml10_end_form_tag,
241 s_chtml10_start_input_tag,
242 s_chtml10_end_input_tag,
246 s_chtml10_start_center_tag,
247 s_chtml10_end_center_tag,
251 s_chtml10_start_hr_tag,
252 s_chtml10_end_hr_tag,
256 s_chtml10_start_img_tag,
257 s_chtml10_end_img_tag,
261 s_chtml10_start_select_tag,
262 s_chtml10_end_select_tag,
266 s_chtml10_start_option_tag,
267 s_chtml10_end_option_tag,
271 s_chtml10_start_div_tag,
272 s_chtml10_end_div_tag,
276 s_chtml10_chxjif_tag,
321 s_chtml10_start_dt_tag,
322 s_chtml10_end_dt_tag,
336 s_chtml10_start_blockquote_tag,
337 s_chtml10_end_blockquote_tag,
341 s_chtml10_start_dir_tag,
342 s_chtml10_end_dir_tag,
346 s_chtml10_start_dl_tag,
347 s_chtml10_end_dl_tag,
351 s_chtml10_start_dd_tag,
352 s_chtml10_end_dd_tag,
358 * converts from CHTML5.0 to CHTML1.0.
360 * @param r [i] Requet_rec is appointed.
361 * @param spec [i] The result of the device specification processing which
362 * was done in advance is appointed.
363 * @param src [i] The character string before the converting is appointed.
364 * @return The character string after the converting is returned.
367 chxj_exchange_chtml10(
373 chxjconvrule_entry* entryp,
386 DBG(r, "start chxj_exchange_chtml10() cookie_id=[%s]", (cookie) ? cookie->cookie_id : "");
388 /*--------------------------------------------------------------------------*/
390 /*--------------------------------------------------------------------------*/
392 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
394 DBG(r,"i found qrcode xml");
397 DBG(r,"not found qrcode xml");
399 /*--------------------------------------------------------------------------*/
400 /* The CHTML structure is initialized. */
401 /*--------------------------------------------------------------------------*/
402 s_init_chtml10(&chtml10, &doc, r, spec);
403 chtml10.entryp = entryp;
404 chtml10.cookie = cookie;
406 chxj_set_content_type(r, "text/html; charset=Windows-31J");
408 /*--------------------------------------------------------------------------*/
409 /* The character string of the input is analyzed. */
410 /*--------------------------------------------------------------------------*/
411 qs_init_malloc(&doc);
412 qs_init_root_node(&doc);
414 ss = apr_pcalloc(r->pool, srclen + 1);
415 memset(ss, 0, srclen + 1);
416 memcpy(ss, src, srclen);
419 chxj_dump_out("[src] CHTML -> CHTML1.0", ss, srclen);
422 qs_parse_string(&doc,ss, strlen(ss));
424 chxj_buffered_write_init(r->pool, &doc.buf);
425 /*--------------------------------------------------------------------------*/
426 /* It converts it from CHTML to CHTML. */
427 /*--------------------------------------------------------------------------*/
428 chxj_node_exchange(spec,r,(void*)&chtml10, &doc, qs_get_root(&doc), 0);
429 chtml10.out = chxj_buffered_write_flush(chtml10.out, &doc.buf);
430 dst = apr_pstrdup(r->pool, chtml10.out);
431 chxj_buffered_write_terminate(&doc.buf);
433 qs_all_free(&doc,QX_LOGMARK);
436 return apr_pstrdup(r->pool,ss);
439 if (strlen(dst) == 0) {
440 dst = apr_psprintf(r->pool, "\n");
442 *dstlen = strlen(dst);
445 chxj_dump_out("[dst] CHTML -> CHTML1.0", dst, *dstlen);
448 DBG(r, "end chxj_exchange_chtml10() cookie_id=[%s] time=[%lld]", (cookie) ? cookie->cookie_id : "", apr_time_now() - t);
455 * The CHTML structure is initialized.
457 * @param chtml10 [i/o] The pointer to the HDML structure that wants to be
458 * initialized is specified.
459 * @param doc [i] The Doc structure that should be set to the initialized
460 * HDML structure is specified.
461 * @param r [i] To use POOL, the pointer to request_rec is specified.
462 * @param spec [i] The pointer to the device_table
471 memset(doc, 0, sizeof(Doc));
472 memset(chtml10, 0, sizeof(chtml10_t));
476 chtml10->spec = spec;
477 chtml10->out = qs_alloc_zero_byte_string(r);
478 chtml10->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
479 chtml10->doc->parse_mode = PARSE_MODE_CHTML;
484 * Corresponding EMOJI to a current character-code is retrieved.
485 * The substitution character string is stored in the rslt pointer if agreeing.
487 * @param chtml10 [i] The pointer to the CHTML structure is specified.
488 * @param txt [i] The character string to want to examine whether it is
489 * EMOJI is specified.
490 * @param rslt [o] The pointer to the pointer that stores the result is
492 * @return When corresponding EMOJI exists, it returns it excluding 0.
495 s_chtml10_search_emoji(chtml10_t* chtml10, char* txt, char** rslt)
502 spec = chtml10->spec;
508 DBG(r,"spec is NULL");
511 for (ee = chtml10->conf->emoji;
516 DBG(r,"emoji->imode is NULL");
520 if (ee->imode->string
522 && strlen(ee->imode->string) > 0
523 && *ee->imode->string == *txt
524 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
525 if (!spec || !spec->emoji_type) {
526 *rslt = apr_palloc(r->pool, 3);
527 (*rslt)[0] = ee->imode->hex1byte & 0xff;
528 (*rslt)[1] = ee->imode->hex2byte & 0xff;
530 return strlen(ee->imode->string);
541 * It is a handler who processes the HTML tag.
543 * @param chtml10 [i/o] The pointer to the CHTML structure at the output
544 * destination is specified.
545 * @param node [i] The HTML tag node is specified.
546 * @return The conversion result is returned.
549 s_chtml10_start_html_tag(void* pdoc, Node* UNUSED(node))
555 chtml10 = GET_CHTML10(pdoc);
559 /*--------------------------------------------------------------------------*/
561 /*--------------------------------------------------------------------------*/
569 * It is a handler who processes the HTML tag.
571 * @param pdoc [i/o] The pointer to the CHTML structure at the output
572 * destination is specified.
573 * @param node [i] The HTML tag node is specified.
574 * @return The conversion result is returned.
577 s_chtml10_end_html_tag(void* pdoc, Node* UNUSED(child))
584 chtml10 = GET_CHTML10(pdoc);
595 * It is a handler who processes the META tag.
597 * @param pdoc [i/o] The pointer to the CHTML structure at the output
598 * destination is specified.
599 * @param node [i] The META tag node is specified.
600 * @return The conversion result is returned.
603 s_chtml10_start_meta_tag(void* pdoc, Node* UNUSED(node))
607 chtml10 = GET_CHTML10(pdoc);
616 * It is a handler who processes the META tag.
618 * @param pdoc [i/o] The pointer to the CHTML structure at the output
619 * destination is specified.
620 * @param node [i] The META tag node is specified.
621 * @return The conversion result is returned.
624 s_chtml10_end_meta_tag(void* pdoc, Node* UNUSED(child))
628 chtml10 = GET_CHTML10(pdoc);
635 * It is a handler who processes the HEAD tag.
637 * @param pdoc [i/o] The pointer to the CHTML structure at the output
638 * destination is specified.
639 * @param node [i] The HEAD tag node is specified.
640 * @return The conversion result is returned.
643 s_chtml10_start_head_tag(void* pdoc, Node* UNUSED(node))
649 chtml10 = GET_CHTML10(pdoc);
660 * It is a handler who processes the HEAD tag.
662 * @param pdoc [i/o] The pointer to the CHTML structure at the output
663 * destination is specified.
664 * @param node [i] The HEAD tag node is specified.
665 * @return The conversion result is returned.
668 s_chtml10_end_head_tag(void* pdoc, Node* UNUSED(child))
674 chtml10 = GET_CHTML10(pdoc);
685 * It is a handler who processes the OL tag.
687 * @param pdoc [i/o] The pointer to the CHTML structure at the output
688 * destination is specified.
689 * @param node [i] The OL tag node is specified.
690 * @return The conversion result is returned.
693 s_chtml10_start_ol_tag(void* pdoc, Node* UNUSED(node))
699 chtml10 = GET_CHTML10(pdoc);
710 * It is a handler who processes the OL tag.
712 * @param pdoc [i/o] The pointer to the CHTML structure at the output
713 * destination is specified.
714 * @param node [i] The OL tag node is specified.
715 * @return The conversion result is returned.
718 s_chtml10_end_ol_tag(void* pdoc, Node* UNUSED(child))
724 chtml10 = GET_CHTML10(pdoc);
735 * It is a handler who processes the UL tag.
737 * @param pdoc [i/o] The pointer to the CHTML structure at the output
738 * destination is specified.
739 * @param node [i] The UL tag node is specified.
740 * @return The conversion result is returned.
743 s_chtml10_start_ul_tag(void* pdoc, Node* UNUSED(node))
749 chtml10 = GET_CHTML10(pdoc);
760 * It is a handler who processes the UL tag.
762 * @param pdoc [i/o] The pointer to the CHTML structure at the output
763 * destination is specified.
764 * @param node [i] The UL tag node is specified.
765 * @return The conversion result is returned.
768 s_chtml10_end_ul_tag(void* pdoc, Node* UNUSED(child))
774 chtml10 = GET_CHTML10(pdoc);
785 * It is a handler who processes the LI tag.
787 * @param pdoc [i/o] The pointer to the CHTML structure at the output
788 * destination is specified.
789 * @param node [i] The LI tag node is specified.
790 * @return The conversion result is returned.
793 s_chtml10_start_li_tag(void* pdoc, Node* UNUSED(node))
799 chtml10 = GET_CHTML10(pdoc);
810 * It is a handler who processes the LI tag.
812 * @param pdoc [i/o] The pointer to the CHTML structure at the output
813 * destination is specified.
814 * @param node [i] The LI tag node is specified.
815 * @return The conversion result is returned.
818 s_chtml10_end_li_tag(void* pdoc, Node* UNUSED(child))
821 chtml10 = GET_CHTML10(pdoc);
827 * It is a handler who processes the H1 tag.
829 * @param pdoc [i/o] The pointer to the CHTML structure at the output
830 * destination is specified.
831 * @param node [i] The H1 tag node is specified.
832 * @return The conversion result is returned.
835 s_chtml10_start_h1_tag(void* pdoc, Node* UNUSED(node))
841 chtml10 = GET_CHTML10(pdoc);
852 * It is a handler who processes the H1 tag.
854 * @param pdoc [i/o] The pointer to the CHTML structure at the output
855 * destination is specified.
856 * @param node [i] The H1 tag node is specified.
857 * @return The conversion result is returned.
860 s_chtml10_end_h1_tag(void* pdoc, Node* UNUSED(child))
866 chtml10 = GET_CHTML10(pdoc);
877 * It is a handler who processes the H2 tag.
879 * @param pdoc [i/o] The pointer to the CHTML structure at the output
880 * destination is specified.
881 * @param node [i] The H2 tag node is specified.
882 * @return The conversion result is returned.
885 s_chtml10_start_h2_tag(void* pdoc, Node* UNUSED(node))
891 chtml10 = GET_CHTML10(pdoc);
902 * It is a handler who processes the H2 tag.
904 * @param pdoc [i/o] The pointer to the CHTML structure at the output
905 * destination is specified.
906 * @param node [i] The H2 tag node is specified.
907 * @return The conversion result is returned.
910 s_chtml10_end_h2_tag(void* pdoc, Node* UNUSED(child))
916 chtml10 = GET_CHTML10(pdoc);
927 * It is a handler who processes the H3 tag.
929 * @param pdoc [i/o] The pointer to the CHTML structure at the output
930 * destination is specified.
931 * @param node [i] The H3 tag node is specified.
932 * @return The conversion result is returned.
935 s_chtml10_start_h3_tag(void* pdoc, Node* UNUSED(node))
941 chtml10 = GET_CHTML10(pdoc);
952 * It is a handler who processes the H3 tag.
954 * @param pdoc [i/o] The pointer to the CHTML structure at the output
955 * destination is specified.
956 * @param node [i] The H3 tag node is specified.
957 * @return The conversion result is returned.
960 s_chtml10_end_h3_tag(void* pdoc, Node* UNUSED(child))
966 chtml10 = GET_CHTML10(pdoc);
977 * It is a handler who processes the H4 tag.
979 * @param pdoc [i/o] The pointer to the CHTML structure at the output
980 * destination is specified.
981 * @param node [i] The H4 tag node is specified.
982 * @return The conversion result is returned.
985 s_chtml10_start_h4_tag(void* pdoc, Node* UNUSED(node))
991 chtml10 = GET_CHTML10(pdoc);
1002 * It is a handler who processes the H4 tag.
1004 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1005 * destination is specified.
1006 * @param node [i] The H4 tag node is specified.
1007 * @return The conversion result is returned.
1010 s_chtml10_end_h4_tag(void* pdoc, Node* UNUSED(child))
1016 chtml10 = GET_CHTML10(pdoc);
1022 return chtml10->out;
1027 * It is a handler who processes the H5 tag.
1029 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1030 * destination is specified.
1031 * @param node [i] The H5 tag node is specified.
1032 * @return The conversion result is returned.
1035 s_chtml10_start_h5_tag(void* pdoc, Node* UNUSED(node))
1041 chtml10 = GET_CHTML10(pdoc);
1047 return chtml10->out;
1052 * It is a handler who processes the H5 tag.
1054 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1055 * destination is specified.
1056 * @param node [i] The H5 tag node is specified.
1057 * @return The conversion result is returned.
1060 s_chtml10_end_h5_tag(void* pdoc, Node* UNUSED(child))
1066 chtml10 = GET_CHTML10(pdoc);
1072 return chtml10->out;
1077 * It is a handler who processes the H6 tag.
1079 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1080 * destination is specified.
1081 * @param node [i] The H6 tag node is specified.
1082 * @return The conversion result is returned.
1085 s_chtml10_start_h6_tag(void* pdoc, Node* UNUSED(node))
1091 chtml10 = GET_CHTML10(pdoc);
1097 return chtml10->out;
1102 * It is a handler who processes the H6 tag.
1104 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1105 * destination is specified.
1106 * @param node [i] The H6 tag node is specified.
1107 * @return The conversion result is returned.
1110 s_chtml10_end_h6_tag(void* pdoc, Node* UNUSED(child))
1116 chtml10 = GET_CHTML10(pdoc);
1122 return chtml10->out;
1127 * It is a handler who processes the TITLE tag.
1129 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1130 * destination is specified.
1131 * @param node [i] The TITLE tag node is specified.
1132 * @return The conversion result is returned.
1135 s_chtml10_start_title_tag(void* pdoc, Node* UNUSED(node))
1141 chtml10 = GET_CHTML10(pdoc);
1147 return chtml10->out;
1152 * It is a handler who processes the TITLE tag.
1154 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1155 * destination is specified.
1156 * @param node [i] The TITLE tag node is specified.
1157 * @return The conversion result is returned.
1160 s_chtml10_end_title_tag(void* pdoc, Node* UNUSED(child))
1166 chtml10 = GET_CHTML10(pdoc);
1170 W10_L("</title>\r\n");
1172 return chtml10->out;
1177 * It is a handler who processes the BASE tag.
1179 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1180 * destination is specified.
1181 * @param node [i] The BASE tag node is specified.
1182 * @return The conversion result is returned.
1185 s_chtml10_start_base_tag(void* pdoc, Node* node)
1192 chtml10 = GET_CHTML10(pdoc);
1198 /*--------------------------------------------------------------------------*/
1199 /* Get Attributes */
1200 /*--------------------------------------------------------------------------*/
1201 for (attr = qs_get_attr(doc,node);
1203 attr = qs_get_next_attr(doc,attr)) {
1207 name = qs_get_attr_name(doc,attr);
1208 value = qs_get_attr_value(doc,attr);
1210 if (STRCASEEQ('h','H',"href", name)) {
1219 return chtml10->out;
1224 * It is a handler who processes the BASE tag.
1226 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1227 * destination is specified.
1228 * @param node [i] The BASE tag node is specified.
1229 * @return The conversion result is returned.
1232 s_chtml10_end_base_tag(void* pdoc, Node* UNUSED(child))
1234 chtml10_t* chtml10 = GET_CHTML10(pdoc);
1236 return chtml10->out;
1241 * It is a handler who processes the BODY tag.
1243 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1244 * destination is specified.
1245 * @param node [i] The BODY tag node is specified.
1246 * @return The conversion result is returned.
1249 s_chtml10_start_body_tag(void* pdoc, Node* node)
1256 chtml10 = GET_CHTML10(pdoc);
1263 /*--------------------------------------------------------------------------*/
1264 /* Get Attributes */
1265 /*--------------------------------------------------------------------------*/
1266 for (attr = qs_get_attr(doc,node);
1268 attr = qs_get_next_attr(doc,attr)) {
1272 name = qs_get_attr_name(doc,attr);
1277 if (strcasecmp(name, "alink") == 0) {
1278 /*----------------------------------------------------------------------*/
1280 /*----------------------------------------------------------------------*/
1287 if (strcasecmp(name, "bgcolor") == 0) {
1288 /*----------------------------------------------------------------------*/
1290 /*----------------------------------------------------------------------*/
1297 if (strcasecmp(name, "text") == 0) {
1298 /*----------------------------------------------------------------------*/
1300 /*----------------------------------------------------------------------*/
1307 if (strcasecmp(name, "link") == 0) {
1308 /*----------------------------------------------------------------------*/
1310 /*----------------------------------------------------------------------*/
1317 if (strcasecmp(name, "vlink") == 0) {
1318 /*----------------------------------------------------------------------*/
1320 /*----------------------------------------------------------------------*/
1332 return chtml10->out;
1337 * It is a handler who processes the BODY tag.
1339 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1340 * destination is specified.
1341 * @param node [i] The BODY tag node is specified.
1342 * @return The conversion result is returned.
1345 s_chtml10_end_body_tag(void* pdoc, Node* UNUSED(child))
1351 chtml10 = GET_CHTML10(pdoc);
1357 return chtml10->out;
1362 * It is a handler who processes the A tag.
1364 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1365 * destination is specified.
1366 * @param node [i] The A tag node is specified.
1367 * @return The conversion result is returned.
1370 s_chtml10_start_a_tag(void *pdoc, Node *node)
1377 chtml10 = GET_CHTML10(pdoc);
1383 /*--------------------------------------------------------------------------*/
1384 /* Get Attributes */
1385 /*--------------------------------------------------------------------------*/
1386 for (attr = qs_get_attr(doc,node);
1388 attr = qs_get_next_attr(doc,attr)) {
1393 name = qs_get_attr_name(doc,attr);
1394 value = qs_get_attr_value(doc,attr);
1399 if (strcasecmp(name, "name") == 0) {
1400 /*--------------------------------------------------------------------*/
1402 /*--------------------------------------------------------------------*/
1411 if (strcasecmp(name, "href") == 0) {
1412 /*--------------------------------------------------------------------*/
1414 /*--------------------------------------------------------------------*/
1415 value = chxj_encoding_parameter(r, value);
1416 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
1425 if (strcasecmp(name, "accesskey") == 0) {
1426 /*--------------------------------------------------------------------*/
1428 /*--------------------------------------------------------------------*/
1429 W10_L(" accesskey=\"");
1437 if (strcasecmp(name, "cti") == 0) {
1438 /*--------------------------------------------------------------------*/
1440 /*--------------------------------------------------------------------*/
1447 if (strcasecmp(name, "utn") == 0) {
1448 /*--------------------------------------------------------------------*/
1450 /*--------------------------------------------------------------------*/
1457 if (strcasecmp(name, "telbook") == 0) {
1458 /*--------------------------------------------------------------------*/
1460 /*--------------------------------------------------------------------*/
1467 if (strcasecmp(name, "kana") == 0) {
1468 /*--------------------------------------------------------------------*/
1470 /*--------------------------------------------------------------------*/
1477 if (strcasecmp(name, "email") == 0) {
1478 /*--------------------------------------------------------------------*/
1480 /*--------------------------------------------------------------------*/
1487 if (strcasecmp(name, "ista") == 0) {
1488 /*--------------------------------------------------------------------*/
1490 /*--------------------------------------------------------------------*/
1494 if (strcasecmp(name, "ilet") == 0) {
1495 /*--------------------------------------------------------------------*/
1497 /*--------------------------------------------------------------------*/
1501 if (strcasecmp(name, "iswf") == 0) {
1502 /*--------------------------------------------------------------------*/
1504 /*--------------------------------------------------------------------*/
1508 if (strcasecmp(name, "irst") == 0) {
1509 /*--------------------------------------------------------------------*/
1511 /*--------------------------------------------------------------------*/
1515 if (strcasecmp(name, "ijam") == 0) {
1516 /*--------------------------------------------------------------------*/
1518 /*--------------------------------------------------------------------*/
1529 return chtml10->out;
1534 * It is a handler who processes the A tag.
1536 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1537 * destination is specified.
1538 * @param node [i] The A tag node is specified.
1539 * @return The conversion result is returned.
1542 s_chtml10_end_a_tag(void *pdoc, Node *UNUSED(child))
1548 chtml10 = GET_CHTML10(pdoc);
1553 return chtml10->out;
1558 * It is a handler who processes the BR tag.
1560 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1561 * destination is specified.
1562 * @param node [i] The BR tag node is specified.
1563 * @return The conversion result is returned.
1566 s_chtml10_start_br_tag(void *pdoc, Node *node)
1573 chtml10 = GET_CHTML10(pdoc);
1579 /*--------------------------------------------------------------------------*/
1580 /* Get Attributes */
1581 /*--------------------------------------------------------------------------*/
1582 for (attr = qs_get_attr(doc,node);
1584 attr = qs_get_next_attr(doc,attr)) {
1588 name = qs_get_attr_name(doc,attr);
1589 value = qs_get_attr_value(doc,attr);
1591 if (STRCASEEQ('c','C',"clear",name)) {
1592 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1600 return chtml10->out;
1605 * It is a handler who processes the BR tag.
1607 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1608 * destination is specified.
1609 * @param node [i] The BR tag node is specified.
1610 * @return The conversion result is returned.
1613 s_chtml10_end_br_tag(void *pdoc, Node *UNUSED(child))
1615 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1617 return chtml10->out;
1622 * It is a handler who processes the TR tag.
1624 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1625 * destination is specified.
1626 * @param node [i] The TR tag node is specified.
1627 * @return The conversion result is returned.
1630 s_chtml10_start_tr_tag(void *pdoc, Node *UNUSED(node))
1632 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1634 return chtml10->out;
1639 * It is a handler who processes the TR tag.
1641 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1642 * destination is specified.
1643 * @param node [i] The TR tag node is specified.
1644 * @return The conversion result is returned.
1647 s_chtml10_end_tr_tag(void *pdoc, Node *UNUSED(child))
1653 chtml10 = GET_CHTML10(pdoc);
1659 return chtml10->out;
1664 * It is a handler who processes the FONT tag.
1666 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1667 * destination is specified.
1668 * @param node [i] The FONT tag node is specified.
1669 * @return The conversion result is returned.
1672 s_chtml10_start_font_tag(void *pdoc, Node *UNUSED(node))
1674 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1678 return chtml10->out;
1683 * It is a handler who processes the FONT tag.
1685 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1686 * destination is specified.
1687 * @param node [i] The FONT tag node is specified.
1688 * @return The conversion result is returned.
1691 s_chtml10_end_font_tag(void *pdoc, Node *UNUSED(child))
1693 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1697 return chtml10->out;
1702 * It is a handler who processes the FORM tag.
1704 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1705 * destination is specified.
1706 * @param node [i] The FORM tag node is specified.
1707 * @return The conversion result is returned.
1710 s_chtml10_start_form_tag(void *pdoc, Node *node)
1717 chtml10 = GET_CHTML10(pdoc);
1723 /*--------------------------------------------------------------------------*/
1724 /* Get Attributes */
1725 /*--------------------------------------------------------------------------*/
1726 for (attr = qs_get_attr(doc,node);
1728 attr = qs_get_next_attr(doc,attr)) {
1732 name = qs_get_attr_name(doc,attr);
1733 value = qs_get_attr_value(doc,attr);
1738 if (strcasecmp(name, "action") == 0) {
1739 /*--------------------------------------------------------------------*/
1741 /*--------------------------------------------------------------------*/
1742 value = chxj_encoding_parameter(r, value);
1743 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
1745 W10_L(" action=\"");
1753 if (strcasecmp(name, "method") == 0) {
1754 /*--------------------------------------------------------------------*/
1756 /*--------------------------------------------------------------------*/
1757 W10_L(" method=\"");
1765 if (strcasecmp(name, "utn") == 0) {
1766 /*--------------------------------------------------------------------*/
1768 /*--------------------------------------------------------------------*/
1780 return chtml10->out;
1785 * It is a handler who processes the FORM tag.
1787 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1788 * destination is specified.
1789 * @param node [i] The FORM tag node is specified.
1790 * @return The conversion result is returned.
1793 s_chtml10_end_form_tag(void* pdoc, Node* UNUSED(child))
1799 chtml10 = GET_CHTML10(pdoc);
1805 return chtml10->out;
1810 * It is a handler who processes the INPUT tag.
1812 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1813 * destination is specified.
1814 * @param node [i] The INPUT tag node is specified.
1815 * @return The conversion result is returned.
1818 s_chtml10_start_input_tag(void* pdoc, Node* node)
1832 chtml10 = GET_CHTML10(pdoc);
1847 /*--------------------------------------------------------------------------*/
1848 /* Get Attributes */
1849 /*--------------------------------------------------------------------------*/
1851 type = qs_get_type_attr(doc, node, r);
1852 name = qs_get_name_attr(doc, node, r);
1853 value = qs_get_value_attr(doc,node,r);
1854 istyle = qs_get_istyle_attr(doc,node,r);
1855 max_length = qs_get_maxlength_attr(doc,node,r);
1856 checked = qs_get_checked_attr(doc,node,r);
1857 accesskey = qs_get_accesskey_attr(doc, node, r);
1858 size = qs_get_size_attr(doc, node, r);
1885 W10_L(" accesskey=\"");
1891 /*------------------------------------------------------------------------*/
1893 /*------------------------------------------------------------------------*/
1896 /*--------------------------------------------------------------------------*/
1897 /* The figure is default for the password. */
1898 /*--------------------------------------------------------------------------*/
1900 W10_L(" maxlength=\"");
1910 return chtml10->out;
1915 * It is a handler who processes the INPUT tag.
1917 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1918 * destination is specified.
1919 * @param node [i] The INPUT tag node is specified.
1920 * @return The conversion result is returned.
1923 s_chtml10_end_input_tag(void* pdoc, Node* UNUSED(child))
1925 chtml10_t* chtml10 = GET_CHTML10(pdoc);
1927 return chtml10->out;
1932 * It is a handler who processes the CENTER tag.
1934 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1935 * destination is specified.
1936 * @param node [i] The CENTER tag node is specified.
1937 * @return The conversion result is returned.
1940 s_chtml10_start_center_tag(void* pdoc, Node* UNUSED(node))
1946 chtml10 = GET_CHTML10(pdoc);
1952 return chtml10->out;
1957 * It is a handler who processes the CENTER tag.
1959 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1960 * destination is specified.
1961 * @param node [i] The CENTER tag node is specified.
1962 * @return The conversion result is returned.
1965 s_chtml10_end_center_tag(void* pdoc, Node* UNUSED(child))
1971 chtml10 = GET_CHTML10(pdoc);
1977 return chtml10->out;
1982 * It is a handler who processes the HR tag.
1984 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1985 * destination is specified.
1986 * @param node [i] The HR tag node is specified.
1987 * @return The conversion result is returned.
1990 s_chtml10_start_hr_tag(void* pdoc, Node* node)
1997 chtml10 = GET_CHTML10(pdoc);
2003 for (attr = qs_get_attr(doc,node);
2005 attr = qs_get_next_attr(doc,attr)) {
2010 name = qs_get_attr_name (doc,attr);
2011 value = qs_get_attr_value(doc,attr);
2016 if (strcasecmp(name, "align") == 0) {
2017 /*--------------------------------------------------------------------*/
2019 /*--------------------------------------------------------------------*/
2028 if (strcasecmp(name, "size") == 0) {
2029 /*--------------------------------------------------------------------*/
2031 /*--------------------------------------------------------------------*/
2040 if (strcasecmp(name, "width") == 0) {
2041 /*--------------------------------------------------------------------*/
2043 /*--------------------------------------------------------------------*/
2052 if (strcasecmp(name, "noshade") == 0) {
2053 /*--------------------------------------------------------------------*/
2055 /*--------------------------------------------------------------------*/
2062 if (strcasecmp(name, "color") == 0) {
2063 /*--------------------------------------------------------------------*/
2065 /*--------------------------------------------------------------------*/
2077 return chtml10->out;
2082 * It is a handler who processes the HR tag.
2084 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2085 * destination is specified.
2086 * @param node [i] The HR tag node is specified.
2087 * @return The conversion result is returned.
2090 s_chtml10_end_hr_tag(void* pdoc, Node* UNUSED(child))
2094 chtml10 = GET_CHTML10(pdoc);
2096 return chtml10->out;
2101 * It is a handler who processes the IMG tag.
2103 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2104 * destination is specified.
2105 * @param node [i] The IMG tag node is specified.
2106 * @return The conversion result is returned.
2109 s_chtml10_start_img_tag(void* pdoc, Node* node)
2115 #ifndef IMG_NOT_CONVERT_FILENAME
2119 chtml10 = GET_CHTML10(pdoc);
2120 #ifndef IMG_NOT_CONVERT_FILENAME
2121 spec = chtml10->spec;
2127 /*--------------------------------------------------------------------------*/
2128 /* Get Attributes */
2129 /*--------------------------------------------------------------------------*/
2130 for (attr = qs_get_attr(doc,node);
2132 attr = qs_get_next_attr(doc,attr)) {
2137 name = qs_get_attr_name (doc,attr);
2138 value = qs_get_attr_value(doc,attr);
2143 if (strcasecmp(name, "src") == 0) {
2144 /*--------------------------------------------------------------------*/
2146 /*--------------------------------------------------------------------*/
2147 #ifdef IMG_NOT_CONVERT_FILENAME
2148 value = chxj_encoding_parameter(r, value);
2149 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
2151 value = apr_psprintf(r->pool,
2154 (strchr(value, '?')) ? '&' : '?',
2155 CHXJ_COOKIE_NOUPDATE_PARAM);
2161 value = chxj_img_conv(r, spec, value);
2162 value = chxj_encoding_parameter(r, value);
2163 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
2165 value = apr_psprintf(r->pool,
2168 (strchr(value, '?')) ? '&' : '?',
2169 CHXJ_COOKIE_NOUPDATE_PARAM);
2180 if (strcasecmp(name, "align" ) == 0) {
2181 /*--------------------------------------------------------------------*/
2183 /*--------------------------------------------------------------------*/
2184 /*--------------------------------------------------------------------*/
2186 /*--------------------------------------------------------------------*/
2192 if (strcasecmp(name, "alt" ) == 0) {
2193 /*--------------------------------------------------------------------*/
2195 /*--------------------------------------------------------------------*/
2204 if (strcasecmp(name, "width" ) == 0) {
2205 /*--------------------------------------------------------------------*/
2207 /*--------------------------------------------------------------------*/
2216 if (strcasecmp(name, "height") == 0) {
2217 /*--------------------------------------------------------------------*/
2219 /*--------------------------------------------------------------------*/
2220 W10_L(" height=\"");
2225 if (strcasecmp(name, "hspace") == 0) {
2226 /*--------------------------------------------------------------------*/
2228 /*--------------------------------------------------------------------*/
2229 W10_L(" hspace=\"");
2237 if (strcasecmp(name, "vspace") == 0) {
2238 /*--------------------------------------------------------------------*/
2240 /*--------------------------------------------------------------------*/
2241 W10_L(" vspace=\"");
2253 return chtml10->out;
2258 * It is a handler who processes the IMG tag.
2260 * @param chtml10 [i/o] The pointer to the CHTML structure at the output
2261 * destination is specified.
2262 * @param node [i] The IMG tag node is specified.
2263 * @return The conversion result is returned.
2266 s_chtml10_end_img_tag(void *pdoc, Node *UNUSED(child))
2270 chtml10 = GET_CHTML10(pdoc);
2272 return chtml10->out;
2277 * It is a handler who processes the SELECT tag.
2279 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2280 * destination is specified.
2281 * @param node [i] The SELECT tag node is specified.
2282 * @return The conversion result is returned.
2285 s_chtml10_start_select_tag(void *pdoc, Node *child)
2295 chtml10 = GET_CHTML10(pdoc);
2303 for (attr = qs_get_attr(doc,child);
2305 attr = qs_get_next_attr(doc,attr)) {
2309 nm = qs_get_attr_name (doc,attr);
2310 val = qs_get_attr_value(doc,attr);
2315 if (strcasecmp(nm, "size") == 0) {
2316 /*--------------------------------------------------------------------*/
2317 /* CHTML 1.0 version 2.0 */
2318 /*--------------------------------------------------------------------*/
2319 size = apr_pstrdup(doc->buf.pool, val);
2325 if (strcasecmp(nm, "name") == 0) {
2326 /*--------------------------------------------------------------------*/
2327 /* CHTML 1.0 version 2.0 */
2328 /*--------------------------------------------------------------------*/
2329 name = apr_pstrdup(doc->buf.pool, val);
2335 if (strcasecmp(nm, "multiple") == 0) {
2336 /*--------------------------------------------------------------------*/
2337 /* CHTML 1.0 version 2.0 */
2338 /*--------------------------------------------------------------------*/
2361 return chtml10->out;
2366 * It is a handler who processes the SELECT tag.
2368 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2369 * destination is specified.
2370 * @param node [i] The SELECT tag node is specified.
2371 * @return The conversion result is returned.
2374 s_chtml10_end_select_tag(void *pdoc, Node *UNUSED(child))
2380 chtml10 = GET_CHTML10(pdoc);
2384 W10_L("</select>\r\n");
2385 return chtml10->out;
2390 * It is a handler who processes the OPTION tag.
2392 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2393 * destination is specified.
2394 * @param node [i] The OPTION tag node is specified.
2395 * @return The conversion result is returned.
2398 s_chtml10_start_option_tag(void *pdoc, Node *child)
2408 chtml10 = GET_CHTML10(pdoc);
2417 for (attr = qs_get_attr(doc,child);
2419 attr = qs_get_next_attr(doc,attr)) {
2423 nm = qs_get_attr_name (doc,attr);
2424 val = qs_get_attr_value(doc,attr);
2429 if (strcasecmp(nm, "selected") == 0) {
2430 /*--------------------------------------------------------------------*/
2431 /* CHTML 1.0 version 2.0 */
2432 /*--------------------------------------------------------------------*/
2433 selected = apr_pstrdup(doc->buf.pool, val);
2439 if (strcasecmp(nm, "value") == 0) {
2440 /*--------------------------------------------------------------------*/
2441 /* CHTML 1.0 version 2.0 */
2442 /*--------------------------------------------------------------------*/
2443 value = apr_pstrdup(doc->buf.pool, val);
2458 W10_L(" value=\"\"");
2462 W10_L(" selected ");
2466 return chtml10->out;
2471 * It is a handler who processes the OPTION tag.
2473 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2474 * destination is specified.
2475 * @param node [i] The OPTION tag node is specified.
2476 * @return The conversion result is returned.
2479 s_chtml10_end_option_tag(void *pdoc, Node *UNUSED(child))
2483 chtml10 = GET_CHTML10(pdoc);
2487 return chtml10->out;
2492 * It is a handler who processes the DIV tag.
2494 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2495 * destination is specified.
2496 * @param node [i] The DIV tag node is specified.
2497 * @return The conversion result is returned.
2500 s_chtml10_start_div_tag(void *pdoc, Node *child)
2509 chtml10 = GET_CHTML10(pdoc);
2517 for (attr = qs_get_attr(doc,child);
2519 attr = qs_get_next_attr(doc,attr)) {
2524 nm = qs_get_attr_name(doc,attr);
2525 val = qs_get_attr_value(doc,attr);
2527 if (STRCASEEQ('a','A',"align", nm)) {
2528 /*----------------------------------------------------------------------*/
2529 /* CHTML 1.0 (W3C version 3.2) */
2530 /*----------------------------------------------------------------------*/
2531 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2532 align = apr_pstrdup(doc->buf.pool, val);
2544 return chtml10->out;
2549 * It is a handler who processes the DIV tag.
2551 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2552 * destination is specified.
2553 * @param node [i] The DIV tag node is specified.
2554 * @return The conversion result is returned.
2557 s_chtml10_end_div_tag(void *pdoc, Node *UNUSED(child))
2563 chtml10 = GET_CHTML10(pdoc);
2568 return chtml10->out;
2573 * It is a handler who processes the CHXJ:IF tag.
2575 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2576 * destination is specified.
2577 * @param node [i] The CHXJ:IF tag node is specified.
2578 * @return The conversion result is returned.
2581 s_chtml10_chxjif_tag(void *pdoc, Node *node)
2588 chtml10 = GET_CHTML10(pdoc);
2592 for (child = qs_get_child_node(doc, node);
2594 child = qs_get_next_node(doc, child)) {
2595 W10_V(child->otext);
2596 s_chtml10_chxjif_tag(chtml10, child);
2599 return chtml10->out;
2604 * It is a handler who processes the PRE tag.
2606 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2607 * destination is specified.
2608 * @param node [i] The PRE tag node is specified.
2609 * @return The conversion result is returned.
2612 s_chtml10_start_pre_tag(void *pdoc, Node *UNUSED(node))
2618 chtml10 = GET_CHTML10(pdoc);
2622 chtml10->pre_flag++;
2624 return chtml10->out;
2629 * It is a handler who processes the PRE tag.
2631 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2632 * destination is specified.
2633 * @param node [i] The PRE tag node is specified.
2634 * @return The conversion result is returned.
2637 s_chtml10_end_pre_tag(void *pdoc, Node *UNUSED(child))
2643 chtml10 = GET_CHTML10(pdoc);
2648 chtml10->pre_flag--;
2650 return chtml10->out;
2655 * It is a handler who processes the P tag.
2657 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2658 * destination is specified.
2659 * @param node [i] The P tag node is specified.
2660 * @return The conversion result is returned.
2663 s_chtml10_start_p_tag(void *pdoc, Node *UNUSED(node))
2669 chtml10 = GET_CHTML10(pdoc);
2674 return chtml10->out;
2679 * It is a handler who processes the P tag.
2681 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2682 * destination is specified.
2683 * @param node [i] The P tag node is specified.
2684 * @return The conversion result is returned.
2687 s_chtml10_end_p_tag(void *pdoc, Node *UNUSED(child))
2693 chtml10 = GET_CHTML10(pdoc);
2698 return chtml10->out;
2703 * It is a handler who processes the TEXTARE tag.
2705 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2706 * destination is specified.
2707 * @param node [i] The TEXTAREA tag node is specified.
2708 * @return The conversion result is returned.
2711 s_chtml10_start_textarea_tag(void *pdoc, Node *node)
2718 chtml10 = GET_CHTML10(pdoc);
2723 chtml10->textarea_flag++;
2725 W10_L("<textarea ");
2727 for (attr = qs_get_attr(doc,node);
2729 attr = qs_get_next_attr(doc,attr)) {
2734 name = qs_get_attr_name (doc,attr);
2735 value = qs_get_attr_value(doc,attr);
2740 if (strcasecmp(name, "name") == 0) {
2749 if (strcasecmp(name, "rows") == 0) {
2758 if (strcasecmp(name, "cols") == 0) {
2771 return chtml10->out;
2776 * It is a handler who processes the TEXTAREA tag.
2778 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2779 * destination is specified.
2780 * @param node [i] The TEXTAREA tag node is specified.
2781 * @return The conversion result is returned.
2784 s_chtml10_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2790 chtml10 = GET_CHTML10(pdoc);
2794 W10_L("</textarea>\r\n");
2795 chtml10->textarea_flag--;
2797 return chtml10->out;
2802 s_chtml10_text(void *pdoc, Node *child)
2814 chtml10 = GET_CHTML10(pdoc);
2818 textval = qs_get_node_value(doc,child);
2819 textval = qs_trim_string(r, textval);
2821 if (strlen(textval) == 0)
2822 return chtml10->out;
2824 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2825 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2827 tdst = qs_alloc_zero_byte_string(r);
2828 memset(one_byte, 0, sizeof(one_byte));
2831 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2835 rtn = s_chtml10_search_emoji(chtml10, &textval[ii], &out);
2837 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2842 if (is_sjis_kanji(textval[ii])) {
2843 one_byte[0] = textval[ii+0];
2844 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2845 one_byte[0] = textval[ii+1];
2846 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2850 if (chtml10->pre_flag) {
2851 one_byte[0] = textval[ii+0];
2852 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2855 if (chtml10->textarea_flag) {
2856 one_byte[0] = textval[ii+0];
2857 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2860 if (textval[ii] != '\r' && textval[ii] != '\n') {
2861 one_byte[0] = textval[ii+0];
2862 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2867 return chtml10->out;
2872 * It is a handler who processes the BLOCKQUOTE tag.
2874 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2875 * destination is specified.
2876 * @param node [i] The BLOCKQUOTE tag node is specified.
2877 * @return The conversion result is returned.
2880 s_chtml10_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2884 chtml10 = GET_CHTML10(pdoc);
2886 W10_L("<blockquote>");
2887 return chtml10->out;
2892 * It is a handler who processes the BLOCKQUOTE tag.
2894 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2895 * destination is specified.
2896 * @param node [i] The BLOCKQUOTE tag node is specified.
2897 * @return The conversion result is returned.
2900 s_chtml10_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2905 chtml10 = GET_CHTML10(pdoc);
2907 W10_L("</blockquote>");
2908 return chtml10->out;
2913 * It is a handler who processes the DIR tag.
2915 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2916 * destination is specified.
2917 * @param node [i] The DIR tag node is specified.
2918 * @return The conversion result is returned.
2921 s_chtml10_start_dir_tag(void *pdoc, Node *UNUSED(child))
2925 chtml10 = GET_CHTML10(pdoc);
2928 return chtml10->out;
2933 * It is a handler who processes the DIR tag.
2935 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2936 * destination is specified.
2937 * @param node [i] The DIR tag node is specified.
2938 * @return The conversion result is returned.
2941 s_chtml10_end_dir_tag(void *pdoc, Node *UNUSED(child))
2946 chtml10 = GET_CHTML10(pdoc);
2949 return chtml10->out;
2954 * It is a handler who processes the DL tag.
2956 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2957 * destination is specified.
2958 * @param node [i] The DL tag node is specified.
2959 * @return The conversion result is returned.
2962 s_chtml10_start_dl_tag(void *pdoc, Node *UNUSED(child))
2966 chtml10 = GET_CHTML10(pdoc);
2969 return chtml10->out;
2974 * It is a handler who processes the DL tag.
2976 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2977 * destination is specified.
2978 * @param node [i] The DL tag node is specified.
2979 * @return The conversion result is returned.
2982 s_chtml10_end_dl_tag(void *pdoc, Node *UNUSED(child))
2986 chtml10 = GET_CHTML10(pdoc);
2989 return chtml10->out;
2994 * It is a handter who processes the DT tag.
2996 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2997 * destination is specified.
2998 * @param node [i] The DT tag node is specified.
2999 * @return The conversion result is returned.
3002 s_chtml10_start_dt_tag(void *pdoc, Node *UNUSED(child))
3006 chtml10 = GET_CHTML10(pdoc);
3009 return chtml10->out;
3014 * It is a handter who processes the DT tag.
3016 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3017 * destination is specified.
3018 * @param node [i] The DT tag node is specified.
3019 * @return The conversion result is returned.
3022 s_chtml10_end_dt_tag(void *pdoc, Node *UNUSED(child))
3025 chtml10 = GET_CHTML10(pdoc);
3026 return chtml10->out;
3031 * It is a handder who processes the DD tag.
3033 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3034 * destination is specified.
3035 * @param node [i] The DD tag node is specified.
3036 * @return The conversion result is returned.
3039 s_chtml10_start_dd_tag(void *pdoc, Node *UNUSED(child))
3043 chtml10 = GET_CHTML10(pdoc);
3046 return chtml10->out;
3051 * It is a handder who processes the DD tag.
3053 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3054 * destination is specified.
3055 * @param node [i] The DD tag node is specified.
3056 * @return The conversion result is returned.
3059 s_chtml10_end_dd_tag(void *pdoc, Node *UNUSED(child))
3062 chtml10 = GET_CHTML10(pdoc);
3063 return chtml10->out;