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* node)
842 chtml10 = GET_CHTML10(pdoc);
847 for (attr = qs_get_attr(doc,node);
849 attr = qs_get_next_attr(doc,attr)) {
852 name = qs_get_attr_name(doc,attr);
853 value = qs_get_attr_value(doc,attr);
854 if (STRCASEEQ('a','A',"align", name)) {
855 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
870 * It is a handler who processes the H1 tag.
872 * @param pdoc [i/o] The pointer to the CHTML structure at the output
873 * destination is specified.
874 * @param node [i] The H1 tag node is specified.
875 * @return The conversion result is returned.
878 s_chtml10_end_h1_tag(void* pdoc, Node* UNUSED(child))
884 chtml10 = GET_CHTML10(pdoc);
895 * It is a handler who processes the H2 tag.
897 * @param pdoc [i/o] The pointer to the CHTML structure at the output
898 * destination is specified.
899 * @param node [i] The H2 tag node is specified.
900 * @return The conversion result is returned.
903 s_chtml10_start_h2_tag(void* pdoc, Node* UNUSED(node))
909 chtml10 = GET_CHTML10(pdoc);
920 * It is a handler who processes the H2 tag.
922 * @param pdoc [i/o] The pointer to the CHTML structure at the output
923 * destination is specified.
924 * @param node [i] The H2 tag node is specified.
925 * @return The conversion result is returned.
928 s_chtml10_end_h2_tag(void* pdoc, Node* UNUSED(child))
934 chtml10 = GET_CHTML10(pdoc);
945 * It is a handler who processes the H3 tag.
947 * @param pdoc [i/o] The pointer to the CHTML structure at the output
948 * destination is specified.
949 * @param node [i] The H3 tag node is specified.
950 * @return The conversion result is returned.
953 s_chtml10_start_h3_tag(void* pdoc, Node* UNUSED(node))
959 chtml10 = GET_CHTML10(pdoc);
970 * It is a handler who processes the H3 tag.
972 * @param pdoc [i/o] The pointer to the CHTML structure at the output
973 * destination is specified.
974 * @param node [i] The H3 tag node is specified.
975 * @return The conversion result is returned.
978 s_chtml10_end_h3_tag(void* pdoc, Node* UNUSED(child))
984 chtml10 = GET_CHTML10(pdoc);
995 * It is a handler who processes the H4 tag.
997 * @param pdoc [i/o] The pointer to the CHTML structure at the output
998 * destination is specified.
999 * @param node [i] The H4 tag node is specified.
1000 * @return The conversion result is returned.
1003 s_chtml10_start_h4_tag(void* pdoc, Node* UNUSED(node))
1009 chtml10 = GET_CHTML10(pdoc);
1015 return chtml10->out;
1020 * It is a handler who processes the H4 tag.
1022 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1023 * destination is specified.
1024 * @param node [i] The H4 tag node is specified.
1025 * @return The conversion result is returned.
1028 s_chtml10_end_h4_tag(void* pdoc, Node* UNUSED(child))
1034 chtml10 = GET_CHTML10(pdoc);
1040 return chtml10->out;
1045 * It is a handler who processes the H5 tag.
1047 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1048 * destination is specified.
1049 * @param node [i] The H5 tag node is specified.
1050 * @return The conversion result is returned.
1053 s_chtml10_start_h5_tag(void* pdoc, Node* UNUSED(node))
1059 chtml10 = GET_CHTML10(pdoc);
1065 return chtml10->out;
1070 * It is a handler who processes the H5 tag.
1072 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1073 * destination is specified.
1074 * @param node [i] The H5 tag node is specified.
1075 * @return The conversion result is returned.
1078 s_chtml10_end_h5_tag(void* pdoc, Node* UNUSED(child))
1084 chtml10 = GET_CHTML10(pdoc);
1090 return chtml10->out;
1095 * It is a handler who processes the H6 tag.
1097 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1098 * destination is specified.
1099 * @param node [i] The H6 tag node is specified.
1100 * @return The conversion result is returned.
1103 s_chtml10_start_h6_tag(void* pdoc, Node* UNUSED(node))
1109 chtml10 = GET_CHTML10(pdoc);
1115 return chtml10->out;
1120 * It is a handler who processes the H6 tag.
1122 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1123 * destination is specified.
1124 * @param node [i] The H6 tag node is specified.
1125 * @return The conversion result is returned.
1128 s_chtml10_end_h6_tag(void* pdoc, Node* UNUSED(child))
1134 chtml10 = GET_CHTML10(pdoc);
1140 return chtml10->out;
1145 * It is a handler who processes the TITLE tag.
1147 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1148 * destination is specified.
1149 * @param node [i] The TITLE tag node is specified.
1150 * @return The conversion result is returned.
1153 s_chtml10_start_title_tag(void* pdoc, Node* UNUSED(node))
1159 chtml10 = GET_CHTML10(pdoc);
1165 return chtml10->out;
1170 * It is a handler who processes the TITLE tag.
1172 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1173 * destination is specified.
1174 * @param node [i] The TITLE tag node is specified.
1175 * @return The conversion result is returned.
1178 s_chtml10_end_title_tag(void* pdoc, Node* UNUSED(child))
1184 chtml10 = GET_CHTML10(pdoc);
1190 return chtml10->out;
1195 * It is a handler who processes the BASE tag.
1197 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1198 * destination is specified.
1199 * @param node [i] The BASE tag node is specified.
1200 * @return The conversion result is returned.
1203 s_chtml10_start_base_tag(void* pdoc, Node* node)
1210 chtml10 = GET_CHTML10(pdoc);
1216 /*--------------------------------------------------------------------------*/
1217 /* Get Attributes */
1218 /*--------------------------------------------------------------------------*/
1219 for (attr = qs_get_attr(doc,node);
1221 attr = qs_get_next_attr(doc,attr)) {
1225 name = qs_get_attr_name(doc,attr);
1226 value = qs_get_attr_value(doc,attr);
1228 if (STRCASEEQ('h','H',"href", name)) {
1237 return chtml10->out;
1242 * It is a handler who processes the BASE tag.
1244 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1245 * destination is specified.
1246 * @param node [i] The BASE tag node is specified.
1247 * @return The conversion result is returned.
1250 s_chtml10_end_base_tag(void* pdoc, Node* UNUSED(child))
1252 chtml10_t* chtml10 = GET_CHTML10(pdoc);
1254 return chtml10->out;
1259 * It is a handler who processes the BODY tag.
1261 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1262 * destination is specified.
1263 * @param node [i] The BODY tag node is specified.
1264 * @return The conversion result is returned.
1267 s_chtml10_start_body_tag(void* pdoc, Node* node)
1274 chtml10 = GET_CHTML10(pdoc);
1281 /*--------------------------------------------------------------------------*/
1282 /* Get Attributes */
1283 /*--------------------------------------------------------------------------*/
1284 for (attr = qs_get_attr(doc,node);
1286 attr = qs_get_next_attr(doc,attr)) {
1290 name = qs_get_attr_name(doc,attr);
1295 if (strcasecmp(name, "alink") == 0) {
1296 /*----------------------------------------------------------------------*/
1298 /*----------------------------------------------------------------------*/
1305 if (strcasecmp(name, "bgcolor") == 0) {
1306 /*----------------------------------------------------------------------*/
1308 /*----------------------------------------------------------------------*/
1315 if (strcasecmp(name, "text") == 0) {
1316 /*----------------------------------------------------------------------*/
1318 /*----------------------------------------------------------------------*/
1325 if (strcasecmp(name, "link") == 0) {
1326 /*----------------------------------------------------------------------*/
1328 /*----------------------------------------------------------------------*/
1335 if (strcasecmp(name, "vlink") == 0) {
1336 /*----------------------------------------------------------------------*/
1338 /*----------------------------------------------------------------------*/
1350 return chtml10->out;
1355 * It is a handler who processes the BODY tag.
1357 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1358 * destination is specified.
1359 * @param node [i] The BODY tag node is specified.
1360 * @return The conversion result is returned.
1363 s_chtml10_end_body_tag(void* pdoc, Node* UNUSED(child))
1369 chtml10 = GET_CHTML10(pdoc);
1375 return chtml10->out;
1380 * It is a handler who processes the A tag.
1382 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1383 * destination is specified.
1384 * @param node [i] The A tag node is specified.
1385 * @return The conversion result is returned.
1388 s_chtml10_start_a_tag(void *pdoc, Node *node)
1395 chtml10 = GET_CHTML10(pdoc);
1401 /*--------------------------------------------------------------------------*/
1402 /* Get Attributes */
1403 /*--------------------------------------------------------------------------*/
1404 for (attr = qs_get_attr(doc,node);
1406 attr = qs_get_next_attr(doc,attr)) {
1411 name = qs_get_attr_name(doc,attr);
1412 value = qs_get_attr_value(doc,attr);
1417 if (strcasecmp(name, "name") == 0) {
1418 /*--------------------------------------------------------------------*/
1420 /*--------------------------------------------------------------------*/
1429 if (strcasecmp(name, "href") == 0) {
1430 /*--------------------------------------------------------------------*/
1432 /*--------------------------------------------------------------------*/
1433 value = chxj_encoding_parameter(r, value);
1434 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
1443 if (strcasecmp(name, "accesskey") == 0) {
1444 /*--------------------------------------------------------------------*/
1446 /*--------------------------------------------------------------------*/
1447 W10_L(" accesskey=\"");
1455 if (strcasecmp(name, "cti") == 0) {
1456 /*--------------------------------------------------------------------*/
1458 /*--------------------------------------------------------------------*/
1465 if (strcasecmp(name, "utn") == 0) {
1466 /*--------------------------------------------------------------------*/
1468 /*--------------------------------------------------------------------*/
1475 if (strcasecmp(name, "telbook") == 0) {
1476 /*--------------------------------------------------------------------*/
1478 /*--------------------------------------------------------------------*/
1485 if (strcasecmp(name, "kana") == 0) {
1486 /*--------------------------------------------------------------------*/
1488 /*--------------------------------------------------------------------*/
1495 if (strcasecmp(name, "email") == 0) {
1496 /*--------------------------------------------------------------------*/
1498 /*--------------------------------------------------------------------*/
1505 if (strcasecmp(name, "ista") == 0) {
1506 /*--------------------------------------------------------------------*/
1508 /*--------------------------------------------------------------------*/
1512 if (strcasecmp(name, "ilet") == 0) {
1513 /*--------------------------------------------------------------------*/
1515 /*--------------------------------------------------------------------*/
1519 if (strcasecmp(name, "iswf") == 0) {
1520 /*--------------------------------------------------------------------*/
1522 /*--------------------------------------------------------------------*/
1526 if (strcasecmp(name, "irst") == 0) {
1527 /*--------------------------------------------------------------------*/
1529 /*--------------------------------------------------------------------*/
1533 if (strcasecmp(name, "ijam") == 0) {
1534 /*--------------------------------------------------------------------*/
1536 /*--------------------------------------------------------------------*/
1547 return chtml10->out;
1552 * It is a handler who processes the A tag.
1554 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1555 * destination is specified.
1556 * @param node [i] The A tag node is specified.
1557 * @return The conversion result is returned.
1560 s_chtml10_end_a_tag(void *pdoc, Node *UNUSED(child))
1566 chtml10 = GET_CHTML10(pdoc);
1571 return chtml10->out;
1576 * It is a handler who processes the BR tag.
1578 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1579 * destination is specified.
1580 * @param node [i] The BR tag node is specified.
1581 * @return The conversion result is returned.
1584 s_chtml10_start_br_tag(void *pdoc, Node *node)
1591 chtml10 = GET_CHTML10(pdoc);
1597 /*--------------------------------------------------------------------------*/
1598 /* Get Attributes */
1599 /*--------------------------------------------------------------------------*/
1600 for (attr = qs_get_attr(doc,node);
1602 attr = qs_get_next_attr(doc,attr)) {
1606 name = qs_get_attr_name(doc,attr);
1607 value = qs_get_attr_value(doc,attr);
1609 if (STRCASEEQ('c','C',"clear",name)) {
1610 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1618 return chtml10->out;
1623 * It is a handler who processes the BR tag.
1625 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1626 * destination is specified.
1627 * @param node [i] The BR tag node is specified.
1628 * @return The conversion result is returned.
1631 s_chtml10_end_br_tag(void *pdoc, Node *UNUSED(child))
1633 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1635 return chtml10->out;
1640 * It is a handler who processes the TR tag.
1642 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1643 * destination is specified.
1644 * @param node [i] The TR tag node is specified.
1645 * @return The conversion result is returned.
1648 s_chtml10_start_tr_tag(void *pdoc, Node *UNUSED(node))
1650 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1652 return chtml10->out;
1657 * It is a handler who processes the TR tag.
1659 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1660 * destination is specified.
1661 * @param node [i] The TR tag node is specified.
1662 * @return The conversion result is returned.
1665 s_chtml10_end_tr_tag(void *pdoc, Node *UNUSED(child))
1671 chtml10 = GET_CHTML10(pdoc);
1677 return chtml10->out;
1682 * It is a handler who processes the FONT tag.
1684 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1685 * destination is specified.
1686 * @param node [i] The FONT tag node is specified.
1687 * @return The conversion result is returned.
1690 s_chtml10_start_font_tag(void *pdoc, Node *UNUSED(node))
1692 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1696 return chtml10->out;
1701 * It is a handler who processes the FONT tag.
1703 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1704 * destination is specified.
1705 * @param node [i] The FONT tag node is specified.
1706 * @return The conversion result is returned.
1709 s_chtml10_end_font_tag(void *pdoc, Node *UNUSED(child))
1711 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1715 return chtml10->out;
1720 * It is a handler who processes the FORM tag.
1722 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1723 * destination is specified.
1724 * @param node [i] The FORM tag node is specified.
1725 * @return The conversion result is returned.
1728 s_chtml10_start_form_tag(void *pdoc, Node *node)
1735 chtml10 = GET_CHTML10(pdoc);
1741 /*--------------------------------------------------------------------------*/
1742 /* Get Attributes */
1743 /*--------------------------------------------------------------------------*/
1744 for (attr = qs_get_attr(doc,node);
1746 attr = qs_get_next_attr(doc,attr)) {
1750 name = qs_get_attr_name(doc,attr);
1751 value = qs_get_attr_value(doc,attr);
1756 if (strcasecmp(name, "action") == 0) {
1757 /*--------------------------------------------------------------------*/
1759 /*--------------------------------------------------------------------*/
1760 value = chxj_encoding_parameter(r, value);
1761 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
1763 W10_L(" action=\"");
1771 if (strcasecmp(name, "method") == 0) {
1772 /*--------------------------------------------------------------------*/
1774 /*--------------------------------------------------------------------*/
1775 W10_L(" method=\"");
1783 if (strcasecmp(name, "utn") == 0) {
1784 /*--------------------------------------------------------------------*/
1786 /*--------------------------------------------------------------------*/
1798 return chtml10->out;
1803 * It is a handler who processes the FORM tag.
1805 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1806 * destination is specified.
1807 * @param node [i] The FORM tag node is specified.
1808 * @return The conversion result is returned.
1811 s_chtml10_end_form_tag(void* pdoc, Node* UNUSED(child))
1817 chtml10 = GET_CHTML10(pdoc);
1823 return chtml10->out;
1828 * It is a handler who processes the INPUT tag.
1830 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1831 * destination is specified.
1832 * @param node [i] The INPUT tag node is specified.
1833 * @return The conversion result is returned.
1836 s_chtml10_start_input_tag(void* pdoc, Node* node)
1850 chtml10 = GET_CHTML10(pdoc);
1865 /*--------------------------------------------------------------------------*/
1866 /* Get Attributes */
1867 /*--------------------------------------------------------------------------*/
1869 type = qs_get_type_attr(doc, node, r);
1870 name = qs_get_name_attr(doc, node, r);
1871 value = qs_get_value_attr(doc,node,r);
1872 istyle = qs_get_istyle_attr(doc,node,r);
1873 max_length = qs_get_maxlength_attr(doc,node,r);
1874 checked = qs_get_checked_attr(doc,node,r);
1875 accesskey = qs_get_accesskey_attr(doc, node, r);
1876 size = qs_get_size_attr(doc, node, r);
1903 W10_L(" accesskey=\"");
1909 /*------------------------------------------------------------------------*/
1911 /*------------------------------------------------------------------------*/
1914 /*--------------------------------------------------------------------------*/
1915 /* The figure is default for the password. */
1916 /*--------------------------------------------------------------------------*/
1918 W10_L(" maxlength=\"");
1928 return chtml10->out;
1933 * It is a handler who processes the INPUT tag.
1935 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1936 * destination is specified.
1937 * @param node [i] The INPUT tag node is specified.
1938 * @return The conversion result is returned.
1941 s_chtml10_end_input_tag(void* pdoc, Node* UNUSED(child))
1943 chtml10_t* chtml10 = GET_CHTML10(pdoc);
1945 return chtml10->out;
1950 * It is a handler who processes the CENTER tag.
1952 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1953 * destination is specified.
1954 * @param node [i] The CENTER tag node is specified.
1955 * @return The conversion result is returned.
1958 s_chtml10_start_center_tag(void* pdoc, Node* UNUSED(node))
1964 chtml10 = GET_CHTML10(pdoc);
1970 return chtml10->out;
1975 * It is a handler who processes the CENTER tag.
1977 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1978 * destination is specified.
1979 * @param node [i] The CENTER tag node is specified.
1980 * @return The conversion result is returned.
1983 s_chtml10_end_center_tag(void* pdoc, Node* UNUSED(child))
1989 chtml10 = GET_CHTML10(pdoc);
1995 return chtml10->out;
2000 * It is a handler who processes the HR tag.
2002 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2003 * destination is specified.
2004 * @param node [i] The HR tag node is specified.
2005 * @return The conversion result is returned.
2008 s_chtml10_start_hr_tag(void* pdoc, Node* node)
2015 chtml10 = GET_CHTML10(pdoc);
2021 for (attr = qs_get_attr(doc,node);
2023 attr = qs_get_next_attr(doc,attr)) {
2028 name = qs_get_attr_name (doc,attr);
2029 value = qs_get_attr_value(doc,attr);
2034 if (strcasecmp(name, "align") == 0) {
2035 /*--------------------------------------------------------------------*/
2037 /*--------------------------------------------------------------------*/
2046 if (strcasecmp(name, "size") == 0) {
2047 /*--------------------------------------------------------------------*/
2049 /*--------------------------------------------------------------------*/
2058 if (strcasecmp(name, "width") == 0) {
2059 /*--------------------------------------------------------------------*/
2061 /*--------------------------------------------------------------------*/
2070 if (strcasecmp(name, "noshade") == 0) {
2071 /*--------------------------------------------------------------------*/
2073 /*--------------------------------------------------------------------*/
2080 if (strcasecmp(name, "color") == 0) {
2081 /*--------------------------------------------------------------------*/
2083 /*--------------------------------------------------------------------*/
2095 return chtml10->out;
2100 * It is a handler who processes the HR tag.
2102 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2103 * destination is specified.
2104 * @param node [i] The HR tag node is specified.
2105 * @return The conversion result is returned.
2108 s_chtml10_end_hr_tag(void* pdoc, Node* UNUSED(child))
2112 chtml10 = GET_CHTML10(pdoc);
2114 return chtml10->out;
2119 * It is a handler who processes the IMG tag.
2121 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2122 * destination is specified.
2123 * @param node [i] The IMG tag node is specified.
2124 * @return The conversion result is returned.
2127 s_chtml10_start_img_tag(void* pdoc, Node* node)
2133 #ifndef IMG_NOT_CONVERT_FILENAME
2137 chtml10 = GET_CHTML10(pdoc);
2138 #ifndef IMG_NOT_CONVERT_FILENAME
2139 spec = chtml10->spec;
2145 /*--------------------------------------------------------------------------*/
2146 /* Get Attributes */
2147 /*--------------------------------------------------------------------------*/
2148 for (attr = qs_get_attr(doc,node);
2150 attr = qs_get_next_attr(doc,attr)) {
2155 name = qs_get_attr_name (doc,attr);
2156 value = qs_get_attr_value(doc,attr);
2161 if (strcasecmp(name, "src") == 0) {
2162 /*--------------------------------------------------------------------*/
2164 /*--------------------------------------------------------------------*/
2165 #ifdef IMG_NOT_CONVERT_FILENAME
2166 value = chxj_encoding_parameter(r, value);
2167 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
2169 value = apr_psprintf(r->pool,
2172 (strchr(value, '?')) ? '&' : '?',
2173 CHXJ_COOKIE_NOUPDATE_PARAM);
2179 value = chxj_img_conv(r, spec, value);
2180 value = chxj_encoding_parameter(r, value);
2181 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
2183 value = apr_psprintf(r->pool,
2186 (strchr(value, '?')) ? '&' : '?',
2187 CHXJ_COOKIE_NOUPDATE_PARAM);
2198 if (strcasecmp(name, "align" ) == 0) {
2199 /*--------------------------------------------------------------------*/
2201 /*--------------------------------------------------------------------*/
2202 /*--------------------------------------------------------------------*/
2204 /*--------------------------------------------------------------------*/
2210 if (strcasecmp(name, "alt" ) == 0) {
2211 /*--------------------------------------------------------------------*/
2213 /*--------------------------------------------------------------------*/
2222 if (strcasecmp(name, "width" ) == 0) {
2223 /*--------------------------------------------------------------------*/
2225 /*--------------------------------------------------------------------*/
2234 if (strcasecmp(name, "height") == 0) {
2235 /*--------------------------------------------------------------------*/
2237 /*--------------------------------------------------------------------*/
2238 W10_L(" height=\"");
2243 if (strcasecmp(name, "hspace") == 0) {
2244 /*--------------------------------------------------------------------*/
2246 /*--------------------------------------------------------------------*/
2247 W10_L(" hspace=\"");
2255 if (strcasecmp(name, "vspace") == 0) {
2256 /*--------------------------------------------------------------------*/
2258 /*--------------------------------------------------------------------*/
2259 W10_L(" vspace=\"");
2271 return chtml10->out;
2276 * It is a handler who processes the IMG tag.
2278 * @param chtml10 [i/o] The pointer to the CHTML structure at the output
2279 * destination is specified.
2280 * @param node [i] The IMG tag node is specified.
2281 * @return The conversion result is returned.
2284 s_chtml10_end_img_tag(void *pdoc, Node *UNUSED(child))
2288 chtml10 = GET_CHTML10(pdoc);
2290 return chtml10->out;
2295 * It is a handler who processes the SELECT tag.
2297 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2298 * destination is specified.
2299 * @param node [i] The SELECT tag node is specified.
2300 * @return The conversion result is returned.
2303 s_chtml10_start_select_tag(void *pdoc, Node *child)
2313 chtml10 = GET_CHTML10(pdoc);
2321 for (attr = qs_get_attr(doc,child);
2323 attr = qs_get_next_attr(doc,attr)) {
2327 nm = qs_get_attr_name (doc,attr);
2328 val = qs_get_attr_value(doc,attr);
2333 if (strcasecmp(nm, "size") == 0) {
2334 /*--------------------------------------------------------------------*/
2335 /* CHTML 1.0 version 2.0 */
2336 /*--------------------------------------------------------------------*/
2337 size = apr_pstrdup(doc->buf.pool, val);
2343 if (strcasecmp(nm, "name") == 0) {
2344 /*--------------------------------------------------------------------*/
2345 /* CHTML 1.0 version 2.0 */
2346 /*--------------------------------------------------------------------*/
2347 name = apr_pstrdup(doc->buf.pool, val);
2353 if (strcasecmp(nm, "multiple") == 0) {
2354 /*--------------------------------------------------------------------*/
2355 /* CHTML 1.0 version 2.0 */
2356 /*--------------------------------------------------------------------*/
2379 return chtml10->out;
2384 * It is a handler who processes the SELECT tag.
2386 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2387 * destination is specified.
2388 * @param node [i] The SELECT tag node is specified.
2389 * @return The conversion result is returned.
2392 s_chtml10_end_select_tag(void *pdoc, Node *UNUSED(child))
2398 chtml10 = GET_CHTML10(pdoc);
2402 W10_L("</select>\r\n");
2403 return chtml10->out;
2408 * It is a handler who processes the OPTION tag.
2410 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2411 * destination is specified.
2412 * @param node [i] The OPTION tag node is specified.
2413 * @return The conversion result is returned.
2416 s_chtml10_start_option_tag(void *pdoc, Node *child)
2426 chtml10 = GET_CHTML10(pdoc);
2435 for (attr = qs_get_attr(doc,child);
2437 attr = qs_get_next_attr(doc,attr)) {
2441 nm = qs_get_attr_name (doc,attr);
2442 val = qs_get_attr_value(doc,attr);
2447 if (strcasecmp(nm, "selected") == 0) {
2448 /*--------------------------------------------------------------------*/
2449 /* CHTML 1.0 version 2.0 */
2450 /*--------------------------------------------------------------------*/
2451 selected = apr_pstrdup(doc->buf.pool, val);
2457 if (strcasecmp(nm, "value") == 0) {
2458 /*--------------------------------------------------------------------*/
2459 /* CHTML 1.0 version 2.0 */
2460 /*--------------------------------------------------------------------*/
2461 value = apr_pstrdup(doc->buf.pool, val);
2476 W10_L(" value=\"\"");
2480 W10_L(" selected ");
2484 return chtml10->out;
2489 * It is a handler who processes the OPTION tag.
2491 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2492 * destination is specified.
2493 * @param node [i] The OPTION tag node is specified.
2494 * @return The conversion result is returned.
2497 s_chtml10_end_option_tag(void *pdoc, Node *UNUSED(child))
2501 chtml10 = GET_CHTML10(pdoc);
2505 return chtml10->out;
2510 * It is a handler who processes the DIV tag.
2512 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2513 * destination is specified.
2514 * @param node [i] The DIV tag node is specified.
2515 * @return The conversion result is returned.
2518 s_chtml10_start_div_tag(void *pdoc, Node *child)
2527 chtml10 = GET_CHTML10(pdoc);
2535 for (attr = qs_get_attr(doc,child);
2537 attr = qs_get_next_attr(doc,attr)) {
2542 nm = qs_get_attr_name(doc,attr);
2543 val = qs_get_attr_value(doc,attr);
2545 if (STRCASEEQ('a','A',"align", nm)) {
2546 /*----------------------------------------------------------------------*/
2547 /* CHTML 1.0 (W3C version 3.2) */
2548 /*----------------------------------------------------------------------*/
2549 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2550 align = apr_pstrdup(doc->buf.pool, val);
2562 return chtml10->out;
2567 * It is a handler who processes the DIV tag.
2569 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2570 * destination is specified.
2571 * @param node [i] The DIV tag node is specified.
2572 * @return The conversion result is returned.
2575 s_chtml10_end_div_tag(void *pdoc, Node *UNUSED(child))
2581 chtml10 = GET_CHTML10(pdoc);
2586 return chtml10->out;
2591 * It is a handler who processes the CHXJ:IF tag.
2593 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2594 * destination is specified.
2595 * @param node [i] The CHXJ:IF tag node is specified.
2596 * @return The conversion result is returned.
2599 s_chtml10_chxjif_tag(void *pdoc, Node *node)
2606 chtml10 = GET_CHTML10(pdoc);
2610 for (child = qs_get_child_node(doc, node);
2612 child = qs_get_next_node(doc, child)) {
2613 W10_V(child->otext);
2614 s_chtml10_chxjif_tag(chtml10, child);
2617 return chtml10->out;
2622 * It is a handler who processes the PRE tag.
2624 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2625 * destination is specified.
2626 * @param node [i] The PRE tag node is specified.
2627 * @return The conversion result is returned.
2630 s_chtml10_start_pre_tag(void *pdoc, Node *UNUSED(node))
2636 chtml10 = GET_CHTML10(pdoc);
2640 chtml10->pre_flag++;
2642 return chtml10->out;
2647 * It is a handler who processes the PRE tag.
2649 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2650 * destination is specified.
2651 * @param node [i] The PRE tag node is specified.
2652 * @return The conversion result is returned.
2655 s_chtml10_end_pre_tag(void *pdoc, Node *UNUSED(child))
2661 chtml10 = GET_CHTML10(pdoc);
2666 chtml10->pre_flag--;
2668 return chtml10->out;
2673 * It is a handler who processes the P tag.
2675 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2676 * destination is specified.
2677 * @param node [i] The P tag node is specified.
2678 * @return The conversion result is returned.
2681 s_chtml10_start_p_tag(void *pdoc, Node *UNUSED(node))
2687 chtml10 = GET_CHTML10(pdoc);
2692 return chtml10->out;
2697 * It is a handler who processes the P tag.
2699 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2700 * destination is specified.
2701 * @param node [i] The P tag node is specified.
2702 * @return The conversion result is returned.
2705 s_chtml10_end_p_tag(void *pdoc, Node *UNUSED(child))
2711 chtml10 = GET_CHTML10(pdoc);
2716 return chtml10->out;
2721 * It is a handler who processes the TEXTARE tag.
2723 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2724 * destination is specified.
2725 * @param node [i] The TEXTAREA tag node is specified.
2726 * @return The conversion result is returned.
2729 s_chtml10_start_textarea_tag(void *pdoc, Node *node)
2736 chtml10 = GET_CHTML10(pdoc);
2741 chtml10->textarea_flag++;
2743 W10_L("<textarea ");
2745 for (attr = qs_get_attr(doc,node);
2747 attr = qs_get_next_attr(doc,attr)) {
2752 name = qs_get_attr_name (doc,attr);
2753 value = qs_get_attr_value(doc,attr);
2758 if (strcasecmp(name, "name") == 0) {
2767 if (strcasecmp(name, "rows") == 0) {
2776 if (strcasecmp(name, "cols") == 0) {
2789 return chtml10->out;
2794 * It is a handler who processes the TEXTAREA tag.
2796 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2797 * destination is specified.
2798 * @param node [i] The TEXTAREA tag node is specified.
2799 * @return The conversion result is returned.
2802 s_chtml10_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2808 chtml10 = GET_CHTML10(pdoc);
2812 W10_L("</textarea>\r\n");
2813 chtml10->textarea_flag--;
2815 return chtml10->out;
2820 s_chtml10_text(void *pdoc, Node *child)
2832 chtml10 = GET_CHTML10(pdoc);
2836 textval = qs_get_node_value(doc,child);
2837 textval = qs_trim_string(r, textval);
2839 if (strlen(textval) == 0)
2840 return chtml10->out;
2842 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2843 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2845 tdst = qs_alloc_zero_byte_string(r);
2846 memset(one_byte, 0, sizeof(one_byte));
2849 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2853 rtn = s_chtml10_search_emoji(chtml10, &textval[ii], &out);
2855 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2860 if (is_sjis_kanji(textval[ii])) {
2861 one_byte[0] = textval[ii+0];
2862 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2863 one_byte[0] = textval[ii+1];
2864 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2868 if (chtml10->pre_flag) {
2869 one_byte[0] = textval[ii+0];
2870 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2873 if (chtml10->textarea_flag) {
2874 one_byte[0] = textval[ii+0];
2875 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2878 if (textval[ii] != '\r' && textval[ii] != '\n') {
2879 one_byte[0] = textval[ii+0];
2880 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2885 return chtml10->out;
2890 * It is a handler who processes the BLOCKQUOTE tag.
2892 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2893 * destination is specified.
2894 * @param node [i] The BLOCKQUOTE tag node is specified.
2895 * @return The conversion result is returned.
2898 s_chtml10_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2902 chtml10 = GET_CHTML10(pdoc);
2904 W10_L("<blockquote>");
2905 return chtml10->out;
2910 * It is a handler who processes the BLOCKQUOTE tag.
2912 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2913 * destination is specified.
2914 * @param node [i] The BLOCKQUOTE tag node is specified.
2915 * @return The conversion result is returned.
2918 s_chtml10_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2923 chtml10 = GET_CHTML10(pdoc);
2925 W10_L("</blockquote>");
2926 return chtml10->out;
2931 * It is a handler who processes the DIR tag.
2933 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2934 * destination is specified.
2935 * @param node [i] The DIR tag node is specified.
2936 * @return The conversion result is returned.
2939 s_chtml10_start_dir_tag(void *pdoc, Node *UNUSED(child))
2943 chtml10 = GET_CHTML10(pdoc);
2946 return chtml10->out;
2951 * It is a handler who processes the DIR tag.
2953 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2954 * destination is specified.
2955 * @param node [i] The DIR tag node is specified.
2956 * @return The conversion result is returned.
2959 s_chtml10_end_dir_tag(void *pdoc, Node *UNUSED(child))
2964 chtml10 = GET_CHTML10(pdoc);
2967 return chtml10->out;
2972 * It is a handler who processes the DL tag.
2974 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2975 * destination is specified.
2976 * @param node [i] The DL tag node is specified.
2977 * @return The conversion result is returned.
2980 s_chtml10_start_dl_tag(void *pdoc, Node *UNUSED(child))
2984 chtml10 = GET_CHTML10(pdoc);
2987 return chtml10->out;
2992 * It is a handler who processes the DL tag.
2994 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2995 * destination is specified.
2996 * @param node [i] The DL tag node is specified.
2997 * @return The conversion result is returned.
3000 s_chtml10_end_dl_tag(void *pdoc, Node *UNUSED(child))
3004 chtml10 = GET_CHTML10(pdoc);
3007 return chtml10->out;
3012 * It is a handter who processes the DT tag.
3014 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3015 * destination is specified.
3016 * @param node [i] The DT tag node is specified.
3017 * @return The conversion result is returned.
3020 s_chtml10_start_dt_tag(void *pdoc, Node *UNUSED(child))
3024 chtml10 = GET_CHTML10(pdoc);
3027 return chtml10->out;
3032 * It is a handter who processes the DT tag.
3034 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3035 * destination is specified.
3036 * @param node [i] The DT tag node is specified.
3037 * @return The conversion result is returned.
3040 s_chtml10_end_dt_tag(void *pdoc, Node *UNUSED(child))
3043 chtml10 = GET_CHTML10(pdoc);
3044 return chtml10->out;
3049 * It is a handder who processes the DD tag.
3051 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3052 * destination is specified.
3053 * @param node [i] The DD tag node is specified.
3054 * @return The conversion result is returned.
3057 s_chtml10_start_dd_tag(void *pdoc, Node *UNUSED(child))
3061 chtml10 = GET_CHTML10(pdoc);
3064 return chtml10->out;
3069 * It is a handder who processes the DD tag.
3071 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3072 * destination is specified.
3073 * @param node [i] The DD tag node is specified.
3074 * @return The conversion result is returned.
3077 s_chtml10_end_dd_tag(void *pdoc, Node *UNUSED(child))
3080 chtml10 = GET_CHTML10(pdoc);
3081 return chtml10->out;