#include "chxj_qr_code.h"
#include "chxj_encoding.h"
+#define BUFFERED 1
+
#define GET_CHTML20(X) ((chtml20_t*)(X))
+#define W_L(X) do { chtml20->out = BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, (X)); } while(0)
+#define W_V(X) do { chtml20->out = (X) ? BUFFERED_WRITE_VALUE(chtml20->out, &doc->buf, (X)) \
+ : BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, ""); } while(0)
static char *s_chtml20_start_html_tag (void *pdoc, Node *node);
static char *s_chtml20_end_html_tag (void *pdoc, Node *node);
qs_parse_string(&doc,ss, strlen(ss));
+ if (! chxj_buffered_write_init(r->pool, &doc.buf)) {
+ ERR(r, "failed: chxj_buffered_write_init()");
+ DBG(r, "end chxj_convert_chtml20()");
+ return apr_pstrdup(r->pool, ss);
+ }
+
/*--------------------------------------------------------------------------*/
/* It converts it from CHTML to CHTML. */
/*--------------------------------------------------------------------------*/
chxj_node_convert(spec,r,(void*)&chtml20, &doc, qs_get_root(&doc), 0);
- dst = chtml20.out;
+ /*--------------------------------------------------------------------------*/
+ /* flush buffer AND terminate. */
+ /*--------------------------------------------------------------------------*/
+ chtml20.out = chxj_buffered_write_flush(chtml20.out, &doc.buf);
+ dst = apr_pstrdup(r->pool, chtml20.out);
+ chxj_buffered_write_terminate(&doc.buf);
qs_all_free(&doc,QX_LOGMARK);
- if (dst == NULL)
+ if (dst == NULL) {
return apr_pstrdup(r->pool,ss);
+ }
- if (strlen(dst) == 0)
+ if (strlen(dst) == 0) {
dst = apr_psprintf(r->pool, "\n");
+ }
*dstlen = strlen(dst);
/*--------------------------------------------------------------------------*/
/* start HTML tag */
/*--------------------------------------------------------------------------*/
+#if BUFFERED
+ W_L("<html>\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<html>\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</html>\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</html>\n", NULL);
+#endif
return chtml20->out;
}
content_type_flag = 0;
refresh_flag = 0;
+#if BUFFERED
+ W_L("<meta");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<meta", NULL);
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*----------------------------------------------------------------------*/
/* CHTML 2.0 */
/*----------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" http-equiv=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" http-equiv=\"",
value,
"\"",
NULL);
+#endif
- if (STRCASEEQ('c','C',"content-type",value))
+ if (STRCASEEQ('c','C',"content-type",value)) {
content_type_flag = 1;
- if (STRCASEEQ('r','R',"refresh", value))
+ }
+ if (STRCASEEQ('r','R',"refresh", value)) {
refresh_flag = 1;
+ }
}
break;
if (strcasecmp(name, "content") == 0) {
if (content_type_flag) {
if (IS_SJIS_STRING(GET_SPEC_CHARSET(chtml20->spec))) {
+#if BUFFERED
+ W_L(" ");
+ W_V(name);
+ W_L("=\"");
+ W_L("text/html; charset=Windows-31J");
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" ",
"text/html; charset=Windows-31J",
"\"",
NULL);
+#endif
}
else {
+#if BUFFERED
+ W_L(" ");
+ W_V(name);
+ W_L("=\"");
+ W_L("text/html; charset=UTF-8");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" ",
"text/html; charset=UTF-8",
"\"",
NULL);
+#endif
}
}
else if (refresh_flag) {
url++;
url = chxj_encoding_parameter(r, url);
url = chxj_add_cookie_parameter(r, url, chtml20->cookie);
+#if BUFFERED
+ W_L(" ");
+ W_V(name);
+ W_L("=\"");
+ W_V(sec);
+ W_L(";");
+ W_V(url);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" ",
url,
"\"",
NULL);
+#endif
}
}
else {
+#if BUFFERED
+ W_L(" ");
+ W_V(name);
+ W_L("=\"");
+ W_V(value);
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" ",
value,
"\"",
NULL);
+#endif
}
}
break;
}
}
+#if BUFFERED
+ W_L(">");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, ">", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<head>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<head>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</head>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</head>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<title>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<title>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</title>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</title>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<base");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<base", NULL);
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
name = qs_get_attr_name(doc,attr);
value = qs_get_attr_value(doc,attr);
- if ((*name == 'h' || *name == 'H')
- && strcasecmp(name, "href") == 0) {
+ if (STRCASEEQ('h','H',"href",name)) {
+#if BUFFERED
+ W_L(" href=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" href=\"",
value,
"\"",
NULL);
+#endif
}
}
+#if BUFFERED
+ W_L(" >\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, " >\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<body");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<body", NULL);
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*----------------------------------------------------------------------*/
/* CHTML 2.0 */
/*----------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" bgcolor=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" bgcolor=\"",
value,
"\"",
NULL);
+#endif
}
break;
/*----------------------------------------------------------------------*/
/* CHTML 2.0 */
/*----------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" text=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" text=\"",
value,
"\"",
NULL);
+#endif
}
break;
/*----------------------------------------------------------------------*/
/* CHTML 2.0 */
/*----------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" link=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" link=\"",
value,
"\"",
NULL);
+#endif
}
break;
}
}
+#if BUFFERED
+ W_L(">\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, ">\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</body>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</body>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<a");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<a", NULL);
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*--------------------------------------------------------------------*/
/* CHTML1.0 */
/*--------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" name=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" name=\"",
value,
"\"",
NULL);
+#endif
}
break;
/*--------------------------------------------------------------------*/
value = chxj_encoding_parameter(r, value);
value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
-
+#if BUFFERED
+ W_L(" href=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" href=\"",
value,
"\"",
NULL);
+#endif
}
break;
/*--------------------------------------------------------------------*/
/* CHTML1.0 */
/*--------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" accesskey=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" accesskey=\"",
value,
"\"",
NULL);
+#endif
}
break;
/*--------------------------------------------------------------------*/
/* CHTML 2.0 */
/*--------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" cti=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" cti=\"",
value,
"\"",
NULL);
+#endif
}
break;
}
}
+#if BUFFERED
+ W_L(">");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, ">", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</a>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</a>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<br>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<br>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<br>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<br>\r\n", NULL);
+#endif
return chtml20->out;
}
r = doc->r;
+#if BUFFERED
+ W_L("<font");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<font", NULL);
-
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*--------------------------------------------------------------------------*/
case 'c':
case 'C':
if (strcasecmp(name, "color") == 0) {
+#if BUFFERED
+ W_L(" color=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" color=\"",
value,
"\"",
NULL);
+#endif
}
break;
}
}
+#if BUFFERED
+ W_L(">");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, ">", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</font>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</font>", NULL);
+#endif
return chtml20->out;
}
r = doc->r;
+#if BUFFERED
+ W_L("<form");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<form", NULL);
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
value = chxj_encoding_parameter(r, value);
value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
+#if BUFFERED
+ W_L(" action=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" action=\"",
value,
"\"",
NULL);
+#endif
}
break;
/*--------------------------------------------------------------------*/
/* CHTML 1.0 */
/*--------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" method=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" method=\"",
value,
"\"",
NULL);
+#endif
}
break;
}
}
+#if BUFFERED
+ W_L(">");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, ">", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</form>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</form>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
-
+#if BUFFERED
+ W_L("<input");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<input", NULL);
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
accesskey = qs_get_accesskey_attr(doc, node, r);
size = qs_get_size_attr(doc, node, r);
- if (type)
+ if (type) {
+#if BUFFERED
+ W_L(" type=\"");
+ W_V(type);
+ W_L("\" ");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" type=\"",
type,
"\" ",
NULL);
+#endif
+ }
- if (size)
+ if (size) {
+#if BUFFERED
+ W_L(" size=\"");
+ W_V(size);
+ W_L("\" ");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" size=\"",
size,
"\" ",
NULL);
+#endif
+ }
- if (name)
+ if (name) {
+#if BUFFERED
+ W_L(" name=\"");
+ W_V(name);
+ W_L("\" ");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" name=\"",
name,
"\" ",
NULL);
+#endif
+ }
- if (value)
+ if (value) {
+#if BUFFERED
+ W_L(" value=\"");
+ W_V(value);
+ W_L("\" ");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" value=\"",
value,
"\" ",
NULL);
+#endif
+ }
- if (accesskey)
+ if (accesskey) {
+#if BUFFERED
+ W_L(" accesskey=\"");
+ W_V(accesskey);
+ W_L("\" ");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" accesskey=\"",
accesskey, "\" ",
NULL);
+#endif
+ }
- if (istyle)
+ if (istyle) {
/*------------------------------------------------------------------------*/
/* CHTML 2.0 */
/*------------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" istyle=\"");
+ W_V(istyle);
+ W_L("\" ");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" istyle=\"",
istyle, "\" ",
NULL);
+#endif
+ }
/*--------------------------------------------------------------------------*/
/* The figure is default for the password. */
if (max_length) {
if (chxj_chk_numeric(max_length) != 0)
max_length = apr_psprintf(r->pool, "0");
- if (istyle != NULL && strcasecmp(istyle, "1") == 0)
+ if (istyle != NULL && istyle[0] == '1') {
+#if BUFFERED
+ char *vv = apr_psprintf(doc->buf.pool,
+ " maxlength=\"%d\"",
+ chxj_atoi(max_length)*2);
+ W_V(vv);
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
apr_psprintf(r->pool,
" maxlength=\"%d\"",
chxj_atoi(max_length)*2),
NULL);
- else
+#endif
+ }
+ else {
+#if BUFFERED
+ char *vv = apr_psprintf(doc->buf.pool,
+ " maxlength=\"%d\"",
+ chxj_atoi(max_length));
+ W_V(vv);
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
apr_psprintf(r->pool,
" maxlength=\"%d\"",
chxj_atoi(max_length)),
NULL);
+#endif
+ }
}
- if (checked)
+ if (checked) {
+#if BUFFERED
+ W_L(" checked ");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" checked ",
NULL);
+#endif
+ }
+#if BUFFERED
+ W_L(" >");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, " >", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<center>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<center>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</center>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</center>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<ul>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<ul>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</ul>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</ul>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<ol>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<ol>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</ol>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</ol>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<li>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<li>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</li>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</li>", NULL);
+#endif
return chtml20->out;
}
r = doc->r;
+#if BUFFERED
+ W_L("<hr ");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<hr ", NULL);
-
+#endif
for (attr = qs_get_attr(doc,node);
attr;
attr = qs_get_next_attr(doc,attr)) {
/*--------------------------------------------------------------------*/
/* CHTML 1.0 */
/*--------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" align=\"");
+ W_V(value);
+ W_L("\" ");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" align=\"",
value,
"\" ",
NULL);
+#endif
}
break;
/*--------------------------------------------------------------------*/
/* CHTML 1.0 */
/*--------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" size=\"");
+ W_V(value);
+ W_L("\" ");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" size=\"",
value,
"\" ",
NULL);
+#endif
}
break;
/*--------------------------------------------------------------------*/
/* CHTML 1.0 */
/*--------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" width=\"");
+ W_V(value);
+ W_L("\" ");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" width=\"",
value,
"\" ",
NULL);
+#endif
}
break;
/*--------------------------------------------------------------------*/
/* CHTML 1.0 */
/*--------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" noshade ");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" noshade ",
NULL);
+#endif
}
break;
break;
}
}
-
+#if BUFFERED
+ W_L(" >");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, " >", NULL);
-
+#endif
return chtml20->out;
}
spec = chtml20->spec;
#endif
+#if BUFFERED
+ W_L("<img");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<img", NULL);
-
-
+#endif
/*-------------------------------------------------------------------------*/
/* Get Attributes */
/*-------------------------------------------------------------------------*/
(strchr(value, '?')) ? '&' : '?',
CHXJ_COOKIE_NOUPDATE_PARAM);
}
+#if BUFFERED
+ W_L(" src=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" src=\"",
value,
"\"",
NULL);
+#endif
#else
value = chxj_img_conv(r, spec, value);
value = chxj_encoding_parameter(r, value);
(strchr(value, '?')) ? '&' : '?',
CHXJ_COOKIE_NOUPDATE_PARAM);
}
-
+#if BUFFERED
+ W_L(" src=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out, " src=\"",
value,
NULL);
-
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
"\"",
NULL);
#endif
+#endif
}
break;
/*--------------------------------------------------------------------*/
/* CHTML 1.0 */
/*--------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" align=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" align=\"",
value,
"\"",
NULL);
+#endif
}
else
if (strcasecmp(name, "alt" ) == 0) {
/*--------------------------------------------------------------------*/
/* CHTML 1.0 */
/*--------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" alt=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" alt=\"",
value,
"\"",
NULL);
+#endif
}
else
if (strcasecmp(name, "align" ) == 0) {
/*--------------------------------------------------------------------*/
/* CHTML 1.0 */
/*--------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" width=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" width=\"",
value,
"\"",
NULL);
+#endif
}
break;
/*--------------------------------------------------------------------*/
/* CHTML 1.0 */
/*--------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" height=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" height=\"",
value,
"\"",
NULL);
+#endif
}
else
if (strcasecmp(name, "hspace") == 0) {
/*--------------------------------------------------------------------*/
/* CHTML 1.0 */
/*--------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" hspace=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" hspace=\"",
value,
"\"",
NULL);
+#endif
}
break;
/*--------------------------------------------------------------------*/
/* CHTML 1.0 */
/*--------------------------------------------------------------------*/
+#if BUFFERED
+ W_L(" vspace=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" vspace=\"",
value,
"\"",
NULL);
+#endif
}
break;
break;
}
}
-
+#if BUFFERED
+ W_L(">");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, ">", NULL);
+#endif
return chtml20->out;
}
char *size = NULL;
char *name = NULL;
+#if BUFFERED
+ W_L("<select");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<select", NULL);
-
+#endif
for (attr = qs_get_attr(doc,child);
attr;
attr = qs_get_next_attr(doc,attr)) {
}
}
- if (size)
+ if (size) {
+#if BUFFERED
+ W_L(" size=\"");
+ W_V(size);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" size=\"",
size,
"\"",
NULL);
+#endif
+ }
- if (name)
+ if (name) {
+#if BUFFERED
+ W_L(" name=\"");
+ W_V(name);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" name=\"",
name,
"\"",
NULL);
-
+#endif
+ }
+#if BUFFERED
+ W_L(">\n");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
">\n",
NULL);
-
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</select>\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</select>\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
- char* selected = NULL;
- char* value = NULL;
+ char *selected = NULL;
+ char *value = NULL;
+#if BUFFERED
+ W_L("<option");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<option", NULL);
-
+#endif
for (attr = qs_get_attr(doc,child);
attr;
attr = qs_get_next_attr(doc,attr)) {
}
}
- if (value)
+ if (value) {
+#if BUFFERED
+ W_L(" value=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" value=\"",
value,
"\"",
NULL);
- else
+#endif
+ }
+ else {
+#if BUFFERED
+ W_L(" value=\"\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" value=\"\"",
NULL);
+#endif
+ }
- if (selected)
+ if (selected) {
+#if BUFFERED
+ W_L(" selected ");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" selected ",
NULL);
+#endif
+ }
+#if BUFFERED
+ W_L(">");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
">",
NULL);
+#endif
return chtml20->out;
}
r = doc->r;
- char* align = NULL;
+ char *align = NULL;
+#if BUFFERED
+ W_L("<div");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<div", NULL);
-
+#endif
for (attr = qs_get_attr(doc,child);
attr;
attr = qs_get_next_attr(doc,attr)) {
nm = qs_get_attr_name(doc,attr);
val = qs_get_attr_value(doc,attr);
- if ((*nm == 'a'||*nm == 'A') && strcasecmp(nm, "align") == 0) {
+ if (STRCASEEQ('a','A',"align", nm)) {
/*----------------------------------------------------------------------*/
/* CHTML 1.0 (W3C version 3.2) */
/*----------------------------------------------------------------------*/
}
}
- if (align)
+ if (align) {
+#if BUFFERED
+ W_L(" align=\"");
+ W_V(align);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" align=\"",
align,
"\"",
NULL);
-
+#endif
+ }
+#if BUFFERED
+ W_L(">");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
">",
NULL);
-
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</div>\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</div>\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<h1>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<h1>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</h1>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</h1>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<h2>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<h2>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</h2>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</h2>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<h3>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<h3>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</h3>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</h3>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<h4>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<h4>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</h4>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</h4>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<h5>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<h5>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</h5>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</h5>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<h6>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<h6>\r\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</h6>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</h6>\r\n", NULL);
+#endif
return chtml20->out;
}
r = doc->r;
chtml20->pre_flag++;
+#if BUFFERED
+ W_L("<pre>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<pre>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</pre>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</pre>", NULL);
+#endif
chtml20->pre_flag--;
return chtml20->out;
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<p>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<p>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</p>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</p>", NULL);
+#endif
return chtml20->out;
}
for (child = qs_get_child_node(doc, node);
child;
child = qs_get_next_node(doc, child)) {
-
+#if BUFFERED
+ W_V(child->otext);
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, child->otext, NULL);
-
+#endif
s_chtml20_chxjif_tag(pdoc, child);
}
r = doc->r;
chtml20->textarea_flag++;
+#if BUFFERED
+ W_L("<textarea ");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<textarea ", NULL);
+#endif
for (attr = qs_get_attr(doc,node);
attr;
case 'n':
case 'N':
if (strcasecmp(name, "name") == 0) {
+#if BUFFERED
+ W_L(" name=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" name=\"",
value,
"\"",
NULL);
+#endif
}
break;
case 'r':
case 'R':
if (strcasecmp(name, "rows") == 0) {
+#if BUFFERED
+ W_L(" rows=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" rows=\"",
value,
"\"",
NULL);
+#endif
}
break;
case 'c':
case 'C':
if (strcasecmp(name, "cols") == 0) {
+#if BUFFERED
+ W_L(" cols=\"");
+ W_V(value);
+ W_L("\"");
+#else
chtml20->out = apr_pstrcat(r->pool,
chtml20->out,
" cols=\"",
value,
"\"",
NULL);
+#endif
}
break;
break;
}
}
-
+#if BUFFERED
+ W_L(">\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, ">\r\n", NULL);
-
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
-
+#if BUFFERED
+ W_L("</textarea>\r\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</textarea>\r\n", NULL);
+#endif
+
chtml20->textarea_flag--;
return chtml20->out;
tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
}
}
+#if BUFFERED
+ W_V(tdst);
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, tdst, NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<dl>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<dl>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("</dl>\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</dl>\n", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<dt>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<dt>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "\n", NULL);
+#endif
return chtml20->out;
}
+
/**
* It is a handler who processes the DD tag.
*
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("<dd>");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<dd>", NULL);
+#endif
return chtml20->out;
}
doc = chtml20->doc;
r = doc->r;
+#if BUFFERED
+ W_L("\n");
+#else
chtml20->out = apr_pstrcat(r->pool, chtml20->out, "\n", NULL);
+#endif
return chtml20->out;
}
-
/*
* vim:ts=2 et
*/