done
+echo "$as_me:$LINENO: checking for iconv_open in -liconv_hook" >&5
+echo $ECHO_N "checking for iconv_open in -liconv_hook... $ECHO_C" >&6
+if test "${ac_cv_lib_iconv_hook_iconv_open+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-liconv_hook $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char iconv_open ();
+int
+main ()
+{
+iconv_open ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_iconv_hook_iconv_open=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_iconv_hook_iconv_open=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_hook_iconv_open" >&5
+echo "${ECHO_T}$ac_cv_lib_iconv_hook_iconv_open" >&6
+if test $ac_cv_lib_iconv_hook_iconv_open = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBICONV_HOOK 1
+_ACEOF
+
+ LIBS="-liconv_hook $LIBS"
+
+else
+
+ { { echo "$as_me:$LINENO: error:
+Please install libiconv_hook.
+" >&5
+echo "$as_me: error:
+Please install libiconv_hook.
+" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+
+
+
ac_config_files="$ac_config_files Makefile src/Makefile"
#include "chxj_img_conv_format.h"
#include "chxj_qr_code.h"
+#include "chxj_encoding.h"
-#ifdef PACKAGE_NAME
-#undef PACKAGE_NAME
-#endif
-
-#ifdef PACKAGE_VERSION
-#undef PACKAGE_VERSION
-#endif
-
-#ifdef PACKAGE_STRING
-#undef PACKAGE_STRING
-#endif
-
-#ifdef PACKAGE_TARNAME
-#undef PACKAGE_TARNAME
-#endif
-
-#include "config.h"
-
#define CHXJ_VERSION_PREFIX PACKAGE_NAME "/"
#define CHXJ_VERSION PACKAGE_VERSION
/**
- * It converts it from CHTML into ML corresponding to each model.
+ * It converts it from CHTML into XXML corresponding to each model.
*
* @param r [i]
* @param src [i] It is former HTML character string.
{
char *user_agent;
char *dst = apr_pstrcat(r->pool, (char*)*src, NULL);
+ char *tmp;
/*------------------------------------------------------------------------*/
/* get UserAgent from http header */
if (!r->header_only) {
device_table_t* spec = chxj_specified_device(r, user_agent);
- if (spec->html_spec_type == CHXJ_SPEC_Chtml_1_0) {
+ switch(spec->html_spec_type) {
+ case CHXJ_SPEC_Chtml_1_0:
/*----------------------------------------------------------------------*/
/* DoCoMo i-Mode 1.0 */
/*----------------------------------------------------------------------*/
ap_log_rerror(
APLOG_MARK,APLOG_DEBUG, 0, r, "select DoCoMo i-Mode 1.0 ");
- dst = chxj_exchange_chtml10(r, spec, *src, *len, len);
+ tmp = chxj_encoding(r, *src, (apr_size_t*)len);
+ dst = chxj_exchange_chtml10(r, spec, tmp, *len, len);
+ break;
- }
- else
- if (spec->html_spec_type == CHXJ_SPEC_Chtml_2_0) {
+ case CHXJ_SPEC_Chtml_2_0:
/*----------------------------------------------------------------------*/
/* DoCoMo i-Mode 2.0 */
/*----------------------------------------------------------------------*/
ap_log_rerror(APLOG_MARK,APLOG_DEBUG, 0, r, "select DoCoMo i-Mode 2.0 ");
- dst = chxj_exchange_chtml20(r, spec, *src, *len, len);
- }
- else
- if (spec->html_spec_type == CHXJ_SPEC_Chtml_3_0) {
+ tmp = chxj_encoding(r, (char*)*src, (apr_size_t*)len);
+ dst = chxj_exchange_chtml20(r, spec, tmp, *len, len);
+ break;
+
+ case CHXJ_SPEC_Chtml_3_0:
/*----------------------------------------------------------------------*/
/* DoCoMo i-Mode 3.0 */
/*----------------------------------------------------------------------*/
ap_log_rerror(APLOG_MARK,APLOG_DEBUG, 0, r, "select DoCoMo i-Mode 3.0 ");
- dst = chxj_exchange_chtml30(r, spec, *src, *len, len);
- }
- else
- if (spec->html_spec_type == CHXJ_SPEC_Chtml_4_0) {
+ tmp = chxj_encoding(r, *src, (apr_size_t*)len);
+ dst = chxj_exchange_chtml30(r, spec, tmp, *len, len);
+ break;
+
+ case CHXJ_SPEC_Chtml_4_0:
/*----------------------------------------------------------------------*/
/* DoCoMo i-Mode 4.0 */
/*----------------------------------------------------------------------*/
ap_log_rerror(APLOG_MARK,APLOG_DEBUG, 0, r, "select DoCoMo i-Mode 4.0 ");
- dst = chxj_exchange_chtml30(r, spec, *src, *len, len);
- }
- else
- if (spec->html_spec_type == CHXJ_SPEC_Chtml_5_0) {
+ tmp = chxj_encoding(r, *src, (apr_size_t*)len);
+ dst = chxj_exchange_chtml30(r, spec, tmp, *len, len);
+ break;
+
+ case CHXJ_SPEC_Chtml_5_0:
/*----------------------------------------------------------------------*/
/* DoCoMo i-Mode 5.0 */
/*----------------------------------------------------------------------*/
ap_log_rerror(APLOG_MARK,APLOG_DEBUG, 0, r, "select DoCoMo i-Mode 5.0 ");
- dst = chxj_exchange_chtml30(r, spec, *src, *len, len);
- }
- else
- if (spec->html_spec_type == CHXJ_SPEC_XHtml_Mobile_1_0) {
+ tmp = chxj_encoding(r, *src, (apr_size_t*)len);
+ dst = chxj_exchange_chtml30(r, spec, tmp, *len, len);
+ break;
+
+ case CHXJ_SPEC_XHtml_Mobile_1_0:
/*----------------------------------------------------------------------*/
/* AU XHtml Mobile 1.0 (XHtml Basic 1.0 extended) */
/*----------------------------------------------------------------------*/
ap_log_rerror(APLOG_MARK,APLOG_DEBUG, 0, r, "select XHTML Mobile 1.0");
- dst = chxj_exchange_xhtml_mobile_1_0(r, spec, *src, *len, len);
- }
- else
- if (spec->html_spec_type == CHXJ_SPEC_Hdml) {
+ tmp = chxj_encoding(r, *src, (apr_size_t*)len);
+ dst = chxj_exchange_xhtml_mobile_1_0(r, spec, tmp, *len, len);
+ break;
+
+ case CHXJ_SPEC_Hdml:
/*----------------------------------------------------------------------*/
/* AU HDML Version 3.0 Only */
/*----------------------------------------------------------------------*/
ap_log_rerror(APLOG_MARK,APLOG_DEBUG, 0, r, "select HDML");
- dst = chxj_exchange_hdml(r, spec, *src, *len, len);
- }
- else
- if (spec->html_spec_type == CHXJ_SPEC_Jhtml) {
+ tmp = chxj_encoding(r, *src, (apr_size_t*)len);
+ dst = chxj_exchange_hdml(r, spec, tmp, *len, len);
+ break;
+
+ case CHXJ_SPEC_Jhtml:
/*----------------------------------------------------------------------*/
/* J-Phone and Vodaphone */
/*----------------------------------------------------------------------*/
ap_log_rerror(APLOG_MARK,APLOG_DEBUG, 0, r, "select JHTML");
- dst = chxj_exchange_jhtml(r, spec, *src, *len, len);
- }
- else {
+ tmp = chxj_encoding(r, *src, (apr_size_t*)len);
+ dst = chxj_exchange_jhtml(r, spec, tmp, *len, len);
+ break;
+
+ default:
ap_log_rerror(APLOG_MARK,APLOG_DEBUG, 0, r, "select ?????");
ap_log_rerror(APLOG_MARK,APLOG_DEBUG, 0, r, "html_spec_type[%d]",
spec->html_spec_type);
ap_set_content_type(r, "text/html; charset=Windows-31J");
+ break;
}
}
*len = 1;
}
dst[*len] = 0;
+
return dst;
}
mrg->emoji_data_file = apr_pstrdup(p, add->emoji_data_file);
}
- if (add->image == CHXJ_IMG_OFF) {
+ if (add->image == CHXJ_IMG_OFF)
mrg->image = base->image;
- }
- else {
+ else
mrg->image = add->image;
- }
- if (strcasecmp(add->image_cache_dir ,DEFAULT_IMAGE_CACHE_DIR)==0) {
+
+ if (strcasecmp(add->image_cache_dir ,DEFAULT_IMAGE_CACHE_DIR)==0)
mrg->image_cache_dir = apr_pstrdup(p, base->image_cache_dir);
- }
- else {
+ else
mrg->image_cache_dir = apr_pstrdup(p, add->image_cache_dir);
- }
- if (add->image_copyright == NULL && base->image_copyright != NULL) {
+ if (add->image_copyright == NULL && base->image_copyright != NULL)
mrg->image_copyright = apr_pstrdup(p, base->image_copyright);
- }
else
- if (add->image_copyright != NULL) {
+ if (add->image_copyright != NULL)
mrg->image_copyright = apr_pstrdup(p, add->image_copyright);
- }
+
return mrg;
}
/**
Doc doc;
doc.r = NULL;
if (strlen(arg) > 256)
- {
return "device data filename too long.";
- }
conf = (mod_chxj_config_t*)mconfig;
conf->device_data_file = apr_pstrdup(parms->pool, arg);
doc.r = NULL;
if (strlen(arg) > 256)
- {
return "emoji data filename too long.";
- }
conf = (mod_chxj_config_t*)mconfig;
conf->emoji_data_file = apr_pstrdup(parms->pool, arg);
{
mod_chxj_config_t* conf;
Doc doc;
+
doc.r = NULL;
+
if (strlen(arg) > 256)
- {
return "image uri is too long.";
- }
conf = (mod_chxj_config_t*)mconfig;
if (strcasecmp("ON", arg) == 0)
- {
conf->image = CHXJ_IMG_ON;
- }
else
- {
conf->image = CHXJ_IMG_OFF;
- }
+
return NULL;
}
Doc doc;
doc.r = NULL;
if (strlen(arg) > 256)
- {
return "cache dir name is too long.";
- }
conf = (mod_chxj_config_t*)mconfig;
conf->image_cache_dir = apr_pstrdup(parms->pool, arg);
doc.r = NULL;
if (strlen(arg) > 256)
- {
return "Copyright Flag is too long.";
- }
conf = (mod_chxj_config_t*)mconfig;
conf->image_copyright = apr_pstrdup(parms->pool, arg);