2 * Copyright (C) 2005-2009 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include "chxj_chtml40.h"
19 #include "chxj_hdml.h"
20 #include "chxj_str_util.h"
21 #include "chxj_dump.h"
22 #include "chxj_img_conv.h"
23 #include "chxj_qr_code.h"
24 #include "chxj_encoding.h"
25 #include "chxj_header_inf.h"
26 #include "chxj_conv_z2h.h"
28 #define GET_CHTML40(X) ((chtml40_t *)(X))
31 #define W_L(X) do { chtml40->out = BUFFERED_WRITE_LITERAL(chtml40->out, &doc->buf, (X)); } while(0)
32 #define W_V(X) do { chtml40->out = (X) ? BUFFERED_WRITE_VALUE(chtml40->out, &doc->buf, (X)) \
33 : BUFFERED_WRITE_LITERAL(chtml40->out, &doc->buf, ""); } while(0)
35 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml40->conf); W_V(nlcode); } while (0)
37 static char *s_chtml40_start_html_tag (void *pdoc, Node *node);
38 static char *s_chtml40_end_html_tag (void *pdoc, Node *node);
39 static char *s_chtml40_start_meta_tag (void *pdoc, Node *node);
40 static char *s_chtml40_end_meta_tag (void *pdoc, Node *node);
41 static char *s_chtml40_start_textarea_tag (void *pdoc, Node *node);
42 static char *s_chtml40_end_textarea_tag (void *pdoc, Node *node);
43 static char *s_chtml40_start_p_tag (void *pdoc, Node *node);
44 static char *s_chtml40_end_p_tag (void *pdoc, Node *node);
45 static char *s_chtml40_start_pre_tag (void *pdoc, Node *node);
46 static char *s_chtml40_end_pre_tag (void *pdoc, Node *node);
47 static char *s_chtml40_start_h1_tag (void *pdoc, Node *node);
48 static char *s_chtml40_end_h1_tag (void *pdoc, Node *node);
49 static char *s_chtml40_start_h2_tag (void *pdoc, Node *node);
50 static char *s_chtml40_end_h2_tag (void *pdoc, Node *node);
51 static char *s_chtml40_start_h3_tag (void *pdoc, Node *node);
52 static char *s_chtml40_end_h3_tag (void *pdoc, Node *node);
53 static char *s_chtml40_start_h4_tag (void *pdoc, Node *node);
54 static char *s_chtml40_end_h4_tag (void *pdoc, Node *node);
55 static char *s_chtml40_start_h5_tag (void *pdoc, Node *node);
56 static char *s_chtml40_end_h5_tag (void *pdoc, Node *node);
57 static char *s_chtml40_start_h6_tag (void *pdoc, Node *node);
58 static char *s_chtml40_end_h6_tag (void *pdoc, Node *node);
59 static char *s_chtml40_start_ul_tag (void *pdoc, Node *node);
60 static char *s_chtml40_end_ul_tag (void *pdoc, Node *node);
61 static char *s_chtml40_start_ol_tag (void *pdoc, Node *node);
62 static char *s_chtml40_end_ol_tag (void *pdoc, Node *node);
63 static char *s_chtml40_start_li_tag (void *pdoc, Node *node);
64 static char *s_chtml40_end_li_tag (void *pdoc, Node *node);
65 static char *s_chtml40_start_head_tag (void *pdoc, Node *node);
66 static char *s_chtml40_end_head_tag (void *pdoc, Node *node);
67 static char *s_chtml40_start_title_tag (void *pdoc, Node *node);
68 static char *s_chtml40_end_title_tag (void *pdoc, Node *node);
69 static char *s_chtml40_start_base_tag (void *pdoc, Node *node);
70 static char *s_chtml40_end_base_tag (void *pdoc, Node *node);
71 static char *s_chtml40_start_body_tag (void *pdoc, Node *node);
72 static char *s_chtml40_end_body_tag (void *pdoc, Node *node);
73 static char *s_chtml40_start_a_tag (void *pdoc, Node *node);
74 static char *s_chtml40_end_a_tag (void *pdoc, Node *node);
75 static char *s_chtml40_start_br_tag (void *pdoc, Node *node);
76 static char *s_chtml40_end_br_tag (void *pdoc, Node *node);
77 static char *s_chtml40_start_tr_tag (void *pdoc, Node *node);
78 static char *s_chtml40_end_tr_tag (void *pdoc, Node *node);
79 static char *s_chtml40_start_font_tag (void *pdoc, Node *node);
80 static char *s_chtml40_end_font_tag (void *pdoc, Node *node);
81 static char *s_chtml40_start_form_tag (void *pdoc, Node *node);
82 static char *s_chtml40_end_form_tag (void *pdoc, Node *node);
83 static char *s_chtml40_start_input_tag (void *pdoc, Node *node);
84 static char *s_chtml40_end_input_tag (void *pdoc, Node *node);
85 static char *s_chtml40_start_center_tag (void *pdoc, Node *node);
86 static char *s_chtml40_end_center_tag (void *pdoc, Node *node);
87 static char *s_chtml40_start_hr_tag (void *pdoc, Node *node);
88 static char *s_chtml40_end_hr_tag (void *pdoc, Node *node);
89 static char *s_chtml40_start_img_tag (void *pdoc, Node *node);
90 static char *s_chtml40_end_img_tag (void *pdoc, Node *node);
91 static char *s_chtml40_start_select_tag (void *pdoc, Node *node);
92 static char *s_chtml40_end_select_tag (void *pdoc, Node *node);
93 static char *s_chtml40_start_option_tag (void *pdoc, Node *node);
94 static char *s_chtml40_end_option_tag (void *pdoc, Node *node);
95 static char *s_chtml40_start_div_tag (void *pdoc, Node *node);
96 static char *s_chtml40_end_div_tag (void *pdoc, Node *node);
97 static char *s_chtml40_chxjif_tag (void *pdoc, Node *node);
98 static char *s_chtml40_text_tag (void *pdoc, Node *node);
99 static char *s_chtml40_start_blockquote_tag(void *pdoc, Node *node);
100 static char *s_chtml40_end_blockquote_tag (void *pdoc, Node *node);
101 static char *s_chtml40_start_dir_tag (void *pdoc, Node *node);
102 static char *s_chtml40_end_dir_tag (void *pdoc, Node *node);
103 static char *s_chtml40_start_dl_tag (void *pdoc, Node *node);
104 static char *s_chtml40_end_dl_tag (void *pdoc, Node *node);
105 static char *s_chtml40_start_dt_tag (void *pdoc, Node *node);
106 static char *s_chtml40_end_dt_tag (void *pdoc, Node *node);
107 static char *s_chtml40_start_dd_tag (void *pdoc, Node *node);
108 static char *s_chtml40_end_dd_tag (void *pdoc, Node *node);
109 static char *s_chtml40_start_marquee_tag (void *pdoc, Node *node);
110 static char *s_chtml40_end_marquee_tag (void *pdoc, Node *node);
111 static char *s_chtml40_start_blink_tag (void *pdoc, Node *node);
112 static char *s_chtml40_end_blink_tag (void *pdoc, Node *node);
113 static char *s_chtml40_start_menu_tag (void *pdoc, Node *node);
114 static char *s_chtml40_end_menu_tag (void *pdoc, Node *node);
115 static char *s_chtml40_start_plaintext_tag (void *pdoc, Node *node);
116 static char *s_chtml40_start_plaintext_tag_inner (void *pdoc, Node *node);
117 static char *s_chtml40_end_plaintext_tag (void *pdoc, Node *node);
118 static char *s_chtml40_newline_mark (void *pdoc, Node *node);
120 static void s_init_chtml40(chtml40_t *chtml, Doc *doc, request_rec *r, device_table *spec);
122 static int s_chtml40_search_emoji(chtml40_t *chtml, char *txt, char **rslt);
125 tag_handler chtml40_handler[] = {
128 s_chtml40_start_html_tag,
129 s_chtml40_end_html_tag,
133 s_chtml40_start_meta_tag,
134 s_chtml40_end_meta_tag,
138 s_chtml40_start_textarea_tag,
139 s_chtml40_end_textarea_tag,
143 s_chtml40_start_p_tag,
148 s_chtml40_start_pre_tag,
149 s_chtml40_end_pre_tag,
153 s_chtml40_start_ul_tag,
154 s_chtml40_end_ul_tag,
158 s_chtml40_start_li_tag,
159 s_chtml40_end_li_tag,
163 s_chtml40_start_ol_tag,
164 s_chtml40_end_ol_tag,
168 s_chtml40_start_h1_tag,
169 s_chtml40_end_h1_tag,
173 s_chtml40_start_h2_tag,
174 s_chtml40_end_h2_tag,
178 s_chtml40_start_h3_tag,
179 s_chtml40_end_h3_tag,
183 s_chtml40_start_h4_tag,
184 s_chtml40_end_h4_tag,
188 s_chtml40_start_h5_tag,
189 s_chtml40_end_h5_tag,
193 s_chtml40_start_h6_tag,
194 s_chtml40_end_h6_tag,
198 s_chtml40_start_head_tag,
199 s_chtml40_end_head_tag,
203 s_chtml40_start_title_tag,
204 s_chtml40_end_title_tag,
208 s_chtml40_start_base_tag,
209 s_chtml40_end_base_tag,
213 s_chtml40_start_body_tag,
214 s_chtml40_end_body_tag,
218 s_chtml40_start_a_tag,
223 s_chtml40_start_br_tag,
224 s_chtml40_end_br_tag,
233 s_chtml40_start_tr_tag,
234 s_chtml40_end_tr_tag,
248 s_chtml40_start_font_tag,
249 s_chtml40_end_font_tag,
253 s_chtml40_start_form_tag,
254 s_chtml40_end_form_tag,
258 s_chtml40_start_input_tag,
259 s_chtml40_end_input_tag,
263 s_chtml40_start_center_tag,
264 s_chtml40_end_center_tag,
268 s_chtml40_start_hr_tag,
269 s_chtml40_end_hr_tag,
273 s_chtml40_start_img_tag,
274 s_chtml40_end_img_tag,
278 s_chtml40_start_select_tag,
279 s_chtml40_end_select_tag,
283 s_chtml40_start_option_tag,
284 s_chtml40_end_option_tag,
288 s_chtml40_start_div_tag,
289 s_chtml40_end_div_tag,
293 s_chtml40_chxjif_tag,
338 s_chtml40_start_dt_tag,
339 s_chtml40_end_dt_tag,
353 s_chtml40_start_blockquote_tag,
354 s_chtml40_end_blockquote_tag,
358 s_chtml40_start_dir_tag,
359 s_chtml40_end_dir_tag,
363 s_chtml40_start_dl_tag,
364 s_chtml40_end_dl_tag,
368 s_chtml40_start_dd_tag,
369 s_chtml40_end_dd_tag,
373 s_chtml40_start_menu_tag,
374 s_chtml40_end_menu_tag,
378 s_chtml40_start_plaintext_tag,
379 s_chtml40_end_plaintext_tag,
383 s_chtml40_start_blink_tag,
384 s_chtml40_end_blink_tag,
388 s_chtml40_start_marquee_tag,
389 s_chtml40_end_marquee_tag,
393 s_chtml40_newline_mark,
400 * converts from CHTML5.0 to CHTML3.0.
402 * @param r [i] Requet_rec is appointed.
403 * @param spec [i] The result of the device specification processing which
404 * was done in advance is appointed.
405 * @param src [i] The character string before the converting is appointed.
406 * @return The character string after the converting is returned.
409 chxj_convert_chtml40(
415 chxjconvrule_entry *entryp,
424 DBG(r, "start chxj_convert_chtml40()");
426 /*--------------------------------------------------------------------------*/
428 /*--------------------------------------------------------------------------*/
430 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
432 DBG(r,"i found qrcode xml");
433 DBG(r, "end chxj_convert_chtml40()");
436 DBG(r,"not found qrcode xml");
438 /*--------------------------------------------------------------------------*/
439 /* The CHTML structure is initialized. */
440 /*--------------------------------------------------------------------------*/
441 s_init_chtml40(&chtml40, &doc, r, spec);
443 chtml40.entryp = entryp;
444 chtml40.cookie = cookie;
446 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
448 /*--------------------------------------------------------------------------*/
449 /* The character string of the input is analyzed. */
450 /*--------------------------------------------------------------------------*/
451 qs_init_malloc(&doc);
452 qs_init_root_node(&doc);
454 ss = apr_pcalloc(r->pool, srclen + 1);
455 memset(ss, 0, srclen + 1);
456 memcpy(ss, src, srclen);
459 chxj_dump_out("[src] CHTML -> CHTML4.0", ss, srclen);
461 chxj_buffered_write_init(r->pool, &doc.buf);
463 qs_parse_string(&doc,ss, strlen(ss));
465 /*--------------------------------------------------------------------------*/
466 /* It converts it from CHTML to CHTML. */
467 /*--------------------------------------------------------------------------*/
468 chxj_node_convert(spec,r,(void*)&chtml40, &doc, qs_get_root(&doc), 0);
469 chtml40.out = chxj_buffered_write_flush(chtml40.out, &doc.buf);
470 dst = apr_pstrdup(r->pool, chtml40.out);
471 chxj_buffered_write_terminate(&doc.buf);
473 qs_all_free(&doc,QX_LOGMARK);
476 dst = apr_pstrdup(r->pool,ss);
478 if (strlen(dst) == 0) {
479 dst = apr_psprintf(r->pool, "\n");
482 *dstlen = strlen(dst);
485 chxj_dump_out("[src] CHTML -> CHTML4.0", dst, *dstlen);
488 DBG(r, "end chxj_convert_chtml40()");
494 * The CHTML structure is initialized.
496 * @param chtml40 [i/o] The pointer to the HDML structure that wants to be
497 * initialized is specified.
498 * @param doc [i] The Doc structure that should be set to the initialized
499 * HDML structure is specified.
500 * @param r [i] To use POOL, the pointer to request_rec is specified.
501 * @param spec [i] The pointer to the device_table
504 s_init_chtml40(chtml40_t *chtml40, Doc *doc, request_rec *r, device_table *spec)
506 memset(doc, 0, sizeof(Doc));
507 memset(chtml40, 0, sizeof(chtml40_t));
511 chtml40->spec = spec;
512 chtml40->out = qs_alloc_zero_byte_string(r->pool);
513 chtml40->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
514 chtml40->doc->parse_mode = PARSE_MODE_CHTML;
519 * Corresponding EMOJI to a current character-code is retrieved.
520 * The substitution character string is stored in the rslt pointer if agreeing.
522 * @param chtml40 [i] The pointer to the CHTML structure is specified.
523 * @param txt [i] The character string to want to examine whether it is
524 * EMOJI is specified.
525 * @param rslt [o] The pointer to the pointer that stores the result is
527 * @return When corresponding EMOJI exists, it returns it excluding 0.
530 s_chtml40_search_emoji(chtml40_t *chtml40, char *txt, char **rslt)
537 spec = chtml40->spec;
543 DBG(r,"spec is NULL");
546 for (ee = chtml40->conf->emoji;
549 if (ee->imode == NULL) {
550 DBG(r, "emoji->imode is NULL");
554 if (ee->imode->string != NULL
555 && strlen(ee->imode->string) > 0
556 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
558 if (spec == NULL || spec->emoji_type == NULL) {
559 *rslt = apr_palloc(r->pool, 3);
560 (*rslt)[0] = ee->imode->hex1byte & 0xff;
561 (*rslt)[1] = ee->imode->hex2byte & 0xff;
563 return strlen(ee->imode->string);
575 chxj_chtml40_emoji_only_converter(request_rec *r, device_table *spec, const char *src, apr_size_t len)
586 chtml40 = &__chtml40;
589 DBG(r, "REQ[%X] start chxj_chtml40_emoji_eonly_converter()", (unsigned int)(apr_size_t)r);
590 memset(doc, 0, sizeof(Doc));
591 memset(chtml40, 0, sizeof(chtml40_t));
595 chtml40->spec = spec;
596 chtml40->out = qs_alloc_zero_byte_string(r->pool);
597 chtml40->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
598 chtml40->doc->parse_mode = PARSE_MODE_CHTML;
600 apr_pool_create(&pool, r->pool);
602 chxj_buffered_write_init(pool, &doc->buf);
604 for (ii=0; ii<len; ii++) {
608 rtn = s_chtml40_search_emoji(chtml40, (char *)&src[ii], &out);
615 if (is_sjis_kanji(src[ii])) {
616 two_byte[0] = src[ii+0];
617 two_byte[1] = src[ii+1];
623 one_byte[0] = src[ii+0];
628 chtml40->out = chxj_buffered_write_flush(chtml40->out, &doc->buf);
630 DBG(r, "REQ[%X] end chxj_chtml40_emoji_eonly_converter()", (unsigned int)(apr_size_t)r);
636 * It is a handler who processes the HTML tag.
638 * @param pdoc [i/o] The pointer to the CHTML structure at the output
639 * destination is specified.
640 * @param node [i] The HTML tag node is specified.
641 * @return The conversion result is returned.
644 s_chtml40_start_html_tag(void *pdoc, Node *UNUSED(node))
646 chtml40_t *chtml40 = GET_CHTML40(pdoc);
647 Doc *doc = chtml40->doc;
649 /*--------------------------------------------------------------------------*/
651 /*--------------------------------------------------------------------------*/
659 * It is a handler who processes the HTML tag.
661 * @param pdoc [i/o] The pointer to the CHTML structure at the output
662 * destination is specified.
663 * @param node [i] The HTML tag node is specified.
664 * @return The conversion result is returned.
667 s_chtml40_end_html_tag(void *pdoc, Node *UNUSED(child))
669 chtml40_t *chtml40 = GET_CHTML40(pdoc);
670 Doc *doc = chtml40->doc;
678 * It is a handler who processes the META tag.
680 * @param pdoc [i/o] The pointer to the CHTML structure at the output
681 * destination is specified.
682 * @param node [i] The META tag node is specified.
683 * @return The conversion result is returned.
686 s_chtml40_start_meta_tag(void *pdoc, Node *node)
692 int content_type_flag;
695 chtml40 = GET_CHTML40(pdoc);
699 content_type_flag = 0;
703 /*--------------------------------------------------------------------------*/
705 /*--------------------------------------------------------------------------*/
706 for (attr = qs_get_attr(doc,node);
708 attr = qs_get_next_attr(doc,attr)) {
709 char *name = qs_get_attr_name(doc,attr);
710 char *value = qs_get_attr_value(doc,attr);
714 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
715 /*----------------------------------------------------------------------*/
717 /*----------------------------------------------------------------------*/
718 W_L(" http-equiv=\"");
721 if (STRCASEEQ('c','C',"content-type", value))
722 content_type_flag = 1;
724 if (STRCASEEQ('r','R',"refresh", value))
731 if (strcasecmp(name, "content") == 0 && value && *value) {
732 if (content_type_flag) {
736 W_V(chxj_header_inf_set_content_type(r, "text/html; charset=SHIFT_JIS"));
744 buf = apr_pstrdup(r->pool, value);
745 url = strchr(buf, ';');
747 sec = apr_pstrdup(r->pool, buf);
750 url = chxj_encoding_parameter(r, url);
751 url = chxj_add_cookie_parameter(r, url, chtml40->cookie);
781 * It is a handler who processes the META tag.
783 * @param pdoc [i/o] The pointer to the CHTML structure at the output
784 * destination is specified.
785 * @param node [i] The META tag node is specified.
786 * @return The conversion result is returned.
789 s_chtml40_end_meta_tag(void* pdoc, Node* UNUSED(child))
791 chtml40_t *chtml40 = GET_CHTML40(pdoc);
798 * It is a handler who processes the HEAD tag.
800 * @param pdoc [i/o] The pointer to the CHTML structure at the output
801 * destination is specified.
802 * @param node [i] The HEAD tag node is specified.
803 * @return The conversion result is returned.
806 s_chtml40_start_head_tag(void* pdoc, Node* UNUSED(node))
808 chtml40_t *chtml40 = GET_CHTML40(pdoc);
809 Doc *doc = chtml40->doc;
818 * It is a handler who processes the HEAD tag.
820 * @param pdoc [i/o] The pointer to the CHTML structure at the output
821 * destination is specified.
822 * @param node [i] The HEAD tag node is specified.
823 * @return The conversion result is returned.
826 s_chtml40_end_head_tag(void *pdoc, Node *UNUSED(node))
828 chtml40_t *chtml40 = GET_CHTML40(pdoc);
829 Doc *doc = chtml40->doc;
838 * It is a handler who processes the TITLE tag.
840 * @param pdoc [i/o] The pointer to the CHTML structure at the output
841 * destination is specified.
842 * @param node [i] The TITLE tag node is specified.
843 * @return The conversion result is returned.
846 s_chtml40_start_title_tag(void *pdoc, Node *UNUSED(node))
848 chtml40_t *chtml40 = GET_CHTML40(pdoc);
849 Doc *doc = chtml40->doc;
858 * It is a handler who processes the TITLE tag.
860 * @param pdoc [i/o] The pointer to the CHTML structure at the output
861 * destination is specified.
862 * @param node [i] The TITLE tag node is specified.
863 * @return The conversion result is returned.
866 s_chtml40_end_title_tag(void *pdoc, Node *UNUSED(child))
868 chtml40_t *chtml40 = GET_CHTML40(pdoc);
869 Doc *doc = chtml40->doc;
878 * It is a handler who processes the BASE tag.
880 * @param pdoc [i/o] The pointer to the CHTML structure at the output
881 * destination is specified.
882 * @param node [i] The BASE tag node is specified.
883 * @return The conversion result is returned.
886 s_chtml40_start_base_tag(void *pdoc, Node *node)
893 chtml40 = GET_CHTML40(pdoc);
898 /*--------------------------------------------------------------------------*/
900 /*--------------------------------------------------------------------------*/
901 for (attr = qs_get_attr(doc,node);
903 attr = qs_get_next_attr(doc,attr)) {
904 char *name = qs_get_attr_name(doc,attr);
905 char *value = qs_get_attr_value(doc,attr);
906 if (STRCASEEQ('h','H',"href", name)) {
919 * It is a handler who processes the BASE tag.
921 * @param pdoc [i/o] The pointer to the CHTML structure at the output
922 * destination is specified.
923 * @param node [i] The BASE tag node is specified.
924 * @return The conversion result is returned.
927 s_chtml40_end_base_tag(void *pdoc, Node *UNUSED(child))
929 chtml40_t *chtml40 = GET_CHTML40(pdoc);
936 * It is a handler who processes the BODY tag.
938 * @param pdoc [i/o] The pointer to the CHTML structure at the output
939 * destination is specified.
940 * @param node [i] The BODY tag node is specified.
941 * @return The conversion result is returned.
944 s_chtml40_start_body_tag(void *pdoc, Node *node)
951 chtml40 = GET_CHTML40(pdoc);
956 /*--------------------------------------------------------------------------*/
958 /*--------------------------------------------------------------------------*/
959 for (attr = qs_get_attr(doc,node);
961 attr = qs_get_next_attr(doc,attr)) {
962 char *name = qs_get_attr_name(doc,attr);
963 char *value = qs_get_attr_value(doc,attr);
964 if (STRCASEEQ('b','B', "bgcolor", name) && value && *value) {
965 /*----------------------------------------------------------------------*/
967 /*----------------------------------------------------------------------*/
972 else if (STRCASEEQ('t','T', "text", name) && value && *value) {
973 /*----------------------------------------------------------------------*/
975 /*----------------------------------------------------------------------*/
980 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
981 /*----------------------------------------------------------------------*/
983 /*----------------------------------------------------------------------*/
988 else if (STRCASEEQ('a','A',"alink", name) && value && *value) {
989 /*----------------------------------------------------------------------*/
991 /*----------------------------------------------------------------------*/
996 else if (STRCASEEQ('v','V',"vlink", name) && value && *value) {
997 /*----------------------------------------------------------------------*/
999 /*----------------------------------------------------------------------*/
1007 return chtml40->out;
1012 * It is a handler who processes the BODY tag.
1014 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1015 * destination is specified.
1016 * @param node [i] The BODY tag node is specified.
1017 * @return The conversion result is returned.
1020 s_chtml40_end_body_tag(void *pdoc, Node *UNUSED(child))
1025 chtml40 = GET_CHTML40(pdoc);
1030 return chtml40->out;
1035 * It is a handler who processes the A tag.
1037 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1038 * destination is specified.
1039 * @param node [i] The A tag node is specified.
1040 * @return The conversion result is returned.
1043 s_chtml40_start_a_tag(void *pdoc, Node *node)
1050 chtml40 = GET_CHTML40(pdoc);
1055 /*--------------------------------------------------------------------------*/
1056 /* Get Attributes */
1057 /*--------------------------------------------------------------------------*/
1058 for (attr = qs_get_attr(doc,node);
1060 attr = qs_get_next_attr(doc,attr)) {
1061 char *name = qs_get_attr_name(doc,attr);
1062 char *value = qs_get_attr_value(doc,attr);
1063 if (STRCASEEQ('n','N',"name", name)) {
1064 /*----------------------------------------------------------------------*/
1066 /*----------------------------------------------------------------------*/
1071 else if (STRCASEEQ('h','H',"href", name)) {
1072 /*----------------------------------------------------------------------*/
1074 /*----------------------------------------------------------------------*/
1075 value = chxj_encoding_parameter(r, value);
1076 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1077 value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
1083 else if (STRCASEEQ('a','A',"accesskey", name)) {
1084 /*----------------------------------------------------------------------*/
1086 /*----------------------------------------------------------------------*/
1087 W_L(" accesskey=\"");
1091 else if (STRCASEEQ('c','C',"cti", name)) {
1092 /*----------------------------------------------------------------------*/
1094 /*----------------------------------------------------------------------*/
1099 else if (STRCASEEQ('i','I',"ijam", name)) {
1100 /*----------------------------------------------------------------------*/
1102 /*----------------------------------------------------------------------*/
1105 else if (STRCASEEQ('u','U',"utn", name)) {
1106 /*----------------------------------------------------------------------*/
1108 /* It is special only for CHTML. */
1109 /*----------------------------------------------------------------------*/
1112 else if (STRCASEEQ('t','T',"telbook", name)) {
1113 /*----------------------------------------------------------------------*/
1115 /*----------------------------------------------------------------------*/
1118 else if (STRCASEEQ('k','K',"kana", name)) {
1119 /*----------------------------------------------------------------------*/
1121 /*----------------------------------------------------------------------*/
1124 else if (STRCASEEQ('e','E',"email", name)) {
1125 /*----------------------------------------------------------------------*/
1127 /*----------------------------------------------------------------------*/
1130 else if (STRCASEEQ('i','I',"ista", name)) {
1131 /*----------------------------------------------------------------------*/
1133 /*----------------------------------------------------------------------*/
1136 else if (STRCASEEQ('i','I',"ilet", name)) {
1137 /*----------------------------------------------------------------------*/
1139 /*----------------------------------------------------------------------*/
1142 else if (STRCASEEQ('i','I',"iswf", name)) {
1143 /*----------------------------------------------------------------------*/
1145 /*----------------------------------------------------------------------*/
1148 else if (STRCASEEQ('i','I',"irst", name)) {
1149 /*----------------------------------------------------------------------*/
1151 /*----------------------------------------------------------------------*/
1156 return chtml40->out;
1161 * It is a handler who processes the A tag.
1163 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1164 * destination is specified.
1165 * @param node [i] The A tag node is specified.
1166 * @return The conversion result is returned.
1169 s_chtml40_end_a_tag(void *pdoc, Node *UNUSED(child))
1174 chtml40 = GET_CHTML40(pdoc);
1179 return chtml40->out;
1184 * It is a handler who processes the BR tag.
1186 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1187 * destination is specified.
1188 * @param node [i] The BR tag node is specified.
1189 * @return The conversion result is returned.
1192 s_chtml40_start_br_tag(void *pdoc, Node *node)
1199 chtml40 = GET_CHTML40(pdoc);
1203 /*--------------------------------------------------------------------------*/
1204 /* Get Attributes */
1205 /*--------------------------------------------------------------------------*/
1206 for (attr = qs_get_attr(doc,node);
1208 attr = qs_get_next_attr(doc,attr)) {
1209 char *name = qs_get_attr_name(doc,attr);
1210 char *value = qs_get_attr_value(doc,attr);
1211 if (STRCASEEQ('c','C',"clear",name)) {
1212 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1221 return chtml40->out;
1226 * It is a handler who processes the BR tag.
1228 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1229 * destination is specified.
1230 * @param node [i] The BR tag node is specified.
1231 * @return The conversion result is returned.
1234 s_chtml40_end_br_tag(void *pdoc, Node *UNUSED(child))
1236 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1238 return chtml40->out;
1243 * It is a handler who processes the TR tag.
1245 * @param chtml40 [i/o] The pointer to the CHTML structure at the output
1246 * destination is specified.
1247 * @param node [i] The TR tag node is specified.
1248 * @return The conversion result is returned.
1251 s_chtml40_start_tr_tag(void *pdoc, Node *UNUSED(node))
1253 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1255 return chtml40->out;
1260 * It is a handler who processes the TR tag.
1262 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1263 * destination is specified.
1264 * @param node [i] The TR tag node is specified.
1265 * @return The conversion result is returned.
1268 s_chtml40_end_tr_tag(void *pdoc, Node *UNUSED(child))
1274 chtml40 = GET_CHTML40(pdoc);
1280 return chtml40->out;
1285 * It is a handler who processes the FONT tag.
1287 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1288 * destination is specified.
1289 * @param node [i] The FONT tag node is specified.
1290 * @return The conversion result is returned.
1293 s_chtml40_start_font_tag(void *pdoc, Node *node)
1301 chtml40 = GET_CHTML40(pdoc);
1305 /*--------------------------------------------------------------------------*/
1306 /* Get Attributes */
1307 /*--------------------------------------------------------------------------*/
1308 for (attr = qs_get_attr(doc,node);
1309 attr && color == NULL;
1310 attr = qs_get_next_attr(doc,attr)) {
1311 char *name = qs_get_attr_name(doc,attr);
1312 char *value = qs_get_attr_value(doc,attr);
1313 if (STRCASEEQ('c','C',"color", name) && value && *value) {
1314 color = apr_pstrdup(doc->buf.pool, value);
1317 else if (STRCASEEQ('s','S',"size", name)) {
1318 /*----------------------------------------------------------------------*/
1320 /*----------------------------------------------------------------------*/
1325 W_L("<font color=\"");
1328 chtml40->font_flag++;
1330 return chtml40->out;
1335 * It is a handler who processes the FONT tag.
1337 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1338 * destination is specified.
1339 * @param node [i] The FONT tag node is specified.
1340 * @return The conversion result is returned.
1343 s_chtml40_end_font_tag(void *pdoc, Node *UNUSED(child))
1349 chtml40 = GET_CHTML40(pdoc);
1353 if (chtml40->font_flag) {
1355 chtml40->font_flag--;
1358 return chtml40->out;
1363 * It is a handler who processes the FORM tag.
1365 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1366 * destination is specified.
1367 * @param node [i] The FORM tag node is specified.
1368 * @return The conversion result is returned.
1371 s_chtml40_start_form_tag(void *pdoc, Node *node)
1377 char *new_hidden_tag = NULL;
1378 char *attr_method = NULL;
1379 char *attr_action = NULL;
1380 char *attr_utn = NULL;
1382 chtml40 = GET_CHTML40(pdoc);
1386 /*--------------------------------------------------------------------------*/
1387 /* Get Attributes */
1388 /*--------------------------------------------------------------------------*/
1389 for (attr = qs_get_attr(doc,node);
1391 attr = qs_get_next_attr(doc,attr)) {
1392 char *name = qs_get_attr_name(doc,attr);
1393 char *value = qs_get_attr_value(doc,attr);
1394 if (STRCASEEQ('a','A',"action", name)) {
1395 /*----------------------------------------------------------------------*/
1397 /*----------------------------------------------------------------------*/
1398 attr_action = chxj_encoding_parameter(r, value);
1399 attr_action = chxj_add_cookie_parameter(r, attr_action, chtml40->cookie);
1401 else if (STRCASEEQ('m','M',"method", name)) {
1402 /*----------------------------------------------------------------------*/
1404 /*----------------------------------------------------------------------*/
1405 attr_method = apr_pstrdup(doc->pool, value);
1407 else if (STRCASEEQ('u','U',"utn", name)) {
1408 /*----------------------------------------------------------------------*/
1410 /* It is special only for CHTML. */
1411 /*----------------------------------------------------------------------*/
1416 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1421 char *new_query_string = NULL;
1422 q = strchr(attr_action, '?');
1424 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &new_query_string, CHXJ_TRUE, CHXJ_FALSE, chtml40->entryp);
1425 if (new_hidden_tag || new_query_string) {
1431 if (new_query_string) {
1433 W_V(new_query_string);
1446 if (new_hidden_tag) {
1447 W_V(new_hidden_tag);
1449 return chtml40->out;
1454 * It is a handler who processes the FORM tag.
1456 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1457 * destination is specified.
1458 * @param node [i] The FORM tag node is specified.
1459 * @return The conversion result is returned.
1462 s_chtml40_end_form_tag(void *pdoc, Node *UNUSED(child))
1467 chtml40 = GET_CHTML40(pdoc);
1472 return chtml40->out;
1477 * It is a handler who processes the INPUT tag.
1479 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1480 * destination is specified.
1481 * @param node [i] The INPUT tag node is specified.
1482 * @return The conversion result is returned.
1485 s_chtml40_start_input_tag(void *pdoc, Node *node)
1490 char *max_length = NULL;
1494 char *istyle = NULL;
1496 char *checked = NULL;
1497 char *accesskey = NULL;
1499 chtml40 = GET_CHTML40(pdoc);
1503 /*--------------------------------------------------------------------------*/
1504 /* Get Attributes */
1505 /*--------------------------------------------------------------------------*/
1506 type = qs_get_type_attr(doc, node, doc->buf.pool);
1507 name = qs_get_name_attr(doc, node, doc->buf.pool);
1508 value = qs_get_value_attr(doc,node, doc->buf.pool);
1509 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1510 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1511 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1512 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1513 size = qs_get_size_attr(doc, node, doc->buf.pool);
1516 type = qs_trim_string(doc->buf.pool, type);
1517 if (type && (STRCASEEQ('t','T',"text", type) ||
1518 STRCASEEQ('p','P',"password",type) ||
1519 STRCASEEQ('c','C',"checkbox",type) ||
1520 STRCASEEQ('r','R',"radio", type) ||
1521 STRCASEEQ('h','H',"hidden", type) ||
1522 STRCASEEQ('s','S',"submit", type) ||
1523 STRCASEEQ('r','R',"reset", type))) {
1529 if (size && *size) {
1534 if (name && *name) {
1539 if (value && *value) {
1540 if (type && (STRCASEEQ('s','S',"submit",type) || STRCASEEQ('r','R',"reset",type))) {
1541 apr_size_t value_len = strlen(value);
1542 value = chxj_conv_z2h(r, value, &value_len, chtml40->entryp);
1546 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1549 if (accesskey && *accesskey) {
1550 W_L(" accesskey=\"");
1555 /*------------------------------------------------------------------------*/
1557 /*------------------------------------------------------------------------*/
1558 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1565 /*--------------------------------------------------------------------------*/
1566 /* The figure is default for the password. */
1567 /*--------------------------------------------------------------------------*/
1568 if (max_length && *max_length) {
1569 if (chxj_chk_numeric(max_length) != 0) {
1570 max_length = apr_psprintf(r->pool, "0");
1572 if (istyle != NULL && *istyle == '1') {
1573 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1577 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1585 return chtml40->out;
1590 * It is a handler who processes the INPUT tag.
1592 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1593 * destination is specified.
1594 * @param node [i] The INPUT tag node is specified.
1595 * @return The conversion result is returned.
1598 s_chtml40_end_input_tag(void *pdoc, Node *UNUSED(child))
1600 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1602 return chtml40->out;
1607 * It is a handler who processes the CENTER tag.
1609 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1610 * destination is specified.
1611 * @param node [i] The CENTER tag node is specified.
1612 * @return The conversion result is returned.
1615 s_chtml40_start_center_tag(void *pdoc, Node *UNUSED(node))
1620 chtml40 = GET_CHTML40(pdoc);
1625 return chtml40->out;
1630 * It is a handler who processes the CENTER tag.
1632 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1633 * destination is specified.
1634 * @param node [i] The CENTER tag node is specified.
1635 * @return The conversion result is returned.
1638 s_chtml40_end_center_tag(void *pdoc, Node *UNUSED(child))
1643 chtml40 = GET_CHTML40(pdoc);
1648 return chtml40->out;
1653 * It is a handler who processes the HR tag.
1655 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1656 * destination is specified.
1657 * @param node [i] The HR tag node is specified.
1658 * @return The conversion result is returned.
1661 s_chtml40_start_hr_tag(void *pdoc, Node *node)
1668 chtml40 = GET_CHTML40(pdoc);
1674 for (attr = qs_get_attr(doc,node);
1676 attr = qs_get_next_attr(doc,attr)) {
1677 char *name = qs_get_attr_name(doc,attr);
1678 char *value = qs_get_attr_value(doc,attr);
1679 if (STRCASEEQ('a','A',"align", name)) {
1680 /*----------------------------------------------------------------------*/
1682 /*----------------------------------------------------------------------*/
1683 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1689 else if (STRCASEEQ('s','S',"size", name)) {
1690 /*----------------------------------------------------------------------*/
1692 /*----------------------------------------------------------------------*/
1693 if (value && *value) {
1699 else if (STRCASEEQ('w','W',"width", name)) {
1700 /*----------------------------------------------------------------------*/
1702 /*----------------------------------------------------------------------*/
1703 if (value && *value) {
1709 else if (STRCASEEQ('n','N',"noshade", name)) {
1710 /*----------------------------------------------------------------------*/
1712 /*----------------------------------------------------------------------*/
1715 else if (STRCASEEQ('c','C',"color", name) && value && *value) {
1716 /*----------------------------------------------------------------------*/
1718 /*----------------------------------------------------------------------*/
1725 return chtml40->out;
1730 * It is a handler who processes the HR tag.
1732 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1733 * destination is specified.
1734 * @param node [i] The HR tag node is specified.
1735 * @return The conversion result is returned.
1738 s_chtml40_end_hr_tag(void *pdoc, Node *UNUSED(child))
1740 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1742 return chtml40->out;
1747 * It is a handler who processes the IMG tag.
1749 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1750 * destination is specified.
1751 * @param node [i] The IMG tag node is specified.
1752 * @return The conversion result is returned.
1755 s_chtml40_start_img_tag(void *pdoc, Node *node)
1757 #ifndef IMG_NOT_CONVERT_FILENAME
1765 chtml40 = GET_CHTML40(pdoc);
1768 #ifndef IMG_NOT_CONVERT_FILENAME
1769 spec = chtml40->spec;
1773 /*--------------------------------------------------------------------------*/
1774 /* Get Attributes */
1775 /*--------------------------------------------------------------------------*/
1776 for (attr = qs_get_attr(doc,node);
1778 attr = qs_get_next_attr(doc,attr)) {
1779 char *name = qs_get_attr_name(doc,attr);
1780 char *value = qs_get_attr_value(doc,attr);
1781 if (STRCASEEQ('s','S',"src", name)) {
1782 /*----------------------------------------------------------------------*/
1784 /*----------------------------------------------------------------------*/
1785 #ifdef IMG_NOT_CONVERT_FILENAME
1786 value = chxj_encoding_parameter(r, value);
1787 value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
1788 value = chxj_add_cookie_no_update_parameter(r, value);
1794 value = chxj_img_conv(r,spec,value);
1795 value = chxj_encoding_parameter(r, value);
1796 value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
1797 value = chxj_add_cookie_no_update_parameter(r, value);
1803 else if (STRCASEEQ('a','A',"align", name)) {
1804 /*----------------------------------------------------------------------*/
1806 /*----------------------------------------------------------------------*/
1807 if (value && (STRCASEEQ('t','T',"top", value) ||
1808 STRCASEEQ('m','M',"middle", value) ||
1809 STRCASEEQ('b','B',"bottom", value) ||
1810 STRCASEEQ('l','L',"left", value) ||
1811 STRCASEEQ('c','C',"center", value) ||
1812 STRCASEEQ('r','R',"right", value))) {
1818 else if (STRCASEEQ('w','W',"width", name) && value && *value) {
1819 /*----------------------------------------------------------------------*/
1821 /*----------------------------------------------------------------------*/
1826 else if (STRCASEEQ('h','H', "height", name) && value && *value) {
1827 /*----------------------------------------------------------------------*/
1829 /*----------------------------------------------------------------------*/
1834 else if (STRCASEEQ('h','H',"hspace", name) && value && *value) {
1835 /*----------------------------------------------------------------------*/
1837 /*----------------------------------------------------------------------*/
1842 else if (STRCASEEQ('v','V',"vspace", name) && value && *value) {
1843 /*----------------------------------------------------------------------*/
1845 /*----------------------------------------------------------------------*/
1850 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
1851 /*----------------------------------------------------------------------*/
1853 /*----------------------------------------------------------------------*/
1860 return chtml40->out;
1865 * It is a handler who processes the IMG tag.
1867 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1868 * destination is specified.
1869 * @param node [i] The IMG tag node is specified.
1870 * @return The conversion result is returned.
1873 s_chtml40_end_img_tag(void *pdoc, Node *UNUSED(child))
1875 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1877 return chtml40->out;
1882 * It is a handler who processes the SELECT tag.
1884 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1885 * destination is specified.
1886 * @param node [i] The SELECT tag node is specified.
1887 * @return The conversion result is returned.
1890 s_chtml40_start_select_tag(void *pdoc, Node *child)
1892 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1893 Doc *doc = chtml40->doc;
1896 char *multiple = NULL;
1900 for (attr = qs_get_attr(doc,child);
1902 attr = qs_get_next_attr(doc,attr)) {
1903 char *nm = qs_get_attr_name(doc,attr);
1904 char *val = qs_get_attr_value(doc,attr);
1905 if (STRCASEEQ('s','S',"size", nm)) {
1906 /*----------------------------------------------------------------------*/
1907 /* CHTML 1.0 version 2.0 */
1908 /*----------------------------------------------------------------------*/
1909 size = apr_pstrdup(doc->buf.pool, val);
1911 else if (STRCASEEQ('n','N',"name", nm)) {
1912 /*----------------------------------------------------------------------*/
1913 /* CHTML 1.0 version 2.0 */
1914 /*----------------------------------------------------------------------*/
1915 name = apr_pstrdup(doc->buf.pool, val);
1917 else if (STRCASEEQ('m','M',"multiple", nm)) {
1918 /*----------------------------------------------------------------------*/
1919 /* CHTML 1.0 version 2.0 */
1920 /*----------------------------------------------------------------------*/
1921 multiple = apr_pstrdup(doc->buf.pool, val);
1924 if (size && *size) {
1929 if (name && *name) {
1938 return chtml40->out;
1943 * It is a handler who processes the SELECT tag.
1945 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1946 * destination is specified.
1947 * @param node [i] The SELECT tag node is specified.
1948 * @return The conversion result is returned.
1951 s_chtml40_end_select_tag(void *pdoc, Node *UNUSED(child))
1953 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1954 Doc *doc = chtml40->doc;
1957 return chtml40->out;
1962 * It is a handler who processes the OPTION tag.
1964 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1965 * destination is specified.
1966 * @param node [i] The OPTION tag node is specified.
1967 * @return The conversion result is returned.
1970 s_chtml40_start_option_tag(void *pdoc, Node *child)
1979 chtml40 = GET_CHTML40(pdoc);
1986 for (attr = qs_get_attr(doc,child);
1988 attr = qs_get_next_attr(doc,attr)) {
1989 char *nm = qs_get_attr_name(doc,attr);
1990 char *val = qs_get_attr_value(doc,attr);
1991 if (STRCASEEQ('s','S',"selected", nm)) {
1992 /*----------------------------------------------------------------------*/
1993 /* CHTML 1.0 version 2.0 */
1994 /*----------------------------------------------------------------------*/
1995 selected = apr_pstrdup(doc->buf.pool, val);
1997 else if (STRCASEEQ('v','V',"value", nm)) {
1998 /*----------------------------------------------------------------------*/
1999 /* CHTML 1.0 version 2.0 */
2000 /*----------------------------------------------------------------------*/
2001 value = apr_pstrdup(doc->buf.pool, val);
2013 return chtml40->out;
2018 * It is a handler who processes the OPTION tag.
2020 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2021 * destination is specified.
2022 * @param node [i] The OPTION tag node is specified.
2023 * @return The conversion result is returned.
2026 s_chtml40_end_option_tag(void *pdoc, Node *UNUSED(child))
2028 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2032 return chtml40->out;
2037 * It is a handler who processes the DIV tag.
2039 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2040 * destination is specified.
2041 * @param node [i] The DIV tag node is specified.
2042 * @return The conversion result is returned.
2045 s_chtml40_start_div_tag(void *pdoc, Node *child)
2053 chtml40 = GET_CHTML40(pdoc);
2059 for (attr = qs_get_attr(doc,child);
2061 attr = qs_get_next_attr(doc,attr)) {
2062 char *nm = qs_get_attr_name(doc,attr);
2063 char *val = qs_get_attr_value(doc,attr);
2064 if (STRCASEEQ('a','A',"align", nm)) {
2065 /*----------------------------------------------------------------------*/
2066 /* CHTML 1.0 (W3C version 3.2) */
2067 /*----------------------------------------------------------------------*/
2068 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2069 align = apr_pstrdup(doc->buf.pool, val);
2079 return chtml40->out;
2084 * It is a handler who processes the DIV tag.
2086 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2087 * destination is specified.
2088 * @param node [i] The DIV tag node is specified.
2089 * @return The conversion result is returned.
2092 s_chtml40_end_div_tag(void *pdoc, Node *UNUSED(node))
2094 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2095 Doc *doc = chtml40->doc;
2099 return chtml40->out;
2104 * It is a handler who processes the UL tag.
2106 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2107 * destination is specified.
2108 * @param node [i] The UL tag node is specified.
2109 * @return The conversion result is returned.
2112 s_chtml40_start_ul_tag(void *pdoc, Node *node)
2114 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2115 Doc *doc = chtml40->doc;
2118 /*--------------------------------------------------------------------------*/
2119 /* Get Attributes */
2120 /*--------------------------------------------------------------------------*/
2121 for (attr = qs_get_attr(doc,node);
2123 attr = qs_get_next_attr(doc,attr)) {
2124 char *name = qs_get_attr_name(doc,attr);
2125 char *value = qs_get_attr_value(doc,attr);
2126 if (STRCASEEQ('t','T',"type",name)) {
2127 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2136 return chtml40->out;
2141 * It is a handler who processes the UL tag.
2143 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2144 * destination is specified.
2145 * @param node [i] The UL tag node is specified.
2146 * @return The conversion result is returned.
2149 s_chtml40_end_ul_tag(void *pdoc, Node *UNUSED(child))
2151 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2152 Doc *doc = chtml40->doc;
2156 return chtml40->out;
2161 * It is a handler who processes the PRE tag.
2163 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2164 * destination is specified.
2165 * @param node [i] The PRE tag node is specified.
2166 * @return The conversion result is returned.
2169 s_chtml40_start_pre_tag(void *pdoc, Node *UNUSED(node))
2171 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2172 Doc *doc = chtml40->doc;
2174 chtml40->pre_flag++;
2177 return chtml40->out;
2182 * It is a handler who processes the PRE tag.
2184 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2185 * destination is specified.
2186 * @param node [i] The PRE tag node is specified.
2187 * @return The conversion result is returned.
2190 s_chtml40_end_pre_tag(void *pdoc, Node *UNUSED(child))
2192 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2193 Doc *doc = chtml40->doc;
2196 chtml40->pre_flag--;
2198 return chtml40->out;
2203 * It is a handler who processes the P tag.
2205 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2206 * destination is specified.
2207 * @param node [i] The P tag node is specified.
2208 * @return The conversion result is returned.
2211 s_chtml40_start_p_tag(void *pdoc, Node *node)
2219 chtml40 = GET_CHTML40(pdoc);
2224 for (attr = qs_get_attr(doc,node);
2226 attr = qs_get_next_attr(doc,attr)) {
2227 char *nm = qs_get_attr_name(doc,attr);
2228 char *val = qs_get_attr_value(doc,attr);
2229 if (STRCASEEQ('a','A',"align", nm)) {
2230 /*----------------------------------------------------------------------*/
2231 /* CHTML 1.0 (W3C version 3.2) */
2232 /*----------------------------------------------------------------------*/
2233 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2234 align = apr_pstrdup(doc->buf.pool, val);
2245 return chtml40->out;
2250 * It is a handler who processes the P tag.
2252 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2253 * destination is specified.
2254 * @param node [i] The P tag node is specified.
2255 * @return The conversion result is returned.
2258 s_chtml40_end_p_tag(void *pdoc, Node *UNUSED(child))
2263 chtml40 = GET_CHTML40(pdoc);
2268 return chtml40->out;
2273 * It is a handler who processes the OL tag.
2275 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2276 * destination is specified.
2277 * @param node [i] The OL tag node is specified.
2278 * @return The conversion result is returned.
2281 s_chtml40_start_ol_tag(void *pdoc, Node *node)
2288 chtml40 = GET_CHTML40(pdoc);
2293 /*--------------------------------------------------------------------------*/
2294 /* Get Attributes */
2295 /*--------------------------------------------------------------------------*/
2296 for (attr = qs_get_attr(doc,node);
2298 attr = qs_get_next_attr(doc,attr)) {
2299 char *name = qs_get_attr_name(doc,attr);
2300 char *value = qs_get_attr_value(doc,attr);
2301 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2306 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2314 return chtml40->out;
2319 * It is a handler who processes the OL tag.
2321 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2322 * destination is specified.
2323 * @param node [i] The OL tag node is specified.
2324 * @return The conversion result is returned.
2327 s_chtml40_end_ol_tag(void *pdoc, Node *UNUSED(node))
2329 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2330 Doc *doc = chtml40->doc;
2334 return chtml40->out;
2339 * It is a handler who processes the LI tag.
2341 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2342 * destination is specified.
2343 * @param node [i] The LI tag node is specified.
2344 * @return The conversion result is returned.
2347 s_chtml40_start_li_tag(void *pdoc, Node *node)
2349 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2350 Doc *doc = chtml40->doc;
2354 /*--------------------------------------------------------------------------*/
2355 /* Get Attributes */
2356 /*--------------------------------------------------------------------------*/
2357 for (attr = qs_get_attr(doc,node);
2359 attr = qs_get_next_attr(doc,attr)) {
2360 char *name = qs_get_attr_name(doc,attr);
2361 char *value = qs_get_attr_value(doc,attr);
2362 if (STRCASEEQ('t','T',"type",name)) {
2363 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('s','S',"square",value) || STRCASEEQ('c','C',"circle",value))) {
2369 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2376 return chtml40->out;
2381 * It is a handler who processes the LI tag.
2383 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2384 * destination is specified.
2385 * @param node [i] The LI tag node is specified.
2386 * @return The conversion result is returned.
2389 s_chtml40_end_li_tag(void *pdoc, Node *UNUSED(child))
2391 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2393 return chtml40->out;
2398 * It is a handler who processes the H1 tag.
2400 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2401 * destination is specified.
2402 * @param node [i] The H1 tag node is specified.
2403 * @return The conversion result is returned.
2406 s_chtml40_start_h1_tag(void *pdoc, Node *node)
2413 chtml40 = GET_CHTML40(pdoc);
2418 for (attr = qs_get_attr(doc,node);
2420 attr = qs_get_next_attr(doc,attr)) {
2421 char *name = qs_get_attr_name(doc,attr);
2422 char *value = qs_get_attr_value(doc,attr);
2423 if (STRCASEEQ('a','A',"align", name)) {
2424 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2434 return chtml40->out;
2439 * It is a handler who processes the H1 tag.
2441 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2442 * destination is specified.
2443 * @param node [i] The H1 tag node is specified.
2444 * @return The conversion result is returned.
2447 s_chtml40_end_h1_tag(void *pdoc, Node *UNUSED(child))
2452 chtml40 = GET_CHTML40(pdoc);
2457 return chtml40->out;
2462 * It is a handler who processes the H2 tag.
2464 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2465 * destination is specified.
2466 * @param node [i] The H2 tag node is specified.
2467 * @return The conversion result is returned.
2470 s_chtml40_start_h2_tag(void *pdoc, Node *node)
2477 chtml40 = GET_CHTML40(pdoc);
2482 for (attr = qs_get_attr(doc,node);
2484 attr = qs_get_next_attr(doc,attr)) {
2485 char *name = qs_get_attr_name(doc,attr);
2486 char *value = qs_get_attr_value(doc,attr);
2487 if (STRCASEEQ('a','A',"align", name)) {
2488 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2497 return chtml40->out;
2502 * It is a handler who processes the H2 tag.
2504 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2505 * destination is specified.
2506 * @param node [i] The H2 tag node is specified.
2507 * @return The conversion result is returned.
2510 s_chtml40_end_h2_tag(void *pdoc, Node *UNUSED(child))
2512 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2513 Doc *doc = chtml40->doc;
2517 return chtml40->out;
2522 * It is a handler who processes the H3 tag.
2524 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2525 * destination is specified.
2526 * @param node [i] The H3 tag node is specified.
2527 * @return The conversion result is returned.
2530 s_chtml40_start_h3_tag(void *pdoc, Node *node)
2537 chtml40 = GET_CHTML40(pdoc);
2542 for (attr = qs_get_attr(doc,node);
2544 attr = qs_get_next_attr(doc,attr)) {
2545 char *name = qs_get_attr_name(doc,attr);
2546 char *value = qs_get_attr_value(doc,attr);
2547 if (STRCASEEQ('a','A',"align", name)) {
2548 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2558 return chtml40->out;
2563 * It is a handler who processes the H3 tag.
2565 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2566 * destination is specified.
2567 * @param node [i] The H3 tag node is specified.
2568 * @return The conversion result is returned.
2571 s_chtml40_end_h3_tag(void *pdoc, Node *UNUSED(child))
2573 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2574 Doc *doc = chtml40->doc;
2578 return chtml40->out;
2583 * It is a handler who processes the H4 tag.
2585 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2586 * destination is specified.
2587 * @param node [i] The H4 tag node is specified.
2588 * @return The conversion result is returned.
2591 s_chtml40_start_h4_tag(void *pdoc, Node *node)
2598 chtml40 = GET_CHTML40(pdoc);
2603 for (attr = qs_get_attr(doc,node);
2605 attr = qs_get_next_attr(doc,attr)) {
2606 char *name = qs_get_attr_name(doc,attr);
2607 char *value = qs_get_attr_value(doc,attr);
2608 if (STRCASEEQ('a','A',"align", name)) {
2609 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2618 return chtml40->out;
2623 * It is a handler who processes the H4 tag.
2625 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2626 * destination is specified.
2627 * @param node [i] The H4 tag node is specified.
2628 * @return The conversion result is returned.
2631 s_chtml40_end_h4_tag(void *pdoc, Node *UNUSED(child))
2633 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2634 Doc *doc = chtml40->doc;
2638 return chtml40->out;
2643 * It is a handler who processes the H5 tag.
2645 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2646 * destination is specified.
2647 * @param node [i] The H5 tag node is specified.
2648 * @return The conversion result is returned.
2651 s_chtml40_start_h5_tag(void *pdoc, Node *node)
2658 chtml40 = GET_CHTML40(pdoc);
2663 for (attr = qs_get_attr(doc,node);
2665 attr = qs_get_next_attr(doc,attr)) {
2666 char *name = qs_get_attr_name(doc,attr);
2667 char *value = qs_get_attr_value(doc,attr);
2668 if (STRCASEEQ('a','A',"align", name)) {
2669 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2678 return chtml40->out;
2683 * It is a handler who processes the H5 tag.
2685 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2686 * destination is specified.
2687 * @param node [i] The H5 tag node is specified.
2688 * @return The conversion result is returned.
2691 s_chtml40_end_h5_tag(void *pdoc, Node *UNUSED(child))
2693 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2694 Doc *doc = chtml40->doc;
2698 return chtml40->out;
2703 * It is a handler who processes the H6 tag.
2705 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2706 * destination is specified.
2707 * @param node [i] The H6 tag node is specified.
2708 * @return The conversion result is returned.
2711 s_chtml40_start_h6_tag(void *pdoc, Node *node)
2718 chtml40 = GET_CHTML40(pdoc);
2723 for (attr = qs_get_attr(doc,node);
2725 attr = qs_get_next_attr(doc,attr)) {
2726 char *name = qs_get_attr_name(doc,attr);
2727 char *value = qs_get_attr_value(doc,attr);
2728 if (STRCASEEQ('a','A',"align", name)) {
2729 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2738 return chtml40->out;
2743 * It is a handler who processes the H6 tag.
2745 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2746 * destination is specified.
2747 * @param node [i] The H6 tag node is specified.
2748 * @return The conversion result is returned.
2751 s_chtml40_end_h6_tag(void *pdoc, Node *UNUSED(child))
2753 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2754 Doc *doc = chtml40->doc;
2758 return chtml40->out;
2763 * It is a handler who processes the TEXTARE tag.
2765 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2766 * destination is specified.
2767 * @param node [i] The TEXTAREA tag node is specified.
2768 * @return The conversion result is returned.
2771 s_chtml40_start_textarea_tag(void *pdoc, Node *node)
2778 chtml40 = GET_CHTML40(pdoc);
2782 chtml40->textarea_flag++;
2785 for (attr = qs_get_attr(doc,node);
2787 attr = qs_get_next_attr(doc,attr)) {
2788 char *name = qs_get_attr_name(doc,attr);
2789 char *value = qs_get_attr_value(doc,attr);
2790 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2791 W_L(" accesskey=\"");
2795 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2800 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2805 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2810 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2817 return chtml40->out;
2822 * It is a handler who processes the TEXTAREA tag.
2824 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2825 * destination is specified.
2826 * @param node [i] The TEXTAREA tag node is specified.
2827 * @return The conversion result is returned.
2830 s_chtml40_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2832 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2833 Doc *doc = chtml40->doc;
2836 chtml40->textarea_flag--;
2838 return chtml40->out;
2843 s_chtml40_chxjif_tag(void *pdoc, Node *node)
2850 chtml40 = GET_CHTML40(pdoc);
2854 for (child = qs_get_child_node(doc, node);
2856 child = qs_get_next_node(doc, child)) {
2858 s_chtml40_chxjif_tag(chtml40, child);
2866 s_chtml40_text_tag(void *pdoc, Node *child)
2878 apr_size_t z2h_input_len;
2880 chtml40 = GET_CHTML40(pdoc);
2884 textval = qs_get_node_value(doc,child);
2885 if (strlen(textval) == 0) {
2886 return chtml40->out;
2889 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2890 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2892 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2893 memset(one_byte, 0, sizeof(one_byte));
2896 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2898 int rtn = s_chtml40_search_emoji(chtml40, &textval[ii], &out);
2900 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2905 if (is_sjis_kanji(textval[ii])) {
2906 one_byte[0] = textval[ii+0];
2907 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2908 one_byte[0] = textval[ii+1];
2909 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2912 else if (chtml40->pre_flag) {
2913 one_byte[0] = textval[ii+0];
2914 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2916 else if (chtml40->textarea_flag) {
2917 one_byte[0] = textval[ii+0];
2918 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2920 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2921 one_byte[0] = textval[ii+0];
2922 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2925 z2h_input_len = strlen(tdst);
2926 tdst = chxj_conv_z2h(r, tdst, &z2h_input_len, chtml40->entryp);
2928 return chtml40->out;
2933 * It is a handler who processes the BLOCKQUOTE tag.
2935 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2936 * destination is specified.
2937 * @param node [i] The BLOCKQUOTE tag node is specified.
2938 * @return The conversion result is returned.
2941 s_chtml40_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2943 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2944 Doc *doc = chtml40->doc;
2945 W_L("<blockquote>");
2946 return chtml40->out;
2951 * It is a handler who processes the BLOCKQUOTE tag.
2953 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2954 * destination is specified.
2955 * @param node [i] The BLOCKQUOTE tag node is specified.
2956 * @return The conversion result is returned.
2959 s_chtml40_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2961 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2962 Doc *doc = chtml40->doc;
2963 W_L("</blockquote>");
2964 return chtml40->out;
2969 * It is a handler who processes the DIR tag.
2971 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2972 * destination is specified.
2973 * @param node [i] The DIR tag node is specified.
2974 * @return The conversion result is returned.
2977 s_chtml40_start_dir_tag(void *pdoc, Node *node)
2979 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2980 Doc *doc = chtml40->doc;
2983 for (attr = qs_get_attr(doc,node);
2985 attr = qs_get_next_attr(doc,attr)) {
2986 char *name = qs_get_attr_name(doc,attr);
2987 char *value = qs_get_attr_value(doc,attr);
2988 if (STRCASEEQ('t','T',"type",name)) {
2989 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2997 return chtml40->out;
3002 * It is a handler who processes the DIR tag.
3004 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3005 * destination is specified.
3006 * @param node [i] The DIR tag node is specified.
3007 * @return The conversion result is returned.
3010 s_chtml40_end_dir_tag(void *pdoc, Node *UNUSED(child))
3012 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3013 Doc *doc = chtml40->doc;
3015 return chtml40->out;
3020 * It is a handler who processes the DL tag.
3022 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3023 * destination is specified.
3024 * @param node [i] The DL tag node is specified.
3025 * @return The conversion result is returned.
3028 s_chtml40_start_dl_tag(void *pdoc, Node *UNUSED(child))
3030 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3031 Doc *doc = chtml40->doc;
3033 return chtml40->out;
3038 * It is a handler who processes the DL tag.
3040 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3041 * destination is specified.
3042 * @param node [i] The DL tag node is specified.
3043 * @return The conversion result is returned.
3046 s_chtml40_end_dl_tag(void *pdoc, Node *UNUSED(child))
3048 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3049 Doc *doc = chtml40->doc;
3051 return chtml40->out;
3056 * It is a handler who processes the DT tag.
3058 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3059 * destination is specified.
3060 * @param node [i] The DT tag node is specified.
3061 * @return The conversion result is returned.
3064 s_chtml40_start_dt_tag(void *pdoc, Node *UNUSED(child))
3066 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3067 Doc *doc = chtml40->doc;
3069 return chtml40->out;
3074 * It is a handler who processes the DT tag.
3076 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3077 * destination is specified.
3078 * @param node [i] The DT tag node is specified.
3079 * @return The conversion result is returned.
3082 s_chtml40_end_dt_tag(void *pdoc, Node *UNUSED(child))
3084 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3086 return chtml40->out;
3091 * It is a handler who processes the DD tag.
3093 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3094 * destination is specified.
3095 * @param node [i] The DD tag node is specified.
3096 * @return The conversion result is returned.
3099 s_chtml40_start_dd_tag(void *pdoc, Node *UNUSED(child))
3101 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3102 Doc *doc = chtml40->doc;
3106 return chtml40->out;
3111 * It is a handler who processes the DD tag.
3113 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3114 * destination is specified.
3115 * @param node [i] The DD tag node is specified.
3116 * @return The conversion result is returned.
3119 s_chtml40_end_dd_tag(void *pdoc, Node *UNUSED(child))
3121 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3123 return chtml40->out;
3128 * It is a handler who processes the MARQUEE tag.
3130 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3131 * destination is specified.
3132 * @param node [i] The MARQUEE tag node is specified.
3133 * @return The conversion result is returned.
3136 s_chtml40_start_marquee_tag(void *pdoc, Node *node)
3138 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3139 Doc *doc = chtml40->doc;
3142 /*--------------------------------------------------------------------------*/
3143 /* Get Attributes */
3144 /*--------------------------------------------------------------------------*/
3145 for (attr = qs_get_attr(doc,node);
3147 attr = qs_get_next_attr(doc,attr)) {
3148 char *name = qs_get_attr_name(doc,attr);
3149 char *value = qs_get_attr_value(doc,attr);
3150 if (STRCASEEQ('d','D',"direction", name)) {
3151 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3152 W_L(" direction=\"");
3157 else if (STRCASEEQ('b','B',"behavior",name)) {
3158 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3159 W_L(" behavior=\"");
3164 else if (STRCASEEQ('l','L',"loop",name)) {
3165 if (value && *value) {
3173 return chtml40->out;
3178 * It is a handler who processes the MARQUEE tag.
3180 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3181 * destination is specified.
3182 * @param node [i] The MARQUEE tag node is specified.
3183 * @return The conversion result is returned.
3186 s_chtml40_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3188 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3189 Doc *doc = chtml40->doc;
3191 return chtml40->out;
3196 * It is a handler who processes the BLINK tag.
3198 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3199 * destination is specified.
3200 * @param node [i] The BLINK tag node is specified.
3201 * @return The conversion result is returned.
3204 s_chtml40_start_blink_tag(void *pdoc, Node *UNUSED(child))
3206 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3207 Doc *doc = chtml40->doc;
3209 return chtml40->out;
3214 * It is a handler who processes the BLINK tag.
3216 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3217 * destination is specified.
3218 * @param node [i] The BLINK tag node is specified.
3219 * @return The conversion result is returned.
3222 s_chtml40_end_blink_tag(void *pdoc, Node *UNUSED(child))
3224 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3225 Doc *doc = chtml40->doc;
3227 return chtml40->out;
3232 * It is a handler who processes the MENU tag.
3234 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3235 * destination is specified.
3236 * @param node [i] The MENU tag node is specified.
3237 * @return The conversion result is returned.
3240 s_chtml40_start_menu_tag(void *pdoc, Node *node)
3242 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3243 Doc *doc = chtml40->doc;
3246 /*--------------------------------------------------------------------------*/
3247 /* Get Attributes */
3248 /*--------------------------------------------------------------------------*/
3249 for (attr = qs_get_attr(doc,node);
3251 attr = qs_get_next_attr(doc,attr)) {
3252 char *name = qs_get_attr_name(doc,attr);
3253 char *value = qs_get_attr_value(doc,attr);
3254 if (STRCASEEQ('t','T',"type",name)) {
3255 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3263 return chtml40->out;
3268 * It is a handler who processes the MENU tag.
3270 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3271 * destination is specified.
3272 * @param node [i] The MENU tag node is specified.
3273 * @return The conversion result is returned.
3276 s_chtml40_end_menu_tag(void *pdoc, Node *UNUSED(child))
3278 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3279 Doc *doc = chtml40->doc;
3281 return chtml40->out;
3286 * It is a handler who processes the PLAINTEXT tag.
3288 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3289 * destination is specified.
3290 * @param node [i] The PLAINTEXT tag node is specified.
3291 * @return The conversion result is returned.
3294 s_chtml40_start_plaintext_tag(void *pdoc, Node *node)
3296 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3297 Doc *doc = chtml40->doc;
3299 s_chtml40_start_plaintext_tag_inner(pdoc,node);
3300 return chtml40->out;
3304 s_chtml40_start_plaintext_tag_inner(void *pdoc, Node *node)
3306 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3307 Doc *doc = chtml40->doc;
3309 for (child = qs_get_child_node(doc, node);
3311 child = qs_get_next_node(doc, child)) {
3313 s_chtml40_start_plaintext_tag_inner(pdoc, child);
3315 return chtml40->out;
3320 * It is a handler who processes the PLAINTEXT tag.
3322 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3323 * destination is specified.
3324 * @param node [i] The PLAINTEXT tag node is specified.
3325 * @return The conversion result is returned.
3328 s_chtml40_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3330 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3331 return chtml40->out;
3336 * * It is handler who processes the New Line Code.
3339 s_chtml40_newline_mark(void *pdoc, Node *UNUSED(node))
3341 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3342 Doc *doc = chtml40->doc;
3344 return chtml40->out;