OSDN Git Service

* bug fix(can not compile).
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Sun, 11 Jun 2006 08:05:40 +0000 (08:05 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Sun, 11 Jun 2006 08:05:40 +0000 (08:05 +0000)
  * add test code.(table, tr, td, link)

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/trunk@469 1a406e8e-add9-4483-a2c8-d8cac5b7c224

configure.ac
doc/modchxj.sdoc
src/chxj_chtml20.c
src/chxj_specified_device.c
src/mod_chxj.c
src/mod_chxj.h
src/qs_parse_string.c
src/qs_parse_string.h

index 3f3df77..972bde3 100644 (file)
@@ -30,6 +30,24 @@ Please specify the --with-apache-header option. And, please specify the place of
 ])
 fi
 
+AC_ARG_WITH(apxs, [  --with-apxs=ARG Path of apxs program file.])
+if test "x$with_apxs" = "x" ; then
+  APXS=""
+fi
+if test "x$with_apxs" = "xyes" ; then
+    AC_MSG_ERROR([
+Please specify the --with-apxs option. And, please specify the place of the apxs program. 
+])
+fi
+
+AC_ARG_WITH(apr-config, [  --with-apr-config=ARG  Path of apr-config program file.])
+if test "x$with_apr_config" = "xyes" ; then
+    AC_MSG_ERROR([
+Please specify the --with-apr-config option. And, please specify the place of the apr-config program. 
+])
+fi
+
+
 AC_ARG_ENABLE(img-conv-f, [  --enable-img-conv-f      Please specify it when you change the file name of the image being written in the 
 source by the automatic operation.])
 if test "x$enable_img_conv_f" = "xyes"; then
@@ -48,12 +66,16 @@ else
 fi
 
 
-
-AC_PATH_PROG(APXS, apxs, no,
-    /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/apache/bin)
-if test "x$APXS" = "xno"; then
-    AC_MSG_ERROR([apxs not found.])
+if test "x$with_apxs" = "x" ; then
+  AC_PATH_PROG(APXS, apxs, no,
+      /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/apache/bin)
+  if test "x$APXS" = "xno"; then
+      AC_MSG_ERROR([apxs not found.])
+  fi
 fi
+if test "x$with_apxs" != "x" ; then
+  APXS=$with_apxs
+fi 
 
 AC_PATH_PROG(LIBTOOL, libtool, no,
     /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
@@ -68,16 +90,21 @@ if test "x$WAND_CONFIG" = "xno" ; then
     AC_MSG_ERROR([wand-config not found.])
 fi
 
-AC_PATH_PROG(APR_CONFIG, apr-config, no,
-   /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
-if test "x$APR_CONFIG" = "xno" ; then
-    AC_MSG_ERROR([apr-config not found.])
+if test "x$with_apr_config" = "x" ; then
+  AC_PATH_PROG(APR_CONFIG, apr-config, no,
+     /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
+  if test "x$APR_CONFIG" = "xno" ; then
+      AC_MSG_ERROR([apr-config not found.])
+  fi
+fi
+if test "x$with_apr_config" != "x" ; then
+  APR_CONFIG=$with_apr_config
 fi
 
 LIBS="${LIBS} `${WAND_CONFIG} --ldflags` `${WAND_CONFIG} --libs` "
 LIBS="${LIBS} `${APR_CONFIG} --ldflags` `${APR_CONFIG} --libs` "
 CFLAGS="${CFLAGS} `${WAND_CONFIG} --cppflags` `${WAND_CONFIG} --cflags`"
-CFLAGS="${CFLAGS} -I`${APR_CONFIG} --includedir` `${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags`"
+CFLAGS="${CFLAGS} `${APR_CONFIG} --includes` `${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags`"
 AC_SUBST(with_apache_header)
 AC_SUBST(CC)
 AC_SUBST(QDEFS)
@@ -88,6 +115,7 @@ AC_SUBST(CFLAGS)
 # Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([string.h strings.h unistd.h fcntl.h sys/types.h sys/stat.h sys/mman.h libgen.h])
+AC_CHECK_HEADERS([apr_shm.h apr_global_mutex.h ap_regex.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
index 4de1aac..354257d 100644 (file)
@@ -25,7 +25,7 @@ mod_chxj
   <li>Apache2.0¤Î¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë·²</li>
   <li>Apache2.0ÍѤÎapxs</li>
   <li>apr(Apache Portable Runtime)¥é¥¤¥Ö¥é¥ê¤È¤½¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë·´</li>
-  <li>automake¡¢autoconf¡¢libtool</li>
+  <li>automake¡¢autoconf¡¢libtool1.3.X</li>
   <li>ImageMagick(MagickWand)</li>
   <li>Linux</li>
 </ol>
index d722f53..e79a38b 100644 (file)
@@ -352,6 +352,38 @@ s_chtml20_node_exchange(chtml20_t* chtml20, Node* node, int indent)
       s_chtml20_end_div_tag   (chtml20, child);
     }
     /*------------------------------------------------------------------------*/
+    /* <TABLE>                                                                */
+    /*------------------------------------------------------------------------*/
+    else
+    if (strcasecmp(name, "table") == 0)
+    {
+      s_chtml20_node_exchange (chtml20, child, indent+1);
+    }
+    /*------------------------------------------------------------------------*/
+    /* <TR>                                                                   */
+    /*------------------------------------------------------------------------*/
+    else
+    if (strcasecmp(name, "tr") == 0)
+    {
+      s_chtml20_node_exchange (chtml20, child, indent+1);
+    }
+    /*------------------------------------------------------------------------*/
+    /* <TD>                                                                   */
+    /*------------------------------------------------------------------------*/
+    else
+    if (strcasecmp(name, "td") == 0)
+    {
+      s_chtml20_node_exchange (chtml20, child, indent+1);
+    }
+    /*------------------------------------------------------------------------*/
+    /* <STYLE>                                                                */
+    /*------------------------------------------------------------------------*/
+    else
+    if (strcasecmp(name, "style") == 0)
+    {
+      s_chtml20_node_exchange (chtml20, child, indent+1);
+    }
+    /*------------------------------------------------------------------------*/
     /* <BLINK>                                                                */
     /*------------------------------------------------------------------------*/
     else
index 3932055..b1f88d7 100644 (file)
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 #include "mod_chxj.h"
-#include "ap_regex.h"
 
 static device_table_t  UNKNOWN_DEVICE      = {
     NULL, "","UNKNOWN", CHXJ_SPEC_UNKNOWN,  0,  0,0,0,0,0,0,0,0,0,0,0,0, ""};
@@ -38,55 +37,50 @@ chxj_specified_device(request_rec* r, const char* user_agent)
   int rtn;
   char* device_id;
 
+  if (user_agent == NULL) 
+    return returnType;
+            
+
   ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "start chxj_specified_device()");
   conf = ap_get_module_config(r->per_dir_config, &chxj_module);
-  for (dtl = conf->devices; dtl; dtl = dtl->next) 
-  {
-    if (dtl->pattern == NULL)
-    {
+  for (dtl = conf->devices; dtl; dtl = dtl->next) {
+    if (dtl->pattern == NULL) {
       ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "pattern is null");
       continue;
     }
 
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "pattern is [%s]", dtl->pattern);
     regexp = ap_pregcomp(r->pool, (const char*)dtl->pattern, AP_REG_EXTENDED|AP_REG_ICASE);
-    if (regexp == NULL) 
-    {
+    if (regexp == NULL) {
       ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "compile failed.");
       return returnType;
     }
 
     rtn = ap_regexec(regexp, user_agent, regexp->re_nsub + 1, match, 0);
-    if (rtn == 0) 
-    {
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "pattern is [%s]", dtl->pattern);
+    if (rtn == 0) {
       device_id = ap_pregsub(r->pool, "$1", user_agent, regexp->re_nsub + 1, match);
       ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "device_id:[%s]", device_id);
-      for (dt = dtl->table; dt; dt = dt->next) 
-      {
-        if (strcasecmp(device_id, dt->device_id) == 0) 
-        {
+      for (dt = dtl->table; dt; dt = dt->next) {
+        if (strcasecmp(device_id, dt->device_id) == 0) {
           ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "device_name:[%s]", dt->device_name);
           returnType = dt;
           break;
         }
       }
-      if (dt == NULL) 
-      {
-        for (dt = dtl->table; dt; dt = dt->next) 
-        {
+      if (dt == NULL) {
+        for (dt = dtl->table; dt; dt = dt->next) {
           if (dt->next == NULL) {
             break;
           }
         }
-        if (dt != NULL)
-        {
+        if (dt != NULL) {
           returnType = dt;
         }
       }
     }
     ap_pregfree(r->pool, regexp);
-    if (returnType != &UNKNOWN_DEVICE) 
-    {
+    if (returnType != &UNKNOWN_DEVICE) {
       ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "end chxj_specified_device()");
       return returnType;
     }
index 658350f..f3d0090 100644 (file)
@@ -31,7 +31,6 @@
 #include "apr_dso.h"
 #include "apr_general.h"
 #include "apr_pools.h"
-#include "ap_regex.h"
 
 #include "mod_chxj.h"
 #include "qs_ignore_sp.h"
index 9b19384..e71583a 100644 (file)
@@ -17,6 +17,7 @@
 #ifndef __MOD_CHXJ_H__
 #define __MOD_CHXJ_H__
 
+
 #include <string.h>
 
 #include "httpd.h"
 #include "qs_parse_string.h"
 #include "qs_parse_tag.h"
 
+#ifndef __CONFIG_H__
+#define __CONFIG_H__
+
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+
+#include "config.h"
+#endif
+#ifdef HAVE_AP_REGEX_H
+#  include "ap_regex.h"
+#else
+#  include "pcreposix.h"
+#  include "pcre.h"
+#  define AP_REG_ASSERT   REG_ASSERT
+#  define AP_REG_BADBR    REG_BADBR
+#  define AP_REG_BADPAT   REG_BADPAT
+#  define AP_REG_BADRPT   REG_BADRPT
+#  define AP_REG_EBRACE   REG_EBRACE
+#  define AP_REG_EBRACK   REG_EBRACK
+#  define AP_REG_ECOLLATE REG_ECOLLATE
+#  define AP_REG_ECTYPE   REG_ECTYPE
+#  define AP_REG_EESCAPE  REG_EESCAPE
+#  define AP_REG_EMPTY    REG_EMPTY
+#  define AP_REG_EPAREN   REG_EPAREN
+#  define AP_REG_ERANGE   REG_ERANGE
+#  define AP_REG_ESIZE    REG_ESIZE
+#  define AP_REG_ESPACE   REG_ESPACE
+#  define AP_REG_ESUBREG  REG_ESUBREG
+#  define AP_REG_INVARG   REG_INVARG
+#  define AP_REG_NOMATCH  REG_NOMATCH
+
+#  define AP_REG_ICASE    REG_ICASE
+#  define AP_REG_NEWLINE  REG_NEWLINE
+#  define AP_REG_NOTBOL   REG_NOTBOL
+#  define AP_REG_NOTEOL   REG_NOTEOL
+
+#  define AP_REG_EXTENDED REG_EXTENDED
+#  define AP_REG_NOSUB    REG_NOSUB
+
+#  define ap_regex_t      regex_t
+#  define ap_regmatch_t   regmatch_t
+#endif
+
+
 #include "chxj_specified_device.h"
 
 
+#ifdef HAVE_APR_GLOBAL_MUTEX_H
+#  include "apr_global_mutex.h"
+#endif
+
+#ifdef HAVE_APR_SHM_H
+#  include "apr_shm.h"
+#endif
+
+
 typedef struct _imode_emoji_t {
   char  hex1byte;
   char  hex2byte;
index 8e9b292..4062530 100644 (file)
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#define DEBUG
 #include <stdio.h>
 #include <strings.h>
 #include "httpd.h"
index 6460265..7b66b70 100644 (file)
@@ -77,6 +77,7 @@
                         &&  (strcasecmp(c, "plaintext") != 0) \
                         &&  (strcasecmp(c, "?xml"     ) != 0) \
                         &&  (strcasecmp(c, "!doctype" ) != 0) \
+                        &&  (strcasecmp(c, "link"     ) != 0) \
                         &&  (strcasecmp(c, "!--"      ) != 0))
 
 /**