--- /dev/null
+/*
+ * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
+ * Copyright (C) 2005 QSDN,Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __CHXJ_HEADER_INF_H__
+#define __CHXJ_HEADER_INF_H__
+
+#include "mod_chxj.h"
+
+#define HTTP_X_CHXJ_SET_CONTENT_TYPE "X-Chxj-Set-Content-Type"
+
+
+extern char *chxj_header_inf_set_content_type(request_rec *r, char *default_string);
+
+#endif
chxj_apache.c \
chxj_add_device_env.c \
chxj_serf.c \
- chxj_conv_z2h.c
+ chxj_conv_z2h.c \
+ chxj_header_inf.c
libmod_chxj_la_CFLAGS = -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include -I@with_apache_header@ -I./serf
libmod_chxj_la-chxj_buffered_write.lo \
libmod_chxj_la-chxj_apache.lo \
libmod_chxj_la-chxj_add_device_env.lo \
- libmod_chxj_la-chxj_serf.lo libmod_chxj_la-chxj_conv_z2h.lo
+ libmod_chxj_la-chxj_serf.lo libmod_chxj_la-chxj_conv_z2h.lo \
+ libmod_chxj_la-chxj_header_inf.lo
libmod_chxj_la_OBJECTS = $(am_libmod_chxj_la_OBJECTS)
libmod_chxj_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libmod_chxj_la_CFLAGS) \
chxj_apache.c \
chxj_add_device_env.c \
chxj_serf.c \
- chxj_conv_z2h.c
+ chxj_conv_z2h.c \
+ chxj_header_inf.c
libmod_chxj_la_CFLAGS = -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include -I@with_apache_header@ -I./serf
AM_CFLAGS = @CFLAGS@ -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include -I@with_apache_header@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_dump.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_encoding.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_hdml.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_header_inf.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_img_conv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_img_conv_format.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_jhtml.Plo@am__quote@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmod_chxj_la_CFLAGS) $(CFLAGS) -c -o libmod_chxj_la-chxj_conv_z2h.lo `test -f 'chxj_conv_z2h.c' || echo '$(srcdir)/'`chxj_conv_z2h.c
+libmod_chxj_la-chxj_header_inf.lo: chxj_header_inf.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmod_chxj_la_CFLAGS) $(CFLAGS) -MT libmod_chxj_la-chxj_header_inf.lo -MD -MP -MF $(DEPDIR)/libmod_chxj_la-chxj_header_inf.Tpo -c -o libmod_chxj_la-chxj_header_inf.lo `test -f 'chxj_header_inf.c' || echo '$(srcdir)/'`chxj_header_inf.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libmod_chxj_la-chxj_header_inf.Tpo $(DEPDIR)/libmod_chxj_la-chxj_header_inf.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='chxj_header_inf.c' object='libmod_chxj_la-chxj_header_inf.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmod_chxj_la_CFLAGS) $(CFLAGS) -c -o libmod_chxj_la-chxj_header_inf.lo `test -f 'chxj_header_inf.c' || echo '$(srcdir)/'`chxj_header_inf.c
+
mostlyclean-libtool:
-rm -f *.lo
#include "chxj_encoding.h"
#include "chxj_buffered_write.h"
#include "chxj_str_util.h"
+#include "chxj_header_inf.h"
#define GET_CHTML10(X) ((chtml10_t *)(X))
#undef W_L
chtml10.entryp = entryp;
chtml10.cookie = cookie;
- chxj_set_content_type(r, "text/html; charset=Windows-31J");
+ chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
/*--------------------------------------------------------------------------*/
/* The character string of the input is analyzed. */
#include "chxj_qr_code.h"
#include "chxj_encoding.h"
#include "chxj_buffered_write.h"
+#include "chxj_header_inf.h"
#define GET_CHTML20(X) ((chtml20_t*)(X))
chtml20.entryp = entryp;
chtml20.cookie = cookie;
- chxj_set_content_type(r, "text/html; charset=Windows-31J");
+ chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
/*--------------------------------------------------------------------------*/
/* The character string of the input is analyzed. */
if (content_type_flag) {
W_L(" ");
W_V(name);
- W_L("=\"text/html; charset=Windows-31J\"");
+ W_L("=\"");
+ W_V(chxj_header_inf_set_content_type(r, "text/html; charset=SHIFT_JIS"));
+ W_L("\"");
}
else if (refresh_flag) {
char *buf = apr_pstrdup(r->pool, value);
#include "chxj_img_conv.h"
#include "chxj_qr_code.h"
#include "chxj_encoding.h"
+#include "chxj_header_inf.h"
#define GET_CHTML30(X) ((chtml30_t *)(X))
#undef W_L
chtml30.entryp = entryp;
chtml30.cookie = cookie;
- chxj_set_content_type(r, "text/html; charset=Windows-31J");
+ chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
/*--------------------------------------------------------------------------*/
/* The character string of the input is analyzed. */
if (content_type_flag) {
W_L(" ");
W_V(name);
- W_L("=\"text/html; charset=Windows-31J\"");
+ W_L("=\"");
+ W_V(chxj_header_inf_set_content_type(r, "text/html; charset=SHIFT_JIS"));
+ W_L("\"");
}
else
if (refresh_flag) {
#include "chxj_img_conv.h"
#include "chxj_qr_code.h"
#include "chxj_encoding.h"
+#include "chxj_header_inf.h"
#define GET_CHTML40(X) ((chtml40_t *)(X))
#undef W_L
chtml40.entryp = entryp;
chtml40.cookie = cookie;
- chxj_set_content_type(r, "text/html; charset=Windows-31J");
+ chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
/*--------------------------------------------------------------------------*/
/* The character string of the input is analyzed. */
if (content_type_flag) {
W_L(" ");
W_V(name);
- W_L("=\"text/html; charset=Windows-31J\"");
+ W_L("=\"");
+ W_V(chxj_header_inf_set_content_type(r, "text/html; charset=SHIFT_JIS"));
+ W_L("\"");
}
else
if (refresh_flag) {
#include "chxj_img_conv.h"
#include "chxj_qr_code.h"
#include "chxj_encoding.h"
+#include "chxj_header_inf.h"
#define GET_CHTML50(X) ((chtml50_t *)(X))
#undef W_L
chtml50.entryp = entryp;
chtml50.cookie = cookie;
- chxj_set_content_type(r, "text/html; charset=Windows-31J");
+ chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
/*--------------------------------------------------------------------------*/
/* The character string of the input is analyzed. */
if (content_type_flag) {
W_L(" ");
W_V(name);
- W_L("=\"text/html; charset=Windows-31J\"");
+ W_L("=\"");
+ W_V(chxj_header_inf_set_content_type(r, "text/html; charset=SHIFT_JIS"));
+ W_L("\"");
}
else
if (refresh_flag) {
--- /dev/null
+/*
+ * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
+ * Copyright (C) 2005 QSDN,Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "mod_chxj.h"
+#include "chxj_header_inf.h"
+#include "chxj_apache.h"
+#include "qs_parse_string.h"
+#include <errno.h>
+
+/**
+ */
+char *
+chxj_header_inf_set_content_type(request_rec *r, char *default_string)
+{
+ char *h_out = NULL;
+ char *err_h_out = NULL;
+
+ DBG(r,"REQ[%X] start chxj_header_inf_set_content_type()", (unsigned int)(apr_size_t)r);
+
+ h_out = (char *)apr_table_get(r->headers_out, HTTP_X_CHXJ_SET_CONTENT_TYPE);
+ err_h_out = (char *)apr_table_get(r->err_headers_out, HTTP_X_CHXJ_SET_CONTENT_TYPE);
+
+ if (err_h_out) {
+ DBG(r,"REQ[%X] end chxj_header_inf_set_content_type()", (unsigned int)(apr_size_t)r);
+ return err_h_out;
+ }
+ if (h_out) {
+ DBG(r,"REQ[%X] end chxj_header_inf_set_content_type()", (unsigned int)(apr_size_t)r);
+ return h_out;
+ }
+
+ DBG(r,"REQ[%X] end chxj_header_inf_set_content_type()", (unsigned int)(apr_size_t)r);
+ return default_string;
+}
+
+/*
+ * vim: ts=2 et
+ */
#include "chxj_encoding.h"
#include "chxj_url_encode.h"
#include "chxj_str_util.h"
+#include "chxj_header_inf.h"
#define GET_JHTML(X) ((jhtml_t *)(X))
jhtml.entryp = entryp;
jhtml.cookie = cookie;
- chxj_set_content_type(r, "text/html; charset=Windows-31J");
+ chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
/*--------------------------------------------------------------------------*/
/* The character string of the input is analyzed. */
W_L(" ");
W_V(name);
W_L("=\"");
- W_L("text/html; charset=Windows-31J");
+ W_V(chxj_header_inf_set_content_type(r, "text/html; charset=SHIFT_JIS"));
W_L("\"");
}
else
#include "chxj_encoding.h"
#include "chxj_url_encode.h"
#include "chxj_str_util.h"
+#include "chxj_header_inf.h"
#define GET_JXHTML(X) ((jxhtml_t *)(X))
jxhtml.entryp = entryp;
jxhtml.cookie = cookie;
- chxj_set_content_type(r, "application/xhtml+xml; charset=Windows-31J");
+ chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=Windows-31J"));
/*--------------------------------------------------------------------------*/
/* The character string of the input is analyzed. */
W_L(" ");
W_V(name);
W_L("=\"");
- W_L("application/xhtml+xml; charset=Windows-31J");
+ W_V(chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=SHIFT_JIS"));
W_L("\"");
}
else
#include "chxj_qr_code.h"
#include "chxj_buffered_write.h"
#include "chxj_str_util.h"
+#include "chxj_header_inf.h"
#define GET_XHTML(X) ((xhtml_t*)(X))
#undef W_L
xhtml.entryp = entryp;
xhtml.cookie = cookie;
- chxj_set_content_type(r, "text/html; charset=Windows-31J");
+ chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
/*--------------------------------------------------------------------------*/
/* The character string of the input is analyzed. */
Attr *attr;
Doc *doc = xhtml->doc;
int content_type_flag = 0;
+ request_rec *r = doc->r;
W_L("<meta");
/*--------------------------------------------------------------------------*/
W_L(" ");
W_V(name);
W_L("=\"");
- W_L("text/html; charset=Windows-31J");
+ W_V(chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
W_L("\"");
}
else {