2 * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include "chxj_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"
26 #define GET_CHTML40(X) ((chtml40_t *)(X))
29 #define W_L(X) do { chtml40->out = BUFFERED_WRITE_LITERAL(chtml40->out, &doc->buf, (X)); } while(0)
30 #define W_V(X) do { chtml40->out = (X) ? BUFFERED_WRITE_VALUE(chtml40->out, &doc->buf, (X)) \
31 : BUFFERED_WRITE_LITERAL(chtml40->out, &doc->buf, ""); } while(0)
33 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml40->conf); W_V(nlcode); } while (0)
35 static char *s_chtml40_start_html_tag (void *pdoc, Node *node);
36 static char *s_chtml40_end_html_tag (void *pdoc, Node *node);
37 static char *s_chtml40_start_meta_tag (void *pdoc, Node *node);
38 static char *s_chtml40_end_meta_tag (void *pdoc, Node *node);
39 static char *s_chtml40_start_textarea_tag (void *pdoc, Node *node);
40 static char *s_chtml40_end_textarea_tag (void *pdoc, Node *node);
41 static char *s_chtml40_start_p_tag (void *pdoc, Node *node);
42 static char *s_chtml40_end_p_tag (void *pdoc, Node *node);
43 static char *s_chtml40_start_pre_tag (void *pdoc, Node *node);
44 static char *s_chtml40_end_pre_tag (void *pdoc, Node *node);
45 static char *s_chtml40_start_h1_tag (void *pdoc, Node *node);
46 static char *s_chtml40_end_h1_tag (void *pdoc, Node *node);
47 static char *s_chtml40_start_h2_tag (void *pdoc, Node *node);
48 static char *s_chtml40_end_h2_tag (void *pdoc, Node *node);
49 static char *s_chtml40_start_h3_tag (void *pdoc, Node *node);
50 static char *s_chtml40_end_h3_tag (void *pdoc, Node *node);
51 static char *s_chtml40_start_h4_tag (void *pdoc, Node *node);
52 static char *s_chtml40_end_h4_tag (void *pdoc, Node *node);
53 static char *s_chtml40_start_h5_tag (void *pdoc, Node *node);
54 static char *s_chtml40_end_h5_tag (void *pdoc, Node *node);
55 static char *s_chtml40_start_h6_tag (void *pdoc, Node *node);
56 static char *s_chtml40_end_h6_tag (void *pdoc, Node *node);
57 static char *s_chtml40_start_ul_tag (void *pdoc, Node *node);
58 static char *s_chtml40_end_ul_tag (void *pdoc, Node *node);
59 static char *s_chtml40_start_ol_tag (void *pdoc, Node *node);
60 static char *s_chtml40_end_ol_tag (void *pdoc, Node *node);
61 static char *s_chtml40_start_li_tag (void *pdoc, Node *node);
62 static char *s_chtml40_end_li_tag (void *pdoc, Node *node);
63 static char *s_chtml40_start_head_tag (void *pdoc, Node *node);
64 static char *s_chtml40_end_head_tag (void *pdoc, Node *node);
65 static char *s_chtml40_start_title_tag (void *pdoc, Node *node);
66 static char *s_chtml40_end_title_tag (void *pdoc, Node *node);
67 static char *s_chtml40_start_base_tag (void *pdoc, Node *node);
68 static char *s_chtml40_end_base_tag (void *pdoc, Node *node);
69 static char *s_chtml40_start_body_tag (void *pdoc, Node *node);
70 static char *s_chtml40_end_body_tag (void *pdoc, Node *node);
71 static char *s_chtml40_start_a_tag (void *pdoc, Node *node);
72 static char *s_chtml40_end_a_tag (void *pdoc, Node *node);
73 static char *s_chtml40_start_br_tag (void *pdoc, Node *node);
74 static char *s_chtml40_end_br_tag (void *pdoc, Node *node);
75 static char *s_chtml40_start_tr_tag (void *pdoc, Node *node);
76 static char *s_chtml40_end_tr_tag (void *pdoc, Node *node);
77 static char *s_chtml40_start_font_tag (void *pdoc, Node *node);
78 static char *s_chtml40_end_font_tag (void *pdoc, Node *node);
79 static char *s_chtml40_start_form_tag (void *pdoc, Node *node);
80 static char *s_chtml40_end_form_tag (void *pdoc, Node *node);
81 static char *s_chtml40_start_input_tag (void *pdoc, Node *node);
82 static char *s_chtml40_end_input_tag (void *pdoc, Node *node);
83 static char *s_chtml40_start_center_tag (void *pdoc, Node *node);
84 static char *s_chtml40_end_center_tag (void *pdoc, Node *node);
85 static char *s_chtml40_start_hr_tag (void *pdoc, Node *node);
86 static char *s_chtml40_end_hr_tag (void *pdoc, Node *node);
87 static char *s_chtml40_start_img_tag (void *pdoc, Node *node);
88 static char *s_chtml40_end_img_tag (void *pdoc, Node *node);
89 static char *s_chtml40_start_select_tag (void *pdoc, Node *node);
90 static char *s_chtml40_end_select_tag (void *pdoc, Node *node);
91 static char *s_chtml40_start_option_tag (void *pdoc, Node *node);
92 static char *s_chtml40_end_option_tag (void *pdoc, Node *node);
93 static char *s_chtml40_start_div_tag (void *pdoc, Node *node);
94 static char *s_chtml40_end_div_tag (void *pdoc, Node *node);
95 static char *s_chtml40_chxjif_tag (void *pdoc, Node *node);
96 static char *s_chtml40_text_tag (void *pdoc, Node *node);
97 static char *s_chtml40_start_blockquote_tag(void *pdoc, Node *node);
98 static char *s_chtml40_end_blockquote_tag (void *pdoc, Node *node);
99 static char *s_chtml40_start_dir_tag (void *pdoc, Node *node);
100 static char *s_chtml40_end_dir_tag (void *pdoc, Node *node);
101 static char *s_chtml40_start_dl_tag (void *pdoc, Node *node);
102 static char *s_chtml40_end_dl_tag (void *pdoc, Node *node);
103 static char *s_chtml40_start_dt_tag (void *pdoc, Node *node);
104 static char *s_chtml40_end_dt_tag (void *pdoc, Node *node);
105 static char *s_chtml40_start_dd_tag (void *pdoc, Node *node);
106 static char *s_chtml40_end_dd_tag (void *pdoc, Node *node);
107 static char *s_chtml40_start_marquee_tag (void *pdoc, Node *node);
108 static char *s_chtml40_end_marquee_tag (void *pdoc, Node *node);
109 static char *s_chtml40_start_blink_tag (void *pdoc, Node *node);
110 static char *s_chtml40_end_blink_tag (void *pdoc, Node *node);
111 static char *s_chtml40_start_menu_tag (void *pdoc, Node *node);
112 static char *s_chtml40_end_menu_tag (void *pdoc, Node *node);
113 static char *s_chtml40_start_plaintext_tag (void *pdoc, Node *node);
114 static char *s_chtml40_start_plaintext_tag_inner (void *pdoc, Node *node);
115 static char *s_chtml40_end_plaintext_tag (void *pdoc, Node *node);
117 static void s_init_chtml40(chtml40_t *chtml, Doc *doc, request_rec *r, device_table *spec);
119 static int s_chtml40_search_emoji(chtml40_t *chtml, char *txt, char **rslt);
122 tag_handler chtml40_handler[] = {
125 s_chtml40_start_html_tag,
126 s_chtml40_end_html_tag,
130 s_chtml40_start_meta_tag,
131 s_chtml40_end_meta_tag,
135 s_chtml40_start_textarea_tag,
136 s_chtml40_end_textarea_tag,
140 s_chtml40_start_p_tag,
145 s_chtml40_start_pre_tag,
146 s_chtml40_end_pre_tag,
150 s_chtml40_start_ul_tag,
151 s_chtml40_end_ul_tag,
155 s_chtml40_start_li_tag,
156 s_chtml40_end_li_tag,
160 s_chtml40_start_ol_tag,
161 s_chtml40_end_ol_tag,
165 s_chtml40_start_h1_tag,
166 s_chtml40_end_h1_tag,
170 s_chtml40_start_h2_tag,
171 s_chtml40_end_h2_tag,
175 s_chtml40_start_h3_tag,
176 s_chtml40_end_h3_tag,
180 s_chtml40_start_h4_tag,
181 s_chtml40_end_h4_tag,
185 s_chtml40_start_h5_tag,
186 s_chtml40_end_h5_tag,
190 s_chtml40_start_h6_tag,
191 s_chtml40_end_h6_tag,
195 s_chtml40_start_head_tag,
196 s_chtml40_end_head_tag,
200 s_chtml40_start_title_tag,
201 s_chtml40_end_title_tag,
205 s_chtml40_start_base_tag,
206 s_chtml40_end_base_tag,
210 s_chtml40_start_body_tag,
211 s_chtml40_end_body_tag,
215 s_chtml40_start_a_tag,
220 s_chtml40_start_br_tag,
221 s_chtml40_end_br_tag,
230 s_chtml40_start_tr_tag,
231 s_chtml40_end_tr_tag,
245 s_chtml40_start_font_tag,
246 s_chtml40_end_font_tag,
250 s_chtml40_start_form_tag,
251 s_chtml40_end_form_tag,
255 s_chtml40_start_input_tag,
256 s_chtml40_end_input_tag,
260 s_chtml40_start_center_tag,
261 s_chtml40_end_center_tag,
265 s_chtml40_start_hr_tag,
266 s_chtml40_end_hr_tag,
270 s_chtml40_start_img_tag,
271 s_chtml40_end_img_tag,
275 s_chtml40_start_select_tag,
276 s_chtml40_end_select_tag,
280 s_chtml40_start_option_tag,
281 s_chtml40_end_option_tag,
285 s_chtml40_start_div_tag,
286 s_chtml40_end_div_tag,
290 s_chtml40_chxjif_tag,
335 s_chtml40_start_dt_tag,
336 s_chtml40_end_dt_tag,
350 s_chtml40_start_blockquote_tag,
351 s_chtml40_end_blockquote_tag,
355 s_chtml40_start_dir_tag,
356 s_chtml40_end_dir_tag,
360 s_chtml40_start_dl_tag,
361 s_chtml40_end_dl_tag,
365 s_chtml40_start_dd_tag,
366 s_chtml40_end_dd_tag,
370 s_chtml40_start_menu_tag,
371 s_chtml40_end_menu_tag,
375 s_chtml40_start_plaintext_tag,
376 s_chtml40_end_plaintext_tag,
380 s_chtml40_start_blink_tag,
381 s_chtml40_end_blink_tag,
385 s_chtml40_start_marquee_tag,
386 s_chtml40_end_marquee_tag,
392 * converts from CHTML5.0 to CHTML3.0.
394 * @param r [i] Requet_rec is appointed.
395 * @param spec [i] The result of the device specification processing which
396 * was done in advance is appointed.
397 * @param src [i] The character string before the converting is appointed.
398 * @return The character string after the converting is returned.
401 chxj_convert_chtml40(
407 chxjconvrule_entry *entryp,
416 DBG(r, "start chxj_convert_chtml40()");
418 /*--------------------------------------------------------------------------*/
420 /*--------------------------------------------------------------------------*/
422 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
424 DBG(r,"i found qrcode xml");
425 DBG(r, "end chxj_convert_chtml40()");
428 DBG(r,"not found qrcode xml");
430 /*--------------------------------------------------------------------------*/
431 /* The CHTML structure is initialized. */
432 /*--------------------------------------------------------------------------*/
433 s_init_chtml40(&chtml40, &doc, r, spec);
435 chtml40.entryp = entryp;
436 chtml40.cookie = cookie;
438 chxj_set_content_type(r, "text/html; charset=Windows-31J");
440 /*--------------------------------------------------------------------------*/
441 /* The character string of the input is analyzed. */
442 /*--------------------------------------------------------------------------*/
443 qs_init_malloc(&doc);
444 qs_init_root_node(&doc);
446 ss = apr_pcalloc(r->pool, srclen + 1);
447 memset(ss, 0, srclen + 1);
448 memcpy(ss, src, srclen);
451 chxj_dump_out("[src] CHTML -> CHTML4.0", ss, srclen);
453 chxj_buffered_write_init(r->pool, &doc.buf);
455 qs_parse_string(&doc,ss, strlen(ss));
457 /*--------------------------------------------------------------------------*/
458 /* It converts it from CHTML to CHTML. */
459 /*--------------------------------------------------------------------------*/
460 chxj_node_convert(spec,r,(void*)&chtml40, &doc, qs_get_root(&doc), 0);
461 chtml40.out = chxj_buffered_write_flush(chtml40.out, &doc.buf);
462 dst = apr_pstrdup(r->pool, chtml40.out);
463 chxj_buffered_write_terminate(&doc.buf);
465 qs_all_free(&doc,QX_LOGMARK);
468 dst = apr_pstrdup(r->pool,ss);
470 if (strlen(dst) == 0) {
471 dst = apr_psprintf(r->pool, "\n");
474 *dstlen = strlen(dst);
477 chxj_dump_out("[src] CHTML -> CHTML4.0", dst, *dstlen);
480 DBG(r, "end chxj_convert_chtml40()");
486 * The CHTML structure is initialized.
488 * @param chtml40 [i/o] The pointer to the HDML structure that wants to be
489 * initialized is specified.
490 * @param doc [i] The Doc structure that should be set to the initialized
491 * HDML structure is specified.
492 * @param r [i] To use POOL, the pointer to request_rec is specified.
493 * @param spec [i] The pointer to the device_table
496 s_init_chtml40(chtml40_t *chtml40, Doc *doc, request_rec *r, device_table *spec)
498 memset(doc, 0, sizeof(Doc));
499 memset(chtml40, 0, sizeof(chtml40_t));
503 chtml40->spec = spec;
504 chtml40->out = qs_alloc_zero_byte_string(r->pool);
505 chtml40->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
506 chtml40->doc->parse_mode = PARSE_MODE_CHTML;
511 * Corresponding EMOJI to a current character-code is retrieved.
512 * The substitution character string is stored in the rslt pointer if agreeing.
514 * @param chtml40 [i] The pointer to the CHTML structure is specified.
515 * @param txt [i] The character string to want to examine whether it is
516 * EMOJI is specified.
517 * @param rslt [o] The pointer to the pointer that stores the result is
519 * @return When corresponding EMOJI exists, it returns it excluding 0.
522 s_chtml40_search_emoji(chtml40_t *chtml40, char *txt, char **rslt)
529 spec = chtml40->spec;
535 DBG(r,"spec is NULL");
538 for (ee = chtml40->conf->emoji;
541 if (ee->imode == NULL) {
542 DBG(r, "emoji->imode is NULL");
546 if (ee->imode->string != NULL
547 && strlen(ee->imode->string) > 0
548 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
550 if (spec == NULL || spec->emoji_type == NULL) {
551 *rslt = apr_palloc(r->pool, 3);
552 (*rslt)[0] = ee->imode->hex1byte & 0xff;
553 (*rslt)[1] = ee->imode->hex2byte & 0xff;
555 return strlen(ee->imode->string);
567 * It is a handler who processes the HTML tag.
569 * @param pdoc [i/o] The pointer to the CHTML structure at the output
570 * destination is specified.
571 * @param node [i] The HTML tag node is specified.
572 * @return The conversion result is returned.
575 s_chtml40_start_html_tag(void *pdoc, Node *UNUSED(node))
577 chtml40_t *chtml40 = GET_CHTML40(pdoc);
578 Doc *doc = chtml40->doc;
580 /*--------------------------------------------------------------------------*/
582 /*--------------------------------------------------------------------------*/
591 * It is a handler who processes the HTML tag.
593 * @param pdoc [i/o] The pointer to the CHTML structure at the output
594 * destination is specified.
595 * @param node [i] The HTML tag node is specified.
596 * @return The conversion result is returned.
599 s_chtml40_end_html_tag(void *pdoc, Node *UNUSED(child))
601 chtml40_t *chtml40 = GET_CHTML40(pdoc);
602 Doc *doc = chtml40->doc;
611 * It is a handler who processes the META tag.
613 * @param pdoc [i/o] The pointer to the CHTML structure at the output
614 * destination is specified.
615 * @param node [i] The META tag node is specified.
616 * @return The conversion result is returned.
619 s_chtml40_start_meta_tag(void *pdoc, Node *node)
625 int content_type_flag;
628 chtml40 = GET_CHTML40(pdoc);
632 content_type_flag = 0;
636 /*--------------------------------------------------------------------------*/
638 /*--------------------------------------------------------------------------*/
639 for (attr = qs_get_attr(doc,node);
641 attr = qs_get_next_attr(doc,attr)) {
642 char *name = qs_get_attr_name(doc,attr);
643 char *value = qs_get_attr_value(doc,attr);
647 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
648 /*----------------------------------------------------------------------*/
650 /*----------------------------------------------------------------------*/
651 W_L(" http-equiv=\"");
654 if (STRCASEEQ('c','C',"content-type", value))
655 content_type_flag = 1;
657 if (STRCASEEQ('r','R',"refresh", value))
664 if (strcasecmp(name, "content") == 0 && value && *value) {
665 if (content_type_flag) {
668 W_L("=\"text/html; charset=Windows-31J\"");
675 buf = apr_pstrdup(r->pool, value);
676 url = strchr(buf, ';');
678 sec = apr_pstrdup(r->pool, buf);
681 url = chxj_encoding_parameter(r, url);
682 url = chxj_add_cookie_parameter(r, url, chtml40->cookie);
713 * It is a handler who processes the META tag.
715 * @param pdoc [i/o] The pointer to the CHTML structure at the output
716 * destination is specified.
717 * @param node [i] The META tag node is specified.
718 * @return The conversion result is returned.
721 s_chtml40_end_meta_tag(void* pdoc, Node* UNUSED(child))
723 chtml40_t *chtml40 = GET_CHTML40(pdoc);
730 * It is a handler who processes the HEAD tag.
732 * @param pdoc [i/o] The pointer to the CHTML structure at the output
733 * destination is specified.
734 * @param node [i] The HEAD tag node is specified.
735 * @return The conversion result is returned.
738 s_chtml40_start_head_tag(void* pdoc, Node* UNUSED(node))
740 chtml40_t *chtml40 = GET_CHTML40(pdoc);
741 Doc *doc = chtml40->doc;
751 * It is a handler who processes the HEAD tag.
753 * @param pdoc [i/o] The pointer to the CHTML structure at the output
754 * destination is specified.
755 * @param node [i] The HEAD tag node is specified.
756 * @return The conversion result is returned.
759 s_chtml40_end_head_tag(void *pdoc, Node *UNUSED(node))
761 chtml40_t *chtml40 = GET_CHTML40(pdoc);
762 Doc *doc = chtml40->doc;
772 * It is a handler who processes the TITLE tag.
774 * @param pdoc [i/o] The pointer to the CHTML structure at the output
775 * destination is specified.
776 * @param node [i] The TITLE tag node is specified.
777 * @return The conversion result is returned.
780 s_chtml40_start_title_tag(void *pdoc, Node *UNUSED(node))
782 chtml40_t *chtml40 = GET_CHTML40(pdoc);
783 Doc *doc = chtml40->doc;
793 * It is a handler who processes the TITLE tag.
795 * @param pdoc [i/o] The pointer to the CHTML structure at the output
796 * destination is specified.
797 * @param node [i] The TITLE tag node is specified.
798 * @return The conversion result is returned.
801 s_chtml40_end_title_tag(void *pdoc, Node *UNUSED(child))
803 chtml40_t *chtml40 = GET_CHTML40(pdoc);
804 Doc *doc = chtml40->doc;
814 * It is a handler who processes the BASE tag.
816 * @param pdoc [i/o] The pointer to the CHTML structure at the output
817 * destination is specified.
818 * @param node [i] The BASE tag node is specified.
819 * @return The conversion result is returned.
822 s_chtml40_start_base_tag(void *pdoc, Node *node)
829 chtml40 = GET_CHTML40(pdoc);
834 /*--------------------------------------------------------------------------*/
836 /*--------------------------------------------------------------------------*/
837 for (attr = qs_get_attr(doc,node);
839 attr = qs_get_next_attr(doc,attr)) {
840 char *name = qs_get_attr_name(doc,attr);
841 char *value = qs_get_attr_value(doc,attr);
842 if (STRCASEEQ('h','H',"href", name)) {
856 * It is a handler who processes the BASE tag.
858 * @param pdoc [i/o] The pointer to the CHTML structure at the output
859 * destination is specified.
860 * @param node [i] The BASE tag node is specified.
861 * @return The conversion result is returned.
864 s_chtml40_end_base_tag(void *pdoc, Node *UNUSED(child))
866 chtml40_t *chtml40 = GET_CHTML40(pdoc);
873 * It is a handler who processes the BODY tag.
875 * @param pdoc [i/o] The pointer to the CHTML structure at the output
876 * destination is specified.
877 * @param node [i] The BODY tag node is specified.
878 * @return The conversion result is returned.
881 s_chtml40_start_body_tag(void *pdoc, Node *node)
888 chtml40 = GET_CHTML40(pdoc);
893 /*--------------------------------------------------------------------------*/
895 /*--------------------------------------------------------------------------*/
896 for (attr = qs_get_attr(doc,node);
898 attr = qs_get_next_attr(doc,attr)) {
899 char *name = qs_get_attr_name(doc,attr);
900 char *value = qs_get_attr_value(doc,attr);
901 if (STRCASEEQ('b','B', "bgcolor", name) && value && *value) {
902 /*----------------------------------------------------------------------*/
904 /*----------------------------------------------------------------------*/
909 else if (STRCASEEQ('t','T', "text", name) && value && *value) {
910 /*----------------------------------------------------------------------*/
912 /*----------------------------------------------------------------------*/
917 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
918 /*----------------------------------------------------------------------*/
920 /*----------------------------------------------------------------------*/
925 else if (STRCASEEQ('a','A',"alink", name) && value && *value) {
926 /*----------------------------------------------------------------------*/
928 /*----------------------------------------------------------------------*/
933 else if (STRCASEEQ('v','V',"vlink", name) && value && *value) {
934 /*----------------------------------------------------------------------*/
936 /*----------------------------------------------------------------------*/
950 * It is a handler who processes the BODY tag.
952 * @param pdoc [i/o] The pointer to the CHTML structure at the output
953 * destination is specified.
954 * @param node [i] The BODY tag node is specified.
955 * @return The conversion result is returned.
958 s_chtml40_end_body_tag(void *pdoc, Node *UNUSED(child))
963 chtml40 = GET_CHTML40(pdoc);
974 * It is a handler who processes the A tag.
976 * @param pdoc [i/o] The pointer to the CHTML structure at the output
977 * destination is specified.
978 * @param node [i] The A tag node is specified.
979 * @return The conversion result is returned.
982 s_chtml40_start_a_tag(void *pdoc, Node *node)
989 chtml40 = GET_CHTML40(pdoc);
994 /*--------------------------------------------------------------------------*/
996 /*--------------------------------------------------------------------------*/
997 for (attr = qs_get_attr(doc,node);
999 attr = qs_get_next_attr(doc,attr)) {
1000 char *name = qs_get_attr_name(doc,attr);
1001 char *value = qs_get_attr_value(doc,attr);
1002 if (STRCASEEQ('n','N',"name", name)) {
1003 /*----------------------------------------------------------------------*/
1005 /*----------------------------------------------------------------------*/
1010 else if (STRCASEEQ('h','H',"href", name)) {
1011 /*----------------------------------------------------------------------*/
1013 /*----------------------------------------------------------------------*/
1014 value = chxj_encoding_parameter(r, value);
1015 value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
1020 else if (STRCASEEQ('a','A',"accesskey", name)) {
1021 /*----------------------------------------------------------------------*/
1023 /*----------------------------------------------------------------------*/
1024 W_L(" accesskey=\"");
1028 else if (STRCASEEQ('c','C',"cti", name)) {
1029 /*----------------------------------------------------------------------*/
1031 /*----------------------------------------------------------------------*/
1036 else if (STRCASEEQ('i','I',"ijam", name)) {
1037 /*----------------------------------------------------------------------*/
1039 /*----------------------------------------------------------------------*/
1042 else if (STRCASEEQ('u','U',"utn", name)) {
1043 /*----------------------------------------------------------------------*/
1045 /* It is special only for CHTML. */
1046 /*----------------------------------------------------------------------*/
1049 else if (STRCASEEQ('t','T',"telbook", name)) {
1050 /*----------------------------------------------------------------------*/
1052 /*----------------------------------------------------------------------*/
1055 else if (STRCASEEQ('k','K',"kana", name)) {
1056 /*----------------------------------------------------------------------*/
1058 /*----------------------------------------------------------------------*/
1061 else if (STRCASEEQ('e','E',"email", name)) {
1062 /*----------------------------------------------------------------------*/
1064 /*----------------------------------------------------------------------*/
1067 else if (STRCASEEQ('i','I',"ista", name)) {
1068 /*----------------------------------------------------------------------*/
1070 /*----------------------------------------------------------------------*/
1073 else if (STRCASEEQ('i','I',"ilet", name)) {
1074 /*----------------------------------------------------------------------*/
1076 /*----------------------------------------------------------------------*/
1079 else if (STRCASEEQ('i','I',"iswf", name)) {
1080 /*----------------------------------------------------------------------*/
1082 /*----------------------------------------------------------------------*/
1085 else if (STRCASEEQ('i','I',"irst", name)) {
1086 /*----------------------------------------------------------------------*/
1088 /*----------------------------------------------------------------------*/
1093 return chtml40->out;
1098 * It is a handler who processes the A tag.
1100 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1101 * destination is specified.
1102 * @param node [i] The A tag node is specified.
1103 * @return The conversion result is returned.
1106 s_chtml40_end_a_tag(void *pdoc, Node *UNUSED(child))
1111 chtml40 = GET_CHTML40(pdoc);
1117 return chtml40->out;
1122 * It is a handler who processes the BR tag.
1124 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1125 * destination is specified.
1126 * @param node [i] The BR tag node is specified.
1127 * @return The conversion result is returned.
1130 s_chtml40_start_br_tag(void *pdoc, Node *node)
1137 chtml40 = GET_CHTML40(pdoc);
1141 /*--------------------------------------------------------------------------*/
1142 /* Get Attributes */
1143 /*--------------------------------------------------------------------------*/
1144 for (attr = qs_get_attr(doc,node);
1146 attr = qs_get_next_attr(doc,attr)) {
1147 char *name = qs_get_attr_name(doc,attr);
1148 char *value = qs_get_attr_value(doc,attr);
1149 if (STRCASEEQ('c','C',"clear",name)) {
1150 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1160 return chtml40->out;
1165 * It is a handler who processes the BR tag.
1167 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1168 * destination is specified.
1169 * @param node [i] The BR tag node is specified.
1170 * @return The conversion result is returned.
1173 s_chtml40_end_br_tag(void *pdoc, Node *UNUSED(child))
1175 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1177 return chtml40->out;
1182 * It is a handler who processes the TR tag.
1184 * @param chtml40 [i/o] The pointer to the CHTML structure at the output
1185 * destination is specified.
1186 * @param node [i] The TR tag node is specified.
1187 * @return The conversion result is returned.
1190 s_chtml40_start_tr_tag(void *pdoc, Node *UNUSED(node))
1192 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1194 return chtml40->out;
1199 * It is a handler who processes the TR tag.
1201 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1202 * destination is specified.
1203 * @param node [i] The TR tag node is specified.
1204 * @return The conversion result is returned.
1207 s_chtml40_end_tr_tag(void *pdoc, Node *UNUSED(child))
1213 chtml40 = GET_CHTML40(pdoc);
1220 return chtml40->out;
1225 * It is a handler who processes the FONT tag.
1227 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1228 * destination is specified.
1229 * @param node [i] The FONT tag node is specified.
1230 * @return The conversion result is returned.
1233 s_chtml40_start_font_tag(void *pdoc, Node *node)
1241 chtml40 = GET_CHTML40(pdoc);
1245 /*--------------------------------------------------------------------------*/
1246 /* Get Attributes */
1247 /*--------------------------------------------------------------------------*/
1248 for (attr = qs_get_attr(doc,node);
1249 attr && color == NULL;
1250 attr = qs_get_next_attr(doc,attr)) {
1251 char *name = qs_get_attr_name(doc,attr);
1252 char *value = qs_get_attr_value(doc,attr);
1253 if (STRCASEEQ('c','C',"color", name) && value && *value) {
1254 color = apr_pstrdup(doc->buf.pool, value);
1257 else if (STRCASEEQ('s','S',"size", name)) {
1258 /*----------------------------------------------------------------------*/
1260 /*----------------------------------------------------------------------*/
1265 W_L("<font color=\"");
1268 chtml40->font_flag++;
1270 return chtml40->out;
1275 * It is a handler who processes the FONT tag.
1277 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1278 * destination is specified.
1279 * @param node [i] The FONT tag node is specified.
1280 * @return The conversion result is returned.
1283 s_chtml40_end_font_tag(void *pdoc, Node *UNUSED(child))
1289 chtml40 = GET_CHTML40(pdoc);
1293 if (chtml40->font_flag) {
1296 chtml40->font_flag--;
1299 return chtml40->out;
1304 * It is a handler who processes the FORM tag.
1306 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1307 * destination is specified.
1308 * @param node [i] The FORM tag node is specified.
1309 * @return The conversion result is returned.
1312 s_chtml40_start_form_tag(void *pdoc, Node *node)
1319 chtml40 = GET_CHTML40(pdoc);
1324 /*--------------------------------------------------------------------------*/
1325 /* Get Attributes */
1326 /*--------------------------------------------------------------------------*/
1327 for (attr = qs_get_attr(doc,node);
1329 attr = qs_get_next_attr(doc,attr)) {
1330 char *name = qs_get_attr_name(doc,attr);
1331 char *value = qs_get_attr_value(doc,attr);
1332 if (STRCASEEQ('a','A',"action", name)) {
1333 /*----------------------------------------------------------------------*/
1335 /*----------------------------------------------------------------------*/
1336 value = chxj_encoding_parameter(r, value);
1337 value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
1342 else if (STRCASEEQ('m','M',"method", name)) {
1343 /*----------------------------------------------------------------------*/
1345 /*----------------------------------------------------------------------*/
1350 else if (STRCASEEQ('u','U',"utn", name)) {
1351 /*----------------------------------------------------------------------*/
1353 /* It is special only for CHTML. */
1354 /*----------------------------------------------------------------------*/
1361 return chtml40->out;
1366 * It is a handler who processes the FORM tag.
1368 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1369 * destination is specified.
1370 * @param node [i] The FORM tag node is specified.
1371 * @return The conversion result is returned.
1374 s_chtml40_end_form_tag(void *pdoc, Node *UNUSED(child))
1379 chtml40 = GET_CHTML40(pdoc);
1385 return chtml40->out;
1390 * It is a handler who processes the INPUT tag.
1392 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1393 * destination is specified.
1394 * @param node [i] The INPUT tag node is specified.
1395 * @return The conversion result is returned.
1398 s_chtml40_start_input_tag(void *pdoc, Node *node)
1403 char *max_length = NULL;
1407 char *istyle = NULL;
1409 char *checked = NULL;
1410 char *accesskey = NULL;
1412 chtml40 = GET_CHTML40(pdoc);
1416 /*--------------------------------------------------------------------------*/
1417 /* Get Attributes */
1418 /*--------------------------------------------------------------------------*/
1419 type = qs_get_type_attr(doc, node, doc->buf.pool);
1420 name = qs_get_name_attr(doc, node, doc->buf.pool);
1421 value = qs_get_value_attr(doc,node, doc->buf.pool);
1422 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1423 max_length = qs_get_maxlength_attr(doc,node,r);
1424 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1425 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1426 size = qs_get_size_attr(doc, node, doc->buf.pool);
1429 type = qs_trim_string(doc->buf.pool, type);
1430 if (type && (STRCASEEQ('t','T',"text", type) ||
1431 STRCASEEQ('p','P',"password",type) ||
1432 STRCASEEQ('c','C',"checkbox",type) ||
1433 STRCASEEQ('r','R',"radio", type) ||
1434 STRCASEEQ('h','H',"hidden", type) ||
1435 STRCASEEQ('s','S',"submit", type) ||
1436 STRCASEEQ('r','R',"reset", type))) {
1442 if (size && *size) {
1447 if (name && *name) {
1452 if (value && *value) {
1457 if (accesskey && *accesskey) {
1458 W_L(" accesskey=\"");
1463 /*------------------------------------------------------------------------*/
1465 /*------------------------------------------------------------------------*/
1466 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1473 /*--------------------------------------------------------------------------*/
1474 /* The figure is default for the password. */
1475 /*--------------------------------------------------------------------------*/
1476 if (max_length && *max_length) {
1477 if (chxj_chk_numeric(max_length) != 0) {
1478 max_length = apr_psprintf(r->pool, "0");
1480 if (istyle != NULL && *istyle == '1') {
1481 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1485 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1494 return chtml40->out;
1499 * It is a handler who processes the INPUT tag.
1501 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1502 * destination is specified.
1503 * @param node [i] The INPUT tag node is specified.
1504 * @return The conversion result is returned.
1507 s_chtml40_end_input_tag(void *pdoc, Node *UNUSED(child))
1509 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1511 return chtml40->out;
1516 * It is a handler who processes the CENTER tag.
1518 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1519 * destination is specified.
1520 * @param node [i] The CENTER tag node is specified.
1521 * @return The conversion result is returned.
1524 s_chtml40_start_center_tag(void *pdoc, Node *UNUSED(node))
1529 chtml40 = GET_CHTML40(pdoc);
1535 return chtml40->out;
1540 * It is a handler who processes the CENTER tag.
1542 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1543 * destination is specified.
1544 * @param node [i] The CENTER tag node is specified.
1545 * @return The conversion result is returned.
1548 s_chtml40_end_center_tag(void *pdoc, Node *UNUSED(child))
1553 chtml40 = GET_CHTML40(pdoc);
1559 return chtml40->out;
1564 * It is a handler who processes the HR tag.
1566 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1567 * destination is specified.
1568 * @param node [i] The HR tag node is specified.
1569 * @return The conversion result is returned.
1572 s_chtml40_start_hr_tag(void *pdoc, Node *node)
1579 chtml40 = GET_CHTML40(pdoc);
1585 for (attr = qs_get_attr(doc,node);
1587 attr = qs_get_next_attr(doc,attr)) {
1588 char *name = qs_get_attr_name(doc,attr);
1589 char *value = qs_get_attr_value(doc,attr);
1590 if (STRCASEEQ('a','A',"align", name)) {
1591 /*----------------------------------------------------------------------*/
1593 /*----------------------------------------------------------------------*/
1594 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1600 else if (STRCASEEQ('s','S',"size", name)) {
1601 /*----------------------------------------------------------------------*/
1603 /*----------------------------------------------------------------------*/
1604 if (value && *value) {
1610 else if (STRCASEEQ('w','W',"width", name)) {
1611 /*----------------------------------------------------------------------*/
1613 /*----------------------------------------------------------------------*/
1614 if (value && *value) {
1620 else if (STRCASEEQ('n','N',"noshade", name)) {
1621 /*----------------------------------------------------------------------*/
1623 /*----------------------------------------------------------------------*/
1626 else if (STRCASEEQ('c','C',"color", name) && value && *value) {
1627 /*----------------------------------------------------------------------*/
1629 /*----------------------------------------------------------------------*/
1637 return chtml40->out;
1642 * It is a handler who processes the HR tag.
1644 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1645 * destination is specified.
1646 * @param node [i] The HR tag node is specified.
1647 * @return The conversion result is returned.
1650 s_chtml40_end_hr_tag(void *pdoc, Node *UNUSED(child))
1652 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1654 return chtml40->out;
1659 * It is a handler who processes the IMG tag.
1661 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1662 * destination is specified.
1663 * @param node [i] The IMG tag node is specified.
1664 * @return The conversion result is returned.
1667 s_chtml40_start_img_tag(void *pdoc, Node *node)
1669 #ifndef IMG_NOT_CONVERT_FILENAME
1677 chtml40 = GET_CHTML40(pdoc);
1680 #ifndef IMG_NOT_CONVERT_FILENAME
1681 spec = chtml40->spec;
1685 /*--------------------------------------------------------------------------*/
1686 /* Get Attributes */
1687 /*--------------------------------------------------------------------------*/
1688 for (attr = qs_get_attr(doc,node);
1690 attr = qs_get_next_attr(doc,attr)) {
1691 char *name = qs_get_attr_name(doc,attr);
1692 char *value = qs_get_attr_value(doc,attr);
1693 if (STRCASEEQ('s','S',"src", name)) {
1694 /*----------------------------------------------------------------------*/
1696 /*----------------------------------------------------------------------*/
1697 #ifdef IMG_NOT_CONVERT_FILENAME
1698 value = chxj_encoding_parameter(r, value);
1699 value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
1701 value = apr_psprintf(r->pool,
1704 (strchr(value, '?')) ? '&' : '?',
1705 CHXJ_COOKIE_NOUPDATE_PARAM);
1712 value = chxj_img_conv(r,spec,value);
1713 value = chxj_encoding_parameter(r, value);
1714 value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
1716 value = apr_psprintf(r->pool,
1719 (strchr(value, '?')) ? '&' : '?',
1720 CHXJ_COOKIE_NOUPDATE_PARAM);
1727 else if (STRCASEEQ('a','A',"align", name)) {
1728 /*----------------------------------------------------------------------*/
1730 /*----------------------------------------------------------------------*/
1731 if (value && (STRCASEEQ('t','T',"top", value) ||
1732 STRCASEEQ('m','M',"middle", value) ||
1733 STRCASEEQ('b','B',"bottom", value) ||
1734 STRCASEEQ('l','L',"left", value) ||
1735 STRCASEEQ('c','C',"center", value) ||
1736 STRCASEEQ('r','R',"right", value))) {
1742 else if (STRCASEEQ('w','W',"width", name) && value && *value) {
1743 /*----------------------------------------------------------------------*/
1745 /*----------------------------------------------------------------------*/
1750 else if (STRCASEEQ('h','H', "height", name) && value && *value) {
1751 /*----------------------------------------------------------------------*/
1753 /*----------------------------------------------------------------------*/
1758 else if (STRCASEEQ('h','H',"hspace", name) && value && *value) {
1759 /*----------------------------------------------------------------------*/
1761 /*----------------------------------------------------------------------*/
1766 else if (STRCASEEQ('v','V',"vspace", name) && value && *value) {
1767 /*----------------------------------------------------------------------*/
1769 /*----------------------------------------------------------------------*/
1774 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
1775 /*----------------------------------------------------------------------*/
1777 /*----------------------------------------------------------------------*/
1785 return chtml40->out;
1790 * It is a handler who processes the IMG tag.
1792 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1793 * destination is specified.
1794 * @param node [i] The IMG tag node is specified.
1795 * @return The conversion result is returned.
1798 s_chtml40_end_img_tag(void *pdoc, Node *UNUSED(child))
1800 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1802 return chtml40->out;
1807 * It is a handler who processes the SELECT tag.
1809 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1810 * destination is specified.
1811 * @param node [i] The SELECT tag node is specified.
1812 * @return The conversion result is returned.
1815 s_chtml40_start_select_tag(void *pdoc, Node *child)
1817 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1818 Doc *doc = chtml40->doc;
1821 char *multiple = NULL;
1825 for (attr = qs_get_attr(doc,child);
1827 attr = qs_get_next_attr(doc,attr)) {
1828 char *nm = qs_get_attr_name(doc,attr);
1829 char *val = qs_get_attr_value(doc,attr);
1830 if (STRCASEEQ('s','S',"size", nm)) {
1831 /*----------------------------------------------------------------------*/
1832 /* CHTML 1.0 version 2.0 */
1833 /*----------------------------------------------------------------------*/
1834 size = apr_pstrdup(doc->buf.pool, val);
1836 else if (STRCASEEQ('n','N',"name", nm)) {
1837 /*----------------------------------------------------------------------*/
1838 /* CHTML 1.0 version 2.0 */
1839 /*----------------------------------------------------------------------*/
1840 name = apr_pstrdup(doc->buf.pool, val);
1842 else if (STRCASEEQ('m','M',"multiple", nm)) {
1843 /*----------------------------------------------------------------------*/
1844 /* CHTML 1.0 version 2.0 */
1845 /*----------------------------------------------------------------------*/
1846 multiple = apr_pstrdup(doc->buf.pool, val);
1849 if (size && *size) {
1854 if (name && *name) {
1864 return chtml40->out;
1869 * It is a handler who processes the SELECT tag.
1871 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1872 * destination is specified.
1873 * @param node [i] The SELECT tag node is specified.
1874 * @return The conversion result is returned.
1877 s_chtml40_end_select_tag(void *pdoc, Node *UNUSED(child))
1879 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1880 Doc *doc = chtml40->doc;
1884 return chtml40->out;
1889 * It is a handler who processes the OPTION tag.
1891 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1892 * destination is specified.
1893 * @param node [i] The OPTION tag node is specified.
1894 * @return The conversion result is returned.
1897 s_chtml40_start_option_tag(void *pdoc, Node *child)
1906 chtml40 = GET_CHTML40(pdoc);
1913 for (attr = qs_get_attr(doc,child);
1915 attr = qs_get_next_attr(doc,attr)) {
1916 char *nm = qs_get_attr_name(doc,attr);
1917 char *val = qs_get_attr_value(doc,attr);
1918 if (STRCASEEQ('s','S',"selected", nm)) {
1919 /*----------------------------------------------------------------------*/
1920 /* CHTML 1.0 version 2.0 */
1921 /*----------------------------------------------------------------------*/
1922 selected = apr_pstrdup(doc->buf.pool, val);
1924 else if (STRCASEEQ('v','V',"value", nm)) {
1925 /*----------------------------------------------------------------------*/
1926 /* CHTML 1.0 version 2.0 */
1927 /*----------------------------------------------------------------------*/
1928 value = apr_pstrdup(doc->buf.pool, val);
1931 if (value && *value) {
1940 return chtml40->out;
1945 * It is a handler who processes the OPTION tag.
1947 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1948 * destination is specified.
1949 * @param node [i] The OPTION tag node is specified.
1950 * @return The conversion result is returned.
1953 s_chtml40_end_option_tag(void *pdoc, Node *UNUSED(child))
1955 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1959 return chtml40->out;
1964 * It is a handler who processes the DIV tag.
1966 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1967 * destination is specified.
1968 * @param node [i] The DIV tag node is specified.
1969 * @return The conversion result is returned.
1972 s_chtml40_start_div_tag(void *pdoc, Node *child)
1980 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('a','A',"align", nm)) {
1992 /*----------------------------------------------------------------------*/
1993 /* CHTML 1.0 (W3C version 3.2) */
1994 /*----------------------------------------------------------------------*/
1995 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1996 align = apr_pstrdup(doc->buf.pool, val);
2007 return chtml40->out;
2012 * It is a handler who processes the DIV tag.
2014 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2015 * destination is specified.
2016 * @param node [i] The DIV tag node is specified.
2017 * @return The conversion result is returned.
2020 s_chtml40_end_div_tag(void *pdoc, Node *UNUSED(node))
2022 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2023 Doc *doc = chtml40->doc;
2028 return chtml40->out;
2033 * It is a handler who processes the UL tag.
2035 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2036 * destination is specified.
2037 * @param node [i] The UL tag node is specified.
2038 * @return The conversion result is returned.
2041 s_chtml40_start_ul_tag(void *pdoc, Node *node)
2043 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2044 Doc *doc = chtml40->doc;
2047 /*--------------------------------------------------------------------------*/
2048 /* Get Attributes */
2049 /*--------------------------------------------------------------------------*/
2050 for (attr = qs_get_attr(doc,node);
2052 attr = qs_get_next_attr(doc,attr)) {
2053 char *name = qs_get_attr_name(doc,attr);
2054 char *value = qs_get_attr_value(doc,attr);
2055 if (STRCASEEQ('t','T',"type",name)) {
2056 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2066 return chtml40->out;
2071 * It is a handler who processes the UL tag.
2073 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2074 * destination is specified.
2075 * @param node [i] The UL tag node is specified.
2076 * @return The conversion result is returned.
2079 s_chtml40_end_ul_tag(void *pdoc, Node *UNUSED(child))
2081 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2082 Doc *doc = chtml40->doc;
2087 return chtml40->out;
2092 * It is a handler who processes the PRE tag.
2094 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2095 * destination is specified.
2096 * @param node [i] The PRE tag node is specified.
2097 * @return The conversion result is returned.
2100 s_chtml40_start_pre_tag(void *pdoc, Node *UNUSED(node))
2102 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2103 Doc *doc = chtml40->doc;
2105 chtml40->pre_flag++;
2109 return chtml40->out;
2114 * It is a handler who processes the PRE tag.
2116 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2117 * destination is specified.
2118 * @param node [i] The PRE tag node is specified.
2119 * @return The conversion result is returned.
2122 s_chtml40_end_pre_tag(void *pdoc, Node *UNUSED(child))
2124 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2125 Doc *doc = chtml40->doc;
2129 chtml40->pre_flag--;
2131 return chtml40->out;
2136 * It is a handler who processes the P tag.
2138 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2139 * destination is specified.
2140 * @param node [i] The P tag node is specified.
2141 * @return The conversion result is returned.
2144 s_chtml40_start_p_tag(void *pdoc, Node *node)
2152 chtml40 = GET_CHTML40(pdoc);
2157 for (attr = qs_get_attr(doc,node);
2159 attr = qs_get_next_attr(doc,attr)) {
2160 char *nm = qs_get_attr_name(doc,attr);
2161 char *val = qs_get_attr_value(doc,attr);
2162 if (STRCASEEQ('a','A',"align", nm)) {
2163 /*----------------------------------------------------------------------*/
2164 /* CHTML 1.0 (W3C version 3.2) */
2165 /*----------------------------------------------------------------------*/
2166 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2167 align = apr_pstrdup(doc->buf.pool, val);
2179 return chtml40->out;
2184 * It is a handler who processes the P tag.
2186 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2187 * destination is specified.
2188 * @param node [i] The P tag node is specified.
2189 * @return The conversion result is returned.
2192 s_chtml40_end_p_tag(void *pdoc, Node *UNUSED(child))
2197 chtml40 = GET_CHTML40(pdoc);
2203 return chtml40->out;
2208 * It is a handler who processes the OL tag.
2210 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2211 * destination is specified.
2212 * @param node [i] The OL tag node is specified.
2213 * @return The conversion result is returned.
2216 s_chtml40_start_ol_tag(void *pdoc, Node *node)
2223 chtml40 = GET_CHTML40(pdoc);
2228 /*--------------------------------------------------------------------------*/
2229 /* Get Attributes */
2230 /*--------------------------------------------------------------------------*/
2231 for (attr = qs_get_attr(doc,node);
2233 attr = qs_get_next_attr(doc,attr)) {
2234 char *name = qs_get_attr_name(doc,attr);
2235 char *value = qs_get_attr_value(doc,attr);
2236 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2241 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2250 return chtml40->out;
2255 * It is a handler who processes the OL tag.
2257 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2258 * destination is specified.
2259 * @param node [i] The OL tag node is specified.
2260 * @return The conversion result is returned.
2263 s_chtml40_end_ol_tag(void *pdoc, Node *UNUSED(node))
2265 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2266 Doc *doc = chtml40->doc;
2271 return chtml40->out;
2276 * It is a handler who processes the LI tag.
2278 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2279 * destination is specified.
2280 * @param node [i] The LI tag node is specified.
2281 * @return The conversion result is returned.
2284 s_chtml40_start_li_tag(void *pdoc, Node *node)
2286 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2287 Doc *doc = chtml40->doc;
2291 /*--------------------------------------------------------------------------*/
2292 /* Get Attributes */
2293 /*--------------------------------------------------------------------------*/
2294 for (attr = qs_get_attr(doc,node);
2296 attr = qs_get_next_attr(doc,attr)) {
2297 char *name = qs_get_attr_name(doc,attr);
2298 char *value = qs_get_attr_value(doc,attr);
2299 if (STRCASEEQ('t','T',"type",name)) {
2300 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('s','S',"square",value) || STRCASEEQ('c','C',"circle",value))) {
2306 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2313 return chtml40->out;
2318 * It is a handler who processes the LI tag.
2320 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2321 * destination is specified.
2322 * @param node [i] The LI tag node is specified.
2323 * @return The conversion result is returned.
2326 s_chtml40_end_li_tag(void *pdoc, Node *UNUSED(child))
2328 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2330 return chtml40->out;
2335 * It is a handler who processes the H1 tag.
2337 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2338 * destination is specified.
2339 * @param node [i] The H1 tag node is specified.
2340 * @return The conversion result is returned.
2343 s_chtml40_start_h1_tag(void *pdoc, Node *node)
2350 chtml40 = GET_CHTML40(pdoc);
2355 for (attr = qs_get_attr(doc,node);
2357 attr = qs_get_next_attr(doc,attr)) {
2358 char *name = qs_get_attr_name(doc,attr);
2359 char *value = qs_get_attr_value(doc,attr);
2360 if (STRCASEEQ('a','A',"align", name)) {
2361 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2371 return chtml40->out;
2376 * It is a handler who processes the H1 tag.
2378 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2379 * destination is specified.
2380 * @param node [i] The H1 tag node is specified.
2381 * @return The conversion result is returned.
2384 s_chtml40_end_h1_tag(void *pdoc, Node *UNUSED(child))
2389 chtml40 = GET_CHTML40(pdoc);
2395 return chtml40->out;
2400 * It is a handler who processes the H2 tag.
2402 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2403 * destination is specified.
2404 * @param node [i] The H2 tag node is specified.
2405 * @return The conversion result is returned.
2408 s_chtml40_start_h2_tag(void *pdoc, Node *node)
2415 chtml40 = GET_CHTML40(pdoc);
2420 for (attr = qs_get_attr(doc,node);
2422 attr = qs_get_next_attr(doc,attr)) {
2423 char *name = qs_get_attr_name(doc,attr);
2424 char *value = qs_get_attr_value(doc,attr);
2425 if (STRCASEEQ('a','A',"align", name)) {
2426 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2435 return chtml40->out;
2440 * It is a handler who processes the H2 tag.
2442 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2443 * destination is specified.
2444 * @param node [i] The H2 tag node is specified.
2445 * @return The conversion result is returned.
2448 s_chtml40_end_h2_tag(void *pdoc, Node *UNUSED(child))
2450 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2451 Doc *doc = chtml40->doc;
2456 return chtml40->out;
2461 * It is a handler who processes the H3 tag.
2463 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2464 * destination is specified.
2465 * @param node [i] The H3 tag node is specified.
2466 * @return The conversion result is returned.
2469 s_chtml40_start_h3_tag(void *pdoc, Node *node)
2476 chtml40 = GET_CHTML40(pdoc);
2481 for (attr = qs_get_attr(doc,node);
2483 attr = qs_get_next_attr(doc,attr)) {
2484 char *name = qs_get_attr_name(doc,attr);
2485 char *value = qs_get_attr_value(doc,attr);
2486 if (STRCASEEQ('a','A',"align", name)) {
2487 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 H3 tag.
2504 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2505 * destination is specified.
2506 * @param node [i] The H3 tag node is specified.
2507 * @return The conversion result is returned.
2510 s_chtml40_end_h3_tag(void *pdoc, Node *UNUSED(child))
2512 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2513 Doc *doc = chtml40->doc;
2518 return chtml40->out;
2523 * It is a handler who processes the H4 tag.
2525 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2526 * destination is specified.
2527 * @param node [i] The H4 tag node is specified.
2528 * @return The conversion result is returned.
2531 s_chtml40_start_h4_tag(void *pdoc, Node *node)
2538 chtml40 = GET_CHTML40(pdoc);
2543 for (attr = qs_get_attr(doc,node);
2545 attr = qs_get_next_attr(doc,attr)) {
2546 char *name = qs_get_attr_name(doc,attr);
2547 char *value = qs_get_attr_value(doc,attr);
2548 if (STRCASEEQ('a','A',"align", name)) {
2549 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 H4 tag.
2565 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2566 * destination is specified.
2567 * @param node [i] The H4 tag node is specified.
2568 * @return The conversion result is returned.
2571 s_chtml40_end_h4_tag(void *pdoc, Node *UNUSED(child))
2573 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2574 Doc *doc = chtml40->doc;
2579 return chtml40->out;
2584 * It is a handler who processes the H5 tag.
2586 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2587 * destination is specified.
2588 * @param node [i] The H5 tag node is specified.
2589 * @return The conversion result is returned.
2592 s_chtml40_start_h5_tag(void *pdoc, Node *node)
2599 chtml40 = GET_CHTML40(pdoc);
2604 for (attr = qs_get_attr(doc,node);
2606 attr = qs_get_next_attr(doc,attr)) {
2607 char *name = qs_get_attr_name(doc,attr);
2608 char *value = qs_get_attr_value(doc,attr);
2609 if (STRCASEEQ('a','A',"align", name)) {
2610 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2619 return chtml40->out;
2624 * It is a handler who processes the H5 tag.
2626 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2627 * destination is specified.
2628 * @param node [i] The H5 tag node is specified.
2629 * @return The conversion result is returned.
2632 s_chtml40_end_h5_tag(void *pdoc, Node *UNUSED(child))
2634 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2635 Doc *doc = chtml40->doc;
2640 return chtml40->out;
2645 * It is a handler who processes the H6 tag.
2647 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2648 * destination is specified.
2649 * @param node [i] The H6 tag node is specified.
2650 * @return The conversion result is returned.
2653 s_chtml40_start_h6_tag(void *pdoc, Node *node)
2660 chtml40 = GET_CHTML40(pdoc);
2665 for (attr = qs_get_attr(doc,node);
2667 attr = qs_get_next_attr(doc,attr)) {
2668 char *name = qs_get_attr_name(doc,attr);
2669 char *value = qs_get_attr_value(doc,attr);
2670 if (STRCASEEQ('a','A',"align", name)) {
2671 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2680 return chtml40->out;
2685 * It is a handler who processes the H6 tag.
2687 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2688 * destination is specified.
2689 * @param node [i] The H6 tag node is specified.
2690 * @return The conversion result is returned.
2693 s_chtml40_end_h6_tag(void *pdoc, Node *UNUSED(child))
2695 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2696 Doc *doc = chtml40->doc;
2701 return chtml40->out;
2706 * It is a handler who processes the TEXTARE tag.
2708 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2709 * destination is specified.
2710 * @param node [i] The TEXTAREA tag node is specified.
2711 * @return The conversion result is returned.
2714 s_chtml40_start_textarea_tag(void *pdoc, Node *node)
2721 chtml40 = GET_CHTML40(pdoc);
2725 chtml40->textarea_flag++;
2728 for (attr = qs_get_attr(doc,node);
2730 attr = qs_get_next_attr(doc,attr)) {
2731 char *name = qs_get_attr_name(doc,attr);
2732 char *value = qs_get_attr_value(doc,attr);
2733 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2734 W_L(" accesskey=\"");
2738 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2743 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2748 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2753 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2761 return chtml40->out;
2766 * It is a handler who processes the TEXTAREA tag.
2768 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2769 * destination is specified.
2770 * @param node [i] The TEXTAREA tag node is specified.
2771 * @return The conversion result is returned.
2774 s_chtml40_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2776 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2777 Doc *doc = chtml40->doc;
2781 chtml40->textarea_flag--;
2783 return chtml40->out;
2788 s_chtml40_chxjif_tag(void *pdoc, Node *node)
2795 chtml40 = GET_CHTML40(pdoc);
2799 for (child = qs_get_child_node(doc, node);
2801 child = qs_get_next_node(doc, child)) {
2803 s_chtml40_chxjif_tag(chtml40, child);
2811 s_chtml40_text_tag(void *pdoc, Node *child)
2824 chtml40 = GET_CHTML40(pdoc);
2828 textval = qs_get_node_value(doc,child);
2829 if (strlen(textval) == 0) {
2830 return chtml40->out;
2833 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2834 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2836 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2837 memset(one_byte, 0, sizeof(one_byte));
2840 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2842 int rtn = s_chtml40_search_emoji(chtml40, &textval[ii], &out);
2844 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2849 if (is_sjis_kanji(textval[ii])) {
2850 one_byte[0] = textval[ii+0];
2851 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2852 one_byte[0] = textval[ii+1];
2853 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2856 else if (chtml40->pre_flag) {
2857 one_byte[0] = textval[ii+0];
2858 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2860 else if (chtml40->textarea_flag) {
2861 one_byte[0] = textval[ii+0];
2862 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2864 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2865 one_byte[0] = textval[ii+0];
2866 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2870 return chtml40->out;
2875 * It is a handler who processes the BLOCKQUOTE tag.
2877 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2878 * destination is specified.
2879 * @param node [i] The BLOCKQUOTE tag node is specified.
2880 * @return The conversion result is returned.
2883 s_chtml40_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2885 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2886 Doc *doc = chtml40->doc;
2887 W_L("<blockquote>");
2889 return chtml40->out;
2894 * It is a handler who processes the BLOCKQUOTE tag.
2896 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2897 * destination is specified.
2898 * @param node [i] The BLOCKQUOTE tag node is specified.
2899 * @return The conversion result is returned.
2902 s_chtml40_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2904 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2905 Doc *doc = chtml40->doc;
2906 W_L("</blockquote>");
2908 return chtml40->out;
2913 * It is a handler who processes the DIR tag.
2915 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2916 * destination is specified.
2917 * @param node [i] The DIR tag node is specified.
2918 * @return The conversion result is returned.
2921 s_chtml40_start_dir_tag(void *pdoc, Node *node)
2923 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2924 Doc *doc = chtml40->doc;
2927 for (attr = qs_get_attr(doc,node);
2929 attr = qs_get_next_attr(doc,attr)) {
2930 char *name = qs_get_attr_name(doc,attr);
2931 char *value = qs_get_attr_value(doc,attr);
2932 if (STRCASEEQ('t','T',"type",name)) {
2933 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2942 return chtml40->out;
2947 * It is a handler who processes the DIR tag.
2949 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2950 * destination is specified.
2951 * @param node [i] The DIR tag node is specified.
2952 * @return The conversion result is returned.
2955 s_chtml40_end_dir_tag(void *pdoc, Node *UNUSED(child))
2957 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2958 Doc *doc = chtml40->doc;
2961 return chtml40->out;
2966 * It is a handler who processes the DL tag.
2968 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2969 * destination is specified.
2970 * @param node [i] The DL tag node is specified.
2971 * @return The conversion result is returned.
2974 s_chtml40_start_dl_tag(void *pdoc, Node *UNUSED(child))
2976 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2977 Doc *doc = chtml40->doc;
2980 return chtml40->out;
2985 * It is a handler who processes the DL tag.
2987 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2988 * destination is specified.
2989 * @param node [i] The DL tag node is specified.
2990 * @return The conversion result is returned.
2993 s_chtml40_end_dl_tag(void *pdoc, Node *UNUSED(child))
2995 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2996 Doc *doc = chtml40->doc;
2999 return chtml40->out;
3004 * It is a handler who processes the DT tag.
3006 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3007 * destination is specified.
3008 * @param node [i] The DT tag node is specified.
3009 * @return The conversion result is returned.
3012 s_chtml40_start_dt_tag(void *pdoc, Node *UNUSED(child))
3014 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3015 Doc *doc = chtml40->doc;
3017 return chtml40->out;
3022 * It is a handler who processes the DT tag.
3024 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3025 * destination is specified.
3026 * @param node [i] The DT tag node is specified.
3027 * @return The conversion result is returned.
3030 s_chtml40_end_dt_tag(void *pdoc, Node *UNUSED(child))
3032 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3034 return chtml40->out;
3039 * It is a handler who processes the DD tag.
3041 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3042 * destination is specified.
3043 * @param node [i] The DD tag node is specified.
3044 * @return The conversion result is returned.
3047 s_chtml40_start_dd_tag(void *pdoc, Node *UNUSED(child))
3049 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3050 Doc *doc = chtml40->doc;
3054 return chtml40->out;
3059 * It is a handler who processes the DD tag.
3061 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3062 * destination is specified.
3063 * @param node [i] The DD tag node is specified.
3064 * @return The conversion result is returned.
3067 s_chtml40_end_dd_tag(void *pdoc, Node *UNUSED(child))
3069 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3071 return chtml40->out;
3076 * It is a handler who processes the MARQUEE tag.
3078 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3079 * destination is specified.
3080 * @param node [i] The MARQUEE tag node is specified.
3081 * @return The conversion result is returned.
3084 s_chtml40_start_marquee_tag(void *pdoc, Node *node)
3086 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3087 Doc *doc = chtml40->doc;
3090 /*--------------------------------------------------------------------------*/
3091 /* Get Attributes */
3092 /*--------------------------------------------------------------------------*/
3093 for (attr = qs_get_attr(doc,node);
3095 attr = qs_get_next_attr(doc,attr)) {
3096 char *name = qs_get_attr_name(doc,attr);
3097 char *value = qs_get_attr_value(doc,attr);
3098 if (STRCASEEQ('d','D',"direction", name)) {
3099 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3100 W_L(" direction=\"");
3105 else if (STRCASEEQ('b','B',"behavior",name)) {
3106 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3107 W_L(" behavior=\"");
3112 else if (STRCASEEQ('l','L',"loop",name)) {
3113 if (value && *value) {
3121 return chtml40->out;
3126 * It is a handler who processes the MARQUEE tag.
3128 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3129 * destination is specified.
3130 * @param node [i] The MARQUEE tag node is specified.
3131 * @return The conversion result is returned.
3134 s_chtml40_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3136 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3137 Doc *doc = chtml40->doc;
3140 return chtml40->out;
3145 * It is a handler who processes the BLINK tag.
3147 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3148 * destination is specified.
3149 * @param node [i] The BLINK tag node is specified.
3150 * @return The conversion result is returned.
3153 s_chtml40_start_blink_tag(void *pdoc, Node *UNUSED(child))
3155 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3156 Doc *doc = chtml40->doc;
3158 return chtml40->out;
3163 * It is a handler who processes the BLINK tag.
3165 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3166 * destination is specified.
3167 * @param node [i] The BLINK tag node is specified.
3168 * @return The conversion result is returned.
3171 s_chtml40_end_blink_tag(void *pdoc, Node *UNUSED(child))
3173 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3174 Doc *doc = chtml40->doc;
3177 return chtml40->out;
3182 * It is a handler who processes the MENU tag.
3184 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3185 * destination is specified.
3186 * @param node [i] The MENU tag node is specified.
3187 * @return The conversion result is returned.
3190 s_chtml40_start_menu_tag(void *pdoc, Node *node)
3192 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3193 Doc *doc = chtml40->doc;
3196 /*--------------------------------------------------------------------------*/
3197 /* Get Attributes */
3198 /*--------------------------------------------------------------------------*/
3199 for (attr = qs_get_attr(doc,node);
3201 attr = qs_get_next_attr(doc,attr)) {
3202 char *name = qs_get_attr_name(doc,attr);
3203 char *value = qs_get_attr_value(doc,attr);
3204 if (STRCASEEQ('t','T',"type",name)) {
3205 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3214 return chtml40->out;
3219 * It is a handler who processes the MENU tag.
3221 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3222 * destination is specified.
3223 * @param node [i] The MENU tag node is specified.
3224 * @return The conversion result is returned.
3227 s_chtml40_end_menu_tag(void *pdoc, Node *UNUSED(child))
3229 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3230 Doc *doc = chtml40->doc;
3233 return chtml40->out;
3238 * It is a handler who processes the PLAINTEXT tag.
3240 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3241 * destination is specified.
3242 * @param node [i] The PLAINTEXT tag node is specified.
3243 * @return The conversion result is returned.
3246 s_chtml40_start_plaintext_tag(void *pdoc, Node *node)
3248 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3249 Doc *doc = chtml40->doc;
3251 s_chtml40_start_plaintext_tag_inner(pdoc,node);
3252 return chtml40->out;
3256 s_chtml40_start_plaintext_tag_inner(void *pdoc, Node *node)
3258 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3259 Doc *doc = chtml40->doc;
3261 for (child = qs_get_child_node(doc, node);
3263 child = qs_get_next_node(doc, child)) {
3265 s_chtml40_start_plaintext_tag_inner(pdoc, child);
3267 return chtml40->out;
3272 * It is a handler who processes the PLAINTEXT tag.
3274 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3275 * destination is specified.
3276 * @param node [i] The PLAINTEXT tag node is specified.
3277 * @return The conversion result is returned.
3280 s_chtml40_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3282 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3283 return chtml40->out;