summaryrefslogtreecommitdiffstats
path: root/include/private
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:30:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:30:05 +0000
commita1e354165254cd9e346751e6c2ddc554feeb0e6d (patch)
tree5fd273cc604fd00efd630eb387a6f79ce102f4e3 /include/private
parentInitial commit. (diff)
downloadapr-util-a1e354165254cd9e346751e6c2ddc554feeb0e6d.tar.xz
apr-util-a1e354165254cd9e346751e6c2ddc554feeb0e6d.zip
Adding upstream version 1.6.3.upstream/1.6.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/private')
-rw-r--r--include/private/apr_crypto_internal.h297
-rw-r--r--include/private/apr_dbd_internal.h365
-rw-r--r--include/private/apr_dbd_odbc_v2.h119
-rw-r--r--include/private/apr_dbm_private.h121
-rw-r--r--include/private/apu_config.h.in191
-rw-r--r--include/private/apu_config.hnw53
-rw-r--r--include/private/apu_config.hw52
-rw-r--r--include/private/apu_internal.h73
-rw-r--r--include/private/apu_select_dbm.h.in28
-rw-r--r--include/private/apu_select_dbm.hw28
10 files changed, 1327 insertions, 0 deletions
diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h
new file mode 100644
index 0000000..1ea838b
--- /dev/null
+++ b/include/private/apr_crypto_internal.h
@@ -0,0 +1,297 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 APR_CRYPTO_INTERNAL_H
+#define APR_CRYPTO_INTERNAL_H
+
+#include <stdarg.h>
+
+#include "apr_crypto.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if APU_HAVE_CRYPTO
+
+struct apr_crypto_driver_t {
+
+ /** name */
+ const char *name;
+
+ /**
+ * @brief: allow driver to perform once-only initialisation.
+ * Called once only.
+ * @param pool The pool to register the cleanup in.
+ * @param params Optional init parameter string.
+ * @param rc Driver-specific additional error code
+ */
+ apr_status_t (*init)(apr_pool_t *pool, const char *params,
+ const apu_err_t **result);
+
+ /**
+ * @brief Create a context for supporting encryption. Keys, certificates,
+ * algorithms and other parameters will be set per context. More than
+ * one context can be created at one time. A cleanup will be automatically
+ * registered with the given pool to guarantee a graceful shutdown.
+ * @param f - context pointer will be written here
+ * @param provider - provider to use
+ * @param params - array of key parameters
+ * @param pool - process pool
+ * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE
+ * if the engine cannot be initialised.
+ */
+ apr_status_t (*make)(apr_crypto_t **f, const apr_crypto_driver_t *provider,
+ const char *params, apr_pool_t *pool);
+
+ /**
+ * @brief Get a hash table of key types, keyed by the name of the type against
+ * a pointer to apr_crypto_block_key_type_t.
+ *
+ * @param types - hashtable of key types keyed to constants.
+ * @param f - encryption context
+ * @return APR_SUCCESS for success
+ */
+ apr_status_t (*get_block_key_types)(apr_hash_t **types,
+ const apr_crypto_t *f);
+
+ /**
+ * @brief Get a hash table of key modes, keyed by the name of the mode against
+ * a pointer to apr_crypto_block_key_mode_t.
+ *
+ * @param modes - hashtable of key modes keyed to constants.
+ * @param f - encryption context
+ * @return APR_SUCCESS for success
+ */
+ apr_status_t (*get_block_key_modes)(apr_hash_t **modes,
+ const apr_crypto_t *f);
+
+ /**
+ * @brief Create a key from the given passphrase. By default, the PBKDF2
+ * algorithm is used to generate the key from the passphrase. It is expected
+ * that the same pass phrase will generate the same key, regardless of the
+ * backend crypto platform used. The key is cleaned up when the context
+ * is cleaned, and may be reused with multiple encryption or decryption
+ * operations.
+ * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If
+ * *key is not NULL, *key must point at a previously created structure.
+ * @param key The key returned, see note.
+ * @param ivSize The size of the initialisation vector will be returned, based
+ * on whether an IV is relevant for this type of crypto.
+ * @param pass The passphrase to use.
+ * @param passLen The passphrase length in bytes
+ * @param salt The salt to use.
+ * @param saltLen The salt length in bytes
+ * @param type 3DES_192, AES_128, AES_192, AES_256.
+ * @param mode Electronic Code Book / Cipher Block Chaining.
+ * @param doPad Pad if necessary.
+ * @param iterations Iteration count
+ * @param f The context to use.
+ * @param p The pool to use.
+ * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend
+ * error occurred while generating the key. APR_ENOCIPHER if the type or mode
+ * is not supported by the particular backend. APR_EKEYTYPE if the key type is
+ * not known. APR_EPADDING if padding was requested but is not supported.
+ * APR_ENOTIMPL if not implemented.
+ */
+ apr_status_t (*passphrase)(apr_crypto_key_t **key, apr_size_t *ivSize,
+ const char *pass, apr_size_t passLen, const unsigned char * salt,
+ apr_size_t saltLen, const apr_crypto_block_key_type_e type,
+ const apr_crypto_block_key_mode_e mode, const int doPad,
+ const int iterations, const apr_crypto_t *f, apr_pool_t *p);
+
+ /**
+ * @brief Initialise a context for encrypting arbitrary data using the given key.
+ * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If
+ * *ctx is not NULL, *ctx must point at a previously created structure.
+ * @param ctx The block context returned, see note.
+ * @param iv Optional initialisation vector. If the buffer pointed to is NULL,
+ * an IV will be created at random, in space allocated from the pool.
+ * If the buffer pointed to is not NULL, the IV in the buffer will be
+ * used.
+ * @param key The key structure.
+ * @param blockSize The block size of the cipher.
+ * @param p The pool to use.
+ * @return Returns APR_ENOIV if an initialisation vector is required but not specified.
+ * Returns APR_EINIT if the backend failed to initialise the context. Returns
+ * APR_ENOTIMPL if not implemented.
+ */
+ apr_status_t (*block_encrypt_init)(apr_crypto_block_t **ctx,
+ const unsigned char **iv, const apr_crypto_key_t *key,
+ apr_size_t *blockSize, apr_pool_t *p);
+
+ /**
+ * @brief Encrypt data provided by in, write it to out.
+ * @note The number of bytes written will be written to outlen. If
+ * out is NULL, outlen will contain the maximum size of the
+ * buffer needed to hold the data, including any data
+ * generated by apr_crypto_block_encrypt_finish below. If *out points
+ * to NULL, a buffer sufficiently large will be created from
+ * the pool provided. If *out points to a not-NULL value, this
+ * value will be used as a buffer instead.
+ * @param out Address of a buffer to which data will be written,
+ * see note.
+ * @param outlen Length of the output will be written here.
+ * @param in Address of the buffer to read.
+ * @param inlen Length of the buffer to read.
+ * @param ctx The block context to use.
+ * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if
+ * not implemented.
+ */
+ apr_status_t (*block_encrypt)(unsigned char **out, apr_size_t *outlen,
+ const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *ctx);
+
+ /**
+ * @brief Encrypt final data block, write it to out.
+ * @note If necessary the final block will be written out after being
+ * padded. Typically the final block will be written to the
+ * same buffer used by apr_crypto_block_encrypt, offset by the
+ * number of bytes returned as actually written by the
+ * apr_crypto_block_encrypt() call. After this call, the context
+ * is cleaned and can be reused by apr_crypto_block_encrypt_init().
+ * @param out Address of a buffer to which data will be written. This
+ * buffer must already exist, and is usually the same
+ * buffer used by apr_evp_crypt(). See note.
+ * @param outlen Length of the output will be written here.
+ * @param ctx The block context to use.
+ * @return APR_ECRYPT if an error occurred.
+ * @return APR_EPADDING if padding was enabled and the block was incorrectly
+ * formatted.
+ * @return APR_ENOTIMPL if not implemented.
+ */
+ apr_status_t (*block_encrypt_finish)(unsigned char *out,
+ apr_size_t *outlen, apr_crypto_block_t *ctx);
+
+ /**
+ * @brief Initialise a context for decrypting arbitrary data using the given key.
+ * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If
+ * *ctx is not NULL, *ctx must point at a previously created structure.
+ * @param ctx The block context returned, see note.
+ * @param blockSize The block size of the cipher.
+ * @param iv Optional initialisation vector. If the buffer pointed to is NULL,
+ * an IV will be created at random, in space allocated from the pool.
+ * If the buffer is not NULL, the IV in the buffer will be used.
+ * @param key The key structure.
+ * @param p The pool to use.
+ * @return Returns APR_ENOIV if an initialisation vector is required but not specified.
+ * Returns APR_EINIT if the backend failed to initialise the context. Returns
+ * APR_ENOTIMPL if not implemented.
+ */
+ apr_status_t (*block_decrypt_init)(apr_crypto_block_t **ctx,
+ apr_size_t *blockSize, const unsigned char *iv,
+ const apr_crypto_key_t *key, apr_pool_t *p);
+
+ /**
+ * @brief Decrypt data provided by in, write it to out.
+ * @note The number of bytes written will be written to outlen. If
+ * out is NULL, outlen will contain the maximum size of the
+ * buffer needed to hold the data, including any data
+ * generated by apr_crypto_block_decrypt_finish below. If *out points
+ * to NULL, a buffer sufficiently large will be created from
+ * the pool provided. If *out points to a not-NULL value, this
+ * value will be used as a buffer instead.
+ * @param out Address of a buffer to which data will be written,
+ * see note.
+ * @param outlen Length of the output will be written here.
+ * @param in Address of the buffer to read.
+ * @param inlen Length of the buffer to read.
+ * @param ctx The block context to use.
+ * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if
+ * not implemented.
+ */
+ apr_status_t (*block_decrypt)(unsigned char **out, apr_size_t *outlen,
+ const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *ctx);
+
+ /**
+ * @brief Decrypt final data block, write it to out.
+ * @note If necessary the final block will be written out after being
+ * padded. Typically the final block will be written to the
+ * same buffer used by apr_crypto_block_decrypt, offset by the
+ * number of bytes returned as actually written by the
+ * apr_crypto_block_decrypt() call. After this call, the context
+ * is cleaned and can be reused by apr_crypto_block_decrypt_init().
+ * @param out Address of a buffer to which data will be written. This
+ * buffer must already exist, and is usually the same
+ * buffer used by apr_evp_crypt(). See note.
+ * @param outlen Length of the output will be written here.
+ * @param ctx The block context to use.
+ * @return APR_ECRYPT if an error occurred.
+ * @return APR_EPADDING if padding was enabled and the block was incorrectly
+ * formatted.
+ * @return APR_ENOTIMPL if not implemented.
+ */
+ apr_status_t (*block_decrypt_finish)(unsigned char *out,
+ apr_size_t *outlen, apr_crypto_block_t *ctx);
+
+ /**
+ * @brief Clean encryption / decryption context.
+ * @note After cleanup, a context is free to be reused if necessary.
+ * @param ctx The block context to use.
+ * @return Returns APR_ENOTIMPL if not supported.
+ */
+ apr_status_t (*block_cleanup)(apr_crypto_block_t *ctx);
+
+ /**
+ * @brief Clean encryption / decryption context.
+ * @note After cleanup, a context is free to be reused if necessary.
+ * @param f The context to use.
+ * @return Returns APR_ENOTIMPL if not supported.
+ */
+ apr_status_t (*cleanup)(apr_crypto_t *f);
+
+ /**
+ * @brief Clean encryption / decryption context.
+ * @note After cleanup, a context is free to be reused if necessary.
+ * @return Returns APR_ENOTIMPL if not supported.
+ */
+ apr_status_t (*shutdown)(void);
+
+ /**
+ * @brief: fetch the most recent error from this driver.
+ * @param result - the result structure
+ * @param f - context pointer
+ * @return APR_SUCCESS for success.
+ */
+ apr_status_t (*error)(const apu_err_t **result, const apr_crypto_t *f);
+
+ /**
+ * @brief Create a key from the provided secret or passphrase. The key is cleaned
+ * up when the context is cleaned, and may be reused with multiple encryption
+ * or decryption operations.
+ * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If
+ * *key is not NULL, *key must point at a previously created structure.
+ * @param key The key returned, see note.
+ * @param rec The key record, from which the key will be derived.
+ * @param f The context to use.
+ * @param p The pool to use.
+ * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend
+ * error occurred while generating the key. APR_ENOCIPHER if the type or mode
+ * is not supported by the particular backend. APR_EKEYTYPE if the key type is
+ * not known. APR_EPADDING if padding was requested but is not supported.
+ * APR_ENOTIMPL if not implemented.
+ */
+ apr_status_t (*key)(apr_crypto_key_t **key, const apr_crypto_key_rec_t *rec,
+ const apr_crypto_t *f, apr_pool_t *p);
+
+};
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/private/apr_dbd_internal.h b/include/private/apr_dbd_internal.h
new file mode 100644
index 0000000..671ffb2
--- /dev/null
+++ b/include/private/apr_dbd_internal.h
@@ -0,0 +1,365 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+/* Overview of what this is and does:
+ * http://www.apache.org/~niq/dbd.html
+ */
+
+#ifndef APR_DBD_INTERNAL_H
+#define APR_DBD_INTERNAL_H
+
+#include <stdarg.h>
+
+#include "apr_dbd.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TXN_IGNORE_ERRORS(t) \
+ ((t) && ((t)->mode & APR_DBD_TRANSACTION_IGNORE_ERRORS))
+#define TXN_NOTICE_ERRORS(t) \
+ ((t) && !((t)->mode & APR_DBD_TRANSACTION_IGNORE_ERRORS))
+
+#define TXN_DO_COMMIT(t) (!((t)->mode & APR_DBD_TRANSACTION_ROLLBACK))
+#define TXN_DO_ROLLBACK(t) ((t)->mode & APR_DBD_TRANSACTION_ROLLBACK)
+
+#define TXN_MODE_BITS \
+ (APR_DBD_TRANSACTION_ROLLBACK|APR_DBD_TRANSACTION_IGNORE_ERRORS)
+
+struct apr_dbd_driver_t {
+ /** name */
+ const char *name;
+
+ /** init: allow driver to perform once-only initialisation.
+ * Called once only. May be NULL
+ */
+ void (*init)(apr_pool_t *pool);
+
+ /** native_handle: return the native database handle of the underlying db
+ *
+ * @param handle - apr_dbd handle
+ * @return - native handle
+ */
+ void *(*native_handle)(apr_dbd_t *handle);
+
+ /** open: obtain a database connection from the server rec.
+ * Must be explicitly closed when you're finished with it.
+ * WARNING: only use this when you need a connection with
+ * a lifetime other than a request
+ *
+ * @param pool - a pool to use for error messages (if any).
+ * @param params - connection parameters.
+ * @param error - descriptive error.
+ * @return database handle, or NULL on error.
+ */
+ apr_dbd_t *(*open)(apr_pool_t *pool, const char *params,
+ const char **error);
+
+ /** check_conn: check status of a database connection
+ *
+ * @param pool - a pool to use for error messages (if any).
+ * @param handle - the connection to check
+ * @return APR_SUCCESS or error
+ */
+ apr_status_t (*check_conn)(apr_pool_t *pool, apr_dbd_t *handle);
+
+ /** close: close/release a connection obtained from open()
+ *
+ * @param handle - the connection to release
+ * @return APR_SUCCESS or error
+ */
+ apr_status_t (*close)(apr_dbd_t *handle);
+
+ /** set_dbname: select database name. May be a no-op if not supported.
+ *
+ * @param pool - working pool
+ * @param handle - the connection
+ * @param name - the database to select
+ * @return 0 for success or error code
+ */
+ int (*set_dbname)(apr_pool_t* pool, apr_dbd_t *handle, const char *name);
+
+ /** transaction: start a transaction. May be a no-op.
+ *
+ * @param pool - a pool to use for error messages (if any).
+ * @param handle - the connection
+ * @param trans - ptr to a transaction. May be null on entry
+ * @return 0 for success or error code
+ */
+ int (*start_transaction)(apr_pool_t *pool, apr_dbd_t *handle,
+ apr_dbd_transaction_t **trans);
+
+ /** end_transaction: end a transaction
+ * (commit on success, rollback on error).
+ * May be a no-op.
+ *
+ * @param trans - the transaction.
+ * @return 0 for success or error code
+ */
+ int (*end_transaction)(apr_dbd_transaction_t *trans);
+
+ /** query: execute an SQL query that doesn't return a result set
+ *
+ * @param handle - the connection
+ * @param nrows - number of rows affected.
+ * @param statement - the SQL statement to execute
+ * @return 0 for success or error code
+ */
+ int (*query)(apr_dbd_t *handle, int *nrows, const char *statement);
+
+ /** select: execute an SQL query that returns a result set
+ *
+ * @param pool - pool to allocate the result set
+ * @param handle - the connection
+ * @param res - pointer to result set pointer. May point to NULL on entry
+ * @param statement - the SQL statement to execute
+ * @param random - 1 to support random access to results (seek any row);
+ * 0 to support only looping through results in order
+ * (async access - faster)
+ * @return 0 for success or error code
+ */
+ int (*select)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res,
+ const char *statement, int random);
+
+ /** num_cols: get the number of columns in a results set
+ *
+ * @param res - result set.
+ * @return number of columns
+ */
+ int (*num_cols)(apr_dbd_results_t *res);
+
+ /** num_tuples: get the number of rows in a results set
+ * of a synchronous select
+ *
+ * @param res - result set.
+ * @return number of rows, or -1 if the results are asynchronous
+ */
+ int (*num_tuples)(apr_dbd_results_t *res);
+
+ /** get_row: get a row from a result set
+ *
+ * @param pool - pool to allocate the row
+ * @param res - result set pointer
+ * @param row - pointer to row pointer. May point to NULL on entry
+ * @param rownum - row number, or -1 for "next row". Ignored if random
+ * access is not supported.
+ * @return 0 for success, -1 for rownum out of range or data finished
+ */
+ int (*get_row)(apr_pool_t *pool, apr_dbd_results_t *res,
+ apr_dbd_row_t **row, int rownum);
+
+ /** get_entry: get an entry from a row
+ *
+ * @param row - row pointer
+ * @param col - entry number
+ * @param val - entry to fill
+ * @return 0 for success, -1 for no data, +1 for general error
+ */
+ const char* (*get_entry)(const apr_dbd_row_t *row, int col);
+
+ /** error: get current error message (if any)
+ *
+ * @param handle - the connection
+ * @param errnum - error code from operation that returned an error
+ * @return the database current error message, or message for errnum
+ * (implementation-dependent whether errnum is ignored)
+ */
+ const char *(*error)(apr_dbd_t *handle, int errnum);
+
+ /** escape: escape a string so it is safe for use in query/select
+ *
+ * @param pool - pool to alloc the result from
+ * @param string - the string to escape
+ * @param handle - the connection
+ * @return the escaped, safe string
+ */
+ const char *(*escape)(apr_pool_t *pool, const char *string,
+ apr_dbd_t *handle);
+
+ /** prepare: prepare a statement
+ *
+ * @param pool - pool to alloc the result from
+ * @param handle - the connection
+ * @param query - the SQL query
+ * @param label - A label for the prepared statement.
+ * use NULL for temporary prepared statements
+ * (eg within a Request in httpd)
+ * @param nargs - number of parameters in the query
+ * @param nvals - number of values passed in p[b]query/select
+ * @param types - pointer to an array with types of parameters
+ * @param statement - statement to prepare. May point to null on entry.
+ * @return 0 for success or error code
+ */
+ int (*prepare)(apr_pool_t *pool, apr_dbd_t *handle, const char *query,
+ const char *label, int nargs, int nvals,
+ apr_dbd_type_e *types, apr_dbd_prepared_t **statement);
+
+ /** pvquery: query using a prepared statement + args
+ *
+ * @param pool - working pool
+ * @param handle - the connection
+ * @param nrows - number of rows affected.
+ * @param statement - the prepared statement to execute
+ * @param args - args to prepared statement
+ * @return 0 for success or error code
+ */
+ int (*pvquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows,
+ apr_dbd_prepared_t *statement, va_list args);
+
+ /** pvselect: select using a prepared statement + args
+ *
+ * @param pool - working pool
+ * @param handle - the connection
+ * @param res - pointer to query results. May point to NULL on entry
+ * @param statement - the prepared statement to execute
+ * @param random - Whether to support random-access to results
+ * @param args - args to prepared statement
+ * @return 0 for success or error code
+ */
+ int (*pvselect)(apr_pool_t *pool, apr_dbd_t *handle,
+ apr_dbd_results_t **res,
+ apr_dbd_prepared_t *statement, int random, va_list args);
+
+ /** pquery: query using a prepared statement + args
+ *
+ * @param pool - working pool
+ * @param handle - the connection
+ * @param nrows - number of rows affected.
+ * @param statement - the prepared statement to execute
+ * @param args - args to prepared statement
+ * @return 0 for success or error code
+ */
+ int (*pquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows,
+ apr_dbd_prepared_t *statement, const char **args);
+
+ /** pselect: select using a prepared statement + args
+ *
+ * @param pool - working pool
+ * @param handle - the connection
+ * @param res - pointer to query results. May point to NULL on entry
+ * @param statement - the prepared statement to execute
+ * @param random - Whether to support random-access to results
+ * @param args - args to prepared statement
+ * @return 0 for success or error code
+ */
+ int (*pselect)(apr_pool_t *pool, apr_dbd_t *handle,
+ apr_dbd_results_t **res, apr_dbd_prepared_t *statement,
+ int random, const char **args);
+
+
+ /** get_name: get a column title from a result set
+ *
+ * @param res - result set pointer
+ * @param col - entry number
+ * @return param name, or NULL if col is out of bounds.
+ */
+ const char* (*get_name)(const apr_dbd_results_t *res, int col);
+
+ /** transaction_mode_get: get the mode of transaction
+ *
+ * @param trans - the transaction.
+ * @return mode of transaction
+ */
+ int (*transaction_mode_get)(apr_dbd_transaction_t *trans);
+
+ /** transaction_mode_set: get the mode of transaction
+ *
+ * @param trans - the transaction.
+ * @param mode - new mode of the transaction
+ * @return the mode of transaction in force after the call
+ */
+ int (*transaction_mode_set)(apr_dbd_transaction_t *trans, int mode);
+
+ /** format of prepared statement parameters */
+ const char *pformat;
+
+ /** pvbquery: query using a prepared statement + binary args
+ *
+ * @param pool - working pool
+ * @param handle - the connection
+ * @param nrows - number of rows affected.
+ * @param statement - the prepared statement to execute
+ * @param args - binary args to prepared statement
+ * @return 0 for success or error code
+ */
+ int (*pvbquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows,
+ apr_dbd_prepared_t *statement, va_list args);
+
+ /** pvbselect: select using a prepared statement + binary args
+ *
+ * @param pool - working pool
+ * @param handle - the connection
+ * @param res - pointer to query results. May point to NULL on entry
+ * @param statement - the prepared statement to execute
+ * @param random - Whether to support random-access to results
+ * @param args - binary args to prepared statement
+ * @return 0 for success or error code
+ */
+ int (*pvbselect)(apr_pool_t *pool, apr_dbd_t *handle,
+ apr_dbd_results_t **res,
+ apr_dbd_prepared_t *statement, int random, va_list args);
+
+ /** pbquery: query using a prepared statement + binary args
+ *
+ * @param pool - working pool
+ * @param handle - the connection
+ * @param nrows - number of rows affected.
+ * @param statement - the prepared statement to execute
+ * @param args - binary args to prepared statement
+ * @return 0 for success or error code
+ */
+ int (*pbquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows,
+ apr_dbd_prepared_t *statement,const void **args);
+
+ /** pbselect: select using a prepared statement + binary args
+ *
+ * @param pool - working pool
+ * @param handle - the connection
+ * @param res - pointer to query results. May point to NULL on entry
+ * @param statement - the prepared statement to execute
+ * @param random - Whether to support random-access to results
+ * @param args - binary args to prepared statement
+ * @return 0 for success or error code
+ */
+ int (*pbselect)(apr_pool_t *pool, apr_dbd_t *handle,
+ apr_dbd_results_t **res, apr_dbd_prepared_t *statement,
+ int random, const void **args);
+
+ /** datum_get: get a binary entry from a row
+ *
+ * @param row - row pointer
+ * @param col - entry number
+ * @param type - type of data to get
+ * @param data - pointer to data, allocated by the caller
+ * @return APR_SUCCESS, an error code on error or if col is out of bounds
+ */
+ apr_status_t (*datum_get)(const apr_dbd_row_t *row, int col,
+ apr_dbd_type_e type, void *data);
+};
+
+/* Export mutex lock/unlock for drivers that need it
+ * deprecated; create a per-dbd mutex within the (*init) function
+ * to avoid blocking other providers running on other threads
+ */
+APU_DECLARE(apr_status_t) apr_dbd_mutex_lock(void);
+APU_DECLARE(apr_status_t) apr_dbd_mutex_unlock(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/private/apr_dbd_odbc_v2.h b/include/private/apr_dbd_odbc_v2.h
new file mode 100644
index 0000000..b8da7b1
--- /dev/null
+++ b/include/private/apr_dbd_odbc_v2.h
@@ -0,0 +1,119 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+
+/* ONLY USED FOR ODBC Version 2 -DODBCV2
+*
+* Re-define everything to work (more-or-less) in an ODBC V2 environment
+* Random access to retrieved rows is not supported - i.e. calls to apr_dbd_select() cannot
+* have a 'random' argument of 1. apr_dbd_get_row() must always pass rownum as 0 (get next row)
+*
+*/
+
+#define SQLHANDLE SQLHENV /* Presumes that ENV, DBC, and STMT handles are all the same datatype */
+#define SQL_NULL_HANDLE 0
+#define SQL_HANDLE_STMT 1
+#define SQL_HANDLE_DBC 2
+#define SQL_HANDLE_ENV 3
+#define SQL_NO_DATA SQL_NO_DATA_FOUND
+
+#ifndef SQL_SUCCEEDED
+#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
+#endif
+
+#undef SQLSetEnvAttr
+#define SQLSetEnvAttr(henv, Attribute, Value, StringLength) (0)
+
+#undef SQLAllocHandle
+#define SQLAllocHandle(type, parent, hndl) \
+( (type == SQL_HANDLE_STMT) ? SQLAllocStmt(parent, hndl) \
+ : (type == SQL_HANDLE_ENV) ? SQLAllocEnv(hndl) \
+ : SQLAllocConnect(parent, hndl) \
+)
+
+#undef SQLFreeHandle
+#define SQLFreeHandle(type, hndl) \
+( (type == SQL_HANDLE_STMT) ? SQLFreeStmt(hndl, SQL_DROP) \
+ : (type == SQL_HANDLE_ENV) ? SQLFreeEnv(hndl) \
+ : SQLFreeConnect(hndl) \
+)
+
+#undef SQLGetDiagRec
+#define SQLGetDiagRec(type, h, i, state, native, buffer, bufsize, reslen) \
+ SQLError( (type == SQL_HANDLE_ENV) ? h : NULL, \
+ (type == SQL_HANDLE_DBC) ? h : NULL, \
+ (type == SQL_HANDLE_STMT) ? h : NULL, \
+ state, native, buffer, bufsize, reslen)
+
+#undef SQLCloseCursor
+#define SQLCloseCursor(stmt) SQLFreeStmt(stmt, SQL_CLOSE)
+
+#undef SQLGetConnectAttr
+#define SQLGetConnectAttr(hdbc, fOption, ValuePtr, BufferLength, NULL) \
+ SQLGetConnectOption(hdbc, fOption, ValuePtr)
+
+#undef SQLSetConnectAttr
+#define SQLSetConnectAttr(hdbc, fOption, ValuePtr, BufferLength) \
+ SQLSetConnectOption(hdbc, fOption, (SQLUINTEGER) ValuePtr)
+
+#undef SQLSetStmtAttr
+#define SQLSetStmtAttr(hstmt, fOption, ValuePtr, BufferLength) (0); return APR_ENOTIMPL;
+
+#undef SQLEndTran
+#define SQLEndTran(hType, hdbc,type) SQLTransact(henv, hdbc, type)
+
+#undef SQLFetchScroll
+#define SQLFetchScroll(stmt, orient, rownum) (0); return APR_ENOTIMPL;
+
+#define SQL_DESC_TYPE SQL_COLUMN_TYPE
+#define SQL_DESC_CONCISE_TYPE SQL_COLUMN_TYPE
+#define SQL_DESC_DISPLAY_SIZE SQL_COLUMN_DISPLAY_SIZE
+#define SQL_DESC_OCTET_LENGTH SQL_COLUMN_LENGTH
+#define SQL_DESC_UNSIGNED SQL_COLUMN_UNSIGNED
+
+#undef SQLColAttribute
+#define SQLColAttribute(s, c, f, a, l, m, n) SQLColAttributes(s, c, f, a, l, m, n)
+
+#define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE
+#define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT
+#define SQL_ATTR_CONNECTION_TIMEOUT 113
+#define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER
+#define SQL_ATTR_DISCONNECT_BEHAVIOR 114
+#define SQL_ATTR_ENLIST_IN_DTC 1207
+#define SQL_ATTR_ENLIST_IN_XA 1208
+
+#define SQL_ATTR_CONNECTION_DEAD 1209
+#define SQL_CD_TRUE 1L /* Connection is closed/dead */
+#define SQL_CD_FALSE 0L /* Connection is open/available */
+
+#define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT
+#define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS
+#define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE
+#define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE
+#define SQL_ATTR_TRACE SQL_OPT_TRACE
+#define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE
+#define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL
+#define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION
+#define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION
+
+#define SQL_ATTR_CURSOR_SCROLLABLE -1
+
+#define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */
+#define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */
+
+#define SQL_FALSE 0
+#define SQL_TRUE 1
+
diff --git a/include/private/apr_dbm_private.h b/include/private/apr_dbm_private.h
new file mode 100644
index 0000000..020d3a6
--- /dev/null
+++ b/include/private/apr_dbm_private.h
@@ -0,0 +1,121 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 APR_DBM_PRIVATE_H
+#define APR_DBM_PRIVATE_H
+
+#include "apr.h"
+#include "apr_errno.h"
+#include "apr_pools.h"
+#include "apr_dbm.h"
+#include "apr_file_io.h"
+
+#include "apu.h"
+
+/* ### for now, include the DBM selection; this will go away once we start
+ ### building and linking all of the DBMs at once. */
+#include "apu_select_dbm.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @internal */
+
+/**
+ * Most DBM libraries take a POSIX mode for creating files. Don't trust
+ * the mode_t type, some platforms may not support it, int is safe.
+ */
+APU_DECLARE(int) apr_posix_perms2mode(apr_fileperms_t perm);
+
+/**
+ * Structure to describe the operations of the DBM
+ */
+typedef struct {
+ /** The name of the DBM Type */
+ const char *name;
+
+ /** Open the DBM */
+ apr_status_t (*open)(apr_dbm_t **pdb, const char *pathname,
+ apr_int32_t mode, apr_fileperms_t perm,
+ apr_pool_t *pool);
+
+ /** Close the DBM */
+ void (*close)(apr_dbm_t *dbm);
+
+ /** Fetch a dbm record value by key */
+ apr_status_t (*fetch)(apr_dbm_t *dbm, apr_datum_t key,
+ apr_datum_t * pvalue);
+
+ /** Store a dbm record value by key */
+ apr_status_t (*store)(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t value);
+
+ /** Delete a dbm record value by key */
+ apr_status_t (*del)(apr_dbm_t *dbm, apr_datum_t key);
+
+ /** Search for a key within the dbm */
+ int (*exists)(apr_dbm_t *dbm, apr_datum_t key);
+
+ /** Retrieve the first record key from a dbm */
+ apr_status_t (*firstkey)(apr_dbm_t *dbm, apr_datum_t * pkey);
+
+ /** Retrieve the next record key from a dbm */
+ apr_status_t (*nextkey)(apr_dbm_t *dbm, apr_datum_t * pkey);
+
+ /** Proactively toss any memory associated with the apr_datum_t. */
+ void (*freedatum)(apr_dbm_t *dbm, apr_datum_t data);
+
+ /** Get the names that the DBM will use for a given pathname. */
+ void (*getusednames)(apr_pool_t *pool,
+ const char *pathname,
+ const char **used1,
+ const char **used2);
+
+} apr_dbm_type_t;
+
+
+/**
+ * The actual DBM
+ */
+struct apr_dbm_t
+{
+ /** Associated pool */
+ apr_pool_t *pool;
+
+ /** pointer to DB Implementation Specific data */
+ void *file;
+
+ /** Current integer error code */
+ int errcode;
+ /** Current string error code */
+ const char *errmsg;
+
+ /** the type of DBM */
+ const apr_dbm_type_t *type;
+};
+
+
+/* Declare all of the DBM provider tables */
+APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_sdbm;
+APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_gdbm;
+APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_ndbm;
+APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* APR_DBM_PRIVATE_H */
diff --git a/include/private/apu_config.h.in b/include/private/apu_config.h.in
new file mode 100644
index 0000000..301060f
--- /dev/null
+++ b/include/private/apu_config.h.in
@@ -0,0 +1,191 @@
+/* include/private/apu_config.h.in. Generated from configure.in by autoheader. */
+
+/* Define if the system crypt() function is threadsafe */
+#undef APU_CRYPT_THREADSAFE
+
+/* Define to 1 if modular components are built as DSOs */
+#undef APU_DSO_BUILD
+
+/* Define to be absolute path to DSO directory */
+#undef APU_DSO_LIBDIR
+
+/* Define if the inbuf parm to iconv() is const char ** */
+#undef APU_ICONV_INBUF_CONST
+
+/* Define that OpenSSL uses const buffers */
+#undef CRYPTO_OPENSSL_CONST_BUFFERS
+
+/* Define if crypt_r has uses CRYPTD */
+#undef CRYPT_R_CRYPTD
+
+/* Define if crypt_r uses struct crypt_data */
+#undef CRYPT_R_STRUCT_CRYPT_DATA
+
+/* Define if CODESET is defined in langinfo.h */
+#undef HAVE_CODESET
+
+/* Define to 1 if you have the <CommonCrypto/CommonKeyDerivation.h> header
+ file. */
+#undef HAVE_COMMONCRYPTO_COMMONKEYDERIVATION_H
+
+/* Define to 1 if you have the `crypt_r' function. */
+#undef HAVE_CRYPT_R
+
+/* Define to 1 if you have the declaration of `EVP_PKEY_CTX_new', and to 0 if
+ you don't. */
+#undef HAVE_DECL_EVP_PKEY_CTX_NEW
+
+/* Define to 1 if you have the <errmsg.h> header file. */
+#undef HAVE_ERRMSG_H
+
+/* Define if expat.h is available */
+#undef HAVE_EXPAT_H
+
+/* Define if explicit_bzero function is supported */
+#undef HAVE_EXPLICIT_BZERO
+
+/* Define to 1 if you have the <iconv.h> header file. */
+#undef HAVE_ICONV_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+#undef HAVE_LANGINFO_H
+
+/* Define to 1 if you have the <lber.h> header file. */
+#undef HAVE_LBER_H
+
+/* Defined if ldap.h is present */
+#undef HAVE_LDAP_H
+
+/* Define to 1 if you have the <ldap_ssl.h> header file. */
+#undef HAVE_LDAP_SSL_H
+
+/* Define to 1 if you have the <libpq-fe.h> header file. */
+#undef HAVE_LIBPQ_FE_H
+
+/* Define if memset_s function is supported */
+#undef HAVE_MEMSET_S
+
+/* Define to 1 if you have the <mysql/errmsg.h> header file. */
+#undef HAVE_MYSQL_ERRMSG_H
+
+/* Define to 1 if you have the <mysql.h> header file. */
+#undef HAVE_MYSQL_H
+
+/* Define to 1 if you have the <mysql/mysql.h> header file. */
+#undef HAVE_MYSQL_MYSQL_H
+
+/* Define to 1 if you have the <mysql/my_global.h> header file. */
+#undef HAVE_MYSQL_MY_GLOBAL_H
+
+/* Define to 1 if you have the <mysql/my_sys.h> header file. */
+#undef HAVE_MYSQL_MY_SYS_H
+
+/* Define to 1 if you have the <my_global.h> header file. */
+#undef HAVE_MY_GLOBAL_H
+
+/* Define to 1 if you have the <my_sys.h> header file. */
+#undef HAVE_MY_SYS_H
+
+/* Define to 1 if you have the `nl_langinfo' function. */
+#undef HAVE_NL_LANGINFO
+
+/* Define to 1 if you have the <nss.h> header file. */
+#undef HAVE_NSS_H
+
+/* Define to 1 if you have the <nss/nss.h> header file. */
+#undef HAVE_NSS_NSS_H
+
+/* Define to 1 if you have the <nss/pk11pub.h> header file. */
+#undef HAVE_NSS_PK11PUB_H
+
+/* Define to 1 if you have the <oci.h> header file. */
+#undef HAVE_OCI_H
+
+/* Define to 1 if you have the <odbc/sql.h> header file. */
+#undef HAVE_ODBC_SQL_H
+
+/* Define to 1 if you have the <openssl/x509.h> header file. */
+#undef HAVE_OPENSSL_X509_H
+
+/* Define to 1 if you have the <pk11pub.h> header file. */
+#undef HAVE_PK11PUB_H
+
+/* Define to 1 if you have the <postgresql/libpq-fe.h> header file. */
+#undef HAVE_POSTGRESQL_LIBPQ_FE_H
+
+/* Define to 1 if you have the <prerror.h> header file. */
+#undef HAVE_PRERROR_H
+
+/* Define to 1 if you have the <sqlite3.h> header file. */
+#undef HAVE_SQLITE3_H
+
+/* Define to 1 if you have the <sqlite.h> header file. */
+#undef HAVE_SQLITE_H
+
+/* Define to 1 if you have the <sql.h> header file. */
+#undef HAVE_SQL_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if compiler handles weak symbols */
+#undef HAVE_WEAK_SYMBOLS
+
+/* Define if xmlparse/xmlparse.h is available */
+#undef HAVE_XMLPARSE_XMLPARSE_H
+
+/* Define if xmltok/xmlparse.h is available */
+#undef HAVE_XMLTOK_XMLPARSE_H
+
+/* Define if xml/xmlparse.h is available */
+#undef HAVE_XML_XMLPARSE_H
+
+/* Define if ldap_set_rebind_proc takes three arguments */
+#undef LDAP_SET_REBIND_PROC_THREE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if all of the C90 standard headers exist (not just the ones
+ required in a freestanding environment). This macro is provided for
+ backward compatibility; new code need not use it. */
+#undef STDC_HEADERS
diff --git a/include/private/apu_config.hnw b/include/private/apu_config.hnw
new file mode 100644
index 0000000..9c6c73e
--- /dev/null
+++ b/include/private/apu_config.hnw
@@ -0,0 +1,53 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+/*
+ * Note: This is a NetWare specific version of apu_config.hnw. It is copied
+ * as apu_config.h at the start of a NetWare build.
+ */
+
+#ifdef NETWARE
+
+#ifndef APU_CONFIG_H
+#define APU_CONFIG_H
+
+/* Always compile Netware with DSO support for .nlm builds */
+#define APU_DSO_BUILD 0
+
+/*
+ * NetWare does not have GDBM, and we always use the bundled (new) Expat
+ */
+
+/* Define if you have the gdbm library (-lgdbm). */
+/* #undef HAVE_LIBGDBM */
+
+/* define if Expat 1.0 or 1.1 was found */
+/* #undef APR_HAVE_OLD_EXPAT */
+
+/* NetWare uses its own ICONV implementation. */
+#define HAVE_ICONV_H 1
+
+/*
+ * check for newer NDKs which use now correctly 'const char*' with iconv.
+ */
+#include <ndkvers.h>
+#if (CURRENT_NDK_THRESHOLD >= 705110000)
+#define APU_ICONV_INBUF_CONST
+#endif
+
+#endif /* APU_CONFIG_H */
+#endif /* NETWARE */
+
diff --git a/include/private/apu_config.hw b/include/private/apu_config.hw
new file mode 100644
index 0000000..b0e2039
--- /dev/null
+++ b/include/private/apu_config.hw
@@ -0,0 +1,52 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+/*
+ * Note: This is a Windows specific version of apu_config.hw. It is copied
+ * as apu_config.h at the start of a Windows build.
+ */
+
+#ifdef WIN32
+
+#ifndef APU_CONFIG_H
+#define APU_CONFIG_H
+
+/* Compile win32 with DSO support for .dll builds */
+#ifdef APU_DECLARE_STATIC
+#define APU_DSO_BUILD 0
+#else
+#define APU_DSO_BUILD 1
+#endif
+
+/* Presume a standard, modern (5.x) mysql sdk/
+#define HAVE_MY_GLOBAL_H 1
+
+/* my_sys.h is broken on VC/Win32, and apparently not required */
+/* #undef HAVE_MY_SYS_H 0 */
+
+/*
+ * Windows does not have GDBM, and we always use the bundled (new) Expat
+ */
+
+/* Define if you have the gdbm library (-lgdbm). */
+/* #undef HAVE_LIBGDBM */
+
+/* define if Expat 1.0 or 1.1 was found */
+/* #undef APR_HAVE_OLD_EXPAT */
+
+
+#endif /* APU_CONFIG_H */
+#endif /* WIN32 */
diff --git a/include/private/apu_internal.h b/include/private/apu_internal.h
new file mode 100644
index 0000000..c95c9d5
--- /dev/null
+++ b/include/private/apu_internal.h
@@ -0,0 +1,73 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 "apr.h"
+#include "apr_dso.h"
+#include "apu.h"
+
+#ifndef APU_INTERNAL_H
+#define APU_INTERNAL_H
+
+#if APU_DSO_BUILD
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For modular dso loading, an internal interlock to allow us to
+ * continue to initialize modules by multiple threads, the caller
+ * of apu_dso_load must lock first, and not unlock until any init
+ * finalization is complete.
+ */
+apr_status_t apu_dso_init(apr_pool_t *pool);
+
+apr_status_t apu_dso_mutex_lock(void);
+apr_status_t apu_dso_mutex_unlock(void);
+
+apr_status_t apu_dso_load(apr_dso_handle_t **dso, apr_dso_handle_sym_t *dsoptr, const char *module,
+ const char *modsym, apr_pool_t *pool);
+
+#if APR_HAS_LDAP
+
+/* For LDAP internal builds, wrap our LDAP namespace */
+
+struct apr__ldap_dso_fntable {
+ int (*info)(apr_pool_t *pool, apr_ldap_err_t **result_err);
+ int (*init)(apr_pool_t *pool, LDAP **ldap, const char *hostname,
+ int portno, int secure, apr_ldap_err_t **result_err);
+ int (*ssl_init)(apr_pool_t *pool, const char *cert_auth_file,
+ int cert_file_type, apr_ldap_err_t **result_err);
+ int (*ssl_deinit)(void);
+ int (*get_option)(apr_pool_t *pool, LDAP *ldap, int option,
+ void *outvalue, apr_ldap_err_t **result_err);
+ int (*set_option)(apr_pool_t *pool, LDAP *ldap, int option,
+ const void *invalue, apr_ldap_err_t **result_err);
+ apr_status_t (*rebind_init)(apr_pool_t *pool);
+ apr_status_t (*rebind_add)(apr_pool_t *pool, LDAP *ld,
+ const char *bindDN, const char *bindPW);
+ apr_status_t (*rebind_remove)(LDAP *ld);
+};
+
+#endif /* APR_HAS_LDAP */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* APU_DSO_BUILD */
+
+#endif /* APU_INTERNAL_H */
+
diff --git a/include/private/apu_select_dbm.h.in b/include/private/apu_select_dbm.h.in
new file mode 100644
index 0000000..b69aec0
--- /dev/null
+++ b/include/private/apu_select_dbm.h.in
@@ -0,0 +1,28 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 APU_SELECT_DBM_H
+#define APU_SELECT_DBM_H
+
+/*
+** The following macros control what features APRUTIL will use
+*/
+#define APU_USE_SDBM @apu_use_sdbm@
+#define APU_USE_NDBM @apu_use_ndbm@
+#define APU_USE_GDBM @apu_use_gdbm@
+#define APU_USE_DB @apu_use_db@
+
+#endif /* !APU_SELECT_DBM_H */
diff --git a/include/private/apu_select_dbm.hw b/include/private/apu_select_dbm.hw
new file mode 100644
index 0000000..97c7b6c
--- /dev/null
+++ b/include/private/apu_select_dbm.hw
@@ -0,0 +1,28 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 APU_SELECT_DBM_H
+#define APU_SELECT_DBM_H
+
+/*
+** The following macros control what features APRUTIL will use
+*/
+#define APU_USE_SDBM 1
+#define APU_USE_GDBM 0
+#define APU_USE_NDBM 0
+#define APU_USE_DB 0
+
+#endif /* !APU_SELECT_DBM_H */