httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r380784 [1/4] - in /httpd/apreq/branches/apr-build-system: ./ build/ include/ library/ module/ module/apache2/
Date Fri, 24 Feb 2006 18:56:38 GMT
Author: joes
Date: Fri Feb 24 10:56:34 2006
New Revision: 380784

URL: http://svn.apache.org/viewcvs?rev=380784&view=rev
Log:
create apr-based build system for the C APIs
no tests, just a barebones build w/ VPATH support

Added:
    httpd/apreq/branches/apr-build-system/   (with props)
    httpd/apreq/branches/apr-build-system/Makefile.in   (with props)
    httpd/apreq/branches/apr-build-system/build/
    httpd/apreq/branches/apr-build-system/build.conf
    httpd/apreq/branches/apr-build-system/build/apreq-conf.m4   (with props)
    httpd/apreq/branches/apr-build-system/build/apreq-hints.m4   (with props)
    httpd/apreq/branches/apr-build-system/build/find_apreq.m4   (with props)
    httpd/apreq/branches/apr-build-system/buildconf   (with props)
    httpd/apreq/branches/apr-build-system/config.layout
    httpd/apreq/branches/apr-build-system/configure.in   (with props)
    httpd/apreq/branches/apr-build-system/include/   (with props)
    httpd/apreq/branches/apr-build-system/include/apreq.h   (with props)
    httpd/apreq/branches/apr-build-system/include/apreq_cookie.h   (with props)
    httpd/apreq/branches/apr-build-system/include/apreq_error.h   (with props)
    httpd/apreq/branches/apr-build-system/include/apreq_module.h   (with props)
    httpd/apreq/branches/apr-build-system/include/apreq_param.h   (with props)
    httpd/apreq/branches/apr-build-system/include/apreq_parser.h   (with props)
    httpd/apreq/branches/apr-build-system/include/apreq_util.h   (with props)
    httpd/apreq/branches/apr-build-system/include/apreq_version.h   (with props)
    httpd/apreq/branches/apr-build-system/library/   (with props)
    httpd/apreq/branches/apr-build-system/library/cookie.c   (with props)
    httpd/apreq/branches/apr-build-system/library/error.c   (with props)
    httpd/apreq/branches/apr-build-system/library/module.c   (with props)
    httpd/apreq/branches/apr-build-system/library/module_cgi.c   (with props)
    httpd/apreq/branches/apr-build-system/library/module_custom.c   (with props)
    httpd/apreq/branches/apr-build-system/library/param.c   (with props)
    httpd/apreq/branches/apr-build-system/library/parser.c   (with props)
    httpd/apreq/branches/apr-build-system/library/parser_header.c   (with props)
    httpd/apreq/branches/apr-build-system/library/parser_multipart.c   (with props)
    httpd/apreq/branches/apr-build-system/library/parser_urlencoded.c   (with props)
    httpd/apreq/branches/apr-build-system/library/util.c   (with props)
    httpd/apreq/branches/apr-build-system/library/version.c   (with props)
    httpd/apreq/branches/apr-build-system/module/
    httpd/apreq/branches/apr-build-system/module/apache2/
    httpd/apreq/branches/apr-build-system/module/apache2/apreq_module_apache2.h   (with props)
    httpd/apreq/branches/apr-build-system/module/apache2/apreq_private_apache2.h   (with props)
    httpd/apreq/branches/apr-build-system/module/apache2/filter.c   (with props)
    httpd/apreq/branches/apr-build-system/module/apache2/handle.c   (with props)

Propchange: httpd/apreq/branches/apr-build-system/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Feb 24 10:56:34 2006
@@ -0,0 +1,7 @@
+config.log
+config.nice
+config.status
+configure
+.libs
+.make.dirs
+Makefile

Added: httpd/apreq/branches/apr-build-system/Makefile.in
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/apr-build-system/Makefile.in?rev=380784&view=auto
==============================================================================
--- httpd/apreq/branches/apr-build-system/Makefile.in (added)
+++ httpd/apreq/branches/apr-build-system/Makefile.in Fri Feb 24 10:56:34 2006
@@ -0,0 +1,91 @@
+#
+# Top-level Makefile for APREQ
+#
+CPP = @CPP@
+
+# gets substituted into some targets
+APREQ_MAJOR_VERSION=@APREQ_MAJOR_VERSION@
+APREQ_DOTTED_VERSION=@APREQ_DOTTED_VERSION@
+
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+INCLUDES = @APREQ_INCLUDES@ @APREQ_PRIV_INCLUDES@ @APR_INCLUDES@
+APREQ_LDFLAGS = @APREQ_LDFLAGS@
+APREQ_LIBS = @APREQ_LIBS@
+
+TARGET_LIB = lib@APREQ_LIBNAME@.la
+INSTALL_SUBDIRS = @APR_ICONV_DIR@ @APR_XML_DIR@
+EXTRA_SOURCE_DIRS = @APR_ICONV_DIR@ @APR_XML_DIR@
+APRUTIL_PCFILE = apr-util-$(APRUTIL_MAJOR_VERSION).pc
+APREQ_CONFIG = apreq2-config
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+TARGETS = $(TARGET_LIB) aprutil.exp
+
+# bring in rules.mk for standard functionality
+@INCLUDE_RULES@
+@INCLUDE_OUTPUTS@
+
+CLEAN_SUBDIRS = test @APR_ICONV_DIR@
+
+CLEAN_TARGETS = exports.c export_vars.c aprutil.exp .make.dirs apu-config.out
+DISTCLEAN_TARGETS = config.cache config.log config.status libtool \
+	include/private/apu_config.h include/private/apu_private.h \
+	include/private/apu_select_dbm.h include/apr_ldap.h include/apu.h \
+	export_vars.sh $(APU_CONFIG) build/rules.mk include/apu_want.h \
+	apr-util.pc build/pkg/pkginfo
+EXTRACLEAN_TARGETS = configure aclocal.m4 include/private/apu_config.h.in \
+	exports.c build-outputs.mk \
+	build/apr_common.m4 build/find_apr.m4 build/install.sh \
+	build/config.guess build/config.sub
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+libdir=@libdir@
+includedir=@includedir@
+top_srcdir=@abs_srcdir@
+top_blddir=@abs_builddir@
+
+# Create apu-config script suitable for the install tree
+apu-config.out: $(APU_CONFIG)
+	sed 's,^\(location=\).*$$,\1installed,' < $(APU_CONFIG) > $@
+
+install: $(TARGET_LIB) apu-config.out
+	$(APR_MKDIR) $(DESTDIR)$(includedir) $(DESTDIR)$(libdir)/pkgconfig \
+		     $(DESTDIR)$(libdir) $(DESTDIR)$(bindir)
+	for f in $(top_srcdir)/include/*.h $(top_blddir)/include/*.h; do \
+		$(INSTALL_DATA) $${f} $(DESTDIR)$(includedir); \
+	done
+	$(INSTALL_DATA) apr-util.pc $(DESTDIR)$(libdir)/pkgconfig/$(APRUTIL_PCFILE)
+	list='$(INSTALL_SUBDIRS)'; for i in $$list; do \
+		( cd $$i ; $(MAKE) DESTDIR=$(DESTDIR) install ); \
+	done
+	$(LIBTOOL) --mode=install $(INSTALL) -m 755 $(TARGET_LIB) $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) aprutil.exp $(DESTDIR)$(libdir)
+	$(INSTALL) -m 755 apu-config.out $(DESTDIR)$(bindir)/$(APU_CONFIG)
+
+$(TARGET_LIB): $(OBJECTS)
+	$(LINK) @lib_target@ $(ALL_LIBS) $(APREQ_LDFLAGS) $(APREQ_LIBS)
+
+exports.c: $(HEADERS)
+	$(APR_MKEXPORT) $(HEADERS) > $@
+
+export_vars.c: $(HEADERS)
+	$(APR_MKVAREXPORT) $(HEADERS) > $@
+
+aprutil.exp: exports.c export_vars.c
+	@echo "#! lib@APRUTIL_LIBNAME@.so" > $@
+	@echo "* This file was AUTOGENERATED at build time." >> $@
+	@echo "* Please do not edit by hand." >> $@
+	$(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@
+	$(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) export_vars.c | sed -e 's/^\#[^!]*//' | sed -e '/^$$/d' >> $@
+
+dox:
+	doxygen $(top_srcdir)/docs/doxygen.conf
+
+test: check
+check: $(TARGET_LIB)
+	cd test && $(MAKE) check

Propchange: httpd/apreq/branches/apr-build-system/Makefile.in
------------------------------------------------------------------------------
    svn:eol-style = native

Added: httpd/apreq/branches/apr-build-system/build.conf
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/apr-build-system/build.conf?rev=380784&view=auto
==============================================================================
--- httpd/apreq/branches/apr-build-system/build.conf (added)
+++ httpd/apreq/branches/apr-build-system/build.conf Fri Feb 24 10:56:34 2006
@@ -0,0 +1,19 @@
+#
+# Configuration file for APREQ. Used by APR/build/gen-build.py
+#
+
+[options]
+
+# the platform-independent .c files
+paths =
+  library/*.c
+# we have no platform-specific subdirs
+platform_dirs =
+
+# the public headers
+headers = include/*.h
+
+# gen_uri_delim.c
+
+# we have a recursive makefile for the test files (for now)
+# test/*.c

Added: httpd/apreq/branches/apr-build-system/build/apreq-conf.m4
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/apr-build-system/build/apreq-conf.m4?rev=380784&view=auto
==============================================================================
--- httpd/apreq/branches/apr-build-system/build/apreq-conf.m4 (added)
+++ httpd/apreq/branches/apr-build-system/build/apreq-conf.m4 Fri Feb 24 10:56:34 2006
@@ -0,0 +1,72 @@
+dnl -------------------------------------------------------- -*- autoconf -*-
+dnl Copyright 2000-2005 The Apache Software Foundation or its licensors, as
+dnl applicable.
+dnl
+dnl Licensed under the Apache License, Version 2.0 (the "License");
+dnl you may not use this file except in compliance with the License.
+dnl You may obtain a copy of the License at
+dnl
+dnl     http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing, software
+dnl distributed under the License is distributed on an "AS IS" BASIS,
+dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+dnl See the License for the specific language governing permissions and
+dnl limitations under the License.
+
+
+dnl
+dnl custom autoconf rules for APRUTIL
+dnl
+
+dnl
+dnl APU_FIND_APR: figure out where APR is located
+dnl
+AC_DEFUN([APREQ_FIND_APR], [
+
+  dnl use the find_apr.m4 script to locate APR. sets apr_found and apr_config
+  APR_FIND_APR(,,,[1])
+  if test "$apr_found" = "no"; then
+    AC_MSG_ERROR(APR could not be located. Please use the --with-apr option.)
+  fi
+
+  APR_BUILD_DIR="`$apr_config --installbuilddir`"
+
+  dnl make APR_BUILD_DIR an absolute directory (we'll need it in the
+  dnl sub-projects in some cases)
+  APR_BUILD_DIR="`cd $APR_BUILD_DIR && pwd`"
+
+  APR_INCLUDES="`$apr_config --includes`"
+  APR_LIBS="`$apr_config --link-libtool --libs`"
+  APR_SO_EXT="`$apr_config --apr-so-ext`"
+  APR_LIB_TARGET="`$apr_config --apr-lib-target`"
+
+  AC_SUBST(APR_INCLUDES)
+  AC_SUBST(APR_LIBS)
+  AC_SUBST(APR_BUILD_DIR)
+])
+
+
+AC_DEFUN([APREQ_FIND_APU], [
+
+  dnl use the find_apr.m4 script to locate APR. sets apr_found and apu_config
+  APR_FIND_APU(,,,[1])
+  if test "$apu_found" = "no"; then
+    AC_MSG_ERROR(APR could not be located. Please use the --with-apr-util option.)
+  fi
+
+  APU_BUILD_DIR="`$apu_config --installbuilddir`"
+
+  dnl make APR_BUILD_DIR an absolute directory (we'll need it in the
+  dnl sub-projects in some cases)
+  APU_BUILD_DIR="`cd $APR_BUILD_DIR && pwd`"
+
+  APU_INCLUDES="`$apu_config --includes`"
+  APU_LIBS="`$apu_config --link-libtool --libs`"
+
+  AC_SUBST(APU_INCLUDES)
+  AC_SUBST(APU_LIBS)
+  AC_SUBST(APU_BUILD_DIR)
+])
+
+

Propchange: httpd/apreq/branches/apr-build-system/build/apreq-conf.m4
------------------------------------------------------------------------------
    svn:eol-style = native

Added: httpd/apreq/branches/apr-build-system/build/apreq-hints.m4
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/apr-build-system/build/apreq-hints.m4?rev=380784&view=auto
==============================================================================
--- httpd/apreq/branches/apr-build-system/build/apreq-hints.m4 (added)
+++ httpd/apreq/branches/apr-build-system/build/apreq-hints.m4 Fri Feb 24 10:56:34 2006
@@ -0,0 +1,61 @@
+dnl -------------------------------------------------------- -*- autoconf -*-
+dnl Copyright 2003-2005 The Apache Software Foundation or its licensors, as
+dnl applicable.
+dnl
+dnl Licensed under the Apache License, Version 2.0 (the "License");
+dnl you may not use this file except in compliance with the License.
+dnl You may obtain a copy of the License at
+dnl
+dnl     http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing, software
+dnl distributed under the License is distributed on an "AS IS" BASIS,
+dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+dnl See the License for the specific language governing permissions and
+dnl limitations under the License.
+
+dnl -----------------------------------------------------------------
+dnl apu-hints.m4: apr-util's autoconf macros for platform-specific hints
+dnl
+dnl  We preload various configure settings depending
+dnl  on previously obtained platform knowledge.
+dnl  We allow all settings to be overridden from
+dnl  the command-line.
+
+dnl
+dnl APU_PRELOAD
+dnl
+dnl  Preload various build parameters based on outside knowledge.
+dnl
+AC_DEFUN([APREQ_PRELOAD], [
+if test "x$apreq_preload_done" != "xyes" ; then
+    apreq_preload_done="yes"
+
+    echo "Applying apr-util hints file rules for $host"
+
+    case "$host" in
+    *-dec-osf*)
+        APR_SETIFNULL(apreq_crypt_threadsafe, [1])
+        ;;
+    *-hp-hpux11.*)
+        APR_SETIFNULL(apreq_crypt_threadsafe, [1])
+        ;;
+    *-ibm-aix4*|*-ibm-aix5.1*)
+        APR_SETIFNULL(apreq_iconv_inbuf_const, [1])
+        ;;
+    *-ibm-os390)
+        APR_SETIFNULL(apreq_crypt_threadsafe, [1])
+        ;;
+    *-solaris2*)
+        APR_SETIFNULL(apreq_iconv_inbuf_const, [1])
+        APR_SETIFNULL(apreq_crypt_threadsafe, [1])
+        ;;
+    *-sco3.2v5*)
+	APR_SETIFNULL(apreq_db_xtra_libs, [-lsocket])
+	;;
+    esac
+
+fi
+])
+
+

Propchange: httpd/apreq/branches/apr-build-system/build/apreq-hints.m4
------------------------------------------------------------------------------
    svn:eol-style = native

Added: httpd/apreq/branches/apr-build-system/build/find_apreq.m4
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/apr-build-system/build/find_apreq.m4?rev=380784&view=auto
==============================================================================
--- httpd/apreq/branches/apr-build-system/build/find_apreq.m4 (added)
+++ httpd/apreq/branches/apr-build-system/build/find_apreq.m4 Fri Feb 24 10:56:34 2006
@@ -0,0 +1,176 @@
+dnl -------------------------------------------------------- -*- autoconf -*-
+dnl Copyright 2002-2005 The Apache Software Foundation or its licensors, as
+dnl applicable.
+dnl
+dnl Licensed under the Apache License, Version 2.0 (the "License");
+dnl you may not use this file except in compliance with the License.
+dnl You may obtain a copy of the License at
+dnl
+dnl     http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing, software
+dnl distributed under the License is distributed on an "AS IS" BASIS,
+dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+dnl See the License for the specific language governing permissions and
+dnl limitations under the License.
+
+dnl
+dnl find_apu.m4 : locate the APR-util (APU) include files and libraries
+dnl
+dnl This macro file can be used by applications to find and use the APU
+dnl library. It provides a standardized mechanism for using APU. It supports
+dnl embedding APU into the application source, or locating an installed
+dnl copy of APU.
+dnl
+dnl APR_FIND_APU(srcdir, builddir, implicit-install-check, acceptable-majors)
+dnl
+dnl   where srcdir is the location of the bundled APU source directory, or
+dnl   empty if source is not bundled.
+dnl
+dnl   where builddir is the location where the bundled APU will be built,
+dnl   or empty if the build will occur in the srcdir.
+dnl
+dnl   where implicit-install-check set to 1 indicates if there is no
+dnl   --with-apr-util option specified, we will look for installed copies.
+dnl
+dnl   where acceptable-majors is a space separated list of acceptable major
+dnl   version numbers. Often only a single major version will be acceptable.
+dnl   If multiple versions are specified, and --with-apr-util=PREFIX or the
+dnl   implicit installed search are used, then the first (leftmost) version
+dnl   in the list that is found will be used.  Currently defaults to [0 1].
+dnl
+dnl Sets the following variables on exit:
+dnl
+dnl   apu_found : "yes", "no", "reconfig"
+dnl
+dnl   apu_config : If the apu-config tool exists, this refers to it.  If
+dnl                apu_found is "reconfig", then the bundled directory
+dnl                should be reconfigured *before* using apu_config.
+dnl
+dnl Note: this macro file assumes that apr-config has been installed; it
+dnl       is normally considered a required part of an APR installation.
+dnl
+dnl Note: At this time, we cannot find *both* a source dir and a build dir.
+dnl       If both are available, the build directory should be passed to
+dnl       the --with-apr-util switch.
+dnl
+dnl Note: the installation layout is presumed to follow the standard
+dnl       PREFIX/lib and PREFIX/include pattern. If the APU config file
+dnl       is available (and can be found), then non-standard layouts are
+dnl       possible, since it will be described in the config file.
+dnl
+dnl If a bundled source directory is available and needs to be (re)configured,
+dnl then apu_found is set to "reconfig". The caller should reconfigure the
+dnl (passed-in) source directory, placing the result in the build directory,
+dnl as appropriate.
+dnl
+dnl If apu_found is "yes" or "reconfig", then the caller should use the
+dnl value of apu_config to fetch any necessary build/link information.
+dnl
+
+AC_DEFUN([APR_FIND_APU], [
+  apu_found="no"
+
+  if test "$target_os" = "os2-emx"; then
+    # Scripts don't pass test -x on OS/2
+    TEST_X="test -f"
+  else
+    TEST_X="test -x"
+  fi
+
+  ifelse([$4], [],
+  [
+    ifdef(AC_WARNING,([$0: missing argument 4 (acceptable-majors): Defaulting to APU 0.x then APU 1.x]))
+    acceptable_majors="0 1"
+  ], [acceptable_majors="$4"])
+
+  apu_temp_acceptable_apu_config=""
+  for apu_temp_major in $acceptable_majors
+  do
+    case $apu_temp_major in
+      0)
+      apu_temp_acceptable_apu_config="$apu_temp_acceptable_apu_config apu-config"
+      ;;
+      *)
+      apu_temp_acceptable_apu_config="$apu_temp_acceptable_apu_config apu-$apu_temp_major-config"
+      ;;
+    esac
+  done
+
+  AC_MSG_CHECKING(for APR-util)
+  AC_ARG_WITH(apr-util,
+  [  --with-apr-util=PATH    prefix for installed APU, path to APU build tree,
+                          or the full path to apu-config],
+  [
+    if test "$withval" = "no" || test "$withval" = "yes"; then
+      AC_MSG_ERROR([--with-apr-util requires a directory or file to be provided])
+    fi
+
+    for apu_temp_apu_config_file in $apu_temp_acceptable_apu_config
+    do
+      for lookdir in "$withval/bin" "$withval"
+      do
+        if $TEST_X "$lookdir/$apu_temp_apu_config_file"; then
+          apu_found="yes"
+          apu_config="$lookdir/$apu_temp_apu_config_file"
+          break 2
+        fi
+      done
+    done
+
+    if test "$apu_found" != "yes" && $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then
+      apu_found="yes"
+      apu_config="$withval"
+    fi
+
+    dnl if --with-apr-util is used, it is a fatal error for its argument
+    dnl to be invalid
+    if test "$apu_found" != "yes"; then
+      AC_MSG_ERROR([the --with-apr-util parameter is incorrect. It must specify an install prefix, a build directory, or an apu-config file.])
+    fi
+  ],[
+    if test -n "$3" && test "$3" = "1"; then
+      for apu_temp_apu_config_file in $apu_temp_acceptable_apu_config
+      do
+        if $apu_temp_apu_config_file --help > /dev/null 2>&1 ; then
+          apu_found="yes"
+          apu_config="$apu_temp_apu_config_file"
+          break
+        else
+          dnl look in some standard places (apparently not in builtin/default)
+          for lookdir in /usr /usr/local /usr/local/apr /opt/apr /usr/local/apache2 ; do
+            if $TEST_X "$lookdir/bin/$apu_temp_apu_config_file"; then
+              apu_found="yes"
+              apu_config="$lookdir/bin/$apu_temp_apu_config_file"
+              break 2
+            fi
+          done
+        fi
+      done
+    fi
+    dnl if we have not found anything yet and have bundled source, use that
+    if test "$apu_found" = "no" && test -d "$1"; then
+      apu_temp_abs_srcdir="`cd $1 && pwd`"
+      apu_found="reconfig"
+      apu_bundled_major="`sed -n '/#define.*APU_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"$1/include/apu_version.h\"`"
+      case $apu_bundled_major in
+        "")
+          AC_MSG_ERROR([failed to find major version of bundled APU])
+        ;;
+        0)
+          apu_temp_apu_config_file="apu-config"
+        ;;
+        *)
+          apu_temp_apu_config_file="apu-$apu_bundled_major-config"
+        ;;
+      esac
+      if test -n "$2"; then
+        apu_config="$2/$apu_temp_apu_config_file"
+      else
+        apu_config="$1/$apu_temp_apu_config_file"
+      fi
+    fi
+  ])
+
+  AC_MSG_RESULT($apu_found)
+])

Propchange: httpd/apreq/branches/apr-build-system/build/find_apreq.m4
------------------------------------------------------------------------------
    svn:eol-style = native

Added: httpd/apreq/branches/apr-build-system/buildconf
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/apr-build-system/buildconf?rev=380784&view=auto
==============================================================================
--- httpd/apreq/branches/apr-build-system/buildconf (added)
+++ httpd/apreq/branches/apr-build-system/buildconf Fri Feb 24 10:56:34 2006
@@ -0,0 +1,106 @@
+#!/bin/sh
+#
+# Copyright 1999-2005 The Apache Software Foundation or its licensors, as
+# applicable.
+#
+# 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.
+#
+#
+
+# Default place to look for apr source.  Can be overridden with 
+#   --with-apr=[directory]
+apr_src_dir=../apr
+apu_src_dir=../apr-util
+
+while test $# -gt 0 
+do
+  # Normalize
+  case "$1" in
+  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  case "$1" in
+  --with-apr=*)
+  apr_src_dir=$optarg
+  ;;
+  --with-apr-util=*)
+  apu_src_dir=$optarg
+  ;;
+  esac
+
+  shift
+done
+
+if [ -f "$apr_src_dir/build/apr_common.m4" ]; then
+  echo ""
+  echo "Looking for apr source in $apr_src_dir"
+else
+  echo ""
+  echo "Problem finding apr source in $apr_src_dir."
+  echo "Use:"
+  echo "  --with-apr=[directory]" 
+  exit 1
+fi
+
+if [ -f "$apu_src_dir/build/find_apu.m4" ]; then
+  echo ""
+  echo "Looking for apr-util source in $apu_src_dir"
+else
+  echo ""
+  echo "Problem finding apr-util source in $apu_src_dir."
+  echo "Use:"
+  echo "  --with-apr-util=[directory]" 
+  exit 1
+fi
+
+set -e
+
+# Remove some files, then copy them from apr source tree
+rm -f build/apr_common.m4 build/find_apr.m4 build/install.sh \
+      build/config.guess build/config.sub
+cp $apr_src_dir/build/apr_common.m4 $apr_src_dir/build/find_apr.m4 \
+   $apr_src_dir/build/install.sh $apr_src_dir/build/config.guess  \
+   $apr_src_dir/build/config.sub build
+
+rm -f build/find_apu.m4
+cp $apu_src_dir/build/find_apu.m4 build
+
+
+# Remove aclocal.m4 as it'll break some builds...
+rm -rf aclocal.m4 autom4te*.cache
+
+#
+# Generate the autoconf header (include/apreq_config.h) and ./configure
+#
+echo "Creating include/private/apreq_config.h ..."
+${AUTOHEADER:-autoheader}
+
+echo "Creating configure ..."
+### do some work to toss config.cache?
+if ${AUTOCONF:-autoconf}; then
+  :
+else
+  echo "autoconf failed"
+  exit 1
+fi
+
+#
+# Generate build-outputs.mk for the build systme
+#
+echo "Generating 'make' outputs ..."
+$apr_src_dir/build/gen-build.py make
+
+# Remove autoconf cache again
+rm -rf autom4te*.cache
+

Propchange: httpd/apreq/branches/apr-build-system/buildconf
------------------------------------------------------------------------------
    svn:executable = *

Added: httpd/apreq/branches/apr-build-system/config.layout
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/apr-build-system/config.layout?rev=380784&view=auto
==============================================================================
--- httpd/apreq/branches/apr-build-system/config.layout (added)
+++ httpd/apreq/branches/apr-build-system/config.layout Fri Feb 24 10:56:34 2006
@@ -0,0 +1,232 @@
+##
+##  config.layout -- Pre-defined Installation Path Layouts
+##
+##  Hints:
+##  - layouts can be loaded with configure's --enable-layout=ID option
+##  - when no --enable-layout option is given, the default layout is `apr'
+##  - a trailing plus character (`+') on paths is replaced with a 
+##    `/<target>' suffix where <target> is currently hardcoded to 'apr'.
+##    (This may become a configurable parameter at some point.)
+##
+
+#   Classical APREQ path layout designed for parallel installs.
+<Layout apreq>
+    prefix:        /usr/local/apr
+    exec_prefix:   ${prefix}
+    bindir:        ${exec_prefix}/bin
+    sbindir:       ${exec_prefix}/bin
+    libdir:        ${exec_prefix}/lib
+    libexecdir:    ${exec_prefix}/modules
+    mandir:        ${prefix}/man
+    sysconfdir:    ${prefix}/conf
+    datadir:       ${prefix}
+    installbuilddir: ${datadir}/build
+    includedir:    ${prefix}/include/apreq2
+    localstatedir: ${prefix}
+    libsuffix:     -${APREQ_MAJOR_VERSION}
+</Layout>
+
+#   Classical single-installation APR path layout.
+<Layout classic>
+    prefix:        /usr/local/apr
+    exec_prefix:   ${prefix}
+    bindir:        ${exec_prefix}/bin
+    sbindir:       ${exec_prefix}/bin
+    libdir:        ${exec_prefix}/lib
+    libexecdir:    ${exec_prefix}/modules
+    mandir:        ${prefix}/man
+    sysconfdir:    ${prefix}/conf
+    datadir:       ${prefix}
+    installbuilddir: ${datadir}/build
+    includedir:    ${prefix}/include
+    localstatedir: ${prefix}
+</Layout>
+
+#   GNU standards conforming path layout.
+#   See FSF's GNU project `make-stds' document for details.
+<Layout GNU>
+    prefix:        /usr/local
+    exec_prefix:   ${prefix}
+    bindir:        ${exec_prefix}/bin
+    sbindir:       ${exec_prefix}/sbin
+    libdir:        ${exec_prefix}/lib
+    libexecdir:    ${exec_prefix}/libexec
+    mandir:        ${prefix}/man
+    sysconfdir:    ${prefix}/etc+
+    datadir:       ${prefix}/share+
+    installbuilddir: ${datadir}/build
+    includedir:    ${prefix}/include+
+    localstatedir: ${prefix}/var+
+    runtimedir:    ${localstatedir}/run
+</Layout>
+
+#   Mac OS X Server (Rhapsody)
+<Layout Mac OS X Server>
+    prefix:        /Local/Library/WebServer
+    exec_prefix:   /usr
+    bindir:        ${exec_prefix}/bin
+    sbindir:       ${exec_prefix}/sbin
+    libdir:        ${exec_prefix}/lib
+    libexecdir:    /System/Library/apr/Modules
+    mandir:        ${exec_prefix}/share/man
+    sysconfdir:    ${prefix}/Configuration
+    datadir:       ${prefix}
+    installbuilddir: /System/Library/apr/Build
+    includedir:    /System/Library/Frameworks/apr.framework/Versions/2.0/Headers
+    localstatedir: /var
+    runtimedir:    ${prefix}/Logs
+</Layout>
+
+#   Darwin/Mac OS Layout
+<Layout Darwin>
+    prefix:        /usr
+    exec_prefix:   ${prefix}
+    bindir:        ${exec_prefix}/bin
+    sbindir:       ${exec_prefix}/sbin
+    libdir:        ${exec_prefix}/lib
+    libexecdir:    ${exec_prefix}/libexec+
+    mandir:        ${prefix}/share/man
+    datadir:       /Library/WebServer
+    sysconfdir:    /etc+
+    installbuilddir: ${prefix}/share/httpd/build
+    includedir:    ${prefix}/include+
+    localstatedir: /var
+    runtimedir:    ${localstatedir}/run
+</Layout>
+
+#   Red Hat Linux 7.x layout
+<Layout RedHat>
+    prefix:        /usr
+    exec_prefix:   ${prefix}
+    bindir:        ${prefix}/bin
+    sbindir:       ${prefix}/sbin
+    libdir:        ${prefix}/lib
+    libexecdir:    ${prefix}/lib/apr
+    mandir:        ${prefix}/man
+    sysconfdir:    /etc/httpd/conf
+    datadir:       /var/www
+    installbuilddir: ${datadir}/build
+    includedir:    ${prefix}/include/apr
+    localstatedir: /var
+    runtimedir:    ${localstatedir}/run
+</Layout>     
+
+#   According to the /opt filesystem conventions
+<Layout opt>
+    prefix:        /opt/apr
+    exec_prefix:   ${prefix}
+    bindir:        ${exec_prefix}/bin
+    sbindir:       ${exec_prefix}/sbin
+    libdir:        ${exec_prefix}/lib
+    libexecdir:    ${exec_prefix}/libexec
+    mandir:        ${prefix}/man
+    sysconfdir:    /etc${prefix}
+    datadir:       ${prefix}/share
+    installbuilddir: ${datadir}/build
+    includedir:    ${prefix}/include
+    localstatedir: /var${prefix}
+    runtimedir:    ${localstatedir}/run
+</Layout>
+
+#  BeOS layout...
+<Layout beos>
+    prefix:        /boot/home/apr
+    exec_prefix:   ${prefix}
+    bindir:        ${exec_prefix}/bin
+    sbindir:       ${exec_prefix}/bin
+    libdir:        ${exec_prefix}/lib
+    libexecdir:    ${exec_prefix}/libexec
+    mandir:        ${prefix}/man
+    sysconfdir:    ${prefix}/conf
+    datadir:       ${prefix}
+    installbuilddir: ${datadir}/build
+    includedir:    ${prefix}/include
+    localstatedir: ${prefix}
+    runtimedir:    ${localstatedir}/logs
+</Layout>
+
+#   SuSE 6.x layout
+<Layout SuSE>
+    prefix:        /usr
+    exec_prefix:   ${prefix}
+    bindir:        ${prefix}/bin
+    sbindir:       ${prefix}/sbin
+    libdir:        ${prefix}/lib
+    libexecdir:    ${prefix}/lib/apr
+    mandir:        ${prefix}/share/man
+    sysconfdir:    /etc/httpd
+    datadir:       /usr/local/httpd
+    installbuilddir: ${datadir}/build
+    includedir:    ${prefix}/include/apr
+    localstatedir: /var/lib/httpd
+    runtimedir:    /var/run
+</Layout>
+
+#   BSD/OS layout
+<Layout BSDI>
+    prefix:        /var/www
+    exec_prefix:   /usr/contrib
+    bindir:        ${exec_prefix}/bin
+    sbindir:       ${exec_prefix}/bin
+    libdir:        ${exec_prefix}/lib
+    libexecdir:    ${exec_prefix}/libexec/apr
+    mandir:        ${exec_prefix}/man
+    sysconfdir:    ${prefix}/conf
+    datadir:       ${prefix}
+    installbuilddir: ${datadir}/build
+    includedir:    ${exec_prefix}/include/apr
+    localstatedir: /var
+    runtimedir:    ${localstatedir}/run
+</Layout>
+
+#   Solaris 8 Layout
+<Layout Solaris>
+    prefix:        /usr/apr
+    exec_prefix:   ${prefix}
+    bindir:        ${exec_prefix}/bin
+    sbindir:       ${exec_prefix}/bin
+    libdir:        ${exec_prefix}/lib
+    libexecdir:    ${exec_prefix}/libexec
+    mandir:        ${exec_prefix}/man
+    sysconfdir:    /etc/apr
+    datadir:       /var/apr
+    installbuilddir: ${datadir}/build
+    includedir:    ${exec_prefix}/include
+    localstatedir: ${prefix}
+    runtimedir:    /var/run
+</Layout>
+
+#   OpenBSD Layout
+<Layout OpenBSD>
+    prefix:        /var/www
+    exec_prefix:   /usr
+    bindir:        ${exec_prefix}/bin
+    sbindir:       ${exec_prefix}/sbin
+    libdir:        ${exec_prefix}/lib
+    libexecdir:    ${exec_prefix}/lib/apr/modules
+    mandir:        ${exec_prefix}/share/man
+    sysconfdir:    ${prefix}/conf
+    datadir:       ${prefix}
+    installbuilddir: ${prefix}/build
+    includedir:    ${exec_prefix}/lib/apr/include
+    localstatedir: ${prefix}
+    runtimedir:    ${prefix}/logs
+</Layout>
+
+# Debian layout
+<Layout Debian>
+    prefix:        
+    exec_prefix:   ${prefix}/usr
+    bindir:        ${exec_prefix}/bin
+    sbindir:       ${exec_prefix}/sbin
+    libdir:        ${exec_prefix}/lib
+    libexecdir:    ${exec_prefix}/lib/apr/modules
+    mandir:        ${exec_prefix}/share/man
+    datadir:       ${exec_prefix}/share/apr
+    includedir:    ${exec_prefix}/include/apr-${APRUTIL_MAJOR_VERSION}
+    localstatedir: ${prefix}/var/run
+    runtimedir:    ${prefix}/var/run
+    infodir:       ${exec_prefix}/share/info
+    libsuffix:     -${APRUTIL_MAJOR_VERSION}
+    installbuilddir: ${prefix}/usr/share/apache2/build
+</Layout>

Added: httpd/apreq/branches/apr-build-system/configure.in
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/apr-build-system/configure.in?rev=380784&view=auto
==============================================================================
--- httpd/apreq/branches/apr-build-system/configure.in (added)
+++ httpd/apreq/branches/apr-build-system/configure.in Fri Feb 24 10:56:34 2006
@@ -0,0 +1,156 @@
+dnl
+dnl Process this file with autoconf to produce a configure script
+dnl
+
+AC_PREREQ(2.50)
+AC_INIT(export_vars.sh.in)
+
+AC_CONFIG_HEADER(include/apreq_config.h)
+AC_CONFIG_AUX_DIR(build)
+
+sinclude(build/apreq-conf.m4)
+sinclude(build/apreq-hints.m4)
+sinclude(build/apr_common.m4)
+sinclude(build/find_apr.m4)
+sinclude(build/find_apu.m4)
+
+dnl Generate ./config.nice for reproducing runs of configure
+dnl 
+APR_CONFIG_NICE(config.nice)
+
+dnl # Some initial steps for configuration.  We setup the default directory
+dnl # and which files are to be configured.
+
+dnl Absolute source/build directory
+abs_srcdir=`(cd $srcdir && pwd)`
+abs_builddir=`pwd`
+
+if test "$abs_builddir" != "$abs_srcdir"; then
+  USE_VPATH=1
+  APREQ_CONFIG_LOCATION=build
+else
+  APREQ_CONFIG_LOCATION=source
+fi
+
+AC_SUBST(APREQ_CONFIG_LOCATION)
+
+AC_CANONICAL_SYSTEM
+
+AC_PROG_INSTALL
+
+dnl
+dnl compute the top directory of the build
+dnl note: this is needed for LIBTOOL and exporting the bundled Expat
+dnl
+top_builddir="$abs_builddir"
+AC_SUBST(top_builddir)
+AC_SUBST(abs_srcdir)
+AC_SUBST(abs_builddir)
+
+dnl Initialize mkdir -p functionality.
+APR_MKDIR_P_CHECK($abs_srcdir/build/mkdir.sh)
+
+dnl get our version information
+get_version="$abs_srcdir/build/get-version.sh"
+version_hdr="$abs_srcdir/include/apreq_version.h"
+APREQ_MAJOR_VERSION="`$get_version major $version_hdr APREQ`"
+APREQ_DOTTED_VERSION="`$get_version all $version_hdr APREQ`"
+
+AC_SUBST(APREQ_DOTTED_VERSION)
+AC_SUBST(APREQ_MAJOR_VERSION)
+
+echo "APREQ Version: ${APREQ_DOTTED_VERSION}"
+
+dnl Enable the layout handling code, then reparse the prefix-style
+dnl arguments due to autoconf being a PITA.
+APR_ENABLE_LAYOUT(apreq)
+APR_PARSE_ARGUMENTS
+
+dnl load os-specific hints for apr-util
+APREQ_PRELOAD
+
+dnl
+dnl set up the compilation flags and stuff
+dnl
+
+APREQ_INCLUDES=""
+APREQ_PRIV_INCLUDES="-I$top_builddir/include -I$top_builddir/include/private"
+if test -n "$USE_VPATH"; then
+    APREQ_PRIV_INCLUDES="$APRUTIL_PRIV_INCLUDES -I$abs_srcdir/include/private -I$abs_srcdir/include"
+fi
+
+dnl
+dnl Find the APR includes directory and (possibly) the source (base) dir.
+dnl
+APREQ_FIND_APR
+
+dnl
+dnl even though we use apr_rules.mk for building apr-util, we need
+dnl to grab CC and CPP ahead of time so that apr-util config tests
+dnl use the same compiler as APR; we need the same compiler options
+dnl and feature test macros as well
+dnl
+APR_SETIFNULL(CC, `$apr_config --cc`)
+APR_SETIFNULL(CPP, `$apr_config --cpp`)
+APR_ADDTO(CFLAGS, `$apr_config --cflags`)
+APR_ADDTO(CPPFLAGS, `$apr_config --cppflags`)
+
+
+APREQ_FIND_APU
+
+so_ext=$APR_SO_EXT
+lib_target=$APR_LIB_TARGET
+AC_SUBST(so_ext)
+AC_SUBST(lib_target)
+
+APREQ_LIBNAME="apreq2"
+AC_SUBST(APREQ_LIBNAME)
+
+dnl
+dnl Prep all the flags and stuff for compilation and export to other builds
+dnl
+APR_ADDTO(APREQ_LIBS, [$APR_LIBS])
+APR_ADDTO(APREQ_LIBS, [$APU_LIBS])
+
+AC_SUBST(APREQ_EXPORT_LIBS)
+AC_SUBST(APREQ_PRIV_INCLUDES)
+AC_SUBST(APREQ_INCLUDES)
+AC_SUBST(APREQ_LDFLAGS)
+AC_SUBST(APREQ_LIBS)
+AC_SUBST(LDFLAGS)
+
+dnl copy apr's rules.mk into our build directory.
+if test ! -d ./build; then
+   $mkdir_p build
+fi
+cp $APR_BUILD_DIR/apr_rules.mk $abs_builddir/build/rules.mk
+
+dnl
+dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles
+dnl
+case "$host_alias" in
+*bsdi* | BSD/OS)
+    # Check whether they've installed GNU make
+    if make --version > /dev/null 2>&1; then
+        INCLUDE_RULES="include $abs_builddir/build/rules.mk"
+        INCLUDE_OUTPUTS="include $abs_srcdir/build-outputs.mk"
+    else
+        INCLUDE_RULES=".include \"$abs_builddir/build/rules.mk\""
+        INCLUDE_OUTPUTS=".include \"$abs_srcdir/build-outputs.mk\""
+    fi
+    ;;
+*)
+    INCLUDE_RULES="include $abs_builddir/build/rules.mk"
+    INCLUDE_OUTPUTS="include $abs_srcdir/build-outputs.mk"
+    ;;
+esac
+AC_SUBST(INCLUDE_RULES)
+AC_SUBST(INCLUDE_OUTPUTS)
+
+for d in include include/private; do
+    test -d $top_builddir/$d || mkdir $top_builddir/$d
+done
+
+AC_CONFIG_FILES([Makefile export_vars.sh])
+
+AC_OUTPUT

Propchange: httpd/apreq/branches/apr-build-system/configure.in
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpd/apreq/branches/apr-build-system/include/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Feb 24 10:56:34 2006
@@ -0,0 +1,2 @@
+apreq_config.h.in
+apreq_config.h

Added: httpd/apreq/branches/apr-build-system/include/apreq.h
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/apr-build-system/include/apreq.h?rev=380784&view=auto
==============================================================================
--- httpd/apreq/branches/apr-build-system/include/apreq.h (added)
+++ httpd/apreq/branches/apr-build-system/include/apreq.h Fri Feb 24 10:56:34 2006
@@ -0,0 +1,286 @@
+/*
+**  Copyright 2003-2006  The Apache Software Foundation
+**
+**  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 APREQ_H
+#define APREQ_H
+
+#ifdef APREQ_DEBUG
+#include <assert.h>
+#endif
+
+#include "apr_tables.h"
+#include <stddef.h>
+
+#ifdef  __cplusplus
+ extern "C" {
+#endif
+
+/**
+ * @file apreq.h
+ * @brief Main header file...
+ * @ingroup libapreq2
+ *
+ * Define the generic APREQ_ macros and common data structures.
+ */
+
+#ifndef WIN32
+/**
+ * The public APREQ functions are declared with APREQ_DECLARE(), so they may
+ * use the most appropriate calling convention.  Public APR functions with 
+ * variable arguments must use APR_DECLARE_NONSTD().
+ *
+ * @remark Both the declaration and implementations must use the same macro.
+ */
+/** APREQ_DECLARE(rettype) apeq_func(args)
+ */
+#define APREQ_DECLARE(d)                APR_DECLARE(d)
+/**
+ * The public APEQ functions using variable arguments are declared with 
+ * APEQ_DECLARE_NONSTD(), as they must follow the C language calling convention.
+ * @see APEQ_DECLARE @see APEQ_DECLARE_DATA
+ * @remark Both the declaration and implementations must use the same macro.
+ * @example
+ */
+/** APEQ_DECLARE_NONSTD(rettype) apr_func(args, ...);
+ */
+#define APREQ_DECLARE_NONSTD(d)         APR_DECLARE_NONSTD(d)
+/**
+ * The public APREQ variables are declared with APREQ_DECLARE_DATA.
+ * This assures the appropriate indirection is invoked at compile time.
+ * @see APREQ_DECLARE @see APREQ_DECLARE_NONSTD
+ * @remark Note that the declaration and implementations use different forms,
+ * but both must include the macro.
+ */
+/** extern APREQ_DECLARE_DATA type apr_variable;\n
+ * APREQ_DECLARE_DATA type apr_variable = value;
+ */
+#define APREQ_DECLARE_DATA
+#else
+#define APREQ_DECLARE(type)             __declspec(dllexport) type __stdcall
+#define APREQ_DECLARE_NONSTD(type)      __declspec(dllexport) type
+#define APREQ_DECLARE_DATA              __declspec(dllexport)
+#endif
+
+/**
+ * Read chucks of data in 64k blocks from the request 
+ */
+
+#define APREQ_DEFAULT_READ_BLOCK_SIZE   (64  * 1024)
+
+/**
+ * Maximum number of bytes mod_apreq2 will send off to libapreq2 for parsing. 
+ * mod_apreq2 will log this event and subsequently remove itself 
+ * from the filter chain.  
+ * @see ap_set_read_limit  
+ */
+#define APREQ_DEFAULT_READ_LIMIT        (64 * 1024 * 1024)
+/**
+ * Maximum number of bytes mod_apreq2 will let accumulate within the 
+ * heap-buckets in a brigade. Excess data will be spooled to an 
+ * appended file bucket
+ * @see ap_set_brigade_read_limit
+ */
+#define APREQ_DEFAULT_BRIGADE_LIMIT     (256 * 1024)
+
+/**
+ * Number of elements in the initial apr_table
+ * @see apr_table_make
+ */
+#define APREQ_DEFAULT_NELTS              8
+
+
+
+/**
+ * Check to see if specified bit f is off in bitfiled name
+ */
+#define APREQ_FLAGS_OFF(f, name) ((f) &= ~(name##_MASK << name##_BIT))
+/**
+ * Check to see if specified bit f is on in bitfiled name
+ */
+#define APREQ_FLAGS_ON(f, name)  ((f) |=  (name##_MASK << name##_BIT))
+/**
+ *  Get specified bit f in bitfiled name
+ */
+#define APREQ_FLAGS_GET(f, name) (((f) >> name##_BIT) & name##_MASK)
+/**
+ * Set specified bit f in bitfiled name to value 
+ * Note the below BIT/Mask defines are used sans the
+ * _BIT, _MASK because of the this define's \#\#_MASK, \#\#_BIT usage.
+ * Each come in a pair
+ */
+#define APREQ_FLAGS_SET(f, name, value)                 \
+    ((f) = (((f) & ~(name##_MASK << name##_BIT))        \
+            | ((name##_MASK & (value)) << name##_BIT)))
+
+/**
+ * Charset Bit 
+ * @see APREQ_FLAGS_OFF @see APREQ_FLAGS_ON
+ * @see APREQ_FLAGS_GET @see APREQ_FLAGS_SET
+ */
+#define APREQ_CHARSET_BIT           0
+
+/**
+ * Charset Mask
+ * @see APREQ_FLAGS_OFF @see APREQ_FLAGS_ON
+ * @see APREQ_FLAGS_GET @see APREQ_FLAGS_SET
+ */
+#define APREQ_CHARSET_MASK        255
+
+/**
+ * Tainted Bit 
+ * @see APREQ_FLAGS_OFF @see APREQ_FLAGS_ON
+ * @see APREQ_FLAGS_GET @see APREQ_FLAGS_SET
+ */
+#define APREQ_TAINTED_BIT           8
+/**
+ * Tainted Mask
+ * @see APREQ_FLAGS_OFF @see APREQ_FLAGS_ON
+ * @see APREQ_FLAGS_GET @see APREQ_FLAGS_SET
+ */
+#define APREQ_TAINTED_MASK          1
+
+/**
+ * Cookier Version Bit
+ * @see APREQ_FLAGS_OFF @see APREQ_FLAGS_ON
+ * @see APREQ_FLAGS_GET @see APREQ_FLAGS_SET
+ */
+
+#define APREQ_COOKIE_VERSION_BIT   11
+/**
+ * Cookie Version Mask
+ * @see APREQ_FLAGS_OFF @see APREQ_FLAGS_ON
+ * @see APREQ_FLAGS_GET @see APREQ_FLAGS_SET
+ */
+#define APREQ_COOKIE_VERSION_MASK   3
+
+/**
+ * Cookie's Secure Bit 
+ * @see APREQ_FLAGS_OFF @see APREQ_FLAGS_ON
+ * @see APREQ_FLAGS_GET @see APREQ_FLAGS_SET
+ */
+#define APREQ_COOKIE_SECURE_BIT    13
+/**
+ * Cookie's Secure Mask
+ * @see APREQ_FLAGS_OFF @see APREQ_FLAGS_ON
+ * @see APREQ_FLAGS_GET @see APREQ_FLAGS_SET
+ */
+#define APREQ_COOKIE_SECURE_MASK    1
+
+/** Character encodings. */
+typedef enum {
+    APREQ_CHARSET_ASCII  =0,
+    APREQ_CHARSET_LATIN1 =1, /* ISO-8859-1   */
+    APREQ_CHARSET_CP1252 =2, /* Windows-1252 */
+    APREQ_CHARSET_UTF8   =8
+} apreq_charset_t;
+
+
+/** @enum apreq_join_t Join type */
+typedef enum {
+    APREQ_JOIN_AS_IS,      /**< Join the strings without modification */
+    APREQ_JOIN_ENCODE,     /**< Url-encode the strings before joining them */
+    APREQ_JOIN_DECODE,     /**< Url-decode the strings before joining them */
+    APREQ_JOIN_QUOTE       /**< Quote the strings, backslashing existing quote marks. */
+} apreq_join_t;
+
+/** @enum apreq_match_t Match type */
+typedef enum {
+    APREQ_MATCH_FULL,       /**< Full match only. */
+    APREQ_MATCH_PARTIAL     /**< Partial matches are ok. */
+} apreq_match_t;
+
+/** @enum apreq_expires_t Expiration date format */
+typedef enum {
+    APREQ_EXPIRES_HTTP,       /**< Use date formatting consistent with RFC 2616 */
+    APREQ_EXPIRES_NSCOOKIE    /**< Use format consistent with Netscape's Cookie Spec */
+} apreq_expires_t;
+
+
+/** @brief libapreq's pre-extensible string type */
+typedef struct apreq_value_t {
+    char             *name;    /**< value name */
+    apr_size_t        nlen;    /**< length of name */
+    apr_size_t        dlen;    /**< length of data */
+    char              data[1]; /**< value data  */
+} apreq_value_t;
+
+/**
+ * Adds the specified apreq_value_t to the apr_table_t.
+ *
+ * @param v value to add
+ * @param t add v to this table
+ *
+ * @return void
+ *
+ * @ see apr_table_t @see apr_value_t
+ */
+  
+static APR_INLINE
+void apreq_value_table_add(const apreq_value_t *v, apr_table_t *t) {
+    apr_table_addn(t, v->name, v->data);
+}
+
+/**
+ * @param T type
+ * @param A attribute
+ * @param P
+ *
+ * XXX
+ */
+#define apreq_attr_to_type(T,A,P) ( (T*) ((char*)(P)-offsetof(T,A)) )
+
+/**
+ * Initialize libapreq2. Applications (except apache modules using
+ * mod_apreq) should call this exactly once before they use any
+ * libapreq2 modules.  If you want to modify the list of default parsers
+ * with apreq_register_parser(), please use apreq_pre_initialize()
+ * and apreq_post_initialize() instead.
+ *
+ * @param pool a base pool persisting while libapreq2 is used
+ * @remarks after you detroy the pool, you have to call this function again
+ *    with a new pool if you still plan to use libapreq2
+ */
+APREQ_DECLARE(apr_status_t) apreq_initialize(apr_pool_t *pool);
+
+
+/**
+ * Pre-initialize libapreq2. Applications (except apache modules using
+ * mod_apreq2) should call this exactly once before they register custom
+ * parsers with libapreq2. mod_apreq2 does this automatically during the
+ * post-config phase, so modules that need call apreq_register_parser should
+ * create a post-config hook using APR_HOOK_MIDDLE.
+ *
+ * @param pool a base pool persisting while libapreq2 is used
+ * @remarks after you detroyed the pool, you have to call this function again
+ *    with a new pool if you still plan to use libapreq2
+ */
+APREQ_DECLARE(apr_status_t) apreq_pre_initialize(apr_pool_t *pool);
+
+/**
+ * Post-initialize libapreq2. Applications (except apache modules using
+ * mod_apreq2) should this exactly once before they use any
+ * libapreq2 modules for parsing.
+ *
+ * @param pool the same pool that was used in apreq_pre_initialize().
+ */
+APREQ_DECLARE(apr_status_t) apreq_post_initialize(apr_pool_t *pool);
+
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* APREQ_H */

Propchange: httpd/apreq/branches/apr-build-system/include/apreq.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: httpd/apreq/branches/apr-build-system/include/apreq_cookie.h
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/apr-build-system/include/apreq_cookie.h?rev=380784&view=auto
==============================================================================
--- httpd/apreq/branches/apr-build-system/include/apreq_cookie.h (added)
+++ httpd/apreq/branches/apr-build-system/include/apreq_cookie.h Fri Feb 24 10:56:34 2006
@@ -0,0 +1,215 @@
+/*
+**  Copyright 2003-2006  The Apache Software Foundation
+**
+**  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 APREQ_COOKIE_H
+#define APREQ_COOKIE_H
+
+#include "apreq.h"
+#include "apr_time.h"
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file apreq_cookie.h
+ * @brief Cookies and Jars.
+ * @ingroup libapreq2
+ *
+ * apreq_cookie.h describes a common server-side API for request (incoming)
+ * and response (outgoing) cookies.  It aims towards compliance with the
+ * standard cookie specifications listed below.
+ *
+ * @see http://wp.netscape.com/newsref/std/cookie_spec.html
+ * @see http://www.ietf.org/rfc/rfc2109.txt
+ * @see http://www.ietf.org/rfc/rfc2964.txt
+ * @see http://www.ietf.org/rfc/rfc2965.txt
+ *
+ */
+
+/** @todo convert this macro to an apreq_module_t method.
+ *
+ * Maximum length of a single Set-Cookie(2) header.
+ */
+#define APREQ_COOKIE_MAX_LENGTH            4096
+
+/** @brief Cookie type, supporting both Netscape and RFC cookie specifications.
+ */
+
+typedef struct apreq_cookie_t {
+
+    char           *path;        /**< Restricts url path */
+    char           *domain;      /**< Restricts server domain */
+    char           *port;        /**< Restricts server port */
+    char           *comment;     /**< RFC cookies may send a comment */
+    char           *commentURL;  /**< RFC cookies may place an URL here */
+    apr_time_t      max_age;     /**< total duration of cookie: -1 == session */
+    unsigned        flags;       /**< charsets, taint marks, app-specific bits */
+    const apreq_value_t   v;     /**< "raw" cookie value */
+
+} apreq_cookie_t;
+
+
+/** Upgrades a jar's table values to apreq_cookie_t structs. */
+static APR_INLINE
+apreq_cookie_t *apreq_value_to_cookie(const char *val)
+{
+    union { const char *in; char *out; } deconst;
+
+    deconst.in = val;
+    return apreq_attr_to_type(apreq_cookie_t, v,
+           apreq_attr_to_type(apreq_value_t, data, deconst.out));
+}
+
+/**@return 1 if this is an RFC cookie, 0 if its a Netscape cookie. */
+static APR_INLINE
+unsigned apreq_cookie_version(const apreq_cookie_t *c) {
+    return APREQ_FLAGS_GET(c->flags, APREQ_COOKIE_VERSION);
+}
+
+/** Sets the cookie's protocol version. */
+static APR_INLINE
+void apreq_cookie_version_set(apreq_cookie_t *c, unsigned v) {
+    APREQ_FLAGS_SET(c->flags, APREQ_COOKIE_VERSION, v);
+}
+
+/** @return 1 if the secure flag is set, 0 otherwise. */
+static APR_INLINE
+unsigned apreq_cookie_is_secure(const apreq_cookie_t *c) {
+    return APREQ_FLAGS_GET(c->flags, APREQ_COOKIE_SECURE);
+}
+
+/** Sets the cookie's secure flag, meaning it only
+ *  comes back over an SSL-encrypted connction.
+ */
+static APR_INLINE
+void apreq_cookie_secure_on(apreq_cookie_t *c) {
+    APREQ_FLAGS_ON(c->flags, APREQ_COOKIE_SECURE);
+}
+
+/** Turns off the cookie's secure flag. */
+static APR_INLINE
+void apreq_cookie_secure_off(apreq_cookie_t *c) {
+    APREQ_FLAGS_OFF(c->flags, APREQ_COOKIE_SECURE);
+}
+
+
+/** @return 1 if the taint flag is set, 0 otherwise. */
+static APR_INLINE
+unsigned apreq_cookie_is_tainted(const apreq_cookie_t *c) {
+    return APREQ_FLAGS_GET(c->flags, APREQ_TAINTED);
+}
+
+/** Sets the cookie's tainted flag. */
+static APR_INLINE
+void apreq_cookie_tainted_on(apreq_cookie_t *c) {
+    APREQ_FLAGS_ON(c->flags, APREQ_TAINTED);
+}
+
+/** Turns off the cookie's tainted flag. */
+static APR_INLINE
+void apreq_cookie_tainted_off(apreq_cookie_t *c) {
+    APREQ_FLAGS_OFF(c->flags, APREQ_TAINTED);
+}
+
+/**
+ * Parse a cookie header and store the cookies in an apr_table_t.
+ *
+ * @param pool pool which allocates the cookies
+ * @param jar table where parsed cookies are stored
+ * @param header the header value
+ *
+ * @return APR_SUCCESS.
+ * @return ::APREQ_ERROR_BADSEQ if an unparseable character sequence appears.
+ * @return ::APREQ_ERROR_MISMATCH if an rfc-cookie attribute appears in a
+ *         netscape cookie header.
+ * @return ::APR_ENOTIMPL if an unrecognized rfc-cookie attribute appears.
+ * @return ::APREQ_ERROR_NOTOKEN if a required token was not present.
+ * @return ::APREQ_ERROR_BADCHAR if an unexpected token was present.
+ */
+APREQ_DECLARE(apr_status_t) apreq_parse_cookie_header(apr_pool_t *pool,
+                                                      apr_table_t *jar,
+                                                      const char *header);
+
+/**
+ * Returns a new cookie, made from the argument list.
+ *
+ * @param pool  Pool which allocates the cookie.
+ * @param name  The cookie's name.
+ * @param nlen  Length of name.
+ * @param value The cookie's value.
+ * @param vlen  Length of value.
+ *
+ * @return the new cookie
+ */
+APREQ_DECLARE(apreq_cookie_t *) apreq_cookie_make(apr_pool_t *pool,
+                                                  const char *name,
+                                                  const apr_size_t nlen,
+                                                  const char *value,
+                                                  const apr_size_t vlen);
+
+/**
+ * Returns a string that represents the cookie as it would appear
+ * in a valid "Set-Cookie*" header.
+ *
+ * @param c cookie.
+ * @param p pool which allocates the returned string.
+ *
+ * @return header string.
+ */
+APREQ_DECLARE(char*) apreq_cookie_as_string(const apreq_cookie_t *c,
+                                            apr_pool_t *p);
+
+
+/**
+ * Same functionality as apreq_cookie_as_string.  Stores the string
+ * representation in buf, using up to len bytes in buf as storage.
+ * The return value has the same semantics as that of apr_snprintf,
+ * including the special behavior for a "len = 0" argument.
+ *
+ * @param c   cookie.
+ * @param buf storage location for the result.
+ * @param len size of buf's storage area.
+ *
+ * @return size of resulting header string.
+ */
+APREQ_DECLARE(int) apreq_cookie_serialize(const apreq_cookie_t *c,
+                                          char *buf, apr_size_t len);
+
+/**
+ * Set the Cookie's expiration date.
+ *
+ * @param c The cookie.
+ * @param time_str If NULL, the Cookie's expiration date is unset,
+ * making it a session cookie.  This means no "expires" or "max-age"
+ * attribute will appear in the cookie's serialized form. If time_str
+ * is not NULL, the expiration date will be reset to the offset (from now)
+ * represented by time_str.  The time_str should be in a format that
+ * apreq_atoi64t() can understand, namely /[+-]?\\d+\\s*[YMDhms]/.
+ *
+ * @remarks Now time_str may also be a fixed date; see apr_date_parse_rfc()
+ * for admissible formats.
+ */
+APREQ_DECLARE(void) apreq_cookie_expires(apreq_cookie_t *c,
+                                         const char *time_str);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /*APREQ_COOKIE_H*/
+
+

Propchange: httpd/apreq/branches/apr-build-system/include/apreq_cookie.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: httpd/apreq/branches/apr-build-system/include/apreq_error.h
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/apr-build-system/include/apreq_error.h?rev=380784&view=auto
==============================================================================
--- httpd/apreq/branches/apr-build-system/include/apreq_error.h (added)
+++ httpd/apreq/branches/apr-build-system/include/apreq_error.h Fri Feb 24 10:56:34 2006
@@ -0,0 +1,96 @@
+/*
+**  Copyright 2003-2006  The Apache Software Foundation
+**
+**  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 APREQ_ERROR_H
+#define APREQ_ERROR_H
+
+#include "apr_errno.h"
+#include "apreq.h"
+
+#ifdef  __cplusplus
+ extern "C" {
+#endif
+
+/**
+ * apreq's wrapper around apr_strerror();
+ * recognizes APREQ_ERROR_* status codes.
+ */
+APREQ_DECLARE(char *)
+apreq_strerror(apr_status_t s, char *buf, apr_size_t bufsize);
+
+/**
+ * @file apreq_error.h
+ * @brief Error status codes.
+ * @ingroup libapreq2
+ *
+ * Define the APREQ_ error codes.
+ */
+
+#ifndef APR_EBADARG
+/**
+ * Bad Arguments return value
+ * @see APR_BADARG
+ */
+#define APR_EBADARG                APR_BADARG   /* XXX: don't use APR_BADARG */
+#endif
+
+/** Internal apreq error. */
+#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
+/** Attempted to perform unsafe action with tainted data. */
+#define APREQ_ERROR_TAINTED        (APREQ_ERROR_GENERAL + 1)
+/** Parsing interrupted. */
+#define APREQ_ERROR_INTERRUPT      (APREQ_ERROR_GENERAL + 2)
+
+/** Invalid input data. */
+#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
+/** Invalid character. */
+#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
+/** Invalid byte sequence. */
+#define APREQ_ERROR_BADSEQ         (APREQ_ERROR_BADDATA  +  2)
+/** Invalid attribute. */
+#define APREQ_ERROR_BADATTR        (APREQ_ERROR_BADDATA  +  3)
+/** Invalid header. */
+#define APREQ_ERROR_BADHEADER      (APREQ_ERROR_BADDATA  +  4)
+/** Invalid utf8 encoding. */
+#define APREQ_ERROR_BADUTF8        (APREQ_ERROR_BADDATA  +  5)
+
+/** Missing input data. */
+#define APREQ_ERROR_NODATA         (APREQ_ERROR_GENERAL  + 20)
+/** Missing required token. */
+#define APREQ_ERROR_NOTOKEN        (APREQ_ERROR_NODATA   +  1)
+/** Missing attribute. */
+#define APREQ_ERROR_NOATTR         (APREQ_ERROR_NODATA   +  2)
+/** Missing header. */
+#define APREQ_ERROR_NOHEADER       (APREQ_ERROR_NODATA   +  3)
+/** Missing parser. */
+#define APREQ_ERROR_NOPARSER       (APREQ_ERROR_NODATA   +  4)
+
+
+/** Conflicting information. */
+#define APREQ_ERROR_MISMATCH       (APREQ_ERROR_GENERAL  + 30)
+/** Exceeds configured maximum limit. */
+#define APREQ_ERROR_OVERLIMIT      (APREQ_ERROR_MISMATCH +  1)
+/** Below configured minimum limit. */
+#define APREQ_ERROR_UNDERLIMIT     (APREQ_ERROR_MISMATCH +  2)
+/** Setting already configured. */
+#define APREQ_ERROR_NOTEMPTY       (APREQ_ERROR_MISMATCH +  3)
+
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* APREQ_ERROR_H */

Propchange: httpd/apreq/branches/apr-build-system/include/apreq_error.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: httpd/apreq/branches/apr-build-system/include/apreq_module.h
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/apr-build-system/include/apreq_module.h?rev=380784&view=auto
==============================================================================
--- httpd/apreq/branches/apr-build-system/include/apreq_module.h (added)
+++ httpd/apreq/branches/apr-build-system/include/apreq_module.h Fri Feb 24 10:56:34 2006
@@ -0,0 +1,456 @@
+/*
+**  Copyright 2003-2006  The Apache Software Foundation
+**
+**  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 APREQ_MODULE_H
+#define APREQ_MODULE_H
+
+#include "apreq_cookie.h"
+#include "apreq_parser.h"
+#include "apreq_error.h"
+
+#ifdef  __cplusplus
+ extern "C" {
+#endif
+
+/**
+ * @file apreq_module.h
+ * @brief Module API
+ * @ingroup libapreq2
+ */
+
+
+/**
+ * An apreq handle associated with a module. The structure
+ * may have variable size, because the module may append its own data
+ * structures after it.
+ */
+typedef struct apreq_handle_t {
+    /** the apreq module which implements this handle */
+    const struct apreq_module_t *module;
+    /** the pool which defines the lifetime of the parsed data */
+    apr_pool_t *pool;
+    /** the allocator, which persists at least as long as the pool */
+    apr_bucket_alloc_t *bucket_alloc;
+
+} apreq_handle_t;
+
+/**
+ * @brief Vtable describing the necessary environment functions.
+ */
+
+
+typedef struct apreq_module_t {
+    /** name of this apreq module */
+    const char *name;
+    /** magic number identifying the module and version */
+    apr_uint32_t magic_number;
+
+    /** get a table with all cookies */
+    apr_status_t (*jar)(apreq_handle_t *, const apr_table_t **);
+    /** get a table with all query string parameters */
+    apr_status_t (*args)(apreq_handle_t *, const apr_table_t **);
+    /** get a table with all body parameters */
+    apr_status_t (*body)(apreq_handle_t *, const apr_table_t **);
+
+    /** get a cookie by its name */
+    apreq_cookie_t *(*jar_get)(apreq_handle_t *, const char *);
+    /** get a query string parameter by its name */
+    apreq_param_t *(*args_get)(apreq_handle_t *, const char *);
+    /** get a body parameter by its name */
+    apreq_param_t *(*body_get)(apreq_handle_t *, const char *);
+
+    /** gets the parser associated with the request body */
+    apr_status_t (*parser_get)(apreq_handle_t *, const apreq_parser_t **);
+    /** manually set a parser for the request body */
+    apr_status_t (*parser_set)(apreq_handle_t *, apreq_parser_t *);
+    /** add a hook function */
+    apr_status_t (*hook_add)(apreq_handle_t *, apreq_hook_t *);
+
+    /** determine the maximum in-memory bytes a brigade may use */
+    apr_status_t (*brigade_limit_get)(apreq_handle_t *, apr_size_t *);
+    /** set the maximum in-memory bytes a brigade may use */
+    apr_status_t (*brigade_limit_set)(apreq_handle_t *, apr_size_t);
+
+    /** determine the maximum amount of data that will be fed into a parser */
+    apr_status_t (*read_limit_get)(apreq_handle_t *, apr_uint64_t *);
+    /** set the maximum amount of data that will be fed into a parser */
+    apr_status_t (*read_limit_set)(apreq_handle_t *, apr_uint64_t);
+
+    /** determine the directory used by the parser for temporary files */
+    apr_status_t (*temp_dir_get)(apreq_handle_t *, const char **);
+    /** set the directory used by the parser for temporary files */
+    apr_status_t (*temp_dir_set)(apreq_handle_t *, const char *);
+
+} apreq_module_t;
+
+
+/**
+ * Defines the module-specific status codes which
+ * are commonly considered to be non-fatal.
+ *
+ * @param s status code returned by an apreq_module_t method.
+ *
+ * @return 1 if s is fatal, 0 otherwise.
+ */
+static APR_INLINE
+unsigned apreq_module_status_is_error(apr_status_t s) {
+    switch (s) {
+    case APR_SUCCESS:
+    case APR_INCOMPLETE:
+    case APR_EINIT:
+    case APREQ_ERROR_NODATA:
+    case APREQ_ERROR_NOPARSER:
+    case APREQ_ERROR_NOHEADER:
+        return 0;
+    default:
+        return 1;
+    }
+}
+
+
+/**
+ * Expose the parsed "cookie" header associated to this handle.
+ *
+ * @param req The request handle
+ * @param t   The resulting table, which will either be NULL or a
+ *            valid table object on return.
+ *
+ * @return    APR_SUCCESS or a module-specific error status code.
+ */
+static APR_INLINE
+apr_status_t apreq_jar(apreq_handle_t *req, const apr_table_t **t)
+{
+    return req->module->jar(req,t);
+}
+
+/**
+ * Expose the parsed "query string" associated to this handle.
+ *
+ * @param req The request handle
+ * @param t   The resulting table, which will either be NULL or a
+ *            valid table object on return.
+ *
+ * @return    APR_SUCCESS or a module-specific error status code.
+ */
+static APR_INLINE
+apr_status_t apreq_args(apreq_handle_t *req, const apr_table_t **t)
+{
+    return req->module->args(req,t);
+}
+
+/**
+ * Expose the parsed "request body" associated to this handle.
+ *
+ * @param req The request handle
+ * @param t   The resulting table, which will either be NULL or a
+ *            valid table object on return.
+ *
+ * @return    APR_SUCCESS or a module-specific error status code.
+ */
+static APR_INLINE
+apr_status_t apreq_body(apreq_handle_t *req, const apr_table_t **t)
+{
+    return req->module->body(req, t);
+}
+
+
+/**
+ * Fetch the first cookie with the given name.
+ *
+ * @param req  The request handle
+ * @param name Case-insensitive cookie name.
+ *
+ * @return     First matching cookie, or NULL if none match.
+ */
+static APR_INLINE
+apreq_cookie_t *apreq_jar_get(apreq_handle_t *req, const char *name)
+{
+    return req->module->jar_get(req, name);
+}
+
+/**
+ * Fetch the first query string param with the given name.
+ *
+ * @param req  The request handle
+ * @param name Case-insensitive param name.
+ *
+ * @return     First matching param, or NULL if none match.
+ */
+static APR_INLINE
+apreq_param_t *apreq_args_get(apreq_handle_t *req, const char *name)
+{
+    return req->module->args_get(req, name);
+}
+
+/**
+ * Fetch the first body param with the given name.
+ *
+ * @param req  The request handle
+ * @param name Case-insensitive cookie name.
+ *
+ * @return     First matching param, or NULL if none match.
+ */
+static APR_INLINE
+apreq_param_t *apreq_body_get(apreq_handle_t *req, const char *name)
+{
+    return req->module->body_get(req, name);
+}
+
+/**
+ * Fetch the active body parser.
+ *
+ * @param req    The request handle
+ * @param parser Points to the active parser on return.
+ *
+ * @return       APR_SUCCESS or module-specific error.
+ *
+ */
+static APR_INLINE
+apr_status_t apreq_parser_get(apreq_handle_t *req,
+                              const apreq_parser_t **parser)
+{
+    return req->module->parser_get(req, parser);
+}
+
+
+/**
+ * Set the body parser for this request.
+ *
+ * @param req    The request handle
+ * @param parser New parser to use.
+ *
+ * @return       APR_SUCCESS or module-specific error.
+ */
+static APR_INLINE
+apr_status_t apreq_parser_set(apreq_handle_t *req,
+                              apreq_parser_t *parser)
+{
+    return req->module->parser_set(req, parser);
+}
+
+/**
+ * Add a parser hook for this request.
+ *
+ * @param req  The request handle
+ * @param hook Hook to add.
+ *
+ * @return     APR_SUCCESS or module-specific error.
+ */
+static APR_INLINE
+apr_status_t apreq_hook_add(apreq_handle_t *req, apreq_hook_t *hook)
+{
+    return req->module->hook_add(req, hook);
+}
+
+
+/**
+ * Set the active brigade limit.
+ *
+ * @param req   The handle.
+ * @param bytes New limit to use.
+ *
+ * @return APR_SUCCESS or module-specific error.
+ *
+ */
+static APR_INLINE
+apr_status_t apreq_brigade_limit_set(apreq_handle_t *req,
+                                     apr_size_t bytes)
+{
+    return req->module->brigade_limit_set(req, bytes);
+}
+
+/**
+ * Get the active brigade limit.
+ *
+ * @param req   The handle.
+ * @param bytes Pointer to resulting (current) limit.
+ *
+ * @return APR_SUCCESS or a module-specific error,
+ *         which may leave bytes undefined.
+ */
+static APR_INLINE
+apr_status_t apreq_brigade_limit_get(apreq_handle_t *req,
+                                     apr_size_t *bytes)
+{
+    return req->module->brigade_limit_get(req, bytes);
+}
+
+/**
+ * Set the active read limit.
+ *
+ * @param req   The handle.
+ * @param bytes New limit to use.
+ *
+ * @return APR_SUCCESS or a module-specific error.
+ *
+ */
+static APR_INLINE
+apr_status_t apreq_read_limit_set(apreq_handle_t *req,
+                                  apr_uint64_t bytes)
+{
+    return req->module->read_limit_set(req, bytes);
+}
+
+/**
+ * Get the active read limit.
+ *
+ * @param req   The request handle.
+ * @param bytes Pointer to resulting (current) limit.
+ *
+ * @return APR_SUCCESS or a module-specific error,
+ *         which may leave bytes undefined.
+ */
+static APR_INLINE
+apr_status_t apreq_read_limit_get(apreq_handle_t *req,
+                                  apr_uint64_t *bytes)
+{
+    return req->module->read_limit_get(req, bytes);
+}
+
+/**
+ * Set the active temp directory.
+ *
+ * @param req  The handle.
+ * @param path New path to use; may be NULL.
+ *
+ * @return APR_SUCCESS or a module-specific error .
+ */
+static APR_INLINE
+apr_status_t apreq_temp_dir_set(apreq_handle_t *req, const char *path)
+{
+    return req->module->temp_dir_set(req, path);
+}
+
+/**
+ * Get the active temp directory.
+ *
+ * @param req   The handle.
+ * @param path  Resulting path to temp dir.
+ *
+ * @return APR_SUCCESS implies path is valid, but may also be NULL.
+ *         Any other return value is module-specific, and may leave
+ *         path undefined.
+ */
+static APR_INLINE
+apr_status_t apreq_temp_dir_get(apreq_handle_t *req, const char **path)
+{
+    return req->module->temp_dir_get(req, path);
+}
+
+
+
+/**
+ * Convenience macro for defining a module by mapping
+ * a function prefix to an associated apreq_module_t structure.
+ *
+ * @param pre Prefix to define new environment.  All attributes of
+ *            the apreq_env_module_t struct are defined with this as their
+ *            prefix. The generated struct is named by appending "_module" to
+ *            the prefix.
+ * @param mmn Magic number (i.e. version number) of this environment.
+ */
+#define APREQ_MODULE(pre, mmn) const apreq_module_t     \
+  pre##_module = { #pre, mmn,                           \
+  pre##_jar,        pre##_args,       pre##_body,       \
+  pre##_jar_get,    pre##_args_get,   pre##_body_get,   \
+  pre##_parser_get, pre##_parser_set, pre##_hook_add,   \
+  pre##_brigade_limit_get, pre##_brigade_limit_set,     \
+  pre##_read_limit_get,    pre##_read_limit_set,        \
+  pre##_temp_dir_get,      pre##_temp_dir_set,          \
+  }
+
+
+/**
+ * Create an apreq handle which is suitable for a CGI program. It
+ * reads input from stdin and writes output to stdout.
+ *
+ * @param pool Pool associated to this handle.
+ *
+ * @return New handle; can only be NULL if the pool allocation failed.
+ *
+ * @remarks The handle gets cached in the pool's userdata, so subsequent
+ *          calls will retrieve the original cached handle.
+ */
+APREQ_DECLARE(apreq_handle_t*) apreq_handle_cgi(apr_pool_t *pool);
+
+/**
+ * Create a custom apreq handle which knows only some static
+ * values. Useful if you want to test the parser code or if you have
+ * got data from a custom source (neither Apache 2 nor CGI).
+ *
+ * @param pool         allocates the parse data,
+ * @param query_string parsed into args table
+ * @param cookie       value of the request "Cookie" header
+ * @param parser       parses the request body
+ * @param read_limit   maximum bytes to read from the body
+ * @param in           brigade containing the request body
+ *
+ * @return new handle; can only be NULL if the pool allocation failed.
+ */
+APREQ_DECLARE(apreq_handle_t*) apreq_handle_custom(apr_pool_t *pool,
+                                                   const char *query_string,
+                                                   const char *cookie,
+                                                   apreq_parser_t *parser,
+                                                   apr_uint64_t read_limit,
+                                                   apr_bucket_brigade *in);
+
+/**
+ * Find the first query string parameter or body parameter with the
+ * specified name.  The match is case-insensitive.
+ *
+ * @param req request handle.
+ * @param key desired parameter name
+ *
+ * @return The first matching parameter (with args searched first) or NULL.
+ */
+APREQ_DECLARE(apreq_param_t *)apreq_param(apreq_handle_t *req, const char *key);
+
+/**
+ * Find the first cookie with the specified name.
+ * The match is case-insensitive.
+ *
+ * @param req request handle.
+ * @param name desired cookie name
+ *
+ * @return The first matching parameter (with args searched first) or NULL.
+ */
+#define apreq_cookie(req, name) apreq_jar_get(req, name)
+
+/**
+ * Returns a table containing key-value pairs for the full request
+ * (args + body).
+ *
+ * @param req request handle
+ * @param p   allocates the returned table.
+ *
+ * @return table representing all available params; is never NULL.
+ */
+APREQ_DECLARE(apr_table_t *) apreq_params(apreq_handle_t *req, apr_pool_t *p);
+
+
+/**
+ * Returns a table containing all request cookies.
+ *
+ * @param req the apreq request handle
+ * @param p Allocates the returned table.
+ */
+APREQ_DECLARE(apr_table_t *)apreq_cookies(apreq_handle_t *req, apr_pool_t *p);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* APREQ_MODULE_H */

Propchange: httpd/apreq/branches/apr-build-system/include/apreq_module.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: httpd/apreq/branches/apr-build-system/include/apreq_param.h
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/apr-build-system/include/apreq_param.h?rev=380784&view=auto
==============================================================================
--- httpd/apreq/branches/apr-build-system/include/apreq_param.h (added)
+++ httpd/apreq/branches/apr-build-system/include/apreq_param.h Fri Feb 24 10:56:34 2006
@@ -0,0 +1,208 @@
+/*
+**  Copyright 2003-2006  The Apache Software Foundation
+**
+**  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 APREQ_PARAM_H
+#define APREQ_PARAM_H
+
+#include "apreq.h"
+#include "apr_buckets.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+ * @file apreq_param.h
+ * @brief Request parsing and parameter API
+ * @ingroup libapreq2
+ */
+
+
+/** Common data structure for params and file uploads */
+typedef struct apreq_param_t {
+    apr_table_t         *info;   /**< header table associated with the param */
+    apr_bucket_brigade  *upload; /**< brigade used to spool upload files */
+    unsigned             flags;  /**< charsets, taint marks, app-specific bits */
+    const apreq_value_t  v;      /**< underlying name/value info */
+} apreq_param_t;
+
+
+/** @return 1 if the taint flag is set, 0 otherwise. */
+static APR_INLINE
+unsigned apreq_param_is_tainted(const apreq_param_t *p) {
+    return APREQ_FLAGS_GET(p->flags, APREQ_TAINTED);
+}
+
+/** Sets the tainted flag. */
+static APR_INLINE
+void apreq_param_tainted_on(apreq_param_t *p) {
+    APREQ_FLAGS_ON(p->flags, APREQ_TAINTED);
+}
+
+/** Turns off the taint flag. */
+static APR_INLINE
+void apreq_param_tainted_off(apreq_param_t *p) {
+    APREQ_FLAGS_OFF(p->flags, APREQ_TAINTED);
+}
+
+/** Sets the character encoding for this parameter. */
+static APR_INLINE
+apreq_charset_t apreq_param_charset_set(apreq_param_t *p, apreq_charset_t c) {
+    apreq_charset_t old = (apreq_charset_t)
+        APREQ_FLAGS_GET(p->flags, APREQ_CHARSET);
+    APREQ_FLAGS_SET(p->flags, APREQ_CHARSET, c);
+    return old;
+}
+
+/** Gets the character encoding for this parameter. */
+static APR_INLINE
+apreq_charset_t apreq_param_charset_get(apreq_param_t *p) {
+    return (apreq_charset_t)APREQ_FLAGS_GET(p->flags, APREQ_CHARSET);
+}
+
+
+/** Upgrades args and body table values to apreq_param_t structs. */
+static APR_INLINE
+apreq_param_t *apreq_value_to_param(const char *val)
+{
+    union { const char *in; char *out; } deconst;
+
+    deconst.in = val;
+    return apreq_attr_to_type(apreq_param_t, v,
+           apreq_attr_to_type(apreq_value_t, data, deconst.out));
+}
+
+
+
+/** creates a param from name/value information */
+APREQ_DECLARE(apreq_param_t *) apreq_param_make(apr_pool_t *p,
+                                                const char *name,
+                                                const apr_size_t nlen,
+                                                const char *val,
+                                                const apr_size_t vlen);
+
+/**
+ * Url-decodes a name=value pair into a param.
+ *
+ * @param param points to the decoded parameter on success
+ * @param pool  Pool from which the param is allocated.
+ * @param word  Start of the name=value pair.
+ * @param nlen  Length of urlencoded name.
+ * @param vlen  Length of urlencoded value.
+ *
+ * @return APR_SUCCESS on success.
+ * @return ::APREQ_ERROR_BADSEQ or ::APREQ_ERROR_BADCHAR on malformed input.
+ *
+ * @remarks     Unless vlen == 0, this function assumes there is
+ *              exactly one character ('=') which separates the pair.
+ *
+ */
+APREQ_DECLARE(apr_status_t) apreq_param_decode(apreq_param_t **param,
+                                               apr_pool_t *pool,
+                                               const char *word,
+                                               apr_size_t nlen,
+                                               apr_size_t vlen);
+
+/**
+ * Url-encodes the param into a name-value pair.
+ * @param pool Pool which allocates the returned string.
+ * @param param Param to encode.
+ * @return name-value pair representing the param.
+ */
+APREQ_DECLARE(char *) apreq_param_encode(apr_pool_t *pool,
+                                         const apreq_param_t *param);
+
+/**
+ * Parse a url-encoded string into a param table.
+ * @param pool    pool used to allocate the param data.
+ * @param t       table to which the params are added.
+ * @param qs      Query string to url-decode.
+ * @return        APR_SUCCESS if successful, error otherwise.
+ * @remark        This function uses [&;] as the set of tokens
+ *                to delineate words, and will treat a word w/o '='
+ *                as a name-value pair with value-length = 0.
+ *
+ */
+APREQ_DECLARE(apr_status_t) apreq_parse_query_string(apr_pool_t *pool,
+                                                     apr_table_t *t,
+                                                     const char *qs);
+
+
+/**
+ * Returns an array of parameters (apreq_param_t *) matching the given key.
+ * The key is case-insensitive.
+ * @param p Allocates the returned array.
+ * @param t the parameter table returned by apreq_args(), apreq_body()
+ *    or apreq_params()
+ * @param key Null-terminated search key, case insensitive.
+ *    key==NULL fetches all parameters.
+ * @return an array of apreq_param_t* (pointers)
+ * @remark Also parses the request if necessary.
+ */
+APREQ_DECLARE(apr_array_header_t *) apreq_params_as_array(apr_pool_t *p,
+                                                          const apr_table_t *t,
+                                                          const char *key);
+
+/**
+ * Returns a ", " -joined string containing all parameters
+ * for the requested key, an empty string if none are found.
+ * The key is case-insensitive.
+ *
+ * @param p Allocates the return string.
+ * @param t the parameter table returned by apreq_args(), apreq_body()
+ *    or apreq_params()
+ * @param key Null-terminated parameter name, case insensitive.
+ *    key==NULL fetches all values.
+ * @param mode Join type- see apreq_join().
+ * @return the joined string or NULL on error
+ * @remark Also parses the request if necessary.
+ */
+APREQ_DECLARE(const char *) apreq_params_as_string(apr_pool_t *p,
+                                                   const apr_table_t *t,
+                                                   const char *key,
+                                                   apreq_join_t mode);
+
+/**
+ * Returns a table of all params in req->body with non-NULL upload brigades.
+ * @param body parameter table returned by apreq_body() or apreq_params()
+ * @param pool Pool which allocates the table struct.
+ * @return Upload table.
+ * @remark Will parse the request if necessary.
+ */
+APREQ_DECLARE(const apr_table_t *) apreq_uploads(const apr_table_t *body,
+                                                 apr_pool_t *pool);
+
+/**
+ * Returns the first param in req->body which has both param->v.name
+ * matching key (case insensitive) and param->upload != NULL.
+ * @param body parameter table returned by apreq_body() or apreq_params()
+ * @param name Parameter name. key == NULL returns first upload.
+ * @return Corresponding upload, NULL if none found.
+ * @remark Will parse the request as necessary.
+ */
+APREQ_DECLARE(const apreq_param_t *) apreq_upload(const apr_table_t *body,
+                                                  const char *name);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* APREQ_PARAM_H */
+
+
+

Propchange: httpd/apreq/branches/apr-build-system/include/apreq_param.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message