#include "chxj_dump.h"
#include "chxj_img_conv.h"
#include "chxj_qr_code.h"
+#include "chxj_buffered_write.h"
+#define BUFFERED 1
#define GET_XHTML(X) ((xhtml_t *)(X))
+#define W_L(X) do { xhtml->out = BUFFERED_WRITE_LITERAL(xhtml->out, &doc->buf, (X)); } while(0)
+#define W_V(X) do { xhtml->out = (X) ? BUFFERED_WRITE_VALUE(xhtml->out, &doc->buf, (X)) \
+ : BUFFERED_WRITE_LITERAL(xhtml->out, &doc->buf, ""); } while(0)
static char *s_xhtml_1_0_start_html_tag (void *pdoc, Node *node);
static char *s_xhtml_1_0_end_html_tag (void *pdoc, Node *node);
#ifdef DUMP_LOG
chxj_dump_out("[src] CHTML->XHTML", ss, srclen);
#endif
- DBG(r,"start parse");
qs_parse_string(&doc,ss, strlen(ss));
- DBG(r,"end parse");
-
+ if (! chxj_buffered_write_init(r->pool, &doc.buf)) {
+ ERR(r, "failed: chxj_buffered_write_init()");
+ DBG(r, "end chxj_convert_xhtml_mobile_1_0()");
+ return apr_pstrdup(r->pool, ss);
+ }
/*--------------------------------------------------------------------------*/
/* It converts it from CHTML to XHTML. */
/*--------------------------------------------------------------------------*/
chxj_node_convert(spec,r,(void*)&xhtml, &doc, qs_get_root(&doc), 0);
- dst = xhtml.out;
+ /*--------------------------------------------------------------------------*/
+ /* flush buffer AND terminate. */
+ /*--------------------------------------------------------------------------*/
+ xhtml.out = chxj_buffered_write_flush(xhtml.out, &doc.buf);
+ dst = apr_pstrdup(r->pool, xhtml.out);
+ chxj_buffered_write_terminate(&doc.buf);
qs_all_free(&doc,QX_LOGMARK);
- if (! dst)
+ if (! dst) {
return apr_pstrdup(r->pool,ss);
+ }
- if (! strlen(dst))
+ if (! strlen(dst)) {
dst = apr_psprintf(r->pool, "\n");
+ }
*dstlen = strlen(dst);
xhtml_t *xhtml = GET_XHTML(pdoc);
Attr *attr;
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
/*--------------------------------------------------------------------------*/
/* Add XML Declare */
/*--------------------------------------------------------------------------*/
+#if BUFFERED
+ W_L("<?xml version=\"1.0\" encoding=\"Windows-31J\"?>\r\n");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
"<?xml version=\"1.0\" encoding=\"Windows-31J\"?>\r\n",
NULL);
+#endif
/*--------------------------------------------------------------------------*/
/* Add DocType */
/*--------------------------------------------------------------------------*/
+#if BUFFERED
+ W_L("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\"\r\n");
+ W_L(" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">\r\n");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\"\r\n",NULL);
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">\r\n",NULL);
+#endif
/*--------------------------------------------------------------------------*/
/* start HTML tag */
/*--------------------------------------------------------------------------*/
+#if BUFFERED
+ W_L("<html");
+ W_L(" xmlns=\"http://www.w3.org/1999/xhtml\"");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<html", NULL);
xhtml->out = apr_pstrcat(r->pool, xhtml->out,
" xmlns=\"http://www.w3.org/1999/xhtml\"", NULL);
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
attr = qs_get_next_attr(doc,attr)) {
char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
- if (strcasecmp(name, "lang") == 0) {
+ if (STRCASEEQ('l','L',"lang",name)) {
+#if BUFFERED
+ W_L(" xml:lang=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" xml:lang=\"",
value,
"\"",
NULL);
+#endif
}
- else
- if (strcasecmp(name, "version") == 0) {
+ else if (STRCASEEQ('v','V',"version",name)) {
+#if BUFFERED
+ W_L(" version=\"-//OPENWAVE//DTD XHTML Mobile 1.0//EN\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" version=\"-//OPENWAVE//DTD XHTML Mobile 1.0//EN\"",
NULL);
+#endif
}
}
-
+#if BUFFERED
+ W_L(">\r\n");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, ">\r\n", NULL);
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("</html>\r\n");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</html>\r\n", NULL);
+#endif
return xhtml->out;
}
xhtml_t *xhtml = GET_XHTML(pdoc);
Attr *attr;
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
int content_type_flag = 0;
+#if BUFFERED
+ W_L("<meta");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<meta", NULL);
-
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*--------------------------------------------------------------------------*/
char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
if (STRCASEEQ('n','N', "name", name)) {
+#if BUFFERED
+ W_L(" ");
+ W_V(name);
+ W_L("=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" ",
value,
"\"",
NULL);
+#endif
}
else if (STRCASEEQ('h','H',"http-equiv", name)) {
+#if BUFFERED
+ W_L(" ");
+ W_V(name);
+ W_L("=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" ",
value,
"\"",
NULL);
+#endif
if (STRCASEEQ('c','C',"content-type", value)) {
content_type_flag = 1;
}
else if (STRCASEEQ('c','C',"content", name)) {
if (content_type_flag) {
if (IS_SJIS_STRING(GET_SPEC_CHARSET(xhtml->spec))) {
+#if BUFFERED
+ W_L(" ");
+ W_V(name);
+ W_L("=\"");
+ W_L("text/html; charset=Windows-31J");
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->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");
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" ",
"text/html; charset=UTF-8",
"\"",
NULL);
+#endif
}
}
else {
+#if BUFFERED
+ W_L(" ");
+ W_V(name);
+ W_L("=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" ",
value,
"\"",
NULL);
+#endif
}
}
}
-
+#if BUFFERED
+ W_L(" />\r\n");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" />\r\n",
NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("<head>\r\n");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<head>\r\n", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</head>\r\n");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</head>\r\n", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("<title>");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<title>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("</title>\r\n");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</title>\r\n", NULL);
-
+#endif
return xhtml->out;
}
xhtml_t *xhtml = GET_XHTML(pdoc);
Attr *attr;
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("<base");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<base", NULL);
-
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*--------------------------------------------------------------------------*/
attr = qs_get_next_attr(doc,attr)) {
char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
- if (strcasecmp(name, "href") == 0) {
+ if (STRCASEEQ('h','H',"href",name)) {
+#if BUFFERED
+ W_L(" href=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" href=\"",
value,
"\"",
NULL);
+#endif
}
}
+#if BUFFERED
+ W_L(" />\r\n");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, " />\r\n", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
Attr *attr;
+#if BUFFERED
+ W_L("<body");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<body", NULL);
-
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*--------------------------------------------------------------------------*/
attr = qs_get_next_attr(doc,attr)) {
char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
- if ((*name == 'b' || *name == 'B') && strcasecmp(name, "bgcolor") == 0) {
+ if (STRCASEEQ('b','B',"bgcolor",name)) {
+#if BUFFERED
+ W_L(" bgcolor=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" bgcolor=\"",
value,
"\"",
NULL);
+#endif
}
- else
- if ((*name == 't' || *name == 'T') && strcasecmp(name, "text") == 0) {
+ else if (STRCASEEQ('t','T',"text",name)) {
+#if BUFFERED
+ W_L(" text=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" text=\"",
value,
"\"",
NULL);
+#endif
}
- else
- if ((*name == 'l' || *name == 'L') && strcasecmp(name, "link") == 0) {
+ else if (STRCASEEQ('l','L',"link",name)) {
+#if BUFFERED
+ W_L(" link=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" link=\"",
value,
"\"",
NULL);
+#endif
}
- else
- if ((*name == 'a' || *name == 'A') && strcasecmp(name, "alink") == 0) {
+ else if (STRCASEEQ('a','A',"alink",name)) {
/* ignore */
}
- else
- if ((*name == 'v' || *name == 'V') && strcasecmp(name, "vlink") == 0) {
+ else if (STRCASEEQ('v','V',"vlink",name)) {
/* ignore */
}
}
+#if BUFFERED
+ W_L(">\r\n");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, ">\r\n", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("</body>\r\n");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</body>\r\n", NULL);
-
+#endif
return xhtml->out;
}
request_rec *r = doc->r;
Attr *attr;
+#if BUFFERED
+ W_L("<a");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<a", NULL);
-
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*--------------------------------------------------------------------------*/
attr = qs_get_next_attr(doc,attr)) {
char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
-
- if ((*name == 'n' || *name == 'N') && strcasecmp(name, "name") == 0) {
+ if (STRCASEEQ('n','N',"name",name)) {
+#if BUFFERED
+ W_L(" id=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" id=\"",
value,
"\"",
NULL);
+#endif
}
- else
- if ((*name == 'h' || *name == 'H') && strcasecmp(name, "href") == 0) {
-#if 0
- apr_size_t ilen;
- char* dbuf;
- ap_unescape_url(value);
- ilen = strlen(value);
- dbuf = chxj_encoding(r, (const char*)value, (apr_size_t*)&ilen);
- dbuf = ap_escape_uri(r->pool,dbuf);
- xhtml->out = apr_pstrcat(r->pool,
- xhtml->out,
- " href=\"",
- dbuf,
- "\"",
- NULL);
-#else
+ else if (STRCASEEQ('h','H',"href",name)) {
value = chxj_encoding_parameter(r, value);
+#if BUFFERED
+ W_L(" href=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" href=\"",
NULL);
#endif
}
- else
- if ((*name == 'a' || *name == 'A') && strcasecmp(name, "accesskey") == 0) {
+ else if (STRCASEEQ('a','A',"accesskey",name)) {
+#if BUFFERED
+ W_L(" accesskey=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" accesskey=\"",
value,
"\"",
NULL);
+#endif
}
- else
- if (strcasecmp(name, "cti") == 0) {
+ else if (STRCASEEQ('c','C',"cti",name)) {
/* ignore */
}
- else
- if (strcasecmp(name, "ijam") == 0) {
+ else if (STRCASEEQ('i','I',"ijam",name)) {
/* ignore */
}
- else
- if (strcasecmp(name, "utn") == 0) {
+ else if (STRCASEEQ('u','U',"utn",name)) {
/* ignore */
}
- else
- if (strcasecmp(name, "telbook") == 0) {
+ else if (STRCASEEQ('t','T',"telbook",name)) {
/* ignore */
}
- else
- if (strcasecmp(name, "kana") == 0) {
+ else if (STRCASEEQ('k','K',"kana",name)) {
/* ignore */
}
- else
- if (strcasecmp(name, "email") == 0) {
+ else if (STRCASEEQ('e','E',"email",name)) {
/* ignore */
}
- else
- if (strcasecmp(name, "ista") == 0) {
+ else if (STRCASEEQ('i','I',"ista",name)) {
/* ignore */
}
- else
- if (strcasecmp(name, "ilet") == 0) {
+ else if (STRCASEEQ('i','I',"ilet",name)) {
/* ignore */
}
- else
- if (strcasecmp(name, "iswf") == 0) {
+ else if (STRCASEEQ('i','I',"iswf",name)) {
/* ignore */
}
- else
- if (strcasecmp(name, "irst") == 0) {
+ else if (STRCASEEQ('i','I',"irst",name)) {
/* ignore */
}
}
+#if BUFFERED
+ W_L(">");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, ">", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("</a>");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</a>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
-
+#if BUFFERED
+ W_L("<br />\r\n");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<br />\r\n", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("<br />\r\n");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<br />\r\n", NULL);
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
Attr *attr;
+#if BUFFERED
+ W_L("<font");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<font", NULL);
+#endif
/* Get Attributes */
for (attr = qs_get_attr(doc,node);
- attr; attr = qs_get_next_attr(doc,attr)) {
+ attr;
+ attr = qs_get_next_attr(doc,attr)) {
char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
- if ((*name == 'c' || *name == 'C') && strcasecmp(name, "color") == 0) {
+ if (STRCASEEQ('c','C',"color",name)) {
+#if BUFFERED
+ W_L(" color=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, " color=\"",value,"\"", NULL);
+#endif
}
- else
- if ((*name == 's' || *name == 'S') && strcasecmp(name, "size") == 0) {
+ else if (STRCASEEQ('s','S',"size",name)) {
+#if BUFFERED
+ W_L(" size=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, " size=\"",value,"\"", NULL);
+#endif
}
}
+#if BUFFERED
+ W_L(">");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, ">", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("</font>");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</font>", NULL);
+#endif
return xhtml->out;
}
request_rec *r = doc->r;
Attr *attr;
+#if BUFFERED
+ W_L("<form");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<form", NULL);
-
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*--------------------------------------------------------------------------*/
attr = qs_get_next_attr(doc,attr)) {
char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
- if ((*name == 'a' || *name == 'A') && strcasecmp(name, "action") == 0) {
+ if (STRCASEEQ('a','A',"action",name)) {
value = chxj_encoding_parameter(r, value);
+#if BUFFERED
+ W_L(" action=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" action=\"",
value,
"\"",
NULL);
+#endif
}
- else
- if ((*name == 'm' || *name == 'M') && strcasecmp(name, "method") == 0) {
+ else if (STRCASEEQ('m','M',"method",name)) {
+#if BUFFERED
+ W_L(" method=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" method=\"",
value,
"\"",
NULL);
+#endif
}
- else
- if ((*name == 'u' || *name == 'U') && strcasecmp(name, "utn") == 0) {
+ else if (STRCASEEQ('u','U',"utn",name)) {
/* ignore */
}
}
+#if BUFFERED
+ W_L(">");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, ">", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("</form>");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</form>", NULL);
-
+#endif
return xhtml->out;
}
char *checked = NULL;
char *accesskey = NULL;
+#if BUFFERED
+ W_L("<input");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<input", NULL);
-
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*--------------------------------------------------------------------------*/
-
type = qs_get_type_attr(doc, node, r);
name = qs_get_name_attr(doc, node, r);
value = qs_get_value_attr(doc,node,r);
checked = qs_get_checked_attr(doc,node,r);
accesskey = qs_get_accesskey_attr(doc, node, r);
size = qs_get_size_attr(doc, node, r);
-
if (type) {
+#if BUFFERED
+ W_L(" type=\"");
+ W_V(type);
+ W_L("\" ");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" type=\"",
type,
"\" ",
NULL);
+#endif
}
if (size) {
+#if BUFFERED
+ W_L(" size=\"");
+ W_V(size);
+ W_L("\" ");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" size=\"",
size,
"\" ",
NULL);
+#endif
}
if (name) {
+#if BUFFERED
+ W_L(" name=\"");
+ W_V(name);
+ W_L("\" ");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" name=\"",
name,
"\" ",
NULL);
+#endif
}
if (value) {
+#if BUFFERED
+ W_L(" value=\"");
+ W_V(value);
+ W_L("\" ");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" value=\"",
value,
"\" ",
NULL);
+#endif
}
if (accesskey) {
+#if BUFFERED
+ W_L(" accesskey=\"");
+ W_V(accesskey);
+ W_L("\" ");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" accesskey=\"",
accesskey, "\" ",
NULL);
+#endif
}
if (istyle) {
char* fmt = qs_conv_istyle_to_format(r,istyle);
int ii;
for (ii=0; (unsigned int)ii<strlen(max_length); ii++) {
if (max_length[ii] < '0' || max_length[ii] > '9') {
- max_length = apr_psprintf(r->pool, "0");
+ max_length = apr_psprintf(doc->buf.pool, "0");
break;
}
}
+#if BUFFERED
+ char *vv = apr_psprintf(doc->buf.pool,
+ " FORMAT=\"%d%s\"",
+ atoi(max_length),
+ fmt);
+ W_V(vv);
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
apr_psprintf(r->pool, " FORMAT=\"%d%s\"",
atoi(max_length),
fmt),
NULL);
+#endif
}
else {
+#if BUFFERED
+ W_L(" FORMAT=\"");
+ W_L("*");
+ W_V(fmt);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" FORMAT=\"",
fmt,
"\"",
NULL);
+#endif
}
}
/*--------------------------------------------------------------------------*/
/* The figure is default for the password. */
/*--------------------------------------------------------------------------*/
- if (type && istyle == NULL
- && (*type == 'p' || *type == 'P')
- && strcasecmp(type, "password") == 0
- && ! xhtml->entryp->pc_flag) {
+ if (type && istyle == NULL && STRCASEEQ('p','P',"password", type) && ! xhtml->entryp->pc_flag) {
if (max_length) {
+#if BUFFERED
+ W_L(" FORMAT=\"");
+ W_V(max_length);
+ W_L("N");
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" FORMAT=\"",
"N",
"\"",
NULL);
+#endif
}
else {
+#if BUFFERED
+ W_L(" FORMAT=\"");
+ W_L("*");
+ W_L("N");
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" FORMAT=\"", "*", "N", "\"", NULL);
+#endif
}
}
if (checked) {
+#if BUFFERED
+ W_L(" checked=\"checked\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out, " checked=\"checked\"", NULL);
+#endif
}
-
+#if BUFFERED
+ W_L(" />");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, " />", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("<center>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<center>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("</center>");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</center>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("<hr />");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<hr />", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
-
xhtml->pre_flag++;
+#if BUFFERED
+ W_L("<pre>");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<pre>", NULL);
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("</pre>");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</pre>", NULL);
+#endif
xhtml->pre_flag--;
return xhtml->out;
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("<p>");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<p>", NULL);
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("</p>");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</p>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("<ul>");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<ul>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
+#if BUFFERED
+ W_L("</ul>");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</ul>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("<h1>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<h1>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</h1>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</h1>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("<h2>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<h2>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</h2>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</h2>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("<h3>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<h3>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</h3>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</h3>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("<h4>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<h4>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</h4>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</h4>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("<h5>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<h5>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</h5>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</h5>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("<h6>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<h6>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</h6>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</h6>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("<ol>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<ol>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</ol>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</ol>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("<li>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<li>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</li>");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</li>", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
Attr *attr;
+ request_rec *r = doc->r;
#ifndef IMG_NOT_CONVERT_FILENAME
device_table *spec = xhtml->spec;
#endif
+#if BUFFERED
+ W_L("<img");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<img", NULL);
-
+#endif
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*--------------------------------------------------------------------------*/
attr = qs_get_next_attr(doc,attr)) {
char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
-
- if ((*name == 's' || *name == 'S') && strcasecmp(name, "src") == 0) {
+ if (STRCASEEQ('s','S',"src",name)) {
value = chxj_encoding_parameter(r, value);
#ifdef IMG_NOT_CONVERT_FILENAME
+#if BUFFERED
+ W_L(" src=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out, " src=\"",value,"\"", NULL);
+#endif
+#else
+#if BUFFERED
+ char *vv = chxj_img_conv(r,spec,value);
+ W_L(" src=\"");
+ W_V(vv);
+ W_L("\"");
+ W_L("\"");
#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out,
" src=\"", chxj_img_conv(r,spec,value) , NULL);
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "\"", NULL);
#endif
+#endif
}
- else
- if (*name == 'a' || *name == 'A') {
- if (strcasecmp(name, "align" ) == 0) {
- xhtml->out = apr_pstrcat(r->pool,
- xhtml->out, " align=\"",value,"\"", NULL);
- }
- else
- if (strcasecmp(name, "alt" ) == 0) {
- xhtml->out = apr_pstrcat(r->pool,
- xhtml->out, " alt=\"",value,"\"", NULL);
- }
+ else if (STRCASEEQ('a','A',"align",name)) {
+#if BUFFERED
+ W_L(" align=\"");
+ W_V(value);
+ W_L("\"");
+#else
+ xhtml->out = apr_pstrcat(r->pool,
+ xhtml->out, " align=\"",value,"\"", NULL);
+#endif
}
- else
- if ((*name == 'w' || *name == 'W') && strcasecmp(name, "width" ) == 0) {
+ else if (STRCASEEQ('a','A',"alt",name)) {
+#if BUFFERED
+ W_L(" alt=\"");
+ W_V(value);
+ W_L("\"");
+#else
+ xhtml->out = apr_pstrcat(r->pool,
+ xhtml->out, " alt=\"",value,"\"", NULL);
+#endif
+ }
+ else if (STRCASEEQ('w','W',"width",name)) {
+#if BUFFERED
+ W_L(" width=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out, " width=\"",value,"\"", NULL);
+#endif
}
- else
- if (*name == 'h' || *name == 'H') {
- if (strcasecmp(name, "height") == 0) {
- xhtml->out = apr_pstrcat(r->pool,
- xhtml->out, " height=\"",value,"\"", NULL);
- }
- else
- if (strcasecmp(name, "hspace") == 0) {
- xhtml->out = apr_pstrcat(r->pool,
- xhtml->out, " hspace=\"",value,"\"", NULL);
- }
+ else if (STRCASEEQ('h','H',"height",name)) {
+#if BUFFERED
+ W_L(" height=\"");
+ W_V(value);
+ W_L("\"");
+#else
+ xhtml->out = apr_pstrcat(r->pool,
+ xhtml->out, " height=\"",value,"\"", NULL);
+#endif
}
- else
- if ((*name == 'v' || *name == 'V') && strcasecmp(name, "vspace") == 0) {
+ else if (STRCASEEQ('h','H',"hspace",name)) {
+#if BUFFERED
+ W_L(" hspace=\"");
+ W_V(value);
+ W_L("\"");
+#else
+ xhtml->out = apr_pstrcat(r->pool,
+ xhtml->out, " hspace=\"",value,"\"", NULL);
+#endif
+ }
+ else if (STRCASEEQ('v','V',"vspace",name)) {
+#if BUFFERED
+ W_L(" vspace=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out, " vspace=\"",value,"\"", NULL);
+#endif
}
}
-
+#if BUFFERED
+ W_L(">");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, ">", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
Attr *attr;
char *size = NULL;
char *name = NULL;
-
+#if BUFFERED
+ W_L("<select");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<select", NULL);
+#endif
for (attr = qs_get_attr(doc,child);
attr;
attr = qs_get_next_attr(doc,attr)) {
char *nm = qs_get_attr_name(doc,attr);
char *val = qs_get_attr_value(doc,attr);
-
- if ((*nm == 's' || *nm == 'S') && strcasecmp(nm, "size") == 0) {
+ if (STRCASEEQ('s','S',"size",nm)) {
/* CHTML version 2.0 */
- size = apr_pstrdup(r->pool, val);
+ size = apr_pstrdup(doc->buf.pool, val);
}
- else
- if ((*nm == 'n' || *nm == 'N') && strcasecmp(nm, "name") == 0) {
+ else if (STRCASEEQ('n','N',"name",nm)) {
/* CHTML version 2.0 */
- name = apr_pstrdup(r->pool, val);
+ name = apr_pstrdup(doc->buf.pool, val);
}
- else
- if ((*nm == 'm' || *nm == 'M') && strcasecmp(nm, "multiple") == 0) {
+ else if (STRCASEEQ('m','M',"multiple",nm)) {
/* CHTML version 2.0 */
/* Ignore */
}
}
-
- if (size)
+ if (size) {
+#if BUFFERED
+ W_L(" size=\"");
+ W_V(size);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, " size=\"",size,"\"", NULL);
-
- if (name)
+#endif
+ }
+ if (name) {
+#if BUFFERED
+ W_L(" name=\"");
+ W_V(name);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, " name=\"",name,"\"", NULL);
-
+#endif
+ }
+#if BUFFERED
+ W_L(">\n");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, ">\n", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</select>\n");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</select>\n", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
Attr *attr;
char *selected = NULL;
char *value = NULL;
-
+#if BUFFERED
+ W_L("<option");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<option", NULL);
+#endif
for (attr = qs_get_attr(doc,child);
attr;
attr = qs_get_next_attr(doc,attr)) {
char *nm = qs_get_attr_name(doc,attr);
char *val = qs_get_attr_value(doc,attr);
-
- if ((*nm == 's' || *nm == 'S') && strcasecmp(nm, "selected") == 0) {
+ if (STRCASEEQ('s','S',"selected",nm)) {
/* CHTML version 2.0 */
- selected = apr_pstrdup(r->pool, val);
+ selected = apr_pstrdup(doc->buf.pool, val);
}
- else
- if ((*nm == 'v' || *nm == 'V') && strcasecmp(nm, "value") == 0) {
+ else if (STRCASEEQ('v','V',"value",nm)) {
/* CHTML version 2.0 */
- value = apr_pstrdup(r->pool, val);
+ value = apr_pstrdup(doc->buf.pool, val);
}
}
-
- if (value)
+ if (value) {
+#if BUFFERED
+ W_L(" value=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, " value=\"",value,"\"", NULL);
- else
+#endif
+ }
+ else {
+#if BUFFERED
+ W_L(" value=\"\"");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, " value=\"\"", NULL);
-
- if (selected)
+#endif
+ }
+ if (selected) {
+#if BUFFERED
+ W_L(" selected=\"selected\"");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, " selected=\"selected\"", NULL);
-
+#endif
+ }
+#if BUFFERED
+ W_L(">");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, ">", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</option>\n");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</option>\n", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
Attr *attr;
-
char *align = NULL;
-
+#if BUFFERED
+ W_L("<div");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<div", NULL);
+#endif
for (attr = qs_get_attr(doc,child);
attr;
attr = qs_get_next_attr(doc,attr)) {
char *nm = qs_get_attr_name(doc,attr);
char *val = qs_get_attr_value(doc,attr);
-
- if ((*nm == 'a' || *nm == 'A') && strcasecmp(nm, "align") == 0) {
+ if (STRCASEEQ('a','A',"align",nm)) {
/* CHTML version 3.2 */
- align = apr_pstrdup(r->pool, val);
+ align = apr_pstrdup(doc->buf.pool, val);
}
}
- if (align)
+ if (align) {
+#if BUFFERED
+ W_L(" align=\"");
+ W_V(align);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool,
xhtml->out, " align=\"", align, "\"", NULL);
-
+#endif
+ }
+#if BUFFERED
+ W_L(">");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, ">", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</div>\n");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</div>\n", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("<div style=\"font-weight:bold\">");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<div style=\"font-weight:bold\">", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</div>\n");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</div>\n", NULL);
-
+#endif
return xhtml->out;
}
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
Node *child;
- request_rec *r = xhtml->doc->r;
for (child = qs_get_child_node(doc, node);
child;
child = qs_get_next_node(doc, child)) {
+#if BUFFERED
+ W_V(child->otext);
+#else
+ request_rec *r = xhtml->doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, child->otext, NULL);
+#endif
s_xhtml_1_0_chxjif_tag(xhtml, child);
}
-
return NULL;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- request_rec *r = doc->r;
Attr *attr;
xhtml->textarea_flag++;
+#if BUFFERED
+ W_L("<textarea ");
+#else
+ request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<textarea ", NULL);
-
+#endif
for (attr = qs_get_attr(doc,node);
attr;
attr = qs_get_next_attr(doc,attr)) {
-
char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
-
- if ((*name == 'n' || *name == 'N') && strcasecmp(name, "name") == 0) {
+ if (STRCASEEQ('n','N',"name",name)) {
+#if BUFFERED
+ W_L(" name=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, " name=\"",value,"\"", NULL);
+#endif
}
- else
- if ((*name == 'r' || *name == 'R') && strcasecmp(name, "rows") == 0) {
+ else if (STRCASEEQ('r','R',"rows",name)) {
+#if BUFFERED
+ W_L(" rows=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, " rows=\"",value,"\"", NULL);
+#endif
}
- else
- if ((*name == 'c' || *name == 'C') && strcasecmp(name, "cols") == 0) {
+ else if (STRCASEEQ('c','C',"cols",name)) {
+#if BUFFERED
+ W_L(" cols=\"");
+ W_V(value);
+ W_L("\"");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, " cols=\"",value,"\"", NULL);
+#endif
}
}
-
+#if BUFFERED
+ W_L(">\r\n");
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, ">\r\n", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</textarea>\r\n");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</textarea>\r\n", NULL);
+#endif
xhtml->textarea_flag--;
return xhtml->out;
tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
}
}
+#if BUFFERED
+ W_V(tdst);
+#else
xhtml->out = apr_pstrcat(r->pool, xhtml->out, tdst, NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("<dl>");
+#else
request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<dl>", NULL);
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("</dl>\n");
+#else
request_rec *r = doc->r;
-
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</dl>\n", NULL);
-
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("<dt>");
+#else
request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<dt>", NULL);
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("\n");
+#else
request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "\n", NULL);
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("<dd>");
+#else
request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<dd>", NULL);
+#endif
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
+#if BUFFERED
+ W_L("\n");
+#else
request_rec *r = doc->r;
xhtml->out = apr_pstrcat(r->pool, xhtml->out, "\n", NULL);
+#endif
return xhtml->out;
}
/*