* bug fix which the size before it converts it into Content-Length when HEAD of
the image conversion is requested is returned.
+ * change to acquire it even if the extension is attached by the image acquisition
+ request.
-- Atsushi Konno <konn@users.sourceforge.jp> Mon, 19 Jun 2006 17:29:48 +0900
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for mod_chxj 0.6.2-stable.
+# Generated by GNU Autoconf 2.59 for mod_chxj 0.6.3-stable.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# Identity of this package.
PACKAGE_NAME='mod_chxj'
PACKAGE_TARNAME='mod_chxj'
-PACKAGE_VERSION='0.6.2-stable'
-PACKAGE_STRING='mod_chxj 0.6.2-stable'
+PACKAGE_VERSION='0.6.3-stable'
+PACKAGE_STRING='mod_chxj 0.6.3-stable'
PACKAGE_BUGREPORT=''
ac_unique_file="src/mod_chxj.c"
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures mod_chxj 0.6.2-stable to adapt to many kinds of systems.
+\`configure' configures mod_chxj 0.6.3-stable to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of mod_chxj 0.6.2-stable:";;
+ short | recursive ) echo "Configuration of mod_chxj 0.6.3-stable:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-mod_chxj configure 0.6.2-stable
+mod_chxj configure 0.6.3-stable
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by mod_chxj $as_me 0.6.2-stable, which was
+It was created by mod_chxj $as_me 0.6.3-stable, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
PACKAGE=mod_chxj
-VERSION=0.6.2-stable
+VERSION=0.6.3-stable
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
{ { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
} >&5
cat >&5 <<_CSEOF
-This file was extended by mod_chxj $as_me 0.6.2-stable, which was
+This file was extended by mod_chxj $as_me 0.6.3-stable, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-mod_chxj config.status 0.6.2-stable
+mod_chxj config.status 0.6.3-stable
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
int color;
char* emoji_type;
+
} device_table;
typedef struct _device_table_list_t {
device_table* tail;
} device_table_list;
+typedef struct _exchange_t {
+ /* convert routine */
+ char* (*exchange)(request_rec* r,
+ struct _device_table_t* spec,
+ const char* src,
+ apr_size_t srclen,
+ apr_size_t *dstlen,
+ struct _chxjconvrule_entry* entryp);
+
+ char* (*encoder)(request_rec *r, const char* src, apr_size_t* len);
+} exchange_t;
+
+extern exchange_t exchange_routine[];
+
device_table* chxj_specified_device(request_rec* r, const char* user_agent);
#endif
#endif
-#include "chxj_specified_device.h"
#ifdef HAVE_APR_GLOBAL_MUTEX_H
jphone_emoji_t* jphone;
} emoji_t;
-typedef struct {
+typedef struct _chxjconvrule_entry {
char *pattern;
ap_regex_t *regexp;
int flags;
int pc_flag;
} chxjconvrule_entry;
+#include "chxj_specified_device.h"
+
typedef struct {
int image;
#define ERR1(X,Y,Za) ap_log_rerror(APLOG_MARK,APLOG_ERR,0,(X),(Y),(Za))
+
#endif
/*
* vim:ts=2 et
int ii;
char* ext[] = {
"jpg",
+ "jpeg",
"png",
"bmp",
"gif",
char* fname;
char* idx;
char* filename_sv;
+ int do_ext_check = TRUE;
+ int next_ok = FALSE;
conf = ap_get_module_config(r->per_dir_config, &chxj_module);
DBG1(r,"URI[%s]", filename_sv);
+ do_ext_check = TRUE;
+ for (ii=0; ii<7-1; ii++) {
+ char* pos = strrchr(filename_sv, '.');
+ if (pos && pos++) {
+ if (strcasecmp(pos, ext[ii]) == 0) {
+ do_ext_check = FALSE;
+ fname = apr_psprintf(r->pool, "%s", filename_sv);
+ break;
+ }
+ }
+ }
- for (ii=0; ii<6; ii++) {
- if (strlen(ext[ii]) == 0)
- fname = apr_psprintf(r->pool, "%s", filename_sv);
- else
- fname = apr_psprintf(r->pool, "%s.%s", filename_sv, ext[ii]);
-
- DBG1(r,"search [%s]", fname);
-
- rv = apr_stat(&st, fname, APR_FINFO_MIN, r->pool);
- if (rv == APR_SUCCESS)
- break;
-
- fname = NULL;
+ if (do_ext_check) {
+ for (ii=0; ii<7; ii++) {
+ if (strlen(ext[ii]) == 0) {
+ fname = apr_psprintf(r->pool, "%s", filename_sv);
+ }
+ else
+ fname = apr_psprintf(r->pool, "%s.%s", filename_sv, ext[ii]);
+
+ DBG1(r,"search [%s]", fname);
+
+ rv = apr_stat(&st, fname, APR_FINFO_MIN, r->pool);
+ if (rv == APR_SUCCESS) {
+ if (st.filetype != APR_DIR)
+ break;
+ }
+
+ fname = NULL;
+ }
}
if (fname == NULL) {
DBG1(r,"NotFound [%s]", r->filename);
return DECLINED;
}
+ for (ii=0; ii<7-1; ii++) {
+ char* pos = strrchr(fname, '.');
+ if (pos && pos++) {
+ if (strcasecmp(pos, ext[ii]) == 0) {
+ next_ok = TRUE;
+ break;
+ }
+ }
+ }
+
+ if (! next_ok) {
+ DBG1(r,"NotFound [%s]", r->filename);
+ return DECLINED;
+ }
if (r->handler == NULL || strcasecmp(r->handler, "chxj-qrcode") != 0) {
DBG1(r,"Found [%s]", fname);
#define CHXJ_VERSION_PREFIX PACKAGE_NAME "/"
#define CHXJ_VERSION PACKAGE_VERSION
+exchange_t exchange_routine[] = {
+ {
+ /* CHXJ_SPEC_UNKNOWN */
+ .exchange = NULL,
+ .encoder = NULL,
+ },
+ {
+ /* CHXJ_SPEC_Chtml_1_0 */
+ .exchange = chxj_exchange_chtml10,
+ .encoder = chxj_encoding,
+ },
+ {
+ /* CHXJ_SPEC_Chtml_2_0 */
+ .exchange = chxj_exchange_chtml20,
+ .encoder = chxj_encoding,
+ },
+ {
+ /* CHXJ_SPEC_Chtml_3_0 */
+ .exchange = chxj_exchange_chtml30,
+ .encoder = chxj_encoding,
+ },
+ {
+ /* CHXJ_SPEC_Chtml_4_0 */
+ .exchange = chxj_exchange_chtml30,
+ .encoder = chxj_encoding,
+ },
+ {
+ /* CHXJ_SPEC_Chtml_5_0 */
+ .exchange = chxj_exchange_chtml30,
+ .encoder = chxj_encoding,
+ },
+ {
+ /* CHXJ_SPEC_XHtml_Mobile_1_0 */
+ .exchange = chxj_exchange_xhtml_mobile_1_0,
+ .encoder = chxj_encoding,
+ },
+ {
+ /* CHXJ_SPEC_Hdml */
+ .exchange = chxj_exchange_hdml,
+ .encoder = chxj_encoding,
+ },
+ {
+ /* CHXJ_SPEC_Jhtml */
+ .exchange = chxj_exchange_jhtml,
+ .encoder = chxj_encoding,
+ },
+ {
+ /* CHXJ_SPEC_HTML */
+ .exchange = NULL,
+ .encoder = NULL,
+ },
+ {
+ NULL
+ }
+};
+
/**
* It converts it from CHTML into XXML corresponding to each model.
*
if (!r->header_only) {
device_table* spec = chxj_specified_device(r, user_agent);
+ tmp = NULL;
+ if (exchange_routine[spec->html_spec_type].encoder)
+ tmp = exchange_routine[spec->html_spec_type].encoder(r, *src, (apr_size_t*)len);
+
+ if (exchange_routine[spec->html_spec_type].exchange) {
+ if (tmp)
+ dst = exchange_routine[spec->html_spec_type].exchange(r, spec, tmp, *len, len, entryp);
+ else
+ dst = exchange_routine[spec->html_spec_type].exchange(r, spec, *src, *len, len, entryp);
+ }
+
+
+#if 0
switch(spec->html_spec_type) {
case CHXJ_SPEC_Chtml_1_0:
/*----------------------------------------------------------------------*/
DBG1(r,"html_spec_type[%d]", spec->html_spec_type);
break;
}
+#endif
}
DBG(r, "end chxj_exchange()");