OSDN Git Service

* Added chxj_dump_string function for DEBUG dump.
authorAtsushi Konno <konn@users.sourceforge.jp>
Sat, 15 Nov 2008 15:51:16 +0000 (00:51 +0900)
committerAtsushi Konno <konn@users.sourceforge.jp>
Sat, 15 Nov 2008 15:51:16 +0000 (00:51 +0900)
include/chxj_dump_string.h [new file with mode: 0644]
include/mod_chxj.h
src/Makefile.am
src/Makefile.in
src/chxj_dump_string.c [new file with mode: 0644]
src/chxj_encoding.c
src/mod_chxj.c
test/chxj_ixhtml10/test_chxj_ixhtml10.c

diff --git a/include/chxj_dump_string.h b/include/chxj_dump_string.h
new file mode 100644 (file)
index 0000000..dc82a51
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * 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_DUMP_STRING__
+#define __CHXJ_DUMP_STRING__
+
+extern void chxj_dump_string(request_rec *r, const char *filename, int line, const char *title, const char *str, apr_size_t len);
+
+#endif
index 64b6bd9..d3373ee 100644 (file)
@@ -450,8 +450,6 @@ extern char* chxj_node_convert(
   int          indent
 );
 
-extern void chxj_dump_string(request_rec *r, const char *filename, int line, const char *title, const char *str, apr_size_t len);
-
 #define IMAGE_CACHE_LIMIT_FMT_LEN  (20)
 
 
index 7b9d5d4..94079d0 100644 (file)
@@ -40,6 +40,7 @@ libmod_chxj_la_SOURCES = mod_chxj.c \
     chxj_buffered_write.c \
     chxj_apache.c \
     chxj_serf.c \
+    chxj_dump_string.c \
     chxj_css.c
 
 
index 0e42ab2..906173c 100644 (file)
@@ -80,7 +80,7 @@ am_libmod_chxj_la_OBJECTS = libmod_chxj_la-mod_chxj.lo \
        libmod_chxj_la-chxj_memcache.lo libmod_chxj_la-chxj_dbm.lo \
        libmod_chxj_la-chxj_buffered_write.lo \
        libmod_chxj_la-chxj_apache.lo libmod_chxj_la-chxj_serf.lo \
-       libmod_chxj_la-chxj_css.lo
+       libmod_chxj_la-chxj_dump_string.lo libmod_chxj_la-chxj_css.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) \
@@ -265,6 +265,7 @@ libmod_chxj_la_SOURCES = mod_chxj.c \
     chxj_buffered_write.c \
     chxj_apache.c \
     chxj_serf.c \
+    chxj_dump_string.c \
     chxj_css.c
 
 libmod_chxj_la_CFLAGS = -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include -I@with_apache_header@  -I./serf -I./css/include
@@ -353,6 +354,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_css.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_dbm.Plo@am__quote@
 @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_dump_string.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_img_conv.Plo@am__quote@
@@ -683,6 +685,13 @@ libmod_chxj_la-chxj_serf.lo: chxj_serf.c
 @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_serf.lo `test -f 'chxj_serf.c' || echo '$(srcdir)/'`chxj_serf.c
 
+libmod_chxj_la-chxj_dump_string.lo: chxj_dump_string.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_dump_string.lo -MD -MP -MF $(DEPDIR)/libmod_chxj_la-chxj_dump_string.Tpo -c -o libmod_chxj_la-chxj_dump_string.lo `test -f 'chxj_dump_string.c' || echo '$(srcdir)/'`chxj_dump_string.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libmod_chxj_la-chxj_dump_string.Tpo $(DEPDIR)/libmod_chxj_la-chxj_dump_string.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='chxj_dump_string.c' object='libmod_chxj_la-chxj_dump_string.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_dump_string.lo `test -f 'chxj_dump_string.c' || echo '$(srcdir)/'`chxj_dump_string.c
+
 libmod_chxj_la-chxj_css.lo: chxj_css.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_css.lo -MD -MP -MF $(DEPDIR)/libmod_chxj_la-chxj_css.Tpo -c -o libmod_chxj_la-chxj_css.lo `test -f 'chxj_css.c' || echo '$(srcdir)/'`chxj_css.c
 @am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libmod_chxj_la-chxj_css.Tpo $(DEPDIR)/libmod_chxj_la-chxj_css.Plo
diff --git a/src/chxj_dump_string.c b/src/chxj_dump_string.c
new file mode 100644 (file)
index 0000000..4f18194
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * 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"
+
+/**
+ * Dump string to debug log.
+ */
+void
+chxj_dump_string(request_rec *r, const char *filename, int line, const char *title, const char *str, apr_size_t len)
+{
+  apr_size_t ii;
+  chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] +-------------------------------------------------------------------+", (unsigned int)(apr_size_t)r);
+  chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] |                                                                   |", (unsigned int)(apr_size_t)r);
+  chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] | %-*.*s |", (unsigned int)(apr_size_t)r, 64, 64, title);
+  chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] |                                                                   |", (unsigned int)(apr_size_t)r);
+  chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] +-------------------------------------------------------------------+", (unsigned int)(apr_size_t)r);
+  for (ii=0; ii<len/64; ii++) {
+    chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] | [%-*.*s] |", (unsigned int)(apr_size_t)r, 64, 64, &str[ii * 64]);
+  }
+  if (len % 64) {
+    chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] | [%-*.*s] |", (unsigned int)(apr_size_t)r, 64, 64, &str[ii * 64]);
+  }
+  chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] +-------------------------------------------------------------------+", (unsigned int)(apr_size_t)r);
+}
index d2e6948..e6bd1a4 100644 (file)
@@ -18,6 +18,7 @@
 #include "chxj_encoding.h"
 #include "chxj_apply_convrule.h"
 #include "chxj_url_encode.h"
+#include "chxj_dump_string.h"
 #include <errno.h>
 #include <iconv.h>
 
index 0013b43..a687de3 100644 (file)
@@ -64,6 +64,7 @@
 #include "chxj_cookie.h"
 #include "chxj_url_encode.h"
 #include "chxj_str_util.h"
+#include "chxj_dump_string.h"
 #if defined(USE_MYSQL_COOKIE)
 #  include "chxj_mysql.h"
 #endif
@@ -844,27 +845,6 @@ pass_data_to_filter(ap_filter_t *f, const char *data,
 }
 
 /**
- * Dump string to debug log.
- */
-void
-chxj_dump_string(request_rec *r, const char *filename, int line, const char *title, const char *str, apr_size_t len)
-{
-  apr_size_t ii;
-  chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] +-------------------------------------------------------------------+", (unsigned int)(apr_size_t)r);
-  chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] |                                                                   |", (unsigned int)(apr_size_t)r);
-  chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] | %-*.*s |", (unsigned int)(apr_size_t)r, 64, 64, title);
-  chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] |                                                                   |", (unsigned int)(apr_size_t)r);
-  chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] +-------------------------------------------------------------------+", (unsigned int)(apr_size_t)r);
-  for (ii=0; ii<len/64; ii++) {
-    chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] | [%-*.*s] |", (unsigned int)(apr_size_t)r, 64, 64, &str[ii * 64]);
-  }
-  if (len % 64) {
-    chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] | [%-*.*s] |", (unsigned int)(apr_size_t)r, 64, 64, &str[ii * 64]);
-  }
-  chxj_log_rerror(filename, line, APLOG_DEBUG,0,r, "REQ[%X] +-------------------------------------------------------------------+", (unsigned int)(apr_size_t)r);
-}
-
-/**
  * It is the main loop of the output filter. 
  *
  * @param f   [i/o] It is a filter.
index 9b91ab4..667c552 100644 (file)
@@ -34,6 +34,7 @@
 #include "chxj_apache.c"
 #include "chxj_dbm.c"
 #include "chxj_str_util.c"
+#include "chxj_dump_string.c"
 #include <iconv.h>
 #include "chxj_serf.h"
 #include "chxj_css.h"