[core] rename lib apr symbols to fspr

This commit is contained in:
Chris Rienzo authored and Andrey Volk committed 2022-08-29 20:17:08 +03:00
1 parent 3c7e8ff989
commit 5c2726f413
354 files changed
+11614 -11614

No files matched your search

-74
View File
@@ -1,74 +0,0 @@
/* 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_RANDOM_H
#define APR_RANDOM_H
#include <apr_pools.h>
typedef struct apr_crypto_hash_t apr_crypto_hash_t;
typedef void apr_crypto_hash_init_t(apr_crypto_hash_t *hash);
typedef void apr_crypto_hash_add_t(apr_crypto_hash_t *hash,const void *data,
apr_size_t bytes);
typedef void apr_crypto_hash_finish_t(apr_crypto_hash_t *hash,
unsigned char *result);
/* FIXME: make this opaque */
struct apr_crypto_hash_t {
apr_crypto_hash_init_t *init;
apr_crypto_hash_add_t *add;
apr_crypto_hash_finish_t *finish;
apr_size_t size;
void *data;
};
APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p);
typedef struct apr_random_t apr_random_t;
APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p,
apr_crypto_hash_t *pool_hash,
apr_crypto_hash_t *key_hash,
apr_crypto_hash_t *prng_hash);
APR_DECLARE(apr_random_t *) apr_random_standard_new(apr_pool_t *p);
APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g,
const void *entropy_,
apr_size_t bytes);
APR_DECLARE(apr_status_t) apr_random_insecure_bytes(apr_random_t *g,
void *random,
apr_size_t bytes);
APR_DECLARE(apr_status_t) apr_random_secure_bytes(apr_random_t *g,
void *random,
apr_size_t bytes);
APR_DECLARE(void) apr_random_barrier(apr_random_t *g);
APR_DECLARE(apr_status_t) apr_random_secure_ready(apr_random_t *r);
APR_DECLARE(apr_status_t) apr_random_insecure_ready(apr_random_t *r);
/* Call this in the child after forking to mix the randomness
pools. Note that its generally a bad idea to fork a process with a
real PRNG in it - better to have the PRNG externally and get the
randomness from there. However, if you really must do it, then you
should supply all your entropy to all the PRNGs - don't worry, they
won't produce the same output.
Note that apr_proc_fork() calls this for you, so only weird
applications need ever call it themselves.
*/
struct apr_proc_t;
APR_DECLARE(void) apr_random_after_fork(struct apr_proc_t *proc);
#endif /* ndef APR_RANDOM_H */
@@ -17,11 +17,11 @@
#ifndef DSO_H
#define DSO_H
#include "apr_private.h"
#include "apr_general.h"
#include "apr_pools.h"
#include "apr_dso.h"
#include "apr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_pools.h"
#include "fspr_dso.h"
#include "fspr.h"
#if APR_HAS_DSO
@@ -30,8 +30,8 @@ void *dlsym(void *handle, const char *symbol);
const char *dlerror(void);
int dlclose(void *handle);
struct apr_dso_handle_t {
apr_pool_t *pool;
struct fspr_dso_handle_t {
fspr_pool_t *pool;
void *handle;
const char *errormsg;
};
@@ -17,20 +17,20 @@
#ifndef DSO_H
#define DSO_H
#include "apr_private.h"
#include "apr_general.h"
#include "apr_pools.h"
#include "apr_errno.h"
#include "apr_dso.h"
#include "apr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_pools.h"
#include "fspr_errno.h"
#include "fspr_dso.h"
#include "fspr.h"
#include <kernel/image.h>
#include <string.h>
#if APR_HAS_DSO
struct apr_dso_handle_t {
struct fspr_dso_handle_t {
image_id handle; /* Handle to the DSO loaded */
apr_pool_t *pool;
fspr_pool_t *pool;
const char *errormsg; /* if the load fails, we have an error
* message here :)
*/
@@ -17,15 +17,15 @@
#ifndef PROC_MUTEX_H
#define PROC_MUTEX_H
#include "apr_pools.h"
#include "apr_proc_mutex.h"
#include "apr_file_io.h"
#include "apr_general.h"
#include "apr_lib.h"
#include "apr_portable.h"
#include "fspr_pools.h"
#include "fspr_proc_mutex.h"
#include "fspr_file_io.h"
#include "fspr_general.h"
#include "fspr_lib.h"
#include "fspr_portable.h"
struct apr_proc_mutex_t {
apr_pool_t *pool;
struct fspr_proc_mutex_t {
fspr_pool_t *pool;
/* Our lock :) */
sem_id Lock;
@@ -18,23 +18,23 @@
#define THREAD_COND_H
#include <kernel/OS.h>
#include "apr_pools.h"
#include "apr_thread_cond.h"
#include "apr_file_io.h"
#include "apr_general.h"
#include "apr_lib.h"
#include "apr_portable.h"
#include "apr_ring.h"
#include "fspr_pools.h"
#include "fspr_thread_cond.h"
#include "fspr_file_io.h"
#include "fspr_general.h"
#include "fspr_lib.h"
#include "fspr_portable.h"
#include "fspr_ring.h"
struct waiter_t {
APR_RING_ENTRY(waiter_t) link;
sem_id sem;
};
struct apr_thread_cond_t {
apr_pool_t *pool;
struct fspr_thread_cond_t {
fspr_pool_t *pool;
sem_id lock;
apr_thread_mutex_t *condlock;
fspr_thread_mutex_t *condlock;
thread_id owner;
/* active list */
APR_RING_HEAD(active_list, waiter_t) alist;
@@ -18,15 +18,15 @@
#define THREAD_MUTEX_H
#include <kernel/OS.h>
#include "apr_pools.h"
#include "apr_thread_mutex.h"
#include "apr_file_io.h"
#include "apr_general.h"
#include "apr_lib.h"
#include "apr_portable.h"
#include "fspr_pools.h"
#include "fspr_thread_mutex.h"
#include "fspr_file_io.h"
#include "fspr_general.h"
#include "fspr_lib.h"
#include "fspr_portable.h"
struct apr_thread_mutex_t {
apr_pool_t *pool;
struct fspr_thread_mutex_t {
fspr_pool_t *pool;
/* Our lock :) */
sem_id Lock;
@@ -34,7 +34,7 @@ struct apr_thread_mutex_t {
/* If we nest locks we need these... */
int nested;
apr_os_thread_t owner;
fspr_os_thread_t owner;
int owner_ref;
};
@@ -18,15 +18,15 @@
#define THREAD_RWLOCK_H
#include <kernel/OS.h>
#include "apr_pools.h"
#include "apr_thread_rwlock.h"
#include "apr_file_io.h"
#include "apr_general.h"
#include "apr_lib.h"
#include "apr_portable.h"
#include "fspr_pools.h"
#include "fspr_thread_rwlock.h"
#include "fspr_file_io.h"
#include "fspr_general.h"
#include "fspr_lib.h"
#include "fspr_portable.h"
struct apr_thread_rwlock_t {
apr_pool_t *pool;
struct fspr_thread_rwlock_t {
fspr_pool_t *pool;
/* Our lock :) */
sem_id Lock;
@@ -14,12 +14,12 @@
* limitations under the License.
*/
#include "apr_thread_proc.h"
#include "apr_arch_file_io.h"
#include "apr_file_io.h"
#include "apr_thread_proc.h"
#include "apr_general.h"
#include "apr_portable.h"
#include "fspr_thread_proc.h"
#include "fspr_arch_file_io.h"
#include "fspr_file_io.h"
#include "fspr_thread_proc.h"
#include "fspr_general.h"
#include "fspr_portable.h"
#include <kernel/OS.h>
#include <signal.h>
#include <string.h>
@@ -39,23 +39,23 @@
#define BEOS_MAX_DATAKEYS 128
struct apr_thread_t {
apr_pool_t *pool;
struct fspr_thread_t {
fspr_pool_t *pool;
thread_id td;
void *data;
apr_thread_start_t func;
apr_status_t exitval;
fspr_thread_start_t func;
fspr_status_t exitval;
};
struct apr_threadattr_t {
apr_pool_t *pool;
struct fspr_threadattr_t {
fspr_pool_t *pool;
int32 attr;
int detached;
int joinable;
};
struct apr_threadkey_t {
apr_pool_t *pool;
struct fspr_threadkey_t {
fspr_pool_t *pool;
int32 key;
};
@@ -73,20 +73,20 @@ struct beos_key {
void (* destructor) (void *);
};
struct apr_procattr_t {
apr_pool_t *pool;
apr_file_t *parent_in;
apr_file_t *child_in;
apr_file_t *parent_out;
apr_file_t *child_out;
apr_file_t *parent_err;
apr_file_t *child_err;
struct fspr_procattr_t {
fspr_pool_t *pool;
fspr_file_t *parent_in;
fspr_file_t *child_in;
fspr_file_t *parent_out;
fspr_file_t *child_out;
fspr_file_t *parent_err;
fspr_file_t *child_err;
char *currdir;
apr_int32_t cmdtype;
apr_int32_t detached;
fspr_int32_t cmdtype;
fspr_int32_t detached;
};
struct apr_thread_once_t {
struct fspr_thread_once_t {
sem_id sem;
int hit;
};
@@ -21,22 +21,22 @@
#ifndef APR_PRIVATE_COMMON_H
#define APR_PRIVATE_COMMON_H
#include "apr_pools.h"
#include "apr_tables.h"
#include "fspr_pools.h"
#include "fspr_tables.h"
apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts,
fspr_status_t fspr_filepath_list_split_impl(fspr_array_header_t **pathelts,
const char *liststr,
char separator,
apr_pool_t *p);
fspr_pool_t *p);
apr_status_t apr_filepath_list_merge_impl(char **liststr,
apr_array_header_t *pathelts,
fspr_status_t fspr_filepath_list_merge_impl(char **liststr,
fspr_array_header_t *pathelts,
char separator,
apr_pool_t *p);
fspr_pool_t *p);
/* temporary defines to handle 64bit compile mismatches */
#define APR_INT_TRUNC_CAST int
#define APR_UINT32_TRUNC_CAST apr_uint32_t
#define APR_UINT32_TRUNC_CAST fspr_uint32_t
#define APR_UINT32_MAX 0xFFFFFFFFUL
#endif /*APR_PRIVATE_COMMON_H*/
@@ -17,11 +17,11 @@
#ifndef DSO_H
#define DSO_H
#include "apr_private.h"
#include "apr_general.h"
#include "apr_pools.h"
#include "apr_dso.h"
#include "apr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_pools.h"
#include "fspr_dso.h"
#include "fspr.h"
#include <dlfcn.h>
@@ -32,8 +32,8 @@ struct sym_list {
char *symbol;
};
struct apr_dso_handle_t {
apr_pool_t *pool;
struct fspr_dso_handle_t {
fspr_pool_t *pool;
void *handle;
const char *errormsg;
sym_list *symbols;
@@ -17,15 +17,15 @@
#ifndef FILE_IO_H
#define FILE_IO_H
#include "apr.h"
#include "apr_private.h"
#include "apr_general.h"
#include "apr_tables.h"
#include "apr_file_io.h"
#include "apr_file_info.h"
#include "apr_errno.h"
#include "apr_lib.h"
#include "apr_poll.h"
#include "fspr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_tables.h"
#include "fspr_file_io.h"
#include "fspr_file_info.h"
#include "fspr_errno.h"
#include "fspr_lib.h"
#include "fspr_poll.h"
/* System headers the file I/O library needs */
#if APR_HAVE_FCNTL_H
@@ -78,45 +78,45 @@
typedef struct stat struct_stat;
struct apr_file_t {
apr_pool_t *pool;
struct fspr_file_t {
fspr_pool_t *pool;
int filedes;
char *fname;
apr_int32_t flags;
fspr_int32_t flags;
int eof_hit;
int is_pipe;
apr_interval_time_t timeout;
fspr_interval_time_t timeout;
int buffered;
enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking;
int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/
/* if there is a timeout set, then this pollset is used */
apr_pollset_t *pollset;
fspr_pollset_t *pollset;
/* Stuff for buffered mode */
char *buffer;
int bufpos; /* Read/Write position in buffer */
apr_off_t dataRead; /* amount of valid data read into buffer */
fspr_off_t dataRead; /* amount of valid data read into buffer */
int direction; /* buffer being used for 0 = read, 1 = write */
apr_off_t filePtr; /* position in file of handle */
fspr_off_t filePtr; /* position in file of handle */
#if APR_HAS_THREADS
struct apr_thread_mutex_t *thlock;
struct fspr_thread_mutex_t *thlock;
#endif
};
struct apr_dir_t {
apr_pool_t *pool;
struct fspr_dir_t {
fspr_pool_t *pool;
char *dirname;
DIR *dirstruct;
struct dirent *entry;
};
typedef struct apr_stat_entry_t apr_stat_entry_t;
typedef struct fspr_stat_entry_t fspr_stat_entry_t;
struct apr_stat_entry_t {
struct fspr_stat_entry_t {
struct stat info;
char *casedName;
apr_time_t expire;
fspr_time_t expire;
NXPathCtx_t pathCtx;
};
@@ -131,21 +131,21 @@ struct apr_stat_entry_t {
* we need to fold the case to canonical form. This function is
* supposed to do so.
*/
apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p);
fspr_status_t filepath_root_case(char **rootpath, char *root, fspr_pool_t *p);
/* This function check to see of the given path includes a drive/volume
* specifier. If the _only_ parameter is set to DRIVE_ONLY then it
* check to see of the path only contains a drive/volume specifier and
* nothing else.
*/
apr_status_t filepath_has_drive(const char *rootpath, int only, apr_pool_t *p);
fspr_status_t filepath_has_drive(const char *rootpath, int only, fspr_pool_t *p);
/* This function compares the drive/volume specifiers for each given path.
* It returns zero if they match or non-zero if not.
*/
apr_status_t filepath_compare_drive(const char *path1, const char *path2, apr_pool_t *p);
fspr_status_t filepath_compare_drive(const char *path1, const char *path2, fspr_pool_t *p);
apr_status_t apr_unix_file_cleanup(void *);
fspr_status_t fspr_unix_file_cleanup(void *);
#endif /* ! FILE_IO_H */
@@ -17,12 +17,12 @@
#ifndef GLOBAL_MUTEX_H
#define GLOBAL_MUTEX_H
#include "apr_global_mutex.h"
#include "apr_thread_mutex.h"
#include "fspr_global_mutex.h"
#include "fspr_thread_mutex.h"
struct apr_global_mutex_t {
apr_pool_t *pool;
apr_thread_mutex_t *mutex;
struct fspr_global_mutex_t {
fspr_pool_t *pool;
fspr_thread_mutex_t *mutex;
};
#endif /* GLOBAL_MUTEX_H */
@@ -17,10 +17,10 @@
#ifndef TIME_INTERNAL_H
#define TIME_INTERNAL_H
#include "apr.h"
#include "fspr.h"
#define TZONE (*___timezone())
void apr_netware_setup_time(void);
void fspr_netware_setup_time(void);
#endif /* TIME_INTERNAL_H */
@@ -22,9 +22,9 @@
arch/netware and then arch/unix. But in this specific case we
want arch/win32.
*/
#include <../win32/apr_arch_networkio.h>
#include <../win32/fspr_arch_networkio.h>
#else
#include <../unix/apr_arch_networkio.h>
#include <../unix/fspr_arch_networkio.h>
#endif
#endif /* ! NETWORK_IO_H */
@@ -17,12 +17,12 @@
#ifndef PROC_MUTEX_H
#define PROC_MUTEX_H
#include "apr_proc_mutex.h"
#include "apr_thread_mutex.h"
#include "fspr_proc_mutex.h"
#include "fspr_thread_mutex.h"
struct apr_proc_mutex_t {
apr_pool_t *pool;
apr_thread_mutex_t *mutex;
struct fspr_proc_mutex_t {
fspr_pool_t *pool;
fspr_thread_mutex_t *mutex;
};
#endif /* PROC_MUTEX_H */
@@ -17,11 +17,11 @@
#ifndef THREAD_COND_H
#define THREAD_COND_H
#include "apr_thread_cond.h"
#include "fspr_thread_cond.h"
#include <nks/synch.h>
struct apr_thread_cond_t {
apr_pool_t *pool;
struct fspr_thread_cond_t {
fspr_pool_t *pool;
NXCond_t *cond;
};
@@ -17,11 +17,11 @@
#ifndef THREAD_MUTEX_H
#define THREAD_MUTEX_H
#include "apr_thread_mutex.h"
#include "fspr_thread_mutex.h"
#include <nks/synch.h>
struct apr_thread_mutex_t {
apr_pool_t *pool;
struct fspr_thread_mutex_t {
fspr_pool_t *pool;
NXMutex_t *mutex;
};
@@ -17,11 +17,11 @@
#ifndef THREAD_RWLOCK_H
#define THREAD_RWLOCK_H
#include "apr_thread_rwlock.h"
#include "fspr_thread_rwlock.h"
#include <nks/synch.h>
struct apr_thread_rwlock_t {
apr_pool_t *pool;
struct fspr_thread_rwlock_t {
fspr_pool_t *pool;
NXRwLock_t *rwlock;
};
@@ -14,9 +14,9 @@
* limitations under the License.
*/
#include "apr.h"
#include "apr_thread_proc.h"
#include "apr_file_io.h"
#include "fspr.h"
#include "fspr_thread_proc.h"
#include "fspr_file_io.h"
#include <sys/wait.h>
@@ -26,52 +26,52 @@
#define SHELL_PATH ""
#define APR_DEFAULT_STACK_SIZE 65536
struct apr_thread_t {
apr_pool_t *pool;
struct fspr_thread_t {
fspr_pool_t *pool;
NXContext_t ctx;
NXThreadId_t td;
char *thread_name;
apr_int32_t cancel;
apr_int32_t cancel_how;
fspr_int32_t cancel;
fspr_int32_t cancel_how;
void *data;
apr_thread_start_t func;
apr_status_t exitval;
fspr_thread_start_t func;
fspr_status_t exitval;
};
struct apr_threadattr_t {
apr_pool_t *pool;
apr_size_t stack_size;
apr_int32_t detach;
struct fspr_threadattr_t {
fspr_pool_t *pool;
fspr_size_t stack_size;
fspr_int32_t detach;
char *thread_name;
};
struct apr_threadkey_t {
apr_pool_t *pool;
struct fspr_threadkey_t {
fspr_pool_t *pool;
NXKey_t key;
};
struct apr_procattr_t {
apr_pool_t *pool;
apr_file_t *parent_in;
apr_file_t *child_in;
apr_file_t *parent_out;
apr_file_t *child_out;
apr_file_t *parent_err;
apr_file_t *child_err;
struct fspr_procattr_t {
fspr_pool_t *pool;
fspr_file_t *parent_in;
fspr_file_t *child_in;
fspr_file_t *parent_out;
fspr_file_t *child_out;
fspr_file_t *parent_err;
fspr_file_t *child_err;
char *currdir;
apr_int32_t cmdtype;
apr_int32_t detached;
apr_int32_t addrspace;
fspr_int32_t cmdtype;
fspr_int32_t detached;
fspr_int32_t addrspace;
};
struct apr_thread_once_t {
struct fspr_thread_once_t {
unsigned long value;
};
//struct apr_proc_t {
// apr_pool_t *pool;
//struct fspr_proc_t {
// fspr_pool_t *pool;
// pid_t pid;
// apr_procattr_t *attr;
// fspr_procattr_t *attr;
//};
#endif /* ! THREAD_PROC_H */
@@ -28,7 +28,7 @@
/* Include the public APR symbols, include our idea of the 'right'
* subset of the Windows.h header. This saves us repetition.
*/
#include "apr.h"
#include "fspr.h"
#include <sys/types.h>
#include <stddef.h>
@@ -185,7 +185,7 @@ void* getStatCache();
/*
* Include common private declarations.
*/
#include "../apr_private_common.h"
#include "../fspr_private_common.h"
#endif /*APR_PRIVATE_H*/
#endif /*NETWARE*/
@@ -1,59 +0,0 @@
/* 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_errno.h"
#include <sys/types.h>
#include <sys/socket.h>
extern int (*apr_os2_socket)(int, int, int);
extern int (*apr_os2_select)(int *, int, int, int, long);
extern int (*apr_os2_sock_errno)();
extern int (*apr_os2_accept)(int, struct sockaddr *, int *);
extern int (*apr_os2_bind)(int, struct sockaddr *, int);
extern int (*apr_os2_connect)(int, struct sockaddr *, int);
extern int (*apr_os2_getpeername)(int, struct sockaddr *, int *);
extern int (*apr_os2_getsockname)(int, struct sockaddr *, int *);
extern int (*apr_os2_getsockopt)(int, int, int, char *, int *);
extern int (*apr_os2_ioctl)(int, int, caddr_t, int);
extern int (*apr_os2_listen)(int, int);
extern int (*apr_os2_recv)(int, char *, int, int);
extern int (*apr_os2_send)(int, const char *, int, int);
extern int (*apr_os2_setsockopt)(int, int, int, char *, int);
extern int (*apr_os2_shutdown)(int, int);
extern int (*apr_os2_soclose)(int);
extern int (*apr_os2_writev)(int, struct iovec *, int);
extern int (*apr_os2_sendto)(int, const char *, int, int, const struct sockaddr *, int);
extern int (*apr_os2_recvfrom)(int, char *, int, int, struct sockaddr *, int *);
#define socket apr_os2_socket
#define select apr_os2_select
#define sock_errno apr_os2_sock_errno
#define accept apr_os2_accept
#define bind apr_os2_bind
#define connect apr_os2_connect
#define getpeername apr_os2_getpeername
#define getsockname apr_os2_getsockname
#define getsockopt apr_os2_getsockopt
#define ioctl apr_os2_ioctl
#define listen apr_os2_listen
#define recv apr_os2_recv
#define send apr_os2_send
#define setsockopt apr_os2_setsockopt
#define shutdown apr_os2_shutdown
#define soclose apr_os2_soclose
#define writev apr_os2_writev
#define sendto apr_os2_sendto
#define recvfrom apr_os2_recvfrom
@@ -17,18 +17,18 @@
#ifndef DSO_H
#define DSO_H
#include "apr_private.h"
#include "apr_general.h"
#include "apr_pools.h"
#include "apr_dso.h"
#include "apr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_pools.h"
#include "fspr_dso.h"
#include "fspr.h"
#if APR_HAS_DSO
struct apr_dso_handle_t {
apr_pool_t *cont; /* Context for returning error strings */
struct fspr_dso_handle_t {
fspr_pool_t *cont; /* Context for returning error strings */
HMODULE handle; /* Handle to the DSO loaded */
apr_status_t load_error;
fspr_status_t load_error;
char *failed_module;
};
@@ -17,13 +17,13 @@
#ifndef FILE_IO_H
#define FILE_IO_H
#include "apr_private.h"
#include "apr_general.h"
#include "apr_thread_mutex.h"
#include "apr_file_io.h"
#include "apr_file_info.h"
#include "apr_errno.h"
#include "apr_poll.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_thread_mutex.h"
#include "fspr_file_io.h"
#include "fspr_file_info.h"
#include "fspr_errno.h"
#include "fspr_poll.h"
/* We have an implementation of mkstemp but it's not very multi-threading
* friendly & is part of the POSIX emulation rather than native so don't
@@ -33,14 +33,14 @@
#define APR_FILE_BUFSIZE 4096
struct apr_file_t {
apr_pool_t *pool;
struct fspr_file_t {
fspr_pool_t *pool;
HFILE filedes;
char * fname;
int isopen;
int buffered;
int eof_hit;
apr_int32_t flags;
fspr_int32_t flags;
int timeout;
int pipe;
HEV pipeSem;
@@ -52,32 +52,32 @@ struct apr_file_t {
unsigned long dataRead; // amount of valid data read into buffer
int direction; // buffer being used for 0 = read, 1 = write
unsigned long filePtr; // position in file of handle
apr_thread_mutex_t *mutex;// mutex semaphore, must be owned to access the above fields
fspr_thread_mutex_t *mutex;// mutex semaphore, must be owned to access the above fields
};
struct apr_dir_t {
apr_pool_t *pool;
struct fspr_dir_t {
fspr_pool_t *pool;
char *dirname;
ULONG handle;
FILEFINDBUF3 entry;
int validentry;
};
apr_status_t apr_file_cleanup(void *);
apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date,
fspr_status_t fspr_file_cleanup(void *);
fspr_status_t fspr_os2_time_to_fspr_time(fspr_time_t *result, FDATE os2date,
FTIME os2time);
apr_status_t apr_apr_time_to_os2_time(FDATE *os2date, FTIME *os2time,
apr_time_t aprtime);
fspr_status_t fspr_fspr_time_to_os2_time(FDATE *os2date, FTIME *os2time,
fspr_time_t aprtime);
/* see win32/fileio.h for description of these */
extern const char c_is_fnchar[256];
#define IS_FNCHAR(c) c_is_fnchar[(unsigned char)c]
apr_status_t filepath_root_test(char *path, apr_pool_t *p);
apr_status_t filepath_drive_get(char **rootpath, char drive,
apr_int32_t flags, apr_pool_t *p);
apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p);
fspr_status_t filepath_root_test(char *path, fspr_pool_t *p);
fspr_status_t filepath_drive_get(char **rootpath, char drive,
fspr_int32_t flags, fspr_pool_t *p);
fspr_status_t filepath_root_case(char **rootpath, char *root, fspr_pool_t *p);
#endif /* ! FILE_IO_H */
@@ -17,11 +17,11 @@
#ifndef NETWORK_IO_H
#define NETWORK_IO_H
#include "apr_private.h"
#include "apr_network_io.h"
#include "apr_general.h"
#include "apr_arch_os2calls.h"
#include "apr_poll.h"
#include "fspr_private.h"
#include "fspr_network_io.h"
#include "fspr_general.h"
#include "fspr_arch_os2calls.h"
#include "fspr_poll.h"
#if APR_HAVE_NETDB_H
#include <netdb.h>
@@ -34,24 +34,24 @@ struct sock_userdata_t {
void *data;
};
struct apr_socket_t {
apr_pool_t *pool;
struct fspr_socket_t {
fspr_pool_t *pool;
int socketdes;
int type;
int protocol;
apr_sockaddr_t *local_addr;
apr_sockaddr_t *remote_addr;
apr_interval_time_t timeout;
fspr_sockaddr_t *local_addr;
fspr_sockaddr_t *remote_addr;
fspr_interval_time_t timeout;
int nonblock;
int local_port_unknown;
int local_interface_unknown;
int remote_addr_unknown;
apr_int32_t options;
apr_int32_t inherit;
fspr_int32_t options;
fspr_int32_t inherit;
sock_userdata_t *userdata;
/* if there is a timeout set, then this pollset is used */
apr_pollset_t *pollset;
fspr_pollset_t *pollset;
};
/* Error codes returned from sock_errno() */
@@ -68,9 +68,9 @@ struct apr_socket_t {
#define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */
#define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */
const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size);
int apr_inet_pton(int af, const char *src, void *dst);
void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t);
const char *fspr_inet_ntop(int af, const void *src, char *dst, fspr_size_t size);
int fspr_inet_pton(int af, const char *src, void *dst);
void fspr_sockaddr_vars_set(fspr_sockaddr_t *, int, fspr_port_t);
#endif /* ! NETWORK_IO_H */
@@ -0,0 +1,59 @@
/* 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 "fspr_errno.h"
#include <sys/types.h>
#include <sys/socket.h>
extern int (*fspr_os2_socket)(int, int, int);
extern int (*fspr_os2_select)(int *, int, int, int, long);
extern int (*fspr_os2_sock_errno)();
extern int (*fspr_os2_accept)(int, struct sockaddr *, int *);
extern int (*fspr_os2_bind)(int, struct sockaddr *, int);
extern int (*fspr_os2_connect)(int, struct sockaddr *, int);
extern int (*fspr_os2_getpeername)(int, struct sockaddr *, int *);
extern int (*fspr_os2_getsockname)(int, struct sockaddr *, int *);
extern int (*fspr_os2_getsockopt)(int, int, int, char *, int *);
extern int (*fspr_os2_ioctl)(int, int, caddr_t, int);
extern int (*fspr_os2_listen)(int, int);
extern int (*fspr_os2_recv)(int, char *, int, int);
extern int (*fspr_os2_send)(int, const char *, int, int);
extern int (*fspr_os2_setsockopt)(int, int, int, char *, int);
extern int (*fspr_os2_shutdown)(int, int);
extern int (*fspr_os2_soclose)(int);
extern int (*fspr_os2_writev)(int, struct iovec *, int);
extern int (*fspr_os2_sendto)(int, const char *, int, int, const struct sockaddr *, int);
extern int (*fspr_os2_recvfrom)(int, char *, int, int, struct sockaddr *, int *);
#define socket fspr_os2_socket
#define select fspr_os2_select
#define sock_errno fspr_os2_sock_errno
#define accept fspr_os2_accept
#define bind fspr_os2_bind
#define connect fspr_os2_connect
#define getpeername fspr_os2_getpeername
#define getsockname fspr_os2_getsockname
#define getsockopt fspr_os2_getsockopt
#define ioctl fspr_os2_ioctl
#define listen fspr_os2_listen
#define recv fspr_os2_recv
#define send fspr_os2_send
#define setsockopt fspr_os2_setsockopt
#define shutdown fspr_os2_shutdown
#define soclose fspr_os2_soclose
#define writev fspr_os2_writev
#define sendto fspr_os2_sendto
#define recvfrom fspr_os2_recvfrom
@@ -17,11 +17,11 @@
#ifndef PROC_MUTEX_H
#define PROC_MUTEX_H
#include "apr_proc_mutex.h"
#include "apr_file_io.h"
#include "fspr_proc_mutex.h"
#include "fspr_file_io.h"
struct apr_proc_mutex_t {
apr_pool_t *pool;
struct fspr_proc_mutex_t {
fspr_pool_t *pool;
HMTX hMutex;
TID owner;
int lock_count;
@@ -17,11 +17,11 @@
#ifndef THREAD_COND_H
#define THREAD_COND_H
#include "apr_thread_cond.h"
#include "apr_file_io.h"
#include "fspr_thread_cond.h"
#include "fspr_file_io.h"
struct apr_thread_cond_t {
apr_pool_t *pool;
struct fspr_thread_cond_t {
fspr_pool_t *pool;
};
#endif /* THREAD_COND_H */
@@ -17,11 +17,11 @@
#ifndef THREAD_MUTEX_H
#define THREAD_MUTEX_H
#include "apr_thread_mutex.h"
#include "apr_file_io.h"
#include "fspr_thread_mutex.h"
#include "fspr_file_io.h"
struct apr_thread_mutex_t {
apr_pool_t *pool;
struct fspr_thread_mutex_t {
fspr_pool_t *pool;
HMTX hMutex;
};
@@ -17,11 +17,11 @@
#ifndef THREAD_RWLOCK_H
#define THREAD_RWLOCK_H
#include "apr_thread_rwlock.h"
#include "apr_file_io.h"
#include "fspr_thread_rwlock.h"
#include "fspr_file_io.h"
struct apr_thread_rwlock_t {
apr_pool_t *pool;
struct fspr_thread_rwlock_t {
fspr_pool_t *pool;
int readers;
HMTX write_lock;
HEV read_done;
@@ -14,8 +14,8 @@
* limitations under the License.
*/
#include "apr_thread_proc.h"
#include "apr_file_io.h"
#include "fspr_thread_proc.h"
#include "fspr_file_io.h"
#ifndef THREAD_PROC_H
#define THREAD_PROC_H
@@ -25,40 +25,40 @@
#define SHELL_PATH "cmd.exe"
#define APR_THREAD_STACKSIZE 65536
struct apr_threadattr_t {
apr_pool_t *pool;
struct fspr_threadattr_t {
fspr_pool_t *pool;
unsigned long attr;
apr_size_t stacksize;
fspr_size_t stacksize;
};
struct apr_thread_t {
apr_pool_t *pool;
struct apr_threadattr_t *attr;
struct fspr_thread_t {
fspr_pool_t *pool;
struct fspr_threadattr_t *attr;
unsigned long tid;
apr_thread_start_t func;
fspr_thread_start_t func;
void *data;
apr_status_t exitval;
fspr_status_t exitval;
};
struct apr_threadkey_t {
apr_pool_t *pool;
struct fspr_threadkey_t {
fspr_pool_t *pool;
unsigned long *key;
};
struct apr_procattr_t {
apr_pool_t *pool;
apr_file_t *parent_in;
apr_file_t *child_in;
apr_file_t *parent_out;
apr_file_t *child_out;
apr_file_t *parent_err;
apr_file_t *child_err;
struct fspr_procattr_t {
fspr_pool_t *pool;
fspr_file_t *parent_in;
fspr_file_t *child_in;
fspr_file_t *parent_out;
fspr_file_t *child_out;
fspr_file_t *parent_err;
fspr_file_t *child_err;
char *currdir;
apr_int32_t cmdtype;
apr_int32_t detached;
fspr_int32_t cmdtype;
fspr_int32_t detached;
};
struct apr_thread_once_t {
struct fspr_thread_once_t {
unsigned long sem;
char hit;
};
@@ -17,21 +17,21 @@
#ifndef DSO_H
#define DSO_H
#include "apr_private.h"
#include "apr_general.h"
#include "apr_pools.h"
#include "apr_dso.h"
#include "apr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_pools.h"
#include "fspr_dso.h"
#include "fspr.h"
#if APR_HAS_DSO
#include <dll.h>
struct apr_dso_handle_t {
struct fspr_dso_handle_t {
dllhandle *handle; /* Handle to the DSO loaded */
int failing_errno; /* Don't save the buffer returned by
strerror(); it gets reused */
apr_pool_t *pool;
fspr_pool_t *pool;
};
#endif
@@ -17,11 +17,11 @@
#ifndef DSO_H
#define DSO_H
#include "apr_private.h"
#include "apr_general.h"
#include "apr_pools.h"
#include "apr_dso.h"
#include "apr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_pools.h"
#include "fspr_dso.h"
#include "fspr.h"
#if APR_HAS_DSO
@@ -52,8 +52,8 @@
#define DLSYM_NEEDS_UNDERSCORE
#endif
struct apr_dso_handle_t {
apr_pool_t *pool;
struct fspr_dso_handle_t {
fspr_pool_t *pool;
void *handle;
const char *errormsg;
};
@@ -17,17 +17,17 @@
#ifndef FILE_IO_H
#define FILE_IO_H
#include "apr.h"
#include "apr_private.h"
#include "apr_general.h"
#include "apr_tables.h"
#include "apr_file_io.h"
#include "apr_file_info.h"
#include "apr_errno.h"
#include "apr_lib.h"
#include "apr_thread_mutex.h"
#include "fspr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_tables.h"
#include "fspr_file_io.h"
#include "fspr_file_info.h"
#include "fspr_errno.h"
#include "fspr_lib.h"
#include "fspr_thread_mutex.h"
#ifndef WAITIO_USES_POLL
#include "apr_poll.h"
#include "fspr_poll.h"
#endif
/* System headers the file I/O library needs */
@@ -84,29 +84,29 @@
#define APR_FILE_BUFSIZE 4096
struct apr_file_t {
apr_pool_t *pool;
struct fspr_file_t {
fspr_pool_t *pool;
int filedes;
char *fname;
apr_int32_t flags;
fspr_int32_t flags;
int eof_hit;
int is_pipe;
apr_interval_time_t timeout;
fspr_interval_time_t timeout;
int buffered;
enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking;
int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/
#ifndef WAITIO_USES_POLL
/* if there is a timeout set, then this pollset is used */
apr_pollset_t *pollset;
fspr_pollset_t *pollset;
#endif
/* Stuff for buffered mode */
char *buffer;
int bufpos; /* Read/Write position in buffer */
unsigned long dataRead; /* amount of valid data read into buffer */
int direction; /* buffer being used for 0 = read, 1 = write */
apr_off_t filePtr; /* position in file of handle */
fspr_off_t filePtr; /* position in file of handle */
#if APR_HAS_THREADS
struct apr_thread_mutex_t *thlock;
struct fspr_thread_mutex_t *thlock;
#endif
};
@@ -121,17 +121,17 @@ typedef struct stat64 struct_stat;
typedef struct stat struct_stat;
#endif
struct apr_dir_t {
apr_pool_t *pool;
struct fspr_dir_t {
fspr_pool_t *pool;
char *dirname;
DIR *dirstruct;
struct dirent *entry;
};
apr_status_t apr_unix_file_cleanup(void *);
fspr_status_t fspr_unix_file_cleanup(void *);
mode_t apr_unix_perms2mode(apr_fileperms_t perms);
apr_fileperms_t apr_unix_mode2perms(mode_t mode);
mode_t fspr_unix_perms2mode(fspr_fileperms_t perms);
fspr_fileperms_t fspr_unix_mode2perms(mode_t mode);
#endif /* ! FILE_IO_H */
@@ -17,19 +17,19 @@
#ifndef GLOBAL_MUTEX_H
#define GLOBAL_MUTEX_H
#include "apr.h"
#include "apr_private.h"
#include "apr_general.h"
#include "apr_lib.h"
#include "apr_global_mutex.h"
#include "apr_arch_proc_mutex.h"
#include "apr_arch_thread_mutex.h"
#include "fspr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_lib.h"
#include "fspr_global_mutex.h"
#include "fspr_arch_proc_mutex.h"
#include "fspr_arch_thread_mutex.h"
struct apr_global_mutex_t {
apr_pool_t *pool;
apr_proc_mutex_t *proc_mutex;
struct fspr_global_mutex_t {
fspr_pool_t *pool;
fspr_proc_mutex_t *proc_mutex;
#if APR_HAS_THREADS
apr_thread_mutex_t *thread_mutex;
fspr_thread_mutex_t *thread_mutex;
#endif /* APR_HAS_THREADS */
};
@@ -17,32 +17,32 @@
#ifndef INHERIT_H
#define INHERIT_H
#include "apr_inherit.h"
#include "fspr_inherit.h"
#define APR_INHERIT (1 << 24) /* Must not conflict with other bits */
#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \
apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \
fspr_status_t fspr_##name##_inherit_set(fspr_##name##_t *the##name) \
{ \
if (the##name->flag & APR_FILE_NOCLEANUP) \
return APR_EINVAL; \
if (!(the##name->flag & APR_INHERIT)) { \
the##name->flag |= APR_INHERIT; \
apr_pool_child_cleanup_set(the##name->pool, \
fspr_pool_child_cleanup_set(the##name->pool, \
(void *)the##name, \
cleanup, apr_pool_cleanup_null); \
cleanup, fspr_pool_cleanup_null); \
} \
return APR_SUCCESS; \
}
#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \
apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \
fspr_status_t fspr_##name##_inherit_unset(fspr_##name##_t *the##name) \
{ \
if (the##name->flag & APR_FILE_NOCLEANUP) \
return APR_EINVAL; \
if (the##name->flag & APR_INHERIT) { \
the##name->flag &= ~APR_INHERIT; \
apr_pool_child_cleanup_set(the##name->pool, \
fspr_pool_child_cleanup_set(the##name->pool, \
(void *)the##name, \
cleanup, cleanup); \
} \
@@ -17,8 +17,8 @@
#ifndef TIME_INTERNAL_H
#define TIME_INTERNAL_H
#include "apr.h"
#include "fspr.h"
void apr_unix_setup_time(void);
void fspr_unix_setup_time(void);
#endif /* TIME_INTERNAL_H */
@@ -17,16 +17,16 @@
#ifndef MISC_H
#define MISC_H
#include "apr.h"
#include "apr_portable.h"
#include "apr_private.h"
#include "apr_general.h"
#include "apr_pools.h"
#include "apr_getopt.h"
#include "apr_thread_proc.h"
#include "apr_file_io.h"
#include "apr_errno.h"
#include "apr_getopt.h"
#include "fspr.h"
#include "fspr_portable.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_pools.h"
#include "fspr_getopt.h"
#include "fspr_thread_proc.h"
#include "fspr_file_io.h"
#include "fspr_errno.h"
#include "fspr_getopt.h"
#if APR_HAVE_STDIO_H
#include <stdio.h>
@@ -49,13 +49,13 @@
#include <kernel/OS.h>
#endif
struct apr_other_child_rec_t {
apr_pool_t *p;
struct apr_other_child_rec_t *next;
apr_proc_t *proc;
struct fspr_other_child_rec_t {
fspr_pool_t *p;
struct fspr_other_child_rec_t *next;
fspr_proc_t *proc;
void (*maintenance) (int, void *, int);
void *data;
apr_os_file_t write_fd;
fspr_os_file_t write_fd;
};
#if defined(WIN32) || defined(NETWARE)
@@ -17,14 +17,14 @@
#ifndef NETWORK_IO_H
#define NETWORK_IO_H
#include "apr.h"
#include "apr_private.h"
#include "apr_network_io.h"
#include "apr_errno.h"
#include "apr_general.h"
#include "apr_lib.h"
#include "fspr.h"
#include "fspr_private.h"
#include "fspr_network_io.h"
#include "fspr_errno.h"
#include "fspr_general.h"
#include "fspr_lib.h"
#ifndef WAITIO_USES_POLL
#include "apr_poll.h"
#include "fspr_poll.h"
#endif
/* System headers the network I/O library needs */
@@ -100,37 +100,37 @@ struct sock_userdata_t {
void *data;
};
struct apr_socket_t {
apr_pool_t *pool;
struct fspr_socket_t {
fspr_pool_t *pool;
int socketdes;
int type;
int protocol;
apr_sockaddr_t *local_addr;
apr_sockaddr_t *remote_addr;
apr_interval_time_t timeout;
fspr_sockaddr_t *local_addr;
fspr_sockaddr_t *remote_addr;
fspr_interval_time_t timeout;
#ifndef HAVE_POLL
int connected;
#endif
int local_port_unknown;
int local_interface_unknown;
int remote_addr_unknown;
apr_int32_t options;
apr_int32_t inherit;
fspr_int32_t options;
fspr_int32_t inherit;
sock_userdata_t *userdata;
#ifndef WAITIO_USES_POLL
/* if there is a timeout set, then this pollset is used */
apr_pollset_t *pollset;
fspr_pollset_t *pollset;
#endif
};
const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size);
int apr_inet_pton(int af, const char *src, void *dst);
void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t);
const char *fspr_inet_ntop(int af, const void *src, char *dst, fspr_size_t size);
int fspr_inet_pton(int af, const char *src, void *dst);
void fspr_sockaddr_vars_set(fspr_sockaddr_t *, int, fspr_port_t);
#define apr_is_option_set(skt, option) \
#define fspr_is_option_set(skt, option) \
(((skt)->options & (option)) == (option))
#define apr_set_option(skt, option, on) \
#define fspr_set_option(skt, option, on) \
do { \
if (on) \
(skt)->options |= (option); \
@@ -17,12 +17,12 @@
#ifndef APR_ARCH_POLL_PRIVATE_H
#define APR_ARCH_POLL_PRIVATE_H
#include "apr.h"
#include "apr_poll.h"
#include "apr_time.h"
#include "apr_portable.h"
#include "apr_arch_networkio.h"
#include "apr_arch_file_io.h"
#include "fspr.h"
#include "fspr_poll.h"
#include "fspr_time.h"
#include "fspr_portable.h"
#include "fspr_arch_networkio.h"
#include "fspr_arch_file_io.h"
#if HAVE_POLL_H
#include <poll.h>
@@ -52,7 +52,7 @@
#define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0
#endif
/* Choose the best method platform specific to use in apr_pollset */
/* Choose the best method platform specific to use in fspr_pollset */
#ifdef HAVE_KQUEUE
#define POLLSET_USES_KQUEUE
#elif defined(HAVE_PORT_CREATE)
@@ -73,16 +73,16 @@
#if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT)
#include "apr_ring.h"
#include "fspr_ring.h"
#if APR_HAS_THREADS
#include "apr_thread_mutex.h"
#include "fspr_thread_mutex.h"
#define pollset_lock_rings() \
if (pollset->flags & APR_POLLSET_THREADSAFE) \
apr_thread_mutex_lock(pollset->ring_lock);
fspr_thread_mutex_lock(pollset->ring_lock);
#define pollset_unlock_rings() \
if (pollset->flags & APR_POLLSET_THREADSAFE) \
apr_thread_mutex_unlock(pollset->ring_lock);
fspr_thread_mutex_unlock(pollset->ring_lock);
#else
#define pollset_lock_rings()
#define pollset_unlock_rings()
@@ -92,7 +92,7 @@ typedef struct pfd_elem_t pfd_elem_t;
struct pfd_elem_t {
APR_RING_ENTRY(pfd_elem_t) link;
apr_pollfd_t pfd;
fspr_pollfd_t pfd;
};
#endif
@@ -23,15 +23,15 @@
#endif
#endif
#include "apr.h"
#include "apr_private.h"
#include "apr_general.h"
#include "apr_lib.h"
#include "apr_proc_mutex.h"
#include "apr_pools.h"
#include "apr_portable.h"
#include "apr_file_io.h"
#include "apr_arch_file_io.h"
#include "fspr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_lib.h"
#include "fspr_proc_mutex.h"
#include "fspr_pools.h"
#include "fspr_portable.h"
#include "fspr_file_io.h"
#include "fspr_arch_file_io.h"
/* System headers required by Locks library */
#if APR_HAVE_SYS_TYPES_H
@@ -73,19 +73,19 @@
#endif
/* End System Headers */
struct apr_proc_mutex_unix_lock_methods_t {
struct fspr_proc_mutex_unix_lock_methods_t {
unsigned int flags;
apr_status_t (*create)(apr_proc_mutex_t *, const char *);
apr_status_t (*acquire)(apr_proc_mutex_t *);
apr_status_t (*tryacquire)(apr_proc_mutex_t *);
apr_status_t (*release)(apr_proc_mutex_t *);
apr_status_t (*cleanup)(void *);
apr_status_t (*child_init)(apr_proc_mutex_t **, apr_pool_t *, const char *);
fspr_status_t (*create)(fspr_proc_mutex_t *, const char *);
fspr_status_t (*acquire)(fspr_proc_mutex_t *);
fspr_status_t (*tryacquire)(fspr_proc_mutex_t *);
fspr_status_t (*release)(fspr_proc_mutex_t *);
fspr_status_t (*cleanup)(void *);
fspr_status_t (*child_init)(fspr_proc_mutex_t **, fspr_pool_t *, const char *);
const char *name;
};
typedef struct apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_lock_methods_t;
typedef struct fspr_proc_mutex_unix_lock_methods_t fspr_proc_mutex_unix_lock_methods_t;
/* bit values for flags field in apr_unix_lock_methods_t */
/* bit values for flags field in fspr_unix_lock_methods_t */
#define APR_PROCESS_LOCK_MECH_IS_GLOBAL 1
#if !APR_HAVE_UNION_SEMUN && defined(APR_HAS_SYSVSEM_SERIALIZE)
@@ -96,14 +96,14 @@ union semun {
};
#endif
struct apr_proc_mutex_t {
apr_pool_t *pool;
const apr_proc_mutex_unix_lock_methods_t *meth;
const apr_proc_mutex_unix_lock_methods_t *inter_meth;
struct fspr_proc_mutex_t {
fspr_pool_t *pool;
const fspr_proc_mutex_unix_lock_methods_t *meth;
const fspr_proc_mutex_unix_lock_methods_t *inter_meth;
int curr_locked;
char *fname;
#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE
apr_file_t *interproc;
fspr_file_t *interproc;
#endif
#if APR_HAS_POSIXSEM_SERIALIZE
sem_t *psem_interproc;
@@ -113,7 +113,7 @@ struct apr_proc_mutex_t {
#endif
};
void apr_proc_mutex_unix_setup_lock(void);
void fspr_proc_mutex_unix_setup_lock(void);
#endif /* PROC_MUTEX_H */
@@ -17,15 +17,15 @@
#ifndef SHM_H
#define SHM_H
#include "apr.h"
#include "apr_private.h"
#include "apr_general.h"
#include "apr_lib.h"
#include "apr_shm.h"
#include "apr_pools.h"
#include "apr_file_io.h"
#include "apr_network_io.h"
#include "apr_portable.h"
#include "fspr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_lib.h"
#include "fspr_shm.h"
#include "fspr_pools.h"
#include "fspr_file_io.h"
#include "fspr_network_io.h"
#include "fspr_portable.h"
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
@@ -55,12 +55,12 @@
#define MAP_FAILED ((void *)-1)
#endif
struct apr_shm_t {
apr_pool_t *pool;
struct fspr_shm_t {
fspr_pool_t *pool;
void *base; /* base real address */
void *usable; /* base usable address */
apr_size_t reqsize; /* requested segment size */
apr_size_t realsize; /* actual segment size */
fspr_size_t reqsize; /* requested segment size */
fspr_size_t realsize; /* actual segment size */
const char *filename; /* NULL if anonymous */
#if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON
int shmid; /* shmem ID returned from shmget() */
@@ -17,13 +17,13 @@
#ifndef THREAD_COND_H
#define THREAD_COND_H
#include "apr.h"
#include "apr_private.h"
#include "apr_general.h"
#include "apr_lib.h"
#include "apr_thread_mutex.h"
#include "apr_thread_cond.h"
#include "apr_pools.h"
#include "fspr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_lib.h"
#include "fspr_thread_mutex.h"
#include "fspr_thread_cond.h"
#include "fspr_pools.h"
#if APR_HAVE_PTHREAD_H
#include <pthread.h>
@@ -32,8 +32,8 @@
/* XXX: Should we have a better autoconf search, something like
* APR_HAS_PTHREAD_COND? -aaron */
#if APR_HAS_THREADS
struct apr_thread_cond_t {
apr_pool_t *pool;
struct fspr_thread_cond_t {
fspr_pool_t *pool;
pthread_cond_t cond;
};
#endif
@@ -23,20 +23,20 @@
#endif
#endif
#include "apr.h"
#include "apr_private.h"
#include "apr_general.h"
#include "apr_thread_mutex.h"
#include "apr_portable.h"
#include "apr_atomic.h"
#include "fspr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_thread_mutex.h"
#include "fspr_portable.h"
#include "fspr_atomic.h"
#if APR_HAVE_PTHREAD_H
#include <pthread.h>
#endif
#if APR_HAS_THREADS
struct apr_thread_mutex_t {
apr_pool_t *pool;
struct fspr_thread_mutex_t {
fspr_pool_t *pool;
pthread_mutex_t mutex;
};
#endif
@@ -17,11 +17,11 @@
#ifndef THREAD_RWLOCK_H
#define THREAD_RWLOCK_H
#include "apr.h"
#include "apr_private.h"
#include "apr_general.h"
#include "apr_thread_rwlock.h"
#include "apr_pools.h"
#include "fspr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_thread_rwlock.h"
#include "fspr_pools.h"
#if APR_HAVE_PTHREAD_H
/* this gives us pthread_rwlock_t */
@@ -31,15 +31,15 @@
#if APR_HAS_THREADS
#ifdef HAVE_PTHREAD_RWLOCKS
struct apr_thread_rwlock_t {
apr_pool_t *pool;
struct fspr_thread_rwlock_t {
fspr_pool_t *pool;
pthread_rwlock_t rwlock;
};
#else
struct apr_thread_rwlock_t {
apr_pool_t *pool;
struct fspr_thread_rwlock_t {
fspr_pool_t *pool;
};
#endif
@@ -14,11 +14,11 @@
* limitations under the License.
*/
#include "apr.h"
#include "apr_private.h"
#include "apr_thread_proc.h"
#include "apr_file_io.h"
#include "apr_arch_file_io.h"
#include "fspr.h"
#include "fspr_private.h"
#include "fspr_thread_proc.h"
#include "fspr_file_io.h"
#include "fspr_arch_file_io.h"
/* System headers required for thread/process library */
#if APR_HAVE_PTHREAD_H
@@ -49,43 +49,43 @@
#if APR_HAS_THREADS
struct apr_thread_t {
apr_pool_t *pool;
struct fspr_thread_t {
fspr_pool_t *pool;
pthread_t *td;
void *data;
apr_thread_start_t func;
apr_status_t exitval;
fspr_thread_start_t func;
fspr_status_t exitval;
int priority;
};
struct apr_threadattr_t {
apr_pool_t *pool;
struct fspr_threadattr_t {
fspr_pool_t *pool;
pthread_attr_t attr;
int priority;
};
struct apr_threadkey_t {
apr_pool_t *pool;
struct fspr_threadkey_t {
fspr_pool_t *pool;
pthread_key_t key;
};
struct apr_thread_once_t {
struct fspr_thread_once_t {
pthread_once_t once;
};
#endif
struct apr_procattr_t {
apr_pool_t *pool;
apr_file_t *parent_in;
apr_file_t *child_in;
apr_file_t *parent_out;
apr_file_t *child_out;
apr_file_t *parent_err;
apr_file_t *child_err;
struct fspr_procattr_t {
fspr_pool_t *pool;
fspr_file_t *parent_in;
fspr_file_t *child_in;
fspr_file_t *parent_out;
fspr_file_t *child_out;
fspr_file_t *parent_err;
fspr_file_t *child_err;
char *currdir;
apr_int32_t cmdtype;
apr_int32_t detached;
fspr_int32_t cmdtype;
fspr_int32_t detached;
#ifdef RLIMIT_CPU
struct rlimit *limit_cpu;
#endif
@@ -98,10 +98,10 @@ struct apr_procattr_t {
#ifdef RLIMIT_NOFILE
struct rlimit *limit_nofile;
#endif
apr_child_errfn_t *errfn;
apr_int32_t errchk;
apr_uid_t uid;
apr_gid_t gid;
fspr_child_errfn_t *errfn;
fspr_int32_t errchk;
fspr_uid_t uid;
fspr_gid_t gid;
};
#endif /* ! THREAD_PROC_H */
@@ -17,15 +17,15 @@
#ifndef ATIME_H
#define ATIME_H
#include "apr_private.h"
#include "apr_time.h"
#include "fspr_private.h"
#include "fspr_time.h"
#if APR_HAVE_TIME_H
#include <time.h>
#endif
struct atime_t {
apr_pool_t *cntxt;
apr_time_t currtime;
fspr_pool_t *cntxt;
fspr_time_t currtime;
SYSTEMTIME *explodedtime;
};
@@ -36,7 +36,7 @@ struct atime_t {
#define APR_DELTA_EPOCH_IN_USEC APR_TIME_C(11644473600000000);
__inline void FileTimeToAprTime(apr_time_t *result, FILETIME *input)
__inline void FileTimeToAprTime(fspr_time_t *result, FILETIME *input)
{
/* Convert FILETIME one 64 bit number so we can work with it. */
*result = input->dwHighDateTime;
@@ -48,7 +48,7 @@ __inline void FileTimeToAprTime(apr_time_t *result, FILETIME *input)
}
__inline void AprTimeToFileTime(LPFILETIME pft, apr_time_t t)
__inline void AprTimeToFileTime(LPFILETIME pft, fspr_time_t t)
{
LONGLONG ll;
t += APR_DELTA_EPOCH_IN_USEC;
@@ -17,18 +17,18 @@
#ifndef DSO_H
#define DSO_H
#include "apr_private.h"
#include "apr_general.h"
#include "apr_pools.h"
#include "apr_dso.h"
#include "apr.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_pools.h"
#include "fspr_dso.h"
#include "fspr.h"
#if APR_HAS_DSO
struct apr_dso_handle_t {
apr_pool_t *cont;
struct fspr_dso_handle_t {
fspr_pool_t *cont;
void *handle;
apr_status_t load_error;
fspr_status_t load_error;
};
#endif
@@ -17,17 +17,17 @@
#ifndef FILE_IO_H
#define FILE_IO_H
#include "apr.h"
#include "apr_private.h"
#include "apr_pools.h"
#include "apr_general.h"
#include "apr_tables.h"
#include "apr_thread_mutex.h"
#include "apr_file_io.h"
#include "apr_file_info.h"
#include "apr_errno.h"
#include "apr_arch_misc.h"
#include "apr_poll.h"
#include "fspr.h"
#include "fspr_private.h"
#include "fspr_pools.h"
#include "fspr_general.h"
#include "fspr_tables.h"
#include "fspr_thread_mutex.h"
#include "fspr_file_io.h"
#include "fspr_file_info.h"
#include "fspr_errno.h"
#include "fspr_arch_misc.h"
#include "fspr_poll.h"
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -49,10 +49,10 @@
#endif
#if APR_HAS_UNICODE_FS
#include "arch/win32/apr_arch_utf8.h"
#include "arch/win32/fspr_arch_utf8.h"
#include <wchar.h>
typedef apr_uint16_t apr_wchar_t;
typedef fspr_uint16_t fspr_wchar_t;
/* Helper functions for the WinNT ApiW() functions. APR treats all
* resource identifiers (files, etc) by their UTF-8 name, to provide
@@ -66,10 +66,10 @@ typedef apr_uint16_t apr_wchar_t;
* Ascii API calls. So we tack them on in utf8_to_unicode_path, and
* strip them right back off in unicode_to_utf8_path.
*/
apr_status_t utf8_to_unicode_path(apr_wchar_t* dststr, apr_size_t dstchars,
fspr_status_t utf8_to_unicode_path(fspr_wchar_t* dststr, fspr_size_t dstchars,
const char* srcstr);
apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars,
const apr_wchar_t* srcstr);
fspr_status_t unicode_to_utf8_path(char* dststr, fspr_size_t dstchars,
const fspr_wchar_t* srcstr);
#endif /* APR_HAS_UNICODE_FS */
@@ -80,7 +80,7 @@ apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars,
* and return the appropriate char* or wchar* for ApiA or ApiW calls.
*/
void *res_name_from_filename(const char *file, int global, apr_pool_t *pool);
void *res_name_from_filename(const char *file, int global, fspr_pool_t *pool);
#define APR_FILE_MAX MAX_PATH
@@ -95,7 +95,7 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool);
#define S_IFWHT 0160000 /* Whiteout */
#endif
/* Internal Flags for apr_file_open */
/* Internal Flags for fspr_file_open */
#define APR_OPENINFO 0x00100000 /* Open without READ or WRITE access */
#define APR_OPENLINK 0x00200000 /* Open a link itself, if supported */
#define APR_READCONTROL 0x00400000 /* Read the file's owner/perms */
@@ -128,20 +128,20 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool);
/* Sneak the Readonly bit through finfo->protection for internal use _only_ */
#define APR_FREADONLY 0x10000000
/* Private function for apr_stat/lstat/getfileinfo/dir_read */
int fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo,
int byhandle, apr_int32_t wanted);
/* Private function for fspr_stat/lstat/getfileinfo/dir_read */
int fillin_fileinfo(fspr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo,
int byhandle, fspr_int32_t wanted);
/* Private function that extends apr_stat/lstat/getfileinfo/dir_read */
apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile,
apr_int32_t wanted, int whatfile);
/* Private function that extends fspr_stat/lstat/getfileinfo/dir_read */
fspr_status_t more_finfo(fspr_finfo_t *finfo, const void *ufile,
fspr_int32_t wanted, int whatfile);
/* whatfile types for the ufile arg */
#define MORE_OF_HANDLE 0
#define MORE_OF_FSPEC 1
#define MORE_OF_WFSPEC 2
/* quick run-down of fields in windows' apr_file_t structure that may have
/* quick run-down of fields in windows' fspr_file_t structure that may have
* obvious uses.
* fname -- the filename as passed to the open call.
* dwFileAttricutes -- Attributes used to open the file.
@@ -150,19 +150,19 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile,
* correctly when writing to a file with this flag set TRUE.
*/
// for apr_poll.c;
// for fspr_poll.c;
#define filedes filehand
struct apr_file_t {
apr_pool_t *pool;
struct fspr_file_t {
fspr_pool_t *pool;
HANDLE filehand;
BOOLEAN pipe; // Is this a pipe of a file?
OVERLAPPED *pOverlapped;
apr_interval_time_t timeout;
apr_int32_t flags;
fspr_interval_time_t timeout;
fspr_int32_t flags;
/* File specific info */
apr_finfo_t *finfo;
fspr_finfo_t *finfo;
char *fname;
DWORD dwFileAttributes;
int eof_hit;
@@ -172,22 +172,22 @@ struct apr_file_t {
/* Stuff for buffered mode */
char *buffer;
apr_size_t bufpos; // Read/Write position in buffer
apr_size_t dataRead; // amount of valid data read into buffer
fspr_size_t bufpos; // Read/Write position in buffer
fspr_size_t dataRead; // amount of valid data read into buffer
int direction; // buffer being used for 0 = read, 1 = write
apr_off_t filePtr; // position in file of handle
apr_thread_mutex_t *mutex; // mutex semaphore, must be owned to access the above fields
fspr_off_t filePtr; // position in file of handle
fspr_thread_mutex_t *mutex; // mutex semaphore, must be owned to access the above fields
/* if there is a timeout set, then this pollset is used */
apr_pollset_t *pollset;
fspr_pollset_t *pollset;
/* Pipe specific info */
};
struct apr_dir_t {
apr_pool_t *pool;
struct fspr_dir_t {
fspr_pool_t *pool;
HANDLE dirhand;
apr_size_t rootlen;
fspr_size_t rootlen;
char *dirname;
char *name;
union {
@@ -209,21 +209,21 @@ struct apr_dir_t {
* or can confound the cmd.exe shell. Here's the list
* [declared in filesys.c]
*/
extern const char apr_c_is_fnchar[256];
extern const char fspr_c_is_fnchar[256];
#define IS_FNCHAR(c) (apr_c_is_fnchar[(unsigned char)(c)] & 1)
#define IS_SHCHAR(c) ((apr_c_is_fnchar[(unsigned char)(c)] & 2) == 2)
#define IS_FNCHAR(c) (fspr_c_is_fnchar[(unsigned char)(c)] & 1)
#define IS_SHCHAR(c) ((fspr_c_is_fnchar[(unsigned char)(c)] & 2) == 2)
/* If the user passes APR_FILEPATH_TRUENAME to either
* apr_filepath_root or apr_filepath_merge, this fn determines
* fspr_filepath_root or fspr_filepath_merge, this fn determines
* that the root really exists. It's expensive, wouldn't want
* to do this too frequenly.
*/
apr_status_t filepath_root_test(char *path, apr_pool_t *p);
fspr_status_t filepath_root_test(char *path, fspr_pool_t *p);
/* The apr_filepath_merge wants to canonicalize the cwd to the
/* The fspr_filepath_merge wants to canonicalize the cwd to the
* addpath if the user passes NULL as the old root path (this
* isn't true of an empty string "", which won't be concatenated.
*
@@ -233,18 +233,18 @@ apr_status_t filepath_root_test(char *path, apr_pool_t *p);
* If flags includes the bit APR_FILEPATH_NATIVE, the path returned
* is in the os-native format.
*/
apr_status_t filepath_drive_get(char **rootpath, char drive,
apr_int32_t flags, apr_pool_t *p);
fspr_status_t filepath_drive_get(char **rootpath, char drive,
fspr_int32_t flags, fspr_pool_t *p);
/* If the user passes d: vs. D: (or //mach/share vs. //MACH/SHARE),
* we need to fold the case to canonical form. This function is
* supposed to do so.
*/
apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p);
fspr_status_t filepath_root_case(char **rootpath, char *root, fspr_pool_t *p);
apr_status_t file_cleanup(void *);
fspr_status_t file_cleanup(void *);
/**
* Internal function to create a Win32/NT pipe that respects some async
@@ -259,20 +259,20 @@ apr_status_t file_cleanup(void *);
* APR_FULL_NONBLOCK
* </pre>
* @remark It so happens that APR_FULL_BLOCK and APR_FULL_NONBLOCK
* are common to apr_procattr_io_set() in, out and err modes.
* are common to fspr_procattr_io_set() in, out and err modes.
* Because APR_CHILD_BLOCK and APR_WRITE_BLOCK share the same value,
* as do APR_PARENT_BLOCK and APR_READ_BLOCK, it's possible to use
* that value directly for creating the stdout/stderr pipes. When
* creating the stdin pipe, the values must be transposed.
* @see apr_procattr_io_set
* @see fspr_procattr_io_set
*/
apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out,
apr_int32_t blocking_mode,
apr_pool_t *p);
fspr_status_t fspr_create_nt_pipe(fspr_file_t **in, fspr_file_t **out,
fspr_int32_t blocking_mode,
fspr_pool_t *p);
/** @see apr_create_nt_pipe */
/** @see fspr_create_nt_pipe */
#define APR_READ_BLOCK 3
/** @see apr_create_nt_pipe */
/** @see fspr_create_nt_pipe */
#define APR_WRITE_BLOCK 4
#endif /* ! FILE_IO_H */
@@ -17,19 +17,19 @@
#ifndef INHERIT_H
#define INHERIT_H
#include "apr_inherit.h"
#include "fspr_inherit.h"
#define APR_INHERIT (1 << 24) /* Must not conflict with other bits */
#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \
APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \
APR_DECLARE(fspr_status_t) fspr_##name##_inherit_set(fspr_##name##_t *the##name) \
{ \
IF_WIN_OS_IS_UNICODE \
{ \
if (!SetHandleInformation(the##name->filehand, \
HANDLE_FLAG_INHERIT, \
HANDLE_FLAG_INHERIT)) \
return apr_get_os_error(); \
return fspr_get_os_error(); \
} \
ELSE_WIN_OS_IS_ANSI \
{ \
@@ -37,7 +37,7 @@ APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \
if (!DuplicateHandle(hproc, the##name->filehand, \
hproc, &temp, 0, TRUE, \
DUPLICATE_SAME_ACCESS)) \
return apr_get_os_error(); \
return fspr_get_os_error(); \
CloseHandle(the##name->filehand); \
the##name->filehand = temp; \
} \
@@ -45,13 +45,13 @@ APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \
}
#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \
APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\
APR_DECLARE(fspr_status_t) fspr_##name##_inherit_unset(fspr_##name##_t *the##name)\
{ \
IF_WIN_OS_IS_UNICODE \
{ \
if (!SetHandleInformation(the##name->filehand, \
HANDLE_FLAG_INHERIT, 0)) \
return apr_get_os_error(); \
return fspr_get_os_error(); \
} \
ELSE_WIN_OS_IS_ANSI \
{ \
@@ -59,7 +59,7 @@ APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\
if (!DuplicateHandle(hproc, the##name->filehand, \
hproc, &temp, 0, FALSE, \
DUPLICATE_SAME_ACCESS)) \
return apr_get_os_error(); \
return fspr_get_os_error(); \
CloseHandle(the##name->filehand); \
the##name->filehand = temp; \
} \
@@ -17,16 +17,16 @@
#ifndef MISC_H
#define MISC_H
#include "apr.h"
#include "apr_portable.h"
#include "apr_private.h"
#include "apr_general.h"
#include "apr_pools.h"
#include "apr_getopt.h"
#include "apr_thread_proc.h"
#include "apr_file_io.h"
#include "apr_errno.h"
#include "apr_getopt.h"
#include "fspr.h"
#include "fspr_portable.h"
#include "fspr_private.h"
#include "fspr_general.h"
#include "fspr_pools.h"
#include "fspr_getopt.h"
#include "fspr_thread_proc.h"
#include "fspr_file_io.h"
#include "fspr_errno.h"
#include "fspr_getopt.h"
#if APR_HAVE_STDIO_H
#include <stdio.h>
@@ -46,26 +46,26 @@
#include <string.h>
#endif
struct apr_other_child_rec_t {
apr_pool_t *p;
struct apr_other_child_rec_t *next;
apr_proc_t *proc;
struct fspr_other_child_rec_t {
fspr_pool_t *p;
struct fspr_other_child_rec_t *next;
fspr_proc_t *proc;
void (*maintenance) (int, void *, int);
void *data;
apr_os_file_t write_fd;
fspr_os_file_t write_fd;
};
#define WSAHighByte 2
#define WSALowByte 0
/* start.c and apr_app.c helpers and communication within misc.c
/* start.c and fspr_app.c helpers and communication within misc.c
*
* They are not for public consumption, although apr_app_init_complete
* They are not for public consumption, although fspr_app_init_complete
* must be an exported symbol to avoid reinitialization.
*/
extern int APR_DECLARE_DATA apr_app_init_complete;
extern int APR_DECLARE_DATA fspr_app_init_complete;
int apr_wastrtoastr(char const * const * *retarr,
int fspr_wastrtoastr(char const * const * *retarr,
wchar_t const * const *arr, int args);
/* Platform specific designation of run time os version.
@@ -104,11 +104,11 @@ typedef enum {
APR_WIN_XP_SP1 = 61,
APR_WIN_XP_SP2 = 62,
APR_WIN_2003 = 70
} apr_oslevel_e;
} fspr_oslevel_e;
extern APR_DECLARE_DATA apr_oslevel_e apr_os_level;
extern APR_DECLARE_DATA fspr_oslevel_e fspr_os_level;
apr_status_t apr_get_oslevel(apr_oslevel_e *);
fspr_status_t fspr_get_oslevel(fspr_oslevel_e *);
/* The APR_HAS_ANSI_FS symbol is PRIVATE, and internal to APR.
* APR only supports char data for filenames. Like most applications,
@@ -131,7 +131,7 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *);
* build which supports only WINNT or WCE.
*/
#if APR_HAS_ANSI_FS && APR_HAS_UNICODE_FS
#define IF_WIN_OS_IS_UNICODE if (apr_os_level >= APR_WIN_UNICODE)
#define IF_WIN_OS_IS_UNICODE if (fspr_os_level >= APR_WIN_UNICODE)
#define ELSE_WIN_OS_IS_ANSI else
#else /* APR_HAS_UNICODE_FS */
#define IF_WIN_OS_IS_UNICODE
@@ -146,26 +146,26 @@ typedef enum {
DLL_SHSTDAPI = 4, // shell32 From ShellAPI.h
DLL_NTDLL = 5, // shell32 From our real kernel
DLL_defined = 6 // must define as last idx_ + 1
} apr_dlltoken_e;
} fspr_dlltoken_e;
FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal);
FARPROC fspr_load_dll_func(fspr_dlltoken_e fnLib, char *fnName, int ordinal);
/* The apr_load_dll_func call WILL fault if the function cannot be loaded */
/* The fspr_load_dll_func call WILL fault if the function cannot be loaded */
#define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \
typedef rettype (calltype *apr_winapi_fpt_##fn) args; \
static apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \
__inline rettype apr_winapi_##fn args \
{ if (!apr_winapi_pfn_##fn) \
apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \
apr_load_dll_func(lib, #fn, ord); \
return (*(apr_winapi_pfn_##fn)) names; }; \
typedef rettype (calltype *fspr_winapi_fpt_##fn) args; \
static fspr_winapi_fpt_##fn fspr_winapi_pfn_##fn = NULL; \
__inline rettype fspr_winapi_##fn args \
{ if (!fspr_winapi_pfn_##fn) \
fspr_winapi_pfn_##fn = (fspr_winapi_fpt_##fn) \
fspr_load_dll_func(lib, #fn, ord); \
return (*(fspr_winapi_pfn_##fn)) names; }; \
/* Provide late bound declarations of every API function missing from
* one or more supported releases of the Win32 API
*
* lib is the enumerated token from apr_dlltoken_e, and must correspond
* to the string table entry in start.c used by the apr_load_dll_func().
* lib is the enumerated token from fspr_dlltoken_e, and must correspond
* to the string table entry in start.c used by the fspr_load_dll_func().
* Token names (attempt to) follow Windows.h declarations prefixed by DLL_
* in order to facilitate comparison. Use the exact declaration syntax
* and names from Windows.h to prevent ambigutity and bugs.
@@ -190,9 +190,9 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0,
IN GET_FILEEX_INFO_LEVELS fInfoLevelId,
OUT LPVOID lpFileInformation),
(lpFileName, fInfoLevelId, lpFileInformation));
#define GetFileAttributesExA apr_winapi_GetFileAttributesExA
#define GetFileAttributesExA fspr_winapi_GetFileAttributesExA
#undef GetFileAttributesEx
#define GetFileAttributesEx apr_winapi_GetFileAttributesExA
#define GetFileAttributesEx fspr_winapi_GetFileAttributesExA
#ifdef GetFileAttributesExW
#undef GetFileAttributesExW
@@ -202,29 +202,29 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExW, 0,
IN GET_FILEEX_INFO_LEVELS fInfoLevelId,
OUT LPVOID lpFileInformation),
(lpFileName, fInfoLevelId, lpFileInformation));
#define GetFileAttributesExW apr_winapi_GetFileAttributesExW
#define GetFileAttributesExW fspr_winapi_GetFileAttributesExW
APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, (
IN HANDLE hFile),
(hFile));
#define CancelIo apr_winapi_CancelIo
#define CancelIo fspr_winapi_CancelIo
APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, TryEnterCriticalSection, 0, (
LPCRITICAL_SECTION lpCriticalSection),
(lpCriticalSection));
#define TryEnterCriticalSection apr_winapi_TryEnterCriticalSection
#define TryEnterCriticalSection fspr_winapi_TryEnterCriticalSection
APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, SwitchToThread, 0, (
void),
());
#define SwitchToThread apr_winapi_SwitchToThread
#define SwitchToThread fspr_winapi_SwitchToThread
APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetEffectiveRightsFromAclW, 0, (
IN PACL pacl,
IN PTRUSTEE_W pTrustee,
OUT PACCESS_MASK pAccessRights),
(pacl, pTrustee, pAccessRights));
#define GetEffectiveRightsFromAclW apr_winapi_GetEffectiveRightsFromAclW
#define GetEffectiveRightsFromAclW fspr_winapi_GetEffectiveRightsFromAclW
APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoW, 0, (
IN LPWSTR pObjectName,
@@ -237,7 +237,7 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoW, 0,
OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor),
(pObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup,
ppDacl, ppSacl, ppSecurityDescriptor));
#define GetNamedSecurityInfoW apr_winapi_GetNamedSecurityInfoW
#define GetNamedSecurityInfoW fspr_winapi_GetNamedSecurityInfoW
APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoA, 0, (
IN LPSTR pObjectName,
@@ -250,9 +250,9 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoA, 0,
OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor),
(pObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup,
ppDacl, ppSacl, ppSecurityDescriptor));
#define GetNamedSecurityInfoA apr_winapi_GetNamedSecurityInfoA
#define GetNamedSecurityInfoA fspr_winapi_GetNamedSecurityInfoA
#undef GetNamedSecurityInfo
#define GetNamedSecurityInfo apr_winapi_GetNamedSecurityInfoA
#define GetNamedSecurityInfo fspr_winapi_GetNamedSecurityInfoA
APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetSecurityInfo, 0, (
IN HANDLE handle,
@@ -265,13 +265,13 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetSecurityInfo, 0, (
OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor),
(handle, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup,
ppDacl, ppSacl, ppSecurityDescriptor));
#define GetSecurityInfo apr_winapi_GetSecurityInfo
#define GetSecurityInfo fspr_winapi_GetSecurityInfo
APR_DECLARE_LATE_DLL_FUNC(DLL_SHSTDAPI, LPWSTR *, WINAPI, CommandLineToArgvW, 0, (
LPCWSTR lpCmdLine,
int *pNumArgs),
(lpCmdLine, pNumArgs));
#define CommandLineToArgvW apr_winapi_CommandLineToArgvW
#define CommandLineToArgvW fspr_winapi_CommandLineToArgvW
#endif /* !defined(_WIN32_WCE) && !defined(WINNT) */
@@ -282,14 +282,14 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryTimerResolution, 0, (
ULONG *pMinRes, /* Maximum NS Resolution */
ULONG *pCurRes), /* Current NS Resolution */
(pMaxRes, pMinRes, pCurRes));
#define QueryTimerResolution apr_winapi_NtQueryTimerResolution
#define QueryTimerResolution fspr_winapi_NtQueryTimerResolution
APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtSetTimerResolution, 0, (
ULONG ReqRes, /* Requested NS Clock Resolution */
BOOL Acquire, /* Aquire (1) or Release (0) our interest */
ULONG *pNewRes), /* The NS Clock Resolution granted */
(ReqRes, Acquire, pNewRes));
#define SetTimerResolution apr_winapi_NtSetTimerResolution
#define SetTimerResolution fspr_winapi_NtSetTimerResolution
/* ### These are ULONG_PTR values, but that's int32 for all we care
* until the Win64 port is prepared.
@@ -310,7 +310,7 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryInformationProcess, 0
ULONG LenPI, /* Use sizeof(PBI) */
ULONG *pSizePI), /* returns pPI buffer used (may pass NULL) */
(hProcess, info, pPI, LenPI, pSizePI));
#define QueryInformationProcess apr_winapi_NtQueryInformationProcess
#define QueryInformationProcess fspr_winapi_NtQueryInformationProcess
APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryObject, 0, (
HANDLE hObject, /* Obvious */
@@ -319,7 +319,7 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryObject, 0, (
ULONG LenOI, /* Use sizeof(PBI) */
ULONG *pSizeOI), /* returns pPI buffer used (may pass NULL) */
(hObject, info, pOI, LenOI, pSizeOI));
#define QueryObject apr_winapi_NtQueryObject
#define QueryObject fspr_winapi_NtQueryObject
#endif /* !defined(_WIN32_WCE) */
@@ -17,9 +17,9 @@
#ifndef NETWORK_IO_H
#define NETWORK_IO_H
#include "apr_network_io.h"
#include "apr_general.h"
#include "apr_poll.h"
#include "fspr_network_io.h"
#include "fspr_general.h"
#include "fspr_poll.h"
#ifdef _MSC_VER
#undef MCAST_JOIN_SOURCE_GROUP
#endif
@@ -31,24 +31,24 @@ struct sock_userdata_t {
void *data;
};
struct apr_socket_t {
apr_pool_t *pool;
struct fspr_socket_t {
fspr_pool_t *pool;
SOCKET socketdes;
int type; /* SOCK_STREAM, SOCK_DGRAM */
int protocol;
apr_sockaddr_t *local_addr;
apr_sockaddr_t *remote_addr;
fspr_sockaddr_t *local_addr;
fspr_sockaddr_t *remote_addr;
int timeout_ms; /* MUST MATCH if timeout > 0 */
apr_interval_time_t timeout;
apr_int32_t disconnected;
fspr_interval_time_t timeout;
fspr_int32_t disconnected;
int local_port_unknown;
int local_interface_unknown;
int remote_addr_unknown;
apr_int32_t options;
apr_int32_t inherit;
fspr_int32_t options;
fspr_int32_t inherit;
#if APR_HAS_SENDFILE
/* As of 07.20.04, the overlapped structure is only used by
* apr_socket_sendfile and that's where it will be allocated
* fspr_socket_sendfile and that's where it will be allocated
* and initialized.
*/
OVERLAPPED *overlapped;
@@ -56,7 +56,7 @@ struct apr_socket_t {
sock_userdata_t *userdata;
/* if there is a timeout set, then this pollset is used */
apr_pollset_t *pollset;
fspr_pollset_t *pollset;
};
#ifdef _WIN32_WCE
@@ -71,16 +71,16 @@ typedef struct _WSABUF {
#define HAVE_STRUCT_IPMREQ
#endif
apr_status_t status_from_res_error(int);
fspr_status_t status_from_res_error(int);
const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size);
int apr_inet_pton(int af, const char *src, void *dst);
void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t);
const char *fspr_inet_ntop(int af, const void *src, char *dst, fspr_size_t size);
int fspr_inet_pton(int af, const char *src, void *dst);
void fspr_sockaddr_vars_set(fspr_sockaddr_t *, int, fspr_port_t);
#define apr_is_option_set(skt, option) \
#define fspr_is_option_set(skt, option) \
(((skt)->options & (option)) == (option))
#define apr_set_option(skt, option, on) \
#define fspr_set_option(skt, option, on) \
do { \
if (on) \
(skt)->options |= (option); \
@@ -17,10 +17,10 @@
#ifndef PROC_MUTEX_H
#define PROC_MUTEX_H
#include "apr_proc_mutex.h"
#include "fspr_proc_mutex.h"
struct apr_proc_mutex_t {
apr_pool_t *pool;
struct fspr_proc_mutex_t {
fspr_pool_t *pool;
HANDLE handle;
const char *fname;
};
@@ -17,10 +17,10 @@
#ifndef THREAD_COND_H
#define THREAD_COND_H
#include "apr_thread_cond.h"
#include "fspr_thread_cond.h"
struct apr_thread_cond_t {
apr_pool_t *pool;
struct fspr_thread_cond_t {
fspr_pool_t *pool;
HANDLE semaphore;
CRITICAL_SECTION csection;
unsigned long num_waiting;
@@ -17,7 +17,7 @@
#ifndef THREAD_MUTEX_H
#define THREAD_MUTEX_H
#include "apr_pools.h"
#include "fspr_pools.h"
typedef enum thread_mutex_type {
thread_mutex_critical_section,
@@ -29,8 +29,8 @@ typedef enum thread_mutex_type {
* and nested_mutex on Win9x only. Otherwise critical_section
* is used for NT nexted mutexes providing optimal performance.
*/
struct apr_thread_mutex_t {
apr_pool_t *pool;
struct fspr_thread_mutex_t {
fspr_pool_t *pool;
thread_mutex_type type;
HANDLE handle;
CRITICAL_SECTION section;
@@ -17,10 +17,10 @@
#ifndef THREAD_RWLOCK_H
#define THREAD_RWLOCK_H
#include "apr_thread_rwlock.h"
#include "fspr_thread_rwlock.h"
struct apr_thread_rwlock_t {
apr_pool_t *pool;
struct fspr_thread_rwlock_t {
fspr_pool_t *pool;
HANDLE write_mutex;
HANDLE read_event;
LONG readers;
@@ -14,50 +14,50 @@
* limitations under the License.
*/
#include "apr_private.h"
#include "apr_thread_proc.h"
#include "apr_file_io.h"
#include "fspr_private.h"
#include "fspr_thread_proc.h"
#include "fspr_file_io.h"
#ifndef THREAD_PROC_H
#define THREAD_PROC_H
#define SHELL_PATH "cmd.exe"
struct apr_thread_t {
apr_pool_t *pool;
struct fspr_thread_t {
fspr_pool_t *pool;
HANDLE td;
apr_int32_t cancel;
apr_int32_t cancel_how;
fspr_int32_t cancel;
fspr_int32_t cancel_how;
void *data;
apr_thread_start_t func;
apr_status_t exitval;
fspr_thread_start_t func;
fspr_status_t exitval;
};
struct apr_threadattr_t {
apr_pool_t *pool;
apr_int32_t detach;
apr_size_t stacksize;
struct fspr_threadattr_t {
fspr_pool_t *pool;
fspr_int32_t detach;
fspr_size_t stacksize;
int priority;
};
struct apr_threadkey_t {
apr_pool_t *pool;
struct fspr_threadkey_t {
fspr_pool_t *pool;
DWORD key;
};
struct apr_procattr_t {
apr_pool_t *pool;
apr_file_t *parent_in;
apr_file_t *child_in;
apr_file_t *parent_out;
apr_file_t *child_out;
apr_file_t *parent_err;
apr_file_t *child_err;
struct fspr_procattr_t {
fspr_pool_t *pool;
fspr_file_t *parent_in;
fspr_file_t *child_in;
fspr_file_t *parent_out;
fspr_file_t *child_out;
fspr_file_t *parent_err;
fspr_file_t *child_err;
char *currdir;
apr_int32_t cmdtype;
apr_int32_t detached;
apr_child_errfn_t *errfn;
apr_int32_t errchk;
fspr_int32_t cmdtype;
fspr_int32_t detached;
fspr_child_errfn_t *errfn;
fspr_int32_t errchk;
#ifndef _WIN32_WCE
HANDLE user_token;
LPSECURITY_ATTRIBUTES sa;
@@ -65,7 +65,7 @@ struct apr_procattr_t {
#endif
};
struct apr_thread_once_t {
struct fspr_thread_once_t {
long value;
};
@@ -17,13 +17,13 @@
#ifndef UTF8_H
#define UTF8_H
#include "apr.h"
#include "apr_lib.h"
#include "apr_errno.h"
#include "fspr.h"
#include "fspr_lib.h"
#include "fspr_errno.h"
/* If we ever support anything more exciting than char... this could move.
*/
typedef apr_uint16_t apr_wchar_t;
typedef fspr_uint16_t fspr_wchar_t;
/**
* An APR internal function for fast utf-8 octet-encoded Unicode conversion
@@ -34,10 +34,10 @@ typedef apr_uint16_t apr_wchar_t;
* when the character code is invalid (in or out of context) and the later
* when more characters were expected, but insufficient characters remain.
*/
APR_DECLARE(apr_status_t) apr_conv_utf8_to_ucs2(const char *in,
apr_size_t *inbytes,
apr_wchar_t *out,
apr_size_t *outwords);
APR_DECLARE(fspr_status_t) fspr_conv_utf8_to_ucs2(const char *in,
fspr_size_t *inbytes,
fspr_wchar_t *out,
fspr_size_t *outwords);
/**
* An APR internal function for fast ucs-2 wide Unicode format conversion to
@@ -48,9 +48,9 @@ APR_DECLARE(apr_status_t) apr_conv_utf8_to_ucs2(const char *in,
* when the character code is invalid (in or out of context) and the later
* when more words were expected, but insufficient words remain.
*/
APR_DECLARE(apr_status_t) apr_conv_ucs2_to_utf8(const apr_wchar_t *in,
apr_size_t *inwords,
APR_DECLARE(fspr_status_t) fspr_conv_ucs2_to_utf8(const fspr_wchar_t *in,
fspr_size_t *inwords,
char *out,
apr_size_t *outbytes);
fspr_size_t *outbytes);
#endif /* def UTF8_H */
@@ -23,18 +23,18 @@ extern "C" {
/* USAGE:
*
* Add the following include to apr_private.h for internal debugging,
* Add the following include to fspr_private.h for internal debugging,
* or copy this header into apr/include add the include below to apr.h
* for really global debugging;
*
* #include "apr_dbg_win32_handles.h"
* #include "fspr_dbg_win32_handles.h"
*
* apr_dbg_log is the crux of this function ... it uses Win32 API and
* fspr_dbg_log is the crux of this function ... it uses Win32 API and
* no apr calls itself to log all activity to a file named for the
* executing application with a .pid suffix. Ergo several instances
* may be executing and logged at once.
*
* HANDLE apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, int nh
* HANDLE fspr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, int nh
* [, HANDLE *hv, char *dsc...])
*
* returns: the handle passed in ha, which is cast back to the real return type.
@@ -42,7 +42,7 @@ extern "C" {
* formats one line into the debug log file if nh is zero;
* ha (hex) seq(hex) tid(hex) fn fl ln
* xxxxxxxx xxxxxxxx xxxxxxxx func() sourcefile:lineno
* The macro apr_dbg_rv makes this simple to implement for many APIs
* The macro fspr_dbg_rv makes this simple to implement for many APIs
* that simply take args that don't interest us, and return a handle.
*
* formats multiple lines (nh) into the debug log file for each hv/dsc pair
@@ -53,67 +53,67 @@ extern "C" {
* treated as a handle.
*/
APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln,
APR_DECLARE_NONSTD(HANDLE) fspr_dbg_log(char* fn, HANDLE ha, char* fl, int ln,
int nh,/* HANDLE *hv, char *dsc */...);
#define apr_dbg_rv(fn, args) (apr_dbg_log(#fn,(fn) args,__FILE__,__LINE__,0))
#define fspr_dbg_rv(fn, args) (fspr_dbg_log(#fn,(fn) args,__FILE__,__LINE__,0))
#define CloseHandle(h) \
((BOOL)apr_dbg_log("CloseHandle", \
((BOOL)fspr_dbg_log("CloseHandle", \
(HANDLE)(CloseHandle)(h), \
__FILE__,__LINE__,1, \
&(h),""))
#define CreateEventA(sd,b1,b2,nm) apr_dbg_rv(CreateEventA,(sd,b1,b2,nm))
#define CreateEventW(sd,b1,b2,nm) apr_dbg_rv(CreateEventW,(sd,b1,b2,nm))
#define CreateEventA(sd,b1,b2,nm) fspr_dbg_rv(CreateEventA,(sd,b1,b2,nm))
#define CreateEventW(sd,b1,b2,nm) fspr_dbg_rv(CreateEventW,(sd,b1,b2,nm))
#define CreateFileA(nm,d1,d2,sd,d3,d4,h) apr_dbg_rv(CreateFileA,(nm,d1,d2,sd,d3,d4,h))
#define CreateFileW(nm,d1,d2,sd,d3,d4,h) apr_dbg_rv(CreateFileW,(nm,d1,d2,sd,d3,d4,h))
#define CreateFileA(nm,d1,d2,sd,d3,d4,h) fspr_dbg_rv(CreateFileA,(nm,d1,d2,sd,d3,d4,h))
#define CreateFileW(nm,d1,d2,sd,d3,d4,h) fspr_dbg_rv(CreateFileW,(nm,d1,d2,sd,d3,d4,h))
#define CreateFileMappingA(fh,sd,d1,d2,d3,nm) apr_dbg_rv(CreateFileMappingA,(fh,sd,d1,d2,d3,nm))
#define CreateFileMappingW(fh,sd,d1,d2,d3,nm) apr_dbg_rv(CreateFileMappingW,(fh,sd,d1,d2,d3,nm))
#define CreateFileMappingA(fh,sd,d1,d2,d3,nm) fspr_dbg_rv(CreateFileMappingA,(fh,sd,d1,d2,d3,nm))
#define CreateFileMappingW(fh,sd,d1,d2,d3,nm) fspr_dbg_rv(CreateFileMappingW,(fh,sd,d1,d2,d3,nm))
#define CreateMutexA(sd,b,nm) apr_dbg_rv(CreateMutexA,(sd,b,nm))
#define CreateMutexW(sd,b,nm) apr_dbg_rv(CreateMutexW,(sd,b,nm))
#define CreateMutexA(sd,b,nm) fspr_dbg_rv(CreateMutexA,(sd,b,nm))
#define CreateMutexW(sd,b,nm) fspr_dbg_rv(CreateMutexW,(sd,b,nm))
#define CreateIoCompletionPort(h1,h2,pd1,d2) apr_dbg_rv(CreateIoCompletionPort,(h1,h2,pd1,d2))
#define CreateIoCompletionPort(h1,h2,pd1,d2) fspr_dbg_rv(CreateIoCompletionPort,(h1,h2,pd1,d2))
#define CreateNamedPipeA(nm,d1,d2,d3,d4,d5,d6,sd) apr_dbg_rv(CreateNamedPipeA,(nm,d1,d2,d3,d4,d5,d6,sd))
#define CreateNamedPipeW(nm,d1,d2,d3,d4,d5,d6,sd) apr_dbg_rv(CreateNamedPipeW,(nm,d1,d2,d3,d4,d5,d6,sd))
#define CreateNamedPipeA(nm,d1,d2,d3,d4,d5,d6,sd) fspr_dbg_rv(CreateNamedPipeA,(nm,d1,d2,d3,d4,d5,d6,sd))
#define CreateNamedPipeW(nm,d1,d2,d3,d4,d5,d6,sd) fspr_dbg_rv(CreateNamedPipeW,(nm,d1,d2,d3,d4,d5,d6,sd))
#define CreatePipe(ph1,ph2,sd,d) \
((BOOL)apr_dbg_log("CreatePipe", \
((BOOL)fspr_dbg_log("CreatePipe", \
(HANDLE)(CreatePipe)(ph1,ph2,sd,d), \
__FILE__,__LINE__,2, \
(ph1),"hRead", \
(ph2),"hWrite"))
#define CreateProcessA(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr) \
((BOOL)apr_dbg_log("CreateProcessA", \
((BOOL)fspr_dbg_log("CreateProcessA", \
(HANDLE)(CreateProcessA)(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr), \
__FILE__,__LINE__,2, \
&((hr)->hProcess),"hProcess", \
&((hr)->hThread),"hThread"))
#define CreateProcessW(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr) \
((BOOL)apr_dbg_log("CreateProcessW", \
((BOOL)fspr_dbg_log("CreateProcessW", \
(HANDLE)(CreateProcessW)(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr), \
__FILE__,__LINE__,2, \
&((hr)->hProcess),"hProcess", \
&((hr)->hThread),"hThread"))
#define CreateSemaphoreA(sd,d1,d2,nm) apr_dbg_rv(CreateSemaphoreA,(sd,d1,d2,nm))
#define CreateSemaphoreW(sd,d1,d2,nm) apr_dbg_rv(CreateSemaphoreW,(sd,d1,d2,nm))
#define CreateSemaphoreA(sd,d1,d2,nm) fspr_dbg_rv(CreateSemaphoreA,(sd,d1,d2,nm))
#define CreateSemaphoreW(sd,d1,d2,nm) fspr_dbg_rv(CreateSemaphoreW,(sd,d1,d2,nm))
#define CreateThread(sd,d1,fn,pv,d2,pd3) apr_dbg_rv(CreateThread,(sd,d1,fn,pv,d2,pd3))
#define CreateThread(sd,d1,fn,pv,d2,pd3) fspr_dbg_rv(CreateThread,(sd,d1,fn,pv,d2,pd3))
#define DeregisterEventSource(h) \
((BOOL)apr_dbg_log("DeregisterEventSource", \
((BOOL)fspr_dbg_log("DeregisterEventSource", \
(HANDLE)(DeregisterEventSource)(h), \
__FILE__,__LINE__,1, \
&(h),""))
#define DuplicateHandle(h1,h2,h3,ph4,d1,b,d2) \
((BOOL)apr_dbg_log("DuplicateHandle", \
((BOOL)fspr_dbg_log("DuplicateHandle", \
(HANDLE)(DuplicateHandle)(h1,h2,h3,ph4,d1,b,d2), \
__FILE__,__LINE__,2, \
(ph4),((h3)==GetCurrentProcess()) \
@@ -122,91 +122,91 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln,
? "Source" : "EXTERN Source"))
#define GetCurrentProcess() \
(apr_dbg_log("GetCurrentProcess", \
(fspr_dbg_log("GetCurrentProcess", \
(GetCurrentProcess)(),__FILE__,__LINE__,0))
#define GetCurrentThread() \
(apr_dbg_log("GetCurrentThread", \
(fspr_dbg_log("GetCurrentThread", \
(GetCurrentThread)(),__FILE__,__LINE__,0))
#define GetModuleHandleA(nm) apr_dbg_rv(GetModuleHandleA,(nm))
#define GetModuleHandleW(nm) apr_dbg_rv(GetModuleHandleW,(nm))
#define GetModuleHandleA(nm) fspr_dbg_rv(GetModuleHandleA,(nm))
#define GetModuleHandleW(nm) fspr_dbg_rv(GetModuleHandleW,(nm))
#define GetStdHandle(d) apr_dbg_rv(GetStdHandle,(d))
#define GetStdHandle(d) fspr_dbg_rv(GetStdHandle,(d))
#define LoadLibraryA(nm) apr_dbg_rv(LoadLibraryA,(nm))
#define LoadLibraryW(nm) apr_dbg_rv(LoadLibraryW,(nm))
#define LoadLibraryA(nm) fspr_dbg_rv(LoadLibraryA,(nm))
#define LoadLibraryW(nm) fspr_dbg_rv(LoadLibraryW,(nm))
#define LoadLibraryExA(nm,h,d) apr_dbg_rv(LoadLibraryExA,(nm,h,d))
#define LoadLibraryExW(nm,h,d) apr_dbg_rv(LoadLibraryExW,(nm,h,d))
#define LoadLibraryExA(nm,h,d) fspr_dbg_rv(LoadLibraryExA,(nm,h,d))
#define LoadLibraryExW(nm,h,d) fspr_dbg_rv(LoadLibraryExW,(nm,h,d))
#define OpenEventA(d,b,nm) apr_dbg_rv(OpenEventA,(d,b,nm))
#define OpenEventW(d,b,nm) apr_dbg_rv(OpenEventW,(d,b,nm))
#define OpenEventA(d,b,nm) fspr_dbg_rv(OpenEventA,(d,b,nm))
#define OpenEventW(d,b,nm) fspr_dbg_rv(OpenEventW,(d,b,nm))
#define OpenFileMappingA(d,b,nm) apr_dbg_rv(OpenFileMappingA,(d,b,nm))
#define OpenFileMappingW(d,b,nm) apr_dbg_rv(OpenFileMappingW,(d,b,nm))
#define OpenFileMappingA(d,b,nm) fspr_dbg_rv(OpenFileMappingA,(d,b,nm))
#define OpenFileMappingW(d,b,nm) fspr_dbg_rv(OpenFileMappingW,(d,b,nm))
#define RegisterEventSourceA(s1,s2) apr_dbg_rv(RegisterEventSourceA,(s1,s2))
#define RegisterEventSourceW(s1,s2) apr_dbg_rv(RegisterEventSourceW,(s1,s2))
#define RegisterEventSourceA(s1,s2) fspr_dbg_rv(RegisterEventSourceA,(s1,s2))
#define RegisterEventSourceW(s1,s2) fspr_dbg_rv(RegisterEventSourceW,(s1,s2))
#define SetEvent(h) \
((BOOL)apr_dbg_log("SetEvent", \
((BOOL)fspr_dbg_log("SetEvent", \
(HANDLE)(SetEvent)(h), \
__FILE__,__LINE__,1, \
&(h),""))
#define SetStdHandle(d,h) \
((BOOL)apr_dbg_log("SetStdHandle", \
((BOOL)fspr_dbg_log("SetStdHandle", \
(HANDLE)(SetStdHandle)(d,h), \
__FILE__,__LINE__,1,&(h),""))
#define socket(i1,i2,i3) \
((SOCKET)apr_dbg_log("socket", \
((SOCKET)fspr_dbg_log("socket", \
(HANDLE)(socket)(i1,i2,i3), \
__FILE__,__LINE__,0))
#define WaitForSingleObject(h,d) \
((DWORD)apr_dbg_log("WaitForSingleObject", \
((DWORD)fspr_dbg_log("WaitForSingleObject", \
(HANDLE)(WaitForSingleObject)(h,d), \
__FILE__,__LINE__,1,&(h),"Signaled"))
#define WaitForSingleObjectEx(h,d,b) \
((DWORD)apr_dbg_log("WaitForSingleObjectEx", \
((DWORD)fspr_dbg_log("WaitForSingleObjectEx", \
(HANDLE)(WaitForSingleObjectEx)(h,d,b), \
__FILE__,__LINE__,1,&(h),"Signaled"))
#define WaitForMultipleObjects(d1,ah,b,d2) \
((DWORD)apr_dbg_log("WaitForMultipleObjects", \
((DWORD)fspr_dbg_log("WaitForMultipleObjects", \
(HANDLE)(WaitForMultipleObjects)(d1,ah,b,d2), \
__FILE__,__LINE__,1,ah,"Signaled"))
#define WaitForMultipleObjectsEx(d1,ah,b1,d2,b2) \
((DWORD)apr_dbg_log("WaitForMultipleObjectsEx", \
((DWORD)fspr_dbg_log("WaitForMultipleObjectsEx", \
(HANDLE)(WaitForMultipleObjectsEx)(d1,ah,b1,d2,b2), \
__FILE__,__LINE__,1,ah,"Signaled"))
#define WSASocketA(i1,i2,i3,pi,g,dw) \
((SOCKET)apr_dbg_log("WSASocketA", \
((SOCKET)fspr_dbg_log("WSASocketA", \
(HANDLE)(WSASocketA)(i1,i2,i3,pi,g,dw), \
__FILE__,__LINE__,0))
#define WSASocketW(i1,i2,i3,pi,g,dw) \
((SOCKET)apr_dbg_log("WSASocketW", \
((SOCKET)fspr_dbg_log("WSASocketW", \
(HANDLE)(WSASocketW)(i1,i2,i3,pi,g,dw), \
__FILE__,__LINE__,0))
#define closesocket(sh) \
((int)apr_dbg_log("closesocket", \
((int)fspr_dbg_log("closesocket", \
(HANDLE)(closesocket)(sh), \
__FILE__,__LINE__,1,&(sh),""))
#define _beginthread(fn,d,pv) \
((unsigned long)apr_dbg_log("_beginthread", \
((unsigned long)fspr_dbg_log("_beginthread", \
(HANDLE)(_beginthread)(fn,d,pv), \
__FILE__,__LINE__,0))
#define _beginthreadex(sd,d1,fn,pv,d2,pd3) \
((unsigned long)apr_dbg_log("_beginthreadex", \
((unsigned long)fspr_dbg_log("_beginthreadex", \
(HANDLE)(_beginthreadex)(sd,d1,fn,pv,d2,pd3), \
__FILE__,__LINE__,0))
@@ -28,7 +28,7 @@
/* Include the public APR symbols, include our idea of the 'right'
* subset of the Windows.h header. This saves us repetition.
*/
#include "apr.h"
#include "fspr.h"
/*
* Add a _very_few_ declarations missing from the restricted set of headers
@@ -153,7 +153,7 @@ APR_DECLARE_DATA int errno;
#ifdef APR_INT64_STRFN
#define APR_OFF_T_STRFN APR_INT64_STRFN
#else
#define APR_OFF_T_STRFN apr_strtoi64
#define APR_OFF_T_STRFN fspr_strtoi64
#endif
#else
#define APR_OFF_T_STRFN strtoi
@@ -165,7 +165,7 @@ APR_DECLARE_DATA int errno;
/*
* Include common private declarations.
*/
#include "../apr_private_common.h"
#include "../fspr_private_common.h"
#endif /*APR_PRIVATE_H*/
#endif /*WIN32*/
@@ -38,7 +38,7 @@
* @{
*/
/**
* @defgroup apr_platform Platform Definitions
* @defgroup fspr_platform Platform Definitions
* @{
*/
@@ -152,7 +152,7 @@ extern "C" {
#endif
/**
* @addtogroup apr_platform
* @addtogroup fspr_platform
* @ingroup APR
* @{
*/
@@ -254,21 +254,21 @@ extern "C" {
/* Typedefs that APR needs. */
typedef unsigned char apr_byte_t;
typedef unsigned char fspr_byte_t;
typedef @short_value@ apr_int16_t;
typedef unsigned @short_value@ apr_uint16_t;
typedef @short_value@ fspr_int16_t;
typedef unsigned @short_value@ fspr_uint16_t;
typedef @int_value@ apr_int32_t;
typedef unsigned @int_value@ apr_uint32_t;
typedef @int_value@ fspr_int32_t;
typedef unsigned @int_value@ fspr_uint32_t;
typedef @long_value@ apr_int64_t;
typedef unsigned @long_value@ apr_uint64_t;
typedef @long_value@ fspr_int64_t;
typedef unsigned @long_value@ fspr_uint64_t;
typedef @size_t_value@ apr_size_t;
typedef @ssize_t_value@ apr_ssize_t;
typedef @off_t_value@ apr_off_t;
typedef @socklen_t_value@ apr_socklen_t;
typedef @size_t_value@ fspr_size_t;
typedef @ssize_t_value@ fspr_ssize_t;
typedef @off_t_value@ fspr_off_t;
typedef @socklen_t_value@ fspr_socklen_t;
#define APR_SIZEOF_VOIDP @voidp_size@
@@ -286,7 +286,7 @@ typedef @socklen_t_value@ apr_socklen_t;
* so that they follow the platform's calling convention.
* @example
*/
/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
/** void* APR_THREAD_FUNC my_thread_entry_fn(fspr_thread_t *thd, void *data);
*/
#define APR_THREAD_FUNC
@@ -298,7 +298,7 @@ typedef @socklen_t_value@ apr_socklen_t;
* @remark Both the declaration and implementations must use the same macro.
* @example
*/
/** APR_DECLARE(rettype) apr_func(args)
/** APR_DECLARE(rettype) fspr_func(args)
* @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA
* @remark Note that when APR compiles the library itself, it passes the
* symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32)
@@ -319,7 +319,7 @@ typedef @socklen_t_value@ apr_socklen_t;
* @remark Both the declaration and implementations must use the same macro.
* @example
*/
/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
/** APR_DECLARE_NONSTD(rettype) fspr_func(args, ...);
*/
#define APR_DECLARE_NONSTD(type) type
@@ -331,8 +331,8 @@ typedef @socklen_t_value@ apr_socklen_t;
* but both must include the macro.
* @example
*/
/** extern APR_DECLARE_DATA type apr_variable;\n
* APR_DECLARE_DATA type apr_variable = value;
/** extern APR_DECLARE_DATA type fspr_variable;\n
* APR_DECLARE_DATA type fspr_variable = value;
*/
#define APR_DECLARE_DATA
@@ -373,9 +373,9 @@ typedef @socklen_t_value@ apr_socklen_t;
#if APR_HAVE_SYS_WAIT_H
#ifdef WEXITSTATUS
#define apr_wait_t int
#define fspr_wait_t int
#else
#define apr_wait_t union wait
#define fspr_wait_t union wait
#define WEXITSTATUS(status) (int)((status).w_retcode)
#define WTERMSIG(status) (int)((status).w_termsig)
#endif /* !WEXITSTATUS */
@@ -73,7 +73,7 @@ extern "C" {
#endif
/**
* @defgroup apr_platform Platform Definitions
* @defgroup fspr_platform Platform Definitions
* @ingroup APR
* @{
*/
@@ -232,28 +232,28 @@ extern "C" {
/* Typedefs that APR needs. */
typedef unsigned char apr_byte_t;
typedef unsigned char fspr_byte_t;
typedef short apr_int16_t;
typedef unsigned short apr_uint16_t;
typedef short fspr_int16_t;
typedef unsigned short fspr_uint16_t;
typedef int apr_int32_t;
typedef unsigned int apr_uint32_t;
typedef int fspr_int32_t;
typedef unsigned int fspr_uint32_t;
typedef long long apr_int64_t;
typedef unsigned long long apr_uint64_t;
typedef long long fspr_int64_t;
typedef unsigned long long fspr_uint64_t;
typedef size_t apr_size_t;
typedef ssize_t apr_ssize_t;
typedef size_t fspr_size_t;
typedef ssize_t fspr_ssize_t;
#if APR_HAS_LARGE_FILES
typedef off64_t apr_off_t;
typedef off64_t fspr_off_t;
#else
typedef off_t apr_off_t;
typedef off_t fspr_off_t;
#endif
#ifdef USE_WINSOCK
typedef int apr_socklen_t;
typedef int fspr_socklen_t;
#else
typedef size_t apr_socklen_t;
typedef size_t fspr_socklen_t;
#endif
/* Are we big endian? */
@@ -280,7 +280,7 @@ typedef size_t apr_socklen_t;
* so that they follow the platform's calling convention.
* @example
*/
/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
/** void* APR_THREAD_FUNC my_thread_entry_fn(fspr_thread_t *thd, void *data);
*/
#define APR_THREAD_FUNC
@@ -292,7 +292,7 @@ typedef size_t apr_socklen_t;
* @remark Both the declaration and implementations must use the same macro.
* @example
*/
/** APR_DECLARE(rettype) apr_func(args)
/** APR_DECLARE(rettype) fspr_func(args)
* @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA
* @remark Note that when APR compiles the library itself, it passes the
* symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32)
@@ -313,7 +313,7 @@ typedef size_t apr_socklen_t;
* @remark Both the declaration and implementations must use the same macro.
* @example
*/
/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
/** APR_DECLARE_NONSTD(rettype) fspr_func(args, ...);
*/
#define APR_DECLARE_NONSTD(type) type
@@ -325,8 +325,8 @@ typedef size_t apr_socklen_t;
* but both must include the macro.
* @example
*/
/** extern APR_DECLARE_DATA type apr_variable;\n
* APR_DECLARE_DATA type apr_variable = value;
/** extern APR_DECLARE_DATA type fspr_variable;\n
* APR_DECLARE_DATA type fspr_variable = value;
*/
#define APR_DECLARE_DATA
@@ -345,7 +345,7 @@ typedef size_t apr_socklen_t;
/* Local machine definition for console and log output. */
#define APR_EOL_STR "\r\n"
typedef int apr_wait_t;
typedef int fspr_wait_t;
#define APR_PATH_MAX PATH_MAX
@@ -106,7 +106,7 @@
#endif /* !_WINDOWS_ */
/**
* @defgroup apr_platform Platform Definitions
* @defgroup fspr_platform Platform Definitions
* @ingroup APR
* @{
*/
@@ -275,7 +275,7 @@ extern "C" {
#endif
/**
* @addtogroup apr_platform
* @addtogroup fspr_platform
* @ingroup APR
* @{
*/
@@ -322,29 +322,29 @@ extern "C" {
/* Typedefs that APR needs. */
typedef unsigned char apr_byte_t;
typedef unsigned char fspr_byte_t;
typedef short apr_int16_t;
typedef unsigned short apr_uint16_t;
typedef short fspr_int16_t;
typedef unsigned short fspr_uint16_t;
typedef int apr_int32_t;
typedef unsigned int apr_uint32_t;
typedef int fspr_int32_t;
typedef unsigned int fspr_uint32_t;
typedef __int64 apr_int64_t;
typedef unsigned __int64 apr_uint64_t;
typedef __int64 fspr_int64_t;
typedef unsigned __int64 fspr_uint64_t;
typedef size_t apr_size_t;
typedef size_t fspr_size_t;
#if APR_HAVE_STDDEF_H
typedef ptrdiff_t apr_ssize_t;
typedef ptrdiff_t fspr_ssize_t;
#else
typedef int apr_ssize_t;
typedef int fspr_ssize_t;
#endif
#if APR_HAS_LARGE_FILES
typedef __int64 apr_off_t;
typedef __int64 fspr_off_t;
#else
typedef int apr_off_t;
typedef int fspr_off_t;
#endif
typedef int apr_socklen_t;
typedef int fspr_socklen_t;
/* Are we big endian? */
/* XXX: Fatal assumption on Alpha platforms */
@@ -356,7 +356,7 @@ typedef int apr_socklen_t;
#define APR_SIZEOF_VOIDP 4
#endif
/* XXX These simply don't belong here, perhaps in apr_portable.h
/* XXX These simply don't belong here, perhaps in fspr_portable.h
* based on some APR_HAVE_PID/GID/UID?
*/
typedef int pid_t;
@@ -378,8 +378,8 @@ typedef int gid_t;
#ifndef WS2TCPIP_INLINE
#define IN6_IS_ADDR_V4MAPPED(a) \
( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \
&& (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
( (*(const fspr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \
&& (*(const fspr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
#endif
#endif /* APR_HAS_IPV6 */
@@ -391,7 +391,7 @@ typedef int gid_t;
* so that they follow the platform's calling convention.
* @example
*/
/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
/** void* APR_THREAD_FUNC my_thread_entry_fn(fspr_thread_t *thd, void *data);
*/
#define APR_THREAD_FUNC __stdcall
@@ -406,7 +406,7 @@ typedef int gid_t;
* @remark Both the declaration and implementations must use the same macro.
* @example
*/
/** APR_DECLARE(rettype) apr_func(args)
/** APR_DECLARE(rettype) fspr_func(args)
* @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA
* @remark Note that when APR compiles the library itself, it passes the
* symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32)
@@ -427,7 +427,7 @@ typedef int gid_t;
* @remark Both the declaration and implementations must use the same macro.
* @example
*/
/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
/** APR_DECLARE_NONSTD(rettype) fspr_func(args, ...);
*/
#define APR_DECLARE_NONSTD(type) type
@@ -439,8 +439,8 @@ typedef int gid_t;
* but both must include the macro.
* @example
*/
/** extern APR_DECLARE_DATA type apr_variable;\n
* APR_DECLARE_DATA type apr_variable = value;
/** extern APR_DECLARE_DATA type fspr_variable;\n
* APR_DECLARE_DATA type fspr_variable = value;
*/
#define APR_DECLARE_DATA
@@ -484,12 +484,12 @@ typedef int gid_t;
/* No difference between PROC and GLOBAL mutex */
#define APR_PROC_MUTEX_IS_GLOBAL 1
typedef int apr_wait_t;
typedef int fspr_wait_t;
/* struct iovec is needed to emulate Unix writev */
struct iovec {
char* iov_base;
apr_size_t iov_len;
fspr_size_t iov_len;
};
/* Nasty Win32 .h ommissions we really need */
@@ -18,50 +18,50 @@
#define APR_ALLOCATOR_H
/**
* @file apr_allocator.h
* @file fspr_allocator.h
* @brief APR Internal Memory Allocation
*/
#include "apr.h"
#include "apr_errno.h"
#include "fspr.h"
#include "fspr_errno.h"
#define APR_WANT_MEMFUNC /**< For no good reason? */
#include "apr_want.h"
#include "fspr_want.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup apr_allocator Internal Memory Allocation
* @defgroup fspr_allocator Internal Memory Allocation
* @ingroup APR
* @{
*/
/** the allocator structure */
typedef struct apr_allocator_t apr_allocator_t;
typedef struct fspr_allocator_t fspr_allocator_t;
/** the structure which holds information about the allocation */
typedef struct apr_memnode_t apr_memnode_t;
typedef struct fspr_memnode_t fspr_memnode_t;
/** basic memory node structure
* @note The next, ref and first_avail fields are available for use by the
* caller of apr_allocator_alloc(), the remaining fields are read-only.
* caller of fspr_allocator_alloc(), the remaining fields are read-only.
* The next field has to be used with caution and sensibly set when the
* memnode is passed back to apr_allocator_free(). See apr_allocator_free()
* memnode is passed back to fspr_allocator_free(). See fspr_allocator_free()
* for details.
* The ref and first_avail fields will be properly restored by
* apr_allocator_free().
* fspr_allocator_free().
*/
struct apr_memnode_t {
apr_memnode_t *next; /**< next memnode */
apr_memnode_t **ref; /**< reference to self */
apr_uint32_t index; /**< size */
apr_uint32_t free_index; /**< how much free */
struct fspr_memnode_t {
fspr_memnode_t *next; /**< next memnode */
fspr_memnode_t **ref; /**< reference to self */
fspr_uint32_t index; /**< size */
fspr_uint32_t free_index; /**< how much free */
char *first_avail; /**< pointer to first free memory */
char *endp; /**< pointer to end of free memory */
};
/** The base size of a memory node - aligned. */
#define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t))
#define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(fspr_memnode_t))
/** Symbolic constants */
#define APR_ALLOCATOR_MAX_FREE_UNLIMITED 0
@@ -71,7 +71,7 @@ struct apr_memnode_t {
* @param allocator The allocator we have just created.
*
*/
APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator);
APR_DECLARE(fspr_status_t) fspr_allocator_create(fspr_allocator_t **allocator);
/**
* Destroy an allocator
@@ -79,7 +79,7 @@ APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator);
* @remark Any memnodes not given back to the allocator prior to destroying
* will _not_ be free()d.
*/
APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator);
APR_DECLARE(void) fspr_allocator_destroy(fspr_allocator_t *allocator);
/**
* Allocate a block of mem from the allocator
@@ -87,8 +87,8 @@ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator);
* @param size The size of the mem to allocate (excluding the
* memnode structure)
*/
APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator,
apr_size_t size);
APR_DECLARE(fspr_memnode_t *) fspr_allocator_alloc(fspr_allocator_t *allocator,
fspr_size_t size);
/**
* Free a list of blocks of mem, giving them back to the allocator.
@@ -97,10 +97,10 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator,
* @param allocator The allocator to give the mem back to
* @param memnode The memory node to return
*/
APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator,
apr_memnode_t *memnode);
APR_DECLARE(void) fspr_allocator_free(fspr_allocator_t *allocator,
fspr_memnode_t *memnode);
#include "apr_pools.h"
#include "fspr_pools.h"
/**
* Set the owner of the allocator
@@ -113,14 +113,14 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator,
* you can make a pool an owner, but if the pool doesn't use the allocator
* the allocator will never be destroyed.
*/
APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator,
apr_pool_t *pool);
APR_DECLARE(void) fspr_allocator_owner_set(fspr_allocator_t *allocator,
fspr_pool_t *pool);
/**
* Get the current owner of the allocator
* @param allocator The allocator to get the owner from
*/
APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator);
APR_DECLARE(fspr_pool_t *) fspr_allocator_owner_get(fspr_allocator_t *allocator);
/**
* Set the current threshold at which the allocator should start
@@ -128,10 +128,10 @@ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator);
* @param allocator The allocator the set the threshold on
* @param size The threshold. 0 == unlimited.
*/
APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator,
apr_size_t size);
APR_DECLARE(void) fspr_allocator_max_free_set(fspr_allocator_t *allocator,
fspr_size_t size);
#include "apr_thread_mutex.h"
#include "fspr_thread_mutex.h"
#if APR_HAS_THREADS
/**
@@ -139,15 +139,15 @@ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator,
* @param allocator The allocator to set the mutex for
* @param mutex The mutex
*/
APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator,
apr_thread_mutex_t *mutex);
APR_DECLARE(void) fspr_allocator_mutex_set(fspr_allocator_t *allocator,
fspr_thread_mutex_t *mutex);
/**
* Get the mutex currently set for the allocator
* @param allocator The allocator
*/
APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get(
apr_allocator_t *allocator);
APR_DECLARE(fspr_thread_mutex_t *) fspr_allocator_mutex_get(
fspr_allocator_t *allocator);
#endif /* APR_HAS_THREADS */
@@ -18,19 +18,19 @@
#define APR_ATOMIC_H
/**
* @file apr_atomic.h
* @file fspr_atomic.h
* @brief APR Atomic Operations
*/
#include "apr.h"
#include "apr_pools.h"
#include "fspr.h"
#include "fspr_pools.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup apr_atomic Atomic Operations
* @defgroup fspr_atomic Atomic Operations
* @ingroup APR
* @{
*/
@@ -41,7 +41,7 @@ extern "C" {
* @param p pool
* @return APR_SUCCESS on successful completion
*/
APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_atomic_init(fspr_pool_t *p);
/*
* Atomic operations on 32-bit values
@@ -50,65 +50,65 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p);
*/
/**
* atomically read an apr_uint32_t from memory
* atomically read an fspr_uint32_t from memory
* @param mem the pointer
*/
APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem);
APR_DECLARE(fspr_uint32_t) fspr_atomic_read32(volatile fspr_uint32_t *mem);
/**
* atomically set an apr_uint32_t in memory
* atomically set an fspr_uint32_t in memory
* @param mem pointer to the object
* @param val value that the object will assume
*/
APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val);
APR_DECLARE(void) fspr_atomic_set32(volatile fspr_uint32_t *mem, fspr_uint32_t val);
/**
* atomically add 'val' to an apr_uint32_t
* atomically add 'val' to an fspr_uint32_t
* @param mem pointer to the object
* @param val amount to add
* @return old value pointed to by mem
*/
APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val);
APR_DECLARE(fspr_uint32_t) fspr_atomic_add32(volatile fspr_uint32_t *mem, fspr_uint32_t val);
/**
* atomically subtract 'val' from an apr_uint32_t
* atomically subtract 'val' from an fspr_uint32_t
* @param mem pointer to the object
* @param val amount to subtract
*/
APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val);
APR_DECLARE(void) fspr_atomic_sub32(volatile fspr_uint32_t *mem, fspr_uint32_t val);
/**
* atomically increment an apr_uint32_t by 1
* atomically increment an fspr_uint32_t by 1
* @param mem pointer to the object
* @return old value pointed to by mem
*/
APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem);
APR_DECLARE(fspr_uint32_t) fspr_atomic_inc32(volatile fspr_uint32_t *mem);
/**
* atomically decrement an apr_uint32_t by 1
* atomically decrement an fspr_uint32_t by 1
* @param mem pointer to the atomic value
* @return zero if the value becomes zero on decrement, otherwise non-zero
*/
APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem);
APR_DECLARE(int) fspr_atomic_dec32(volatile fspr_uint32_t *mem);
/**
* compare an apr_uint32_t's value with 'cmp'.
* compare an fspr_uint32_t's value with 'cmp'.
* If they are the same swap the value with 'with'
* @param mem pointer to the value
* @param with what to swap it with
* @param cmp the value to compare it to
* @return the old value of *mem
*/
APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with,
apr_uint32_t cmp);
APR_DECLARE(fspr_uint32_t) fspr_atomic_cas32(volatile fspr_uint32_t *mem, fspr_uint32_t with,
fspr_uint32_t cmp);
/**
* exchange an apr_uint32_t's value with 'val'.
* exchange an fspr_uint32_t's value with 'val'.
* @param mem pointer to the value
* @param val what to swap it with
* @return the old value of *mem
*/
APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val);
APR_DECLARE(fspr_uint32_t) fspr_atomic_xchg32(volatile fspr_uint32_t *mem, fspr_uint32_t val);
/**
* compare the pointer's value with cmp.
@@ -118,7 +118,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint
* @param cmp the value to compare it to
* @return the old value of the pointer
*/
APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp);
APR_DECLARE(void*) fspr_atomic_casptr(volatile void **mem, void *with, const void *cmp);
/** @} */
@@ -18,20 +18,20 @@
#define APR_DSO_DOT_H
/**
* @file apr_dso.h
* @file fspr_dso.h
* @brief APR Dynamic Object Handling Routines
*/
#include "apr.h"
#include "apr_pools.h"
#include "apr_errno.h"
#include "fspr.h"
#include "fspr_pools.h"
#include "fspr_errno.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup apr_dso Dynamic Object Handling
* @defgroup fspr_dso Dynamic Object Handling
* @ingroup APR
* @{
*/
@@ -41,12 +41,12 @@ extern "C" {
/**
* Structure for referencing dynamic objects
*/
typedef struct apr_dso_handle_t apr_dso_handle_t;
typedef struct fspr_dso_handle_t fspr_dso_handle_t;
/**
* Structure for referencing symbols from dynamic objects
*/
typedef void * apr_dso_handle_sym_t;
typedef void * fspr_dso_handle_sym_t;
/**
* Load a DSO library.
@@ -56,14 +56,14 @@ typedef void * apr_dso_handle_sym_t;
* @bug We aught to provide an alternative to RTLD_GLOBAL, which
* is the only supported method of loading DSOs today.
*/
APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle,
const char *path, apr_pool_t *ctx);
APR_DECLARE(fspr_status_t) fspr_dso_load(fspr_dso_handle_t **res_handle,
const char *path, fspr_pool_t *ctx);
/**
* Close a DSO library.
* @param handle handle to close.
*/
APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle);
APR_DECLARE(fspr_status_t) fspr_dso_unload(fspr_dso_handle_t *handle);
/**
* Load a symbol from a DSO handle.
@@ -71,8 +71,8 @@ APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle);
* @param handle handle to load the symbol from.
* @param symname Name of the symbol to load.
*/
APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym,
apr_dso_handle_t *handle,
APR_DECLARE(fspr_status_t) fspr_dso_sym(fspr_dso_handle_sym_t *ressym,
fspr_dso_handle_t *handle,
const char *symname);
/**
@@ -81,7 +81,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym,
* @param buf Location to store the dso error
* @param bufsize The size of the provided buffer
*/
APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize);
APR_DECLARE(const char *) fspr_dso_error(fspr_dso_handle_t *dso, char *buf, fspr_size_t bufsize);
#endif /* APR_HAS_DSO */
@@ -17,18 +17,18 @@
#ifndef APR_ENV_H
#define APR_ENV_H
/**
* @file apr_env.h
* @file fspr_env.h
* @brief APR Environment functions
*/
#include "apr_errno.h"
#include "apr_pools.h"
#include "fspr_errno.h"
#include "fspr_pools.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_env Functions for manupulating the environment
* @defgroup fspr_env Functions for manupulating the environment
* @ingroup APR
* @{
*/
@@ -39,8 +39,8 @@ extern "C" {
* @param envvar the name of the environment variable
* @param pool where to allocate @a value and any temporary storage from
*/
APR_DECLARE(apr_status_t) apr_env_get(char **value, const char *envvar,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_env_get(char **value, const char *envvar,
fspr_pool_t *pool);
/**
* Set the value of an environment variable
@@ -48,15 +48,15 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, const char *envvar,
* @param value the value to set
* @param pool where to allocate temporary storage from
*/
APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, const char *value,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_env_set(const char *envvar, const char *value,
fspr_pool_t *pool);
/**
* Delete a variable from the environment
* @param envvar the name of the environment variable
* @param pool where to allocate temporary storage from
*/
APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_env_delete(const char *envvar, fspr_pool_t *pool);
/** @} */
@@ -18,11 +18,11 @@
#define APR_ERRNO_H
/**
* @file apr_errno.h
* @file fspr_errno.h
* @brief APR Error Codes
*/
#include "apr.h"
#include "fspr.h"
#if APR_HAVE_ERRNO_H
#include <errno.h>
@@ -33,7 +33,7 @@ extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_errno Error Codes
* @defgroup fspr_errno Error Codes
* @ingroup APR
* @{
*/
@@ -41,7 +41,7 @@ extern "C" {
/**
* Type for specifying an error or status code.
*/
typedef int apr_status_t;
typedef int fspr_status_t;
/**
* Return a human readable string describing the specified error.
@@ -49,14 +49,14 @@ typedef int apr_status_t;
* @param buf A buffer to hold the error string.
* @param bufsize Size of the buffer to hold the string.
*/
APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
apr_size_t bufsize);
APR_DECLARE(char *) fspr_strerror(fspr_status_t statcode, char *buf,
fspr_size_t bufsize);
#if defined(DOXYGEN)
/**
* @def APR_FROM_OS_ERROR(os_err_type syserr)
* Fold a platform specific error into an apr_status_t code.
* @return apr_status_t
* Fold a platform specific error into an fspr_status_t code.
* @return fspr_status_t
* @param e The platform os error code.
* @warning macro implementation; the syserr argument may be evaluated
* multiple times.
@@ -64,46 +64,46 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
#define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
/**
* @def APR_TO_OS_ERROR(apr_status_t statcode)
* @def APR_TO_OS_ERROR(fspr_status_t statcode)
* @return os_err_type
* Fold an apr_status_t code back to the native platform defined error.
* @param e The apr_status_t folded platform os error code.
* Fold an fspr_status_t code back to the native platform defined error.
* @param e The fspr_status_t folded platform os error code.
* @warning macro implementation; the statcode argument may be evaluated
* multiple times. If the statcode was not created by apr_get_os_error
* multiple times. If the statcode was not created by fspr_get_os_error
* or APR_FROM_OS_ERROR, the results are undefined.
*/
#define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
/** @def apr_get_os_error()
* @return apr_status_t the last platform error, folded into apr_status_t, on most platforms
/** @def fspr_get_os_error()
* @return fspr_status_t the last platform error, folded into fspr_status_t, on most platforms
* @remark This retrieves errno, or calls a GetLastError() style function, and
* folds it with APR_FROM_OS_ERROR. Some platforms (such as OS2) have no
* such mechanism, so this call may be unsupported. Do NOT use this
* call for socket errors from socket, send, recv etc!
*/
/** @def apr_set_os_error(e)
* Reset the last platform error, unfolded from an apr_status_t, on some platforms
/** @def fspr_set_os_error(e)
* Reset the last platform error, unfolded from an fspr_status_t, on some platforms
* @param e The OS error folded in a prior call to APR_FROM_OS_ERROR()
* @warning This is a macro implementation; the statcode argument may be evaluated
* multiple times. If the statcode was not created by apr_get_os_error
* multiple times. If the statcode was not created by fspr_get_os_error
* or APR_FROM_OS_ERROR, the results are undefined. This macro sets
* errno, or calls a SetLastError() style function, unfolding statcode
* with APR_TO_OS_ERROR. Some platforms (such as OS2) have no such
* mechanism, so this call may be unsupported.
*/
/** @def apr_get_netos_error()
* Return the last socket error, folded into apr_status_t, on all platforms
/** @def fspr_get_netos_error()
* Return the last socket error, folded into fspr_status_t, on all platforms
* @remark This retrieves errno or calls a GetLastSocketError() style function,
* and folds it with APR_FROM_OS_ERROR.
*/
/** @def apr_set_netos_error(e)
* Reset the last socket error, unfolded from an apr_status_t
/** @def fspr_set_netos_error(e)
* Reset the last socket error, unfolded from an fspr_status_t
* @param e The socket error folded in a prior call to APR_FROM_OS_ERROR()
* @warning This is a macro implementation; the statcode argument may be evaluated
* multiple times. If the statcode was not created by apr_get_os_error
* multiple times. If the statcode was not created by fspr_get_os_error
* or APR_FROM_OS_ERROR, the results are undefined. This macro sets
* errno, or calls a WSASetLastError() style function, unfolding
* socketcode with APR_TO_OS_ERROR.
@@ -146,12 +146,12 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
+ (APR_OS_ERRSPACE_SIZE * 10))
/**
* APR_OS_START_EAIERR folds EAI_ error codes from getaddrinfo() into
* apr_status_t values.
* fspr_status_t values.
*/
#define APR_OS_START_EAIERR (APR_OS_START_CANONERR + APR_OS_ERRSPACE_SIZE)
/**
* APR_OS_START_SYSERR folds platform-specific system error values into
* apr_status_t values.
* fspr_status_t values.
*/
#define APR_OS_START_SYSERR (APR_OS_START_EAIERR + APR_OS_ERRSPACE_SIZE)
@@ -176,7 +176,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
* APR_ENOTHDKEY APR was not given a thread key structure
* APR_ENOSHMAVAIL There is no more shared memory available
* APR_EDSOOPEN APR was unable to open the dso object. For more
* information call apr_dso_error().
* information call fspr_dso_error().
* APR_EGENERAL General failure (specific information not available)
* APR_EBADIP The specified IP address is invalid
* APR_EBADMASK The specified netmask is invalid
@@ -327,7 +327,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
/* empty slot: +18 */
/**
* APR was unable to open the dso object.
* For more information call apr_dso_error().
* For more information call fspr_dso_error().
*/
#if defined(WIN32)
#define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN \
@@ -348,7 +348,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
/** The given path contained wildcards. */
#define APR_STATUS_IS_EPATHWILD(s) ((s) == APR_EPATHWILD)
/** Could not find the requested symbol.
* For more information call apr_dso_error().
* For more information call fspr_dso_error().
*/
#if defined(WIN32)
#define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND \
@@ -775,14 +775,14 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
* The API calls always return a result codes which
* should be filtered through APR_FROM_OS_ERROR().
*
* #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError()))
* #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e)))
* #define fspr_get_os_error() (APR_FROM_OS_ERROR(GetLastError()))
* #define fspr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e)))
*/
/* A special case, only socket calls require this;
*/
#define apr_get_netos_error() (APR_FROM_OS_ERROR(errno))
#define apr_set_netos_error(e) (errno = APR_TO_OS_ERROR(e))
#define fspr_get_netos_error() (APR_FROM_OS_ERROR(errno))
#define fspr_set_netos_error(e) (errno = APR_TO_OS_ERROR(e))
/* And this needs to be greped away for good:
*/
@@ -938,13 +938,13 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
#define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
#define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
#define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError()))
#define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e)))
#define fspr_get_os_error() (APR_FROM_OS_ERROR(GetLastError()))
#define fspr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e)))
/* A special case, only socket calls require this:
*/
#define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError()))
#define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e)))
#define fspr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError()))
#define fspr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e)))
/* APR CANONICAL ERROR TESTS */
#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \
@@ -1051,12 +1051,12 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
#define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
#define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
#define apr_get_os_error() (errno)
#define apr_set_os_error(e) (errno = (e))
#define fspr_get_os_error() (errno)
#define fspr_set_os_error(e) (errno = (e))
/* A special case, only socket calls require this: */
#define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError()))
#define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e)))
#define fspr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError()))
#define fspr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e)))
/* APR CANONICAL ERROR TESTS */
#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES)
@@ -1113,13 +1113,13 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
#define APR_FROM_OS_ERROR(e) (e)
#define APR_TO_OS_ERROR(e) (e)
#define apr_get_os_error() (errno)
#define apr_set_os_error(e) (errno = (e))
#define fspr_get_os_error() (errno)
#define fspr_set_os_error(e) (errno = (e))
/* A special case, only socket calls require this:
*/
#define apr_get_netos_error() (errno)
#define apr_set_netos_error(e) (errno = (e))
#define fspr_get_netos_error() (errno)
#define fspr_set_netos_error(e) (errno = (e))
/**
* @addtogroup APR_STATUS_IS
@@ -18,16 +18,16 @@
#define APR_FILE_INFO_H
/**
* @file apr_file_info.h
* @file fspr_file_info.h
* @brief APR File Information
*/
#include "apr.h"
#include "apr_user.h"
#include "apr_pools.h"
#include "apr_tables.h"
#include "apr_time.h"
#include "apr_errno.h"
#include "fspr.h"
#include "fspr_user.h"
#include "fspr_pools.h"
#include "fspr_tables.h"
#include "fspr_time.h"
#include "fspr_errno.h"
#if APR_HAVE_SYS_UIO_H
#include <sys/uio.h>
@@ -38,7 +38,7 @@ extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_file_info File Information
* @defgroup fspr_file_info File Information
* @ingroup APR
* @{
*/
@@ -48,8 +48,8 @@ extern "C" {
* so the APR_NOFILE value must be distinct from APR_UNKFILE.
*/
/** apr_filetype_e values for the filetype member of the
* apr_file_info_t structure
/** fspr_filetype_e values for the filetype member of the
* fspr_file_info_t structure
* @warning: Not all of the filetypes below can be determined.
* For example, a given platform might not correctly report
* a socket descriptor as APR_SOCK if that type isn't
@@ -69,10 +69,10 @@ typedef enum {
APR_LNK, /**< a symbolic link */
APR_SOCK, /**< a [unix domain] socket */
APR_UNKFILE = 127 /**< a file of some other unknown type */
} apr_filetype_e;
} fspr_filetype_e;
/**
* @defgroup apr_file_permissions File Permissions flags
* @defgroup fspr_file_permissions File Permissions flags
* @{
*/
@@ -93,7 +93,7 @@ typedef enum {
#define APR_FPROT_OS_DEFAULT 0x0FFF /**< use OS's default permissions */
/* additional permission flags for apr_file_copy and apr_file_append */
/* additional permission flags for fspr_file_copy and fspr_file_append */
#define APR_FPROT_FILE_SOURCE_PERMS 0x1000 /**< Copy source file's permissions */
/* backcompat */
@@ -118,35 +118,35 @@ typedef enum {
/**
* Structure for referencing directories.
*/
typedef struct apr_dir_t apr_dir_t;
typedef struct fspr_dir_t fspr_dir_t;
/**
* Structure for determining file permissions.
*/
typedef apr_int32_t apr_fileperms_t;
typedef fspr_int32_t fspr_fileperms_t;
#if (defined WIN32) || (defined NETWARE)
/**
* Structure for determining the inode of the file.
*/
typedef apr_uint64_t apr_ino_t;
typedef fspr_uint64_t fspr_ino_t;
/**
* Structure for determining the device the file is on.
*/
typedef apr_uint32_t apr_dev_t;
typedef fspr_uint32_t fspr_dev_t;
#else
/** The inode of the file. */
typedef ino_t apr_ino_t;
typedef ino_t fspr_ino_t;
/**
* Structure for determining the device the file is on.
*/
typedef dev_t apr_dev_t;
typedef dev_t fspr_dev_t;
#endif
/**
* @defgroup apr_file_stat Stat Functions
* @defgroup fspr_file_stat Stat Functions
* @{
*/
/** file info structure */
typedef struct apr_finfo_t apr_finfo_t;
typedef struct fspr_finfo_t fspr_finfo_t;
#define APR_FINFO_LINK 0x00000001 /**< Stat the link not the file itself if it is a link */
#define APR_FINFO_MTIME 0x00000010 /**< Modification Time */
@@ -170,52 +170,52 @@ typedef struct apr_finfo_t apr_finfo_t;
#define APR_FINFO_IDENT 0x00003000 /**< dev and inode */
#define APR_FINFO_OWNER 0x00030000 /**< user and group */
#define APR_FINFO_PROT 0x00700000 /**< all protections */
#define APR_FINFO_NORM 0x0073b170 /**< an atomic unix apr_stat() */
#define APR_FINFO_DIRENT 0x02000000 /**< an atomic unix apr_dir_read() */
#define APR_FINFO_NORM 0x0073b170 /**< an atomic unix fspr_stat() */
#define APR_FINFO_DIRENT 0x02000000 /**< an atomic unix fspr_dir_read() */
/**
* The file information structure. This is analogous to the POSIX
* stat structure.
*/
struct apr_finfo_t {
struct fspr_finfo_t {
/** Allocates memory and closes lingering handles in the specified pool */
apr_pool_t *pool;
/** The bitmask describing valid fields of this apr_finfo_t structure
fspr_pool_t *pool;
/** The bitmask describing valid fields of this fspr_finfo_t structure
* including all available 'wanted' fields and potentially more */
apr_int32_t valid;
fspr_int32_t valid;
/** The access permissions of the file. Mimics Unix access rights. */
apr_fileperms_t protection;
fspr_fileperms_t protection;
/** The type of file. One of APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE,
* APR_LNK or APR_SOCK. If the type is undetermined, the value is APR_NOFILE.
* If the type cannot be determined, the value is APR_UNKFILE.
*/
apr_filetype_e filetype;
fspr_filetype_e filetype;
/** The user id that owns the file */
apr_uid_t user;
fspr_uid_t user;
/** The group id that owns the file */
apr_gid_t group;
fspr_gid_t group;
/** The inode of the file. */
apr_ino_t inode;
fspr_ino_t inode;
/** The id of the device the file is on. */
apr_dev_t device;
fspr_dev_t device;
/** The number of hard links to the file. */
apr_int32_t nlink;
fspr_int32_t nlink;
/** The size of the file */
apr_off_t size;
fspr_off_t size;
/** The storage size consumed by the file */
apr_off_t csize;
fspr_off_t csize;
/** The time the file was last accessed */
apr_time_t atime;
fspr_time_t atime;
/** The time the file was last modified */
apr_time_t mtime;
fspr_time_t mtime;
/** The time the file was created, or the inode was last changed */
apr_time_t ctime;
fspr_time_t ctime;
/** The pathname of the file (possibly unrooted) */
const char *fname;
/** The file's name (no path) in filesystem case */
const char *name;
/** The file's handle, if accessed (can be submitted to apr_duphandle) */
struct apr_file_t *filehand;
/** The file's handle, if accessed (can be submitted to fspr_duphandle) */
struct fspr_file_t *filehand;
};
/**
@@ -224,7 +224,7 @@ struct apr_finfo_t {
* @param finfo Where to store the information about the file, which is
* never touched if the call fails.
* @param fname The name of the file to stat.
* @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_
* @param wanted The desired fspr_finfo_t fields, as a bit flag of APR_FINFO_
values
* @param pool the pool to use to allocate the new file.
*
@@ -232,12 +232,12 @@ struct apr_finfo_t {
* not be filled in, and you need to check the @c finfo->valid bitmask
* to verify that what you're looking for is there.
*/
APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
apr_int32_t wanted, apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_stat(fspr_finfo_t *finfo, const char *fname,
fspr_int32_t wanted, fspr_pool_t *pool);
/** @} */
/**
* @defgroup apr_dir Directory Manipulation Functions
* @defgroup fspr_dir Directory Manipulation Functions
* @{
*/
@@ -247,58 +247,58 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
* @param dirname The full path to the directory (use / on all systems)
* @param pool The pool to use.
*/
APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir,
APR_DECLARE(fspr_status_t) fspr_dir_open(fspr_dir_t **new_dir,
const char *dirname,
apr_pool_t *pool);
fspr_pool_t *pool);
/**
* close the specified directory.
* @param thedir the directory descriptor to close.
*/
APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir);
APR_DECLARE(fspr_status_t) fspr_dir_close(fspr_dir_t *thedir);
/**
* Read the next entry from the specified directory.
* @param finfo the file info structure and filled in by apr_dir_read
* @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_
* @param finfo the file info structure and filled in by fspr_dir_read
* @param wanted The desired fspr_finfo_t fields, as a bit flag of APR_FINFO_
values
* @param thedir the directory descriptor returned from apr_dir_open
* @param thedir the directory descriptor returned from fspr_dir_open
* @remark No ordering is guaranteed for the entries read.
*
* @note If @c APR_INCOMPLETE is returned all the fields in @a finfo may
* not be filled in, and you need to check the @c finfo->valid bitmask
* to verify that what you're looking for is there.
*/
APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
apr_dir_t *thedir);
APR_DECLARE(fspr_status_t) fspr_dir_read(fspr_finfo_t *finfo, fspr_int32_t wanted,
fspr_dir_t *thedir);
/**
* Rewind the directory to the first entry.
* @param thedir the directory descriptor to rewind.
*/
APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir);
APR_DECLARE(fspr_status_t) fspr_dir_rewind(fspr_dir_t *thedir);
/** @} */
/**
* @defgroup apr_filepath Filepath Manipulation Functions
* @defgroup fspr_filepath Filepath Manipulation Functions
* @{
*/
/** Cause apr_filepath_merge to fail if addpath is above rootpath */
/** Cause fspr_filepath_merge to fail if addpath is above rootpath */
#define APR_FILEPATH_NOTABOVEROOT 0x01
/** internal: Only meaningful with APR_FILEPATH_NOTABOVEROOT */
#define APR_FILEPATH_SECUREROOTTEST 0x02
/** Cause apr_filepath_merge to fail if addpath is above rootpath,
/** Cause fspr_filepath_merge to fail if addpath is above rootpath,
* even given a rootpath /foo/bar and an addpath ../bar/bash
*/
#define APR_FILEPATH_SECUREROOT 0x03
/** Fail apr_filepath_merge if the merged path is relative */
/** Fail fspr_filepath_merge if the merged path is relative */
#define APR_FILEPATH_NOTRELATIVE 0x04
/** Fail apr_filepath_merge if the merged path is absolute */
/** Fail fspr_filepath_merge if the merged path is absolute */
#define APR_FILEPATH_NOTABSOLUTE 0x08
/** Return the file system's native path format (e.g. path delimiters
@@ -334,10 +334,10 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir);
* the drive letter), or APR_EBADPATH if the root is simply invalid.
* APR_SUCCESS is returned if filepath is an absolute path.
*/
APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath,
APR_DECLARE(fspr_status_t) fspr_filepath_root(const char **rootpath,
const char **filepath,
apr_int32_t flags,
apr_pool_t *p);
fspr_int32_t flags,
fspr_pool_t *p);
/**
* Merge additional file path onto the previously processed rootpath
@@ -352,11 +352,11 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath,
* result code will be APR_EPATHWILD, and all further segments will not
* reflect the true filenames including the wildcard and following segments.
*/
APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath,
APR_DECLARE(fspr_status_t) fspr_filepath_merge(char **newpath,
const char *rootpath,
const char *addpath,
apr_int32_t flags,
apr_pool_t *p);
fspr_int32_t flags,
fspr_pool_t *p);
/**
* Split a search path into separate components
@@ -367,9 +367,9 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath,
* @remark the path separator in @a liststr is system specific;
* e.g., ':' on Unix, ';' on Windows, etc.
*/
APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts,
APR_DECLARE(fspr_status_t) fspr_filepath_list_split(fspr_array_header_t **pathelts,
const char *liststr,
apr_pool_t *p);
fspr_pool_t *p);
/**
* Merge a list of search path components into a single search path
@@ -380,9 +380,9 @@ APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts,
* @remark the path separator in @a liststr is system specific;
* e.g., ':' on Unix, ';' on Windows, etc.
*/
APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr,
apr_array_header_t *pathelts,
apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_filepath_list_merge(char **liststr,
fspr_array_header_t *pathelts,
fspr_pool_t *p);
/**
* Return the default file path (for relative file names)
@@ -391,15 +391,15 @@ APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr,
* default file path in os-native format.
* @param p the pool to allocate the default path string from
*/
APR_DECLARE(apr_status_t) apr_filepath_get(char **path, apr_int32_t flags,
apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_filepath_get(char **path, fspr_int32_t flags,
fspr_pool_t *p);
/**
* Set the default file path (for relative file names)
* @param path the default path returned
* @param p the pool to allocate any working storage
*/
APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_filepath_set(const char *path, fspr_pool_t *p);
/** The FilePath character encoding is unknown */
#define APR_FILEPATH_ENCODING_UNKNOWN 0
@@ -414,10 +414,10 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p);
* Determine the encoding used internally by the FilePath functions
* @param style points to a variable which receives the encoding style flag
* @param p the pool to allocate any working storage
* @remark Use @c apr_os_locale_encoding and/or @c apr_os_default_encoding
* @remark Use @c fspr_os_locale_encoding and/or @c fspr_os_default_encoding
* to get the name of the path encoding if it's not UTF-8.
*/
APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_filepath_encoding(int *style, fspr_pool_t *p);
/** @} */
/** @} */
@@ -18,33 +18,33 @@
#define APR_FILE_IO_H
/**
* @file apr_file_io.h
* @file fspr_file_io.h
* @brief APR File I/O Handling
*/
#include "apr.h"
#include "apr_pools.h"
#include "apr_time.h"
#include "apr_errno.h"
#include "apr_file_info.h"
#include "apr_inherit.h"
#include "fspr.h"
#include "fspr_pools.h"
#include "fspr_time.h"
#include "fspr_errno.h"
#include "fspr_file_info.h"
#include "fspr_inherit.h"
#define APR_WANT_STDIO /**< for SEEK_* */
#define APR_WANT_IOVEC /**< for apr_file_writev */
#include "apr_want.h"
#define APR_WANT_IOVEC /**< for fspr_file_writev */
#include "fspr_want.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_file_io File I/O Handling Functions
* @defgroup fspr_file_io File I/O Handling Functions
* @ingroup APR
* @{
*/
/**
* @defgroup apr_file_open_flags File Open Flags/Routines
* @defgroup fspr_file_open_flags File Open Flags/Routines
* @{
*/
@@ -73,7 +73,7 @@ extern "C" {
when the file is opened */
#define APR_FOPEN_SENDFILE_ENABLED 0x01000 /**< Advisory flag that this
file should support
apr_socket_sendfile operation */
fspr_socket_sendfile operation */
#define APR_FOPEN_LARGEFILE 0x04000 /**< Platform dependent flag to enable
large file support; WARNING see
below. */
@@ -94,12 +94,12 @@ extern "C" {
#define APR_LARGEFILE APR_FOPEN_LARGEFILE /**< @deprecated @see APR_FOPEN_LARGEFILE */
/** @warning The APR_LARGEFILE flag only has effect on some platforms
* where sizeof(apr_off_t) == 4. Where implemented, it allows opening
* where sizeof(fspr_off_t) == 4. Where implemented, it allows opening
* and writing to a file which exceeds the size which can be
* represented by apr_off_t (2 gigabytes). When a file's size does
* exceed 2Gb, apr_file_info_get() will fail with an error on the
* descriptor, likewise apr_stat()/apr_lstat() will fail on the
* filename. apr_dir_read() will fail with APR_INCOMPLETE on a
* represented by fspr_off_t (2 gigabytes). When a file's size does
* exceed 2Gb, fspr_file_info_get() will fail with an error on the
* descriptor, likewise fspr_stat()/fspr_lstat() will fail on the
* filename. fspr_dir_read() will fail with APR_INCOMPLETE on a
* directory entry for a large file depending on the particular
* APR_FINFO_* flags. Generally, it is not recommended to use this
* flag. */
@@ -107,11 +107,11 @@ extern "C" {
/** @} */
/**
* @defgroup apr_file_seek_flags File Seek Flags
* @defgroup fspr_file_seek_flags File Seek Flags
* @{
*/
/* flags for apr_file_seek */
/* flags for fspr_file_seek */
/** Set the file position */
#define APR_SET SEEK_SET
/** Current */
@@ -121,18 +121,18 @@ extern "C" {
/** @} */
/**
* @defgroup apr_file_attrs_set_flags File Attribute Flags
* @defgroup fspr_file_attrs_set_flags File Attribute Flags
* @{
*/
/* flags for apr_file_attrs_set */
/* flags for fspr_file_attrs_set */
#define APR_FILE_ATTR_READONLY 0x01 /**< File is read-only */
#define APR_FILE_ATTR_EXECUTABLE 0x02 /**< File is executable */
#define APR_FILE_ATTR_HIDDEN 0x04 /**< File is hidden */
/** @} */
/**
* @defgroup apr_file_writev{_full} max iovec size
* @defgroup fspr_file_writev{_full} max iovec size
* @{
*/
#if defined(DOXYGEN)
@@ -148,19 +148,19 @@ extern "C" {
/** @} */
/** File attributes */
typedef apr_uint32_t apr_fileattrs_t;
typedef fspr_uint32_t fspr_fileattrs_t;
/** Type to pass as whence argument to apr_file_seek. */
typedef int apr_seek_where_t;
/** Type to pass as whence argument to fspr_file_seek. */
typedef int fspr_seek_where_t;
/**
* Structure for referencing files.
*/
typedef struct apr_file_t apr_file_t;
typedef struct fspr_file_t fspr_file_t;
/* File lock types/flags */
/**
* @defgroup apr_file_lock_types File Lock Types
* @defgroup fspr_file_lock_types File Lock Types
* @{
*/
@@ -203,29 +203,29 @@ typedef struct apr_file_t apr_file_t;
* writes across process/machines
* APR_FILE_NOCLEANUP Do not register a cleanup with the pool
* passed in on the <EM>pool</EM> argument (see below).
* The apr_os_file_t handle in apr_file_t will not
* The fspr_os_file_t handle in fspr_file_t will not
* be closed when the pool is destroyed.
* APR_SENDFILE_ENABLED Open with appropriate platform semantics
* for sendfile operations. Advisory only,
* apr_socket_sendfile does not check this flag.
* fspr_socket_sendfile does not check this flag.
* </PRE>
* @param perm Access permissions for file.
* @param pool The pool to use.
* @remark If perm is APR_OS_DEFAULT and the file is being created,
* appropriate default permissions will be used.
* @remark By default, the returned file descriptor will not be
* inherited by child processes created by apr_proc_create(). This
* can be changed using apr_file_inherit_set().
* inherited by child processes created by fspr_proc_create(). This
* can be changed using fspr_file_inherit_set().
*/
APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **newf, const char *fname,
apr_int32_t flag, apr_fileperms_t perm,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_file_open(fspr_file_t **newf, const char *fname,
fspr_int32_t flag, fspr_fileperms_t perm,
fspr_pool_t *pool);
/**
* Close the specified file.
* @param file The file descriptor to close.
*/
APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file);
APR_DECLARE(fspr_status_t) fspr_file_close(fspr_file_t *file);
/**
* Delete the specified file.
@@ -234,7 +234,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file);
* @remark If the file is open, it won't be removed until all
* instances are closed.
*/
APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_file_remove(const char *path, fspr_pool_t *pool);
/**
* Rename the specified file.
@@ -245,9 +245,9 @@ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool);
* overwritten. Moving files or directories across devices may not be
* possible.
*/
APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path,
APR_DECLARE(fspr_status_t) fspr_file_rename(const char *from_path,
const char *to_path,
apr_pool_t *pool);
fspr_pool_t *pool);
/**
* Copy the specified file to another file.
@@ -261,10 +261,10 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path,
* @remark The new file does not need to exist, it will be created if required.
* @warning If the new file already exists, its contents will be overwritten.
*/
APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path,
APR_DECLARE(fspr_status_t) fspr_file_copy(const char *from_path,
const char *to_path,
apr_fileperms_t perms,
apr_pool_t *pool);
fspr_fileperms_t perms,
fspr_pool_t *pool);
/**
* Append the specified file to another file.
@@ -277,55 +277,55 @@ APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path,
* @param pool The pool to use.
* @remark The new file does not need to exist, it will be created if required.
*/
APR_DECLARE(apr_status_t) apr_file_append(const char *from_path,
APR_DECLARE(fspr_status_t) fspr_file_append(const char *from_path,
const char *to_path,
apr_fileperms_t perms,
apr_pool_t *pool);
fspr_fileperms_t perms,
fspr_pool_t *pool);
/**
* Are we at the end of the file
* @param fptr The apr file we are testing.
* @remark Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise.
*/
APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr);
APR_DECLARE(fspr_status_t) fspr_file_eof(fspr_file_t *fptr);
/**
* Open standard error as an apr file pointer.
* @param thefile The apr file to use as stderr.
* @param pool The pool to allocate the file out of.
*
* @remark The only reason that the apr_file_open_std* functions exist
* @remark The only reason that the fspr_file_open_std* functions exist
* is that you may not always have a stderr/out/in on Windows. This
* is generally a problem with newer versions of Windows and services.
*
* @remark The other problem is that the C library functions generally work
* differently on Windows and Unix. So, by using apr_file_open_std*
* differently on Windows and Unix. So, by using fspr_file_open_std*
* functions, you can get a handle to an APR struct that works with
* the APR functions which are supposed to work identically on all
* platforms.
*/
APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_file_open_stderr(fspr_file_t **thefile,
fspr_pool_t *pool);
/**
* open standard output as an apr file pointer.
* @param thefile The apr file to use as stdout.
* @param pool The pool to allocate the file out of.
*
* @remark See remarks for apr_file_open_stdout.
* @remark See remarks for fspr_file_open_stdout.
*/
APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_file_open_stdout(fspr_file_t **thefile,
fspr_pool_t *pool);
/**
* open standard input as an apr file pointer.
* @param thefile The apr file to use as stdin.
* @param pool The pool to allocate the file out of.
*
* @remark See remarks for apr_file_open_stdout.
* @remark See remarks for fspr_file_open_stdout.
*/
APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_file_open_stdin(fspr_file_t **thefile,
fspr_pool_t *pool);
/**
* Read data from the specified file.
@@ -334,7 +334,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile,
* @param nbytes On entry, the number of bytes to read; on exit, the number
* of bytes read.
*
* @remark apr_file_read will read up to the specified number of
* @remark fspr_file_read will read up to the specified number of
* bytes, but never more. If there isn't enough data to fill that
* number of bytes, all of the available data is read. The third
* argument is modified to reflect the number of bytes read. If a
@@ -344,8 +344,8 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile,
* @remark It is not possible for both bytes to be read and an APR_EOF
* or other error to be returned. APR_EINTR is never returned.
*/
APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf,
apr_size_t *nbytes);
APR_DECLARE(fspr_status_t) fspr_file_read(fspr_file_t *thefile, void *buf,
fspr_size_t *nbytes);
/**
* Write data to the specified file.
@@ -354,7 +354,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf,
* @param nbytes On entry, the number of bytes to write; on exit, the number
* of bytes written.
*
* @remark apr_file_write will write up to the specified number of
* @remark fspr_file_write will write up to the specified number of
* bytes, but never more. If the OS cannot write that many bytes, it
* will write as many as it can. The third argument is modified to
* reflect the * number of bytes written.
@@ -362,8 +362,8 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf,
* @remark It is possible for both bytes to be written and an error to
* be returned. APR_EINTR is never returned.
*/
APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf,
apr_size_t *nbytes);
APR_DECLARE(fspr_status_t) fspr_file_write(fspr_file_t *thefile, const void *buf,
fspr_size_t *nbytes);
/**
* Write data from iovec array to the specified file.
@@ -377,12 +377,12 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf,
* @remark It is possible for both bytes to be written and an error to
* be returned. APR_EINTR is never returned.
*
* @remark apr_file_writev is available even if the underlying
* @remark fspr_file_writev is available even if the underlying
* operating system doesn't provide writev().
*/
APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile,
APR_DECLARE(fspr_status_t) fspr_file_writev(fspr_file_t *thefile,
const struct iovec *vec,
apr_size_t nvec, apr_size_t *nbytes);
fspr_size_t nvec, fspr_size_t *nbytes);
/**
* Read data from the specified file, ensuring that the buffer is filled
@@ -392,7 +392,7 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile,
* @param nbytes The number of bytes to read.
* @param bytes_read If non-NULL, this will contain the number of bytes read.
*
* @remark apr_file_read will read up to the specified number of
* @remark fspr_file_read will read up to the specified number of
* bytes, but never more. If there isn't enough data to fill that
* number of bytes, then the process/thread will block until it is
* available or EOF is reached. If a char was put back into the
@@ -404,9 +404,9 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile,
*
* @remark APR_EINTR is never returned.
*/
APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf,
apr_size_t nbytes,
apr_size_t *bytes_read);
APR_DECLARE(fspr_status_t) fspr_file_read_full(fspr_file_t *thefile, void *buf,
fspr_size_t nbytes,
fspr_size_t *bytes_read);
/**
* Write data to the specified file, ensuring that all of the data is
@@ -416,7 +416,7 @@ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf,
* @param nbytes The number of bytes to write.
* @param bytes_written If non-NULL, set to the number of bytes written.
*
* @remark apr_file_write will write up to the specified number of
* @remark fspr_file_write will write up to the specified number of
* bytes, but never more. If the OS cannot write that many bytes, the
* process/thread will block until they can be written. Exceptional
* error such as "out of space" or "pipe closed" will terminate with
@@ -428,10 +428,10 @@ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf,
*
* @remark APR_EINTR is never returned.
*/
APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile,
APR_DECLARE(fspr_status_t) fspr_file_write_full(fspr_file_t *thefile,
const void *buf,
apr_size_t nbytes,
apr_size_t *bytes_written);
fspr_size_t nbytes,
fspr_size_t *bytes_written);
/**
@@ -444,33 +444,33 @@ APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile,
* will fail with APR_EINVAL.
* @param nbytes The number of bytes written.
*
* @remark apr_file_writev_full is available even if the underlying
* @remark fspr_file_writev_full is available even if the underlying
* operating system doesn't provide writev().
*/
APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile,
APR_DECLARE(fspr_status_t) fspr_file_writev_full(fspr_file_t *thefile,
const struct iovec *vec,
apr_size_t nvec,
apr_size_t *nbytes);
fspr_size_t nvec,
fspr_size_t *nbytes);
/**
* Write a character into the specified file.
* @param ch The character to write.
* @param thefile The file descriptor to write to
*/
APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile);
APR_DECLARE(fspr_status_t) fspr_file_putc(char ch, fspr_file_t *thefile);
/**
* Read a character from the specified file.
* @param ch The character to read into
* @param thefile The file descriptor to read from
*/
APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile);
APR_DECLARE(fspr_status_t) fspr_file_getc(char *ch, fspr_file_t *thefile);
/**
* Put a character back onto a specified stream.
* @param ch The character to write.
* @param thefile The file descriptor to write to
*/
APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile);
APR_DECLARE(fspr_status_t) fspr_file_ungetc(char ch, fspr_file_t *thefile);
/**
* Read a string from the specified file.
@@ -479,32 +479,32 @@ APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile);
* @param thefile The file descriptor to read from
* @remark The buffer will be NUL-terminated if any characters are stored.
*/
APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len,
apr_file_t *thefile);
APR_DECLARE(fspr_status_t) fspr_file_gets(char *str, int len,
fspr_file_t *thefile);
/**
* Write the string into the specified file.
* @param str The string to write.
* @param thefile The file descriptor to write to
*/
APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile);
APR_DECLARE(fspr_status_t) fspr_file_puts(const char *str, fspr_file_t *thefile);
/**
* Flush the file's buffer.
* @param thefile The file descriptor to flush
*/
APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile);
APR_DECLARE(fspr_status_t) fspr_file_flush(fspr_file_t *thefile);
/**
* Duplicate the specified file descriptor.
* @param new_file The structure to duplicate into.
* @param old_file The file to duplicate.
* @param p The pool to use for the new file.
* @remark *new_file must point to a valid apr_file_t, or point to NULL.
* @remark *new_file must point to a valid fspr_file_t, or point to NULL.
*/
APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file,
apr_file_t *old_file,
apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_file_dup(fspr_file_t **new_file,
fspr_file_t *old_file,
fspr_pool_t *p);
/**
* Duplicate the specified file descriptor and close the original
@@ -512,26 +512,26 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file,
* @param old_file The file to duplicate
* @param p The pool to use for the new file
*
* @remark new_file MUST point at a valid apr_file_t. It cannot be NULL.
* @remark new_file MUST point at a valid fspr_file_t. It cannot be NULL.
*/
APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file,
apr_file_t *old_file,
apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_file_dup2(fspr_file_t *new_file,
fspr_file_t *old_file,
fspr_pool_t *p);
/**
* Move the specified file descriptor to a new pool
* @param new_file Pointer in which to return the new apr_file_t
* @param new_file Pointer in which to return the new fspr_file_t
* @param old_file The file to move
* @param p The pool to which the descriptor is to be moved
* @remark Unlike apr_file_dup2(), this function doesn't do an
* @remark Unlike fspr_file_dup2(), this function doesn't do an
* OS dup() operation on the underlying descriptor; it just
* moves the descriptor's apr_file_t wrapper to a new pool.
* moves the descriptor's fspr_file_t wrapper to a new pool.
* @remark The new pool need not be an ancestor of old_file's pool.
* @remark After calling this function, old_file may not be used
*/
APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file,
apr_file_t *old_file,
apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_file_setaside(fspr_file_t **new_file,
fspr_file_t *old_file,
fspr_pool_t *p);
/**
* Move the read/write file offset to a specified byte within a file.
@@ -546,9 +546,9 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file,
* @remark The third argument is modified to be the offset the pointer
was actually moved to.
*/
APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile,
apr_seek_where_t where,
apr_off_t *offset);
APR_DECLARE(fspr_status_t) fspr_file_seek(fspr_file_t *thefile,
fspr_seek_where_t where,
fspr_off_t *offset);
/**
* Create an anonymous pipe.
@@ -556,12 +556,12 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile,
* @param out The file descriptor to use as output from the pipe.
* @param pool The pool to operate on.
* @remark By default, the returned file descriptors will be inherited
* by child processes created using apr_proc_create(). This can be
* changed using apr_file_inherit_unset().
* by child processes created using fspr_proc_create(). This can be
* changed using fspr_file_inherit_unset().
*/
APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in,
apr_file_t **out,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_file_pipe_create(fspr_file_t **in,
fspr_file_t **out,
fspr_pool_t *pool);
/**
* Create a named pipe.
@@ -569,17 +569,17 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in,
* @param perm The permissions for the newly created pipe.
* @param pool The pool to operate on.
*/
APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename,
apr_fileperms_t perm,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_file_namedpipe_create(const char *filename,
fspr_fileperms_t perm,
fspr_pool_t *pool);
/**
* Get the timeout value for a pipe or manipulate the blocking state.
* @param thepipe The pipe we are getting a timeout for.
* @param timeout The current timeout value in microseconds.
*/
APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe,
apr_interval_time_t *timeout);
APR_DECLARE(fspr_status_t) fspr_file_pipe_timeout_get(fspr_file_t *thepipe,
fspr_interval_time_t *timeout);
/**
* Set the timeout value for a pipe or manipulate the blocking state.
@@ -587,8 +587,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe,
* @param timeout The timeout value in microseconds. Values < 0 mean wait
* forever, 0 means do not wait at all.
*/
APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe,
apr_interval_time_t timeout);
APR_DECLARE(fspr_status_t) fspr_file_pipe_timeout_set(fspr_file_t *thepipe,
fspr_interval_time_t timeout);
/** file (un)locking functions. */
@@ -601,13 +601,13 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe,
* @param thefile The file to lock.
* @param type The type of lock to establish on the file.
*/
APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type);
APR_DECLARE(fspr_status_t) fspr_file_lock(fspr_file_t *thefile, int type);
/**
* Remove any outstanding locks on the file.
* @param thefile The file to unlock.
*/
APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile);
APR_DECLARE(fspr_status_t) fspr_file_unlock(fspr_file_t *thefile);
/**accessor and general file_io functions. */
@@ -616,8 +616,8 @@ APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile);
* @param new_path The path of the file.
* @param thefile The currently open file.
*/
APR_DECLARE(apr_status_t) apr_file_name_get(const char **new_path,
apr_file_t *thefile);
APR_DECLARE(fspr_status_t) fspr_file_name_get(const char **new_path,
fspr_file_t *thefile);
/**
* Return the data associated with the current file.
@@ -625,8 +625,8 @@ APR_DECLARE(apr_status_t) apr_file_name_get(const char **new_path,
* @param key The key to use for retreiving data associated with this file.
* @param file The currently open file.
*/
APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key,
apr_file_t *file);
APR_DECLARE(fspr_status_t) fspr_file_data_get(void **data, const char *key,
fspr_file_t *file);
/**
* Set the data associated with the current file.
@@ -635,9 +635,9 @@ APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key,
* @param key The key to use for assocaiteing data with the file.
* @param cleanup The cleanup routine to use when the file is destroyed.
*/
APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data,
APR_DECLARE(fspr_status_t) fspr_file_data_set(fspr_file_t *file, void *data,
const char *key,
apr_status_t (*cleanup)(void *));
fspr_status_t (*cleanup)(void *));
/**
* Write a string to a file using a printf format.
@@ -646,7 +646,7 @@ APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data,
* @param ... The values to substitute in the format string
* @return The number of bytes written
*/
APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr,
APR_DECLARE_NONSTD(int) fspr_file_printf(fspr_file_t *fptr,
const char *format, ...)
__attribute__((format(printf,2,3)));
@@ -662,8 +662,8 @@ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr,
* @warning Platforms which do not implement this feature will return
* APR_ENOTIMPL.
*/
APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname,
apr_fileperms_t perms);
APR_DECLARE(fspr_status_t) fspr_file_perms_set(const char *fname,
fspr_fileperms_t perms);
/**
* Set attributes of the specified file.
@@ -683,10 +683,10 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname,
* @warning Platforms which do not implement this feature will return
* APR_ENOTIMPL.
*/
APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname,
apr_fileattrs_t attributes,
apr_fileattrs_t attr_mask,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_file_attrs_set(const char *fname,
fspr_fileattrs_t attributes,
fspr_fileattrs_t attr_mask,
fspr_pool_t *pool);
/**
* Set the mtime of the specified file.
@@ -696,9 +696,9 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname,
* @warning Platforms which do not implement this feature will return
* APR_ENOTIMPL.
*/
APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname,
apr_time_t mtime,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_file_mtime_set(const char *fname,
fspr_time_t mtime,
fspr_pool_t *pool);
/**
* Create a new directory on the file system.
@@ -706,8 +706,8 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname,
* @param perm Permissions for the new direcoty.
* @param pool the pool to use.
*/
APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_dir_make(const char *path, fspr_fileperms_t perm,
fspr_pool_t *pool);
/** Creates a new directory on the file system, but behaves like
* 'mkdir -p'. Creates intermediate directories as required. No error
@@ -716,26 +716,26 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm,
* @param perm Permissions for the new direcoty.
* @param pool the pool to use.
*/
APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path,
apr_fileperms_t perm,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_dir_make_recursive(const char *path,
fspr_fileperms_t perm,
fspr_pool_t *pool);
/**
* Remove directory from the file system.
* @param path the path for the directory to be removed. (use / on all systems)
* @param pool the pool to use.
*/
APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_dir_remove(const char *path, fspr_pool_t *pool);
/**
* get the specified file's stats.
* @param finfo Where to store the information about the file.
* @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values
* @param wanted The desired fspr_finfo_t fields, as a bit flag of APR_FINFO_ values
* @param thefile The file to get information about.
*/
APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo,
apr_int32_t wanted,
apr_file_t *thefile);
APR_DECLARE(fspr_status_t) fspr_file_info_get(fspr_finfo_t *finfo,
fspr_int32_t wanted,
fspr_file_t *thefile);
/**
@@ -743,14 +743,14 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo,
* @param fp The file to truncate
* @param offset The offset to truncate to.
*/
APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset);
APR_DECLARE(fspr_status_t) fspr_file_trunc(fspr_file_t *fp, fspr_off_t offset);
/**
* Retrieve the flags that were passed into apr_file_open()
* Retrieve the flags that were passed into fspr_file_open()
* when the file was opened.
* @return apr_int32_t the flags
* @return fspr_int32_t the flags
*/
APR_DECLARE(apr_int32_t) apr_file_flags_get(apr_file_t *f);
APR_DECLARE(fspr_int32_t) fspr_file_flags_get(fspr_file_t *f);
/**
* Get the pool used by the file.
@@ -784,8 +784,8 @@ APR_DECLARE_INHERIT_UNSET(file);
* array.
*
*/
APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *templ,
apr_int32_t flags, apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_file_mktemp(fspr_file_t **fp, char *templ,
fspr_int32_t flags, fspr_pool_t *p);
/**
@@ -800,8 +800,8 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *templ,
* is successful.
*
*/
APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir,
apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_temp_dir_get(const char **temp_dir,
fspr_pool_t *p);
/** @} */
@@ -38,19 +38,19 @@
#define _APR_FNMATCH_H_
/**
* @file apr_fnmatch.h
* @file fspr_fnmatch.h
* @brief APR FNMatch Functions
*/
#include "apr_errno.h"
#include "apr_tables.h"
#include "fspr_errno.h"
#include "fspr_tables.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup apr_fnmatch Filename Matching Functions
* @defgroup fspr_fnmatch Filename Matching Functions
* @ingroup APR
* @{
*/
@@ -78,7 +78,7 @@ extern "C" {
* </PRE>
*/
APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern,
APR_DECLARE(fspr_status_t) fspr_fnmatch(const char *pattern,
const char *strings, int flags);
/**
@@ -86,7 +86,7 @@ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern,
* @param pattern The pattern to search for glob characters.
* @return non-zero if pattern has any glob characters in it
*/
APR_DECLARE(int) apr_fnmatch_test(const char *pattern);
APR_DECLARE(int) fspr_fnmatch_test(const char *pattern);
/**
* Find all files that match a specified pattern.
@@ -95,9 +95,9 @@ APR_DECLARE(int) apr_fnmatch_test(const char *pattern);
* @param p The pool to use.
* @return non-zero if pattern has any glob characters in it
*/
APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern,
apr_array_header_t **result,
apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_match_glob(const char *pattern,
fspr_array_header_t **result,
fspr_pool_t *p);
/** @} */
@@ -18,16 +18,16 @@
#define APR_GENERAL_H
/**
* @file apr_general.h
* @file fspr_general.h
* This is collection of oddballs that didn't fit anywhere else,
* and might move to more appropriate headers with the release
* of APR 1.0.
* @brief APR Miscellaneous library routines
*/
#include "apr.h"
#include "apr_pools.h"
#include "apr_errno.h"
#include "fspr.h"
#include "fspr_pools.h"
#include "fspr_errno.h"
#if !defined(_ANSI_SOURCE) && defined(_DARWIN_C_SOURCE)
#define NSIG __DARWIN_NSIG
@@ -42,7 +42,7 @@ extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_general Miscellaneous library routines
* @defgroup fspr_general Miscellaneous library routines
* @ingroup APR
* This is collection of oddballs that didn't fit anywhere else,
* and might move to more appropriate headers with the release
@@ -69,7 +69,7 @@ extern "C" {
#define APR_ASCII_TAB '\011'
/** signal numbers typedef */
typedef int apr_signum_t;
typedef int fspr_signum_t;
/**
* Finding offsets of elements within structures.
@@ -148,7 +148,7 @@ int strncasecmp(const char *a, const char *b, size_t n);
* String and memory functions
*/
/* APR_STRINGIFY is defined here, and also in apr_release.h, so wrap it */
/* APR_STRINGIFY is defined here, and also in fspr_release.h, so wrap it */
#ifndef APR_STRINGIFY
/** Properly quote a value as a string in the C preprocessor */
#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
@@ -167,17 +167,17 @@ void *memchr(const void *s, int c, size_t n);
/** @} */
/**
* @defgroup apr_library Library initialization and termination
* @defgroup fspr_library Library initialization and termination
* @{
*/
/**
* Setup any APR internal data structures. This MUST be the first function
* called for any APR library.
* @remark See apr_app_initialize if this is an application, rather than
* @remark See fspr_app_initialize if this is an application, rather than
* a library consumer of apr.
*/
APR_DECLARE(apr_status_t) apr_initialize(void);
APR_DECLARE(fspr_status_t) fspr_initialize(void);
/**
* Set up an application with normalized argc, argv (and optionally env) in
@@ -187,11 +187,11 @@ APR_DECLARE(apr_status_t) apr_initialize(void);
* @param argc Pointer to the argc that may be corrected
* @param argv Pointer to the argv that may be corrected
* @param env Pointer to the env that may be corrected, may be NULL
* @remark See apr_initialize if this is a library consumer of apr.
* Otherwise, this call is identical to apr_initialize, and must be closed
* with a call to apr_terminate at the end of program execution.
* @remark See fspr_initialize if this is a library consumer of apr.
* Otherwise, this call is identical to fspr_initialize, and must be closed
* with a call to fspr_terminate at the end of program execution.
*/
APR_DECLARE(apr_status_t) apr_app_initialize(int *argc,
APR_DECLARE(fspr_status_t) fspr_app_initialize(int *argc,
char const * const * *argv,
char const * const * *env);
@@ -202,25 +202,25 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc,
* has stopped using APR services. The APR developers suggest using
* atexit to ensure this is called. When using APR from a language
* other than C that has problems with the calling convention, use
* apr_terminate2() instead.
* fspr_terminate2() instead.
*/
APR_DECLARE_NONSTD(void) apr_terminate(void);
APR_DECLARE_NONSTD(void) fspr_terminate(void);
/**
* Tear down any APR internal data structures which aren't torn down
* automatically, same as apr_terminate
* @remark An APR program must call either the apr_terminate or apr_terminate2
* automatically, same as fspr_terminate
* @remark An APR program must call either the fspr_terminate or fspr_terminate2
* function once it it has finished using APR services. The APR
* developers suggest using atexit(apr_terminate) to ensure this is done.
* apr_terminate2 exists to allow non-c language apps to tear down apr,
* while apr_terminate is recommended from c language applications.
* developers suggest using atexit(fspr_terminate) to ensure this is done.
* fspr_terminate2 exists to allow non-c language apps to tear down apr,
* while fspr_terminate is recommended from c language applications.
*/
APR_DECLARE(void) apr_terminate2(void);
APR_DECLARE(void) fspr_terminate2(void);
/** @} */
/**
* @defgroup apr_random Random Functions
* @defgroup fspr_random Random Functions
* @{
*/
@@ -232,8 +232,8 @@ APR_DECLARE(void) apr_terminate2(void);
* @param buf Buffer to fill with random bytes
* @param length Length of buffer in bytes
*/
APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf,
apr_size_t length);
APR_DECLARE(fspr_status_t) fspr_generate_random_bytes(unsigned char * buf,
fspr_size_t length);
#endif
/** @} */
@@ -18,18 +18,18 @@
#define APR_GETOPT_H
/**
* @file apr_getopt.h
* @file fspr_getopt.h
* @brief APR Command Arguments (getopt)
*/
#include "apr_pools.h"
#include "fspr_pools.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_getopt Command Argument Parsing
* @defgroup fspr_getopt Command Argument Parsing
* @ingroup APR
* @{
*/
@@ -37,19 +37,19 @@ extern "C" {
/**
* defintion of a error function
*/
typedef void (apr_getopt_err_fn_t)(void *arg, const char *err, ...);
typedef void (fspr_getopt_err_fn_t)(void *arg, const char *err, ...);
/** @see apr_getopt_t */
typedef struct apr_getopt_t apr_getopt_t;
/** @see fspr_getopt_t */
typedef struct fspr_getopt_t fspr_getopt_t;
/**
* Structure to store command line argument information.
*/
struct apr_getopt_t {
struct fspr_getopt_t {
/** context for processing */
apr_pool_t *cont;
fspr_pool_t *cont;
/** function to print error message (NULL == no messages) */
apr_getopt_err_fn_t *errfn;
fspr_getopt_err_fn_t *errfn;
/** user defined first arg to pass to error message */
void *errarg;
/** index into parent argv vector */
@@ -72,13 +72,13 @@ struct apr_getopt_t {
int skip_end;
};
/** @see apr_getopt_option_t */
typedef struct apr_getopt_option_t apr_getopt_option_t;
/** @see fspr_getopt_option_t */
typedef struct fspr_getopt_option_t fspr_getopt_option_t;
/**
* Structure used to describe options that getopt should search for.
*/
struct apr_getopt_option_t {
struct fspr_getopt_option_t {
/** long option name, or NULL if option has no long name */
const char *name;
/** option letter, or a value greater than 255 if option has no letter */
@@ -90,20 +90,20 @@ struct apr_getopt_option_t {
};
/**
* Initialize the arguments for parsing by apr_getopt().
* @param os The options structure created for apr_getopt()
* Initialize the arguments for parsing by fspr_getopt().
* @param os The options structure created for fspr_getopt()
* @param cont The pool to operate on
* @param argc The number of arguments to parse
* @param argv The array of arguments to parse
* @remark Arguments 2 and 3 are most commonly argc and argv from main(argc, argv)
* The errfn is initialized to fprintf(stderr... but may be overridden.
*/
APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont,
APR_DECLARE(fspr_status_t) fspr_getopt_init(fspr_getopt_t **os, fspr_pool_t *cont,
int argc, const char * const *argv);
/**
* Parse the options initialized by apr_getopt_init().
* @param os The apr_opt_t structure returned by apr_getopt_init()
* Parse the options initialized by fspr_getopt_init().
* @param os The fspr_opt_t structure returned by fspr_getopt_init()
* @param opts A string of characters that are acceptable options to the
* program. Characters followed by ":" are required to have an
* option associated
@@ -117,19 +117,19 @@ APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont,
* APR_SUCCESS -- The next option was found.
* </PRE>
*/
APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts,
APR_DECLARE(fspr_status_t) fspr_getopt(fspr_getopt_t *os, const char *opts,
char *option_ch, const char **option_arg);
/**
* Parse the options initialized by apr_getopt_init(), accepting long
* Parse the options initialized by fspr_getopt_init(), accepting long
* options beginning with "--" in addition to single-character
* options beginning with "-".
* @param os The apr_getopt_t structure created by apr_getopt_init()
* @param opts A pointer to a list of apr_getopt_option_t structures, which
* @param os The fspr_getopt_t structure created by fspr_getopt_init()
* @param opts A pointer to a list of fspr_getopt_option_t structures, which
* can be initialized with { "name", optch, has_args }. has_args
* is nonzero if the option requires an argument. A structure
* with an optch value of 0 terminates the list.
* @param option_ch Receives the value of "optch" from the apr_getopt_option_t
* @param option_ch Receives the value of "optch" from the fspr_getopt_option_t
* structure corresponding to the next option matched.
* @param option_arg Receives the argument following the option, if any.
* @return There are four potential status values on exit. They are:
@@ -145,8 +145,8 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts,
* after arguments, and os->argv will be permuted to leave non-option arguments
* at the end (the original argv is unaffected).
*/
APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os,
const apr_getopt_option_t *opts,
APR_DECLARE(fspr_status_t) fspr_getopt_long(fspr_getopt_t *os,
const fspr_getopt_option_t *opts,
int *option_ch,
const char **option_arg);
/** @} */
@@ -18,16 +18,16 @@
#define APR_GLOBAL_MUTEX_H
/**
* @file apr_global_mutex.h
* @file fspr_global_mutex.h
* @brief APR Global Locking Routines
*/
#include "apr.h"
#include "apr_proc_mutex.h" /* only for apr_lockmech_e */
#include "apr_pools.h"
#include "apr_errno.h"
#include "fspr.h"
#include "fspr_proc_mutex.h" /* only for fspr_lockmech_e */
#include "fspr_pools.h"
#include "fspr_errno.h"
#if APR_PROC_MUTEX_IS_GLOBAL
#include "apr_proc_mutex.h"
#include "fspr_proc_mutex.h"
#endif
#ifdef __cplusplus
@@ -43,7 +43,7 @@ extern "C" {
#if !APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN)
/** Opaque global mutex structure. */
typedef struct apr_global_mutex_t apr_global_mutex_t;
typedef struct fspr_global_mutex_t fspr_global_mutex_t;
/* Function definitions */
@@ -51,7 +51,7 @@ typedef struct apr_global_mutex_t apr_global_mutex_t;
* Create and initialize a mutex that can be used to synchronize both
* processes and threads. Note: There is considerable overhead in using
* this API if only cross-process or cross-thread mutual exclusion is
* required. See apr_proc_mutex.h and apr_thread_mutex.h for more
* required. See fspr_proc_mutex.h and fspr_thread_mutex.h for more
* specialized lock routines.
* @param mutex the memory address where the newly created mutex will be
* stored.
@@ -71,10 +71,10 @@ typedef struct apr_global_mutex_t apr_global_mutex_t;
* @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports
* APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable.
*/
APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex,
APR_DECLARE(fspr_status_t) fspr_global_mutex_create(fspr_global_mutex_t **mutex,
const char *fname,
apr_lockmech_e mech,
apr_pool_t *pool);
fspr_lockmech_e mech,
fspr_pool_t *pool);
/**
* Re-open a mutex in a child process.
@@ -82,22 +82,22 @@ APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex,
* @param fname A file name to use if the mutex mechanism requires one. This
* argument should always be provided. The mutex code itself will
* determine if it should be used. This filename should be the
* same one that was passed to apr_global_mutex_create().
* same one that was passed to fspr_global_mutex_create().
* @param pool The pool to operate on.
* @remark This function must be called to maintain portability, even
* if the underlying lock mechanism does not require it.
*/
APR_DECLARE(apr_status_t) apr_global_mutex_child_init(
apr_global_mutex_t **mutex,
APR_DECLARE(fspr_status_t) fspr_global_mutex_child_init(
fspr_global_mutex_t **mutex,
const char *fname,
apr_pool_t *pool);
fspr_pool_t *pool);
/**
* Acquire the lock for the given mutex. If the mutex is already locked,
* the current thread will be put to sleep until the lock becomes available.
* @param mutex the mutex on which to acquire the lock.
*/
APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex);
APR_DECLARE(fspr_status_t) fspr_global_mutex_lock(fspr_global_mutex_t *mutex);
/**
* Attempt to acquire the lock for the given mutex. If the mutex has already
@@ -106,23 +106,23 @@ APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex);
* if the return value was APR_EBUSY, for portability reasons.
* @param mutex the mutex on which to attempt the lock acquiring.
*/
APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex);
APR_DECLARE(fspr_status_t) fspr_global_mutex_trylock(fspr_global_mutex_t *mutex);
/**
* Release the lock for the given mutex.
* @param mutex the mutex from which to release the lock.
*/
APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex);
APR_DECLARE(fspr_status_t) fspr_global_mutex_unlock(fspr_global_mutex_t *mutex);
/**
* Destroy the mutex and free the memory associated with the lock.
* @param mutex the mutex to destroy.
*/
APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex);
APR_DECLARE(fspr_status_t) fspr_global_mutex_destroy(fspr_global_mutex_t *mutex);
/**
* Get the pool used by this global_mutex.
* @return apr_pool_t the pool
* @return fspr_pool_t the pool
*/
APR_POOL_DECLARE_ACCESSOR(global_mutex);
@@ -130,17 +130,17 @@ APR_POOL_DECLARE_ACCESSOR(global_mutex);
/* Some platforms [e.g. Win32] have cross process locks that are truly
* global locks, since there isn't the concept of cross-process locks.
* Define these platforms in terms of an apr_proc_mutex_t.
* Define these platforms in terms of an fspr_proc_mutex_t.
*/
#define apr_global_mutex_t apr_proc_mutex_t
#define apr_global_mutex_create apr_proc_mutex_create
#define apr_global_mutex_child_init apr_proc_mutex_child_init
#define apr_global_mutex_lock apr_proc_mutex_lock
#define apr_global_mutex_trylock apr_proc_mutex_trylock
#define apr_global_mutex_unlock apr_proc_mutex_unlock
#define apr_global_mutex_destroy apr_proc_mutex_destroy
#define apr_global_mutex_pool_get apr_proc_mutex_pool_get
#define fspr_global_mutex_t fspr_proc_mutex_t
#define fspr_global_mutex_create fspr_proc_mutex_create
#define fspr_global_mutex_child_init fspr_proc_mutex_child_init
#define fspr_global_mutex_lock fspr_proc_mutex_lock
#define fspr_global_mutex_trylock fspr_proc_mutex_trylock
#define fspr_global_mutex_unlock fspr_proc_mutex_unlock
#define fspr_global_mutex_destroy fspr_proc_mutex_destroy
#define fspr_global_mutex_pool_get fspr_proc_mutex_pool_get
#endif
@@ -18,43 +18,43 @@
#define APR_HASH_H
/**
* @file apr_hash.h
* @file fspr_hash.h
* @brief APR Hash Tables
*/
#include "apr_pools.h"
#include "fspr_pools.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup apr_hash Hash Tables
* @defgroup fspr_hash Hash Tables
* @ingroup APR
* @{
*/
/**
* When passing a key to apr_hash_set or apr_hash_get, this value can be
* passed to indicate a string-valued key, and have apr_hash compute the
* When passing a key to fspr_hash_set or fspr_hash_get, this value can be
* passed to indicate a string-valued key, and have fspr_hash compute the
* length automatically.
*
* @remark apr_hash will use strlen(key) for the length. The NUL terminator
* @remark fspr_hash will use strlen(key) for the length. The NUL terminator
* is not included in the hash value (why throw a constant in?).
* Since the hash table merely references the provided key (rather
* than copying it), apr_hash_this() will return the NUL-term'd key.
* than copying it), fspr_hash_this() will return the NUL-term'd key.
*/
#define APR_HASH_KEY_STRING (-1)
/**
* Abstract type for hash tables.
*/
typedef struct apr_hash_t apr_hash_t;
typedef struct fspr_hash_t fspr_hash_t;
/**
* Abstract type for scanning hash tables.
*/
typedef struct apr_hash_index_t apr_hash_index_t;
typedef struct fspr_hash_index_t fspr_hash_index_t;
/**
* Callback functions for calculating hash values.
@@ -62,20 +62,20 @@ typedef struct apr_hash_index_t apr_hash_index_t;
* @param klen The length of the key, or APR_HASH_KEY_STRING to use the string
* length. If APR_HASH_KEY_STRING then returns the actual key length.
*/
typedef unsigned int (*apr_hashfunc_t)(const char *key, apr_ssize_t *klen);
typedef unsigned int (*fspr_hashfunc_t)(const char *key, fspr_ssize_t *klen);
/**
* The default hash function.
*/
APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *key,
apr_ssize_t *klen);
APR_DECLARE_NONSTD(unsigned int) fspr_hashfunc_default(const char *key,
fspr_ssize_t *klen);
/**
* Create a hash table.
* @param pool The pool to allocate the hash table out of
* @return The hash table just created
*/
APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool);
APR_DECLARE(fspr_hash_t *) fspr_hash_make(fspr_pool_t *pool);
/**
* Create a hash table with a custom hash function
@@ -83,8 +83,8 @@ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool);
* @param hash_func A custom hash function.
* @return The hash table just created
*/
APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool,
apr_hashfunc_t hash_func);
APR_DECLARE(fspr_hash_t *) fspr_hash_make_custom(fspr_pool_t *pool,
fspr_hashfunc_t hash_func);
/**
* Make a copy of a hash table
@@ -93,8 +93,8 @@ APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool,
* @return The hash table just created
* @remark Makes a shallow copy
*/
APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool,
const apr_hash_t *h);
APR_DECLARE(fspr_hash_t *) fspr_hash_copy(fspr_pool_t *pool,
const fspr_hash_t *h);
/**
* Associate a value with a key in a hash table.
@@ -104,8 +104,8 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool,
* @param val Value to associate with the key
* @remark If the value is NULL the hash entry is deleted.
*/
APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key,
apr_ssize_t klen, const void *val);
APR_DECLARE(void) fspr_hash_set(fspr_hash_t *ht, const void *key,
fspr_ssize_t klen, const void *val);
/**
* Look up the value associated with a key in a hash table.
@@ -114,12 +114,12 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key,
* @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string length.
* @return Returns NULL if the key is not present.
*/
APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key,
apr_ssize_t klen);
APR_DECLARE(void *) fspr_hash_get(fspr_hash_t *ht, const void *key,
fspr_ssize_t klen);
/**
* Start iterating over the entries in a hash table.
* @param p The pool to allocate the apr_hash_index_t iterator. If this
* @param p The pool to allocate the fspr_hash_index_t iterator. If this
* pool is NULL, then an internal, non-thread-safe iterator is used.
* @param ht The hash table
* @remark There is no restriction on adding or deleting hash entries during
@@ -132,20 +132,20 @@ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key,
/**
* <PRE>
*
* int sum_values(apr_pool_t *p, apr_hash_t *ht)
* int sum_values(fspr_pool_t *p, fspr_hash_t *ht)
* {
* apr_hash_index_t *hi;
* fspr_hash_index_t *hi;
* void *val;
* int sum = 0;
* for (hi = apr_hash_first(p, ht); hi; hi = apr_hash_next(hi)) {
* apr_hash_this(hi, NULL, NULL, &val);
* for (hi = fspr_hash_first(p, ht); hi; hi = fspr_hash_next(hi)) {
* fspr_hash_this(hi, NULL, NULL, &val);
* sum += *(int *)val;
* }
* return sum;
* }
* </PRE>
*/
APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht);
APR_DECLARE(fspr_hash_index_t *) fspr_hash_first(fspr_pool_t *p, fspr_hash_t *ht);
/**
* Continue iterating over the entries in a hash table.
@@ -153,7 +153,7 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht);
* @return a pointer to the updated iteration state. NULL if there are no more
* entries.
*/
APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi);
APR_DECLARE(fspr_hash_index_t *) fspr_hash_next(fspr_hash_index_t *hi);
/**
* Get the current entry's details from the iteration state.
@@ -164,21 +164,21 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi);
* @remark The return pointers should point to a variable that will be set to the
* corresponding data, or they may be NULL if the data isn't interesting.
*/
APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key,
apr_ssize_t *klen, void **val);
APR_DECLARE(void) fspr_hash_this(fspr_hash_index_t *hi, const void **key,
fspr_ssize_t *klen, void **val);
/**
* Get the number of key/value pairs in the hash table.
* @param ht The hash table
* @return The number of key/value pairs in the hash table.
*/
APR_DECLARE(unsigned int) apr_hash_count(apr_hash_t *ht);
APR_DECLARE(unsigned int) fspr_hash_count(fspr_hash_t *ht);
/**
* Clear any key/value pairs in the hash table.
* @param ht The hash table
*/
APR_DECLARE(void) apr_hash_clear(apr_hash_t *ht);
APR_DECLARE(void) fspr_hash_clear(fspr_hash_t *ht);
/**
* Merge two hash tables into one new hash table. The values of the overlay
@@ -189,9 +189,9 @@ APR_DECLARE(void) apr_hash_clear(apr_hash_t *ht);
* @param base The table that represents the initial values of the new table
* @return A new hash table containing all of the data from the two passed in
*/
APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p,
const apr_hash_t *overlay,
const apr_hash_t *base);
APR_DECLARE(fspr_hash_t *) fspr_hash_overlay(fspr_pool_t *p,
const fspr_hash_t *overlay,
const fspr_hash_t *base);
/**
* Merge two hash tables into one new hash table. If the same key
@@ -203,16 +203,16 @@ APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p,
* @param h2 The second of the tables to merge
* @param merger A callback function to merge values, or NULL to
* make values from h1 override values from h2 (same semantics as
* apr_hash_overlay())
* fspr_hash_overlay())
* @param data Client data to pass to the merger function
* @return A new hash table containing all of the data from the two passed in
*/
APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p,
const apr_hash_t *h1,
const apr_hash_t *h2,
void * (*merger)(apr_pool_t *p,
APR_DECLARE(fspr_hash_t *) fspr_hash_merge(fspr_pool_t *p,
const fspr_hash_t *h1,
const fspr_hash_t *h2,
void * (*merger)(fspr_pool_t *p,
const void *key,
apr_ssize_t klen,
fspr_ssize_t klen,
const void *h1_val,
const void *h2_val,
const void *data),
@@ -18,34 +18,34 @@
#define APR_INHERIT_H
/**
* @file apr_inherit.h
* @file fspr_inherit.h
* @brief APR File Handle Inheritance Helpers
* @remark This internal header includes internal declaration helpers
* for other headers to declare apr_foo_inherit_[un]set functions.
* for other headers to declare fspr_foo_inherit_[un]set functions.
*/
/**
* Prototype for type-specific declarations of apr_foo_inherit_set
* Prototype for type-specific declarations of fspr_foo_inherit_set
* functions.
* @remark Doxygen unwraps this macro (via doxygen.conf) to provide
* actual help for each specific occurance of apr_foo_inherit_set.
* actual help for each specific occurance of fspr_foo_inherit_set.
* @remark the linkage is specified for APR. It would be possible to expand
* the macros to support other linkages.
*/
#define APR_DECLARE_INHERIT_SET(type) \
APR_DECLARE(apr_status_t) apr_##type##_inherit_set( \
apr_##type##_t *the##type)
APR_DECLARE(fspr_status_t) fspr_##type##_inherit_set( \
fspr_##type##_t *the##type)
/**
* Prototype for type-specific declarations of apr_foo_inherit_unset
* Prototype for type-specific declarations of fspr_foo_inherit_unset
* functions.
* @remark Doxygen unwraps this macro (via doxygen.conf) to provide
* actual help for each specific occurance of apr_foo_inherit_unset.
* actual help for each specific occurance of fspr_foo_inherit_unset.
* @remark the linkage is specified for APR. It would be possible to expand
* the macros to support other linkages.
*/
#define APR_DECLARE_INHERIT_UNSET(type) \
APR_DECLARE(apr_status_t) apr_##type##_inherit_unset( \
apr_##type##_t *the##type)
APR_DECLARE(fspr_status_t) fspr_##type##_inherit_unset( \
fspr_##type##_t *the##type)
#endif /* ! APR_INHERIT_H */
@@ -18,15 +18,15 @@
#define APR_LIB_H
/**
* @file apr_lib.h
* @file fspr_lib.h
* This is collection of oddballs that didn't fit anywhere else,
* and might move to more appropriate headers with the release
* of APR 1.0.
* @brief APR general purpose library routines
*/
#include "apr.h"
#include "apr_errno.h"
#include "fspr.h"
#include "fspr_errno.h"
#if APR_HAVE_CTYPE_H
#include <ctype.h>
@@ -40,7 +40,7 @@ extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_lib General Purpose Library Routines
* @defgroup fspr_lib General Purpose Library Routines
* @ingroup APR
* This is collection of oddballs that didn't fit anywhere else,
* and might move to more appropriate headers with the release
@@ -55,13 +55,13 @@ extern "C" {
* Define the structures used by the APR general-purpose library.
*/
/** @see apr_vformatter_buff_t */
typedef struct apr_vformatter_buff_t apr_vformatter_buff_t;
/** @see fspr_vformatter_buff_t */
typedef struct fspr_vformatter_buff_t fspr_vformatter_buff_t;
/**
* Structure used by the variable-formatter routines.
*/
struct apr_vformatter_buff_t {
struct fspr_vformatter_buff_t {
/** The current position */
char *curpos;
/** The end position of the format string */
@@ -81,26 +81,26 @@ struct apr_vformatter_buff_t {
* "bs\\path\\stuff" -> "stuff"
* </PRE>
*/
APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname);
APR_DECLARE(const char *) fspr_filepath_name_get(const char *pathname);
/**
* apr_killpg
* fspr_killpg
* Small utility macros to make things easier to read. Not usually a
* goal, to be sure..
*/
#ifdef WIN32
#define apr_killpg(x, y)
#define fspr_killpg(x, y)
#else /* WIN32 */
#ifdef NO_KILLPG
#define apr_killpg(x, y) (kill (-(x), (y)))
#define fspr_killpg(x, y) (kill (-(x), (y)))
#else /* NO_KILLPG */
#define apr_killpg(x, y) (killpg ((x), (y)))
#define fspr_killpg(x, y) (killpg ((x), (y)))
#endif /* NO_KILLPG */
#endif /* WIN32 */
/**
* apr_vformatter() is a generic printf-style formatting routine
* fspr_vformatter() is a generic printf-style formatting routine
* with some extensions.
* @param flush_func The function to call when the buffer is full
* @param c The buffer to write to
@@ -112,11 +112,11 @@ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname);
* The extensions are:
*
* %%pA takes a struct in_addr *, and prints it as a.b.c.d
* %%pI takes an apr_sockaddr_t * and prints it as a.b.c.d:port or
* %%pI takes an fspr_sockaddr_t * and prints it as a.b.c.d:port or
* [ipv6-address]:port
* %%pT takes an apr_os_thread_t * and prints it in decimal
* %%pT takes an fspr_os_thread_t * and prints it in decimal
* ('0' is printed if !APR_HAS_THREADS)
* %%pt takes an apr_os_thread_t * and prints it in hexadecimal
* %%pt takes an fspr_os_thread_t * and prints it in hexadecimal
* ('0' is printed if !APR_HAS_THREADS)
* %%pp takes a void * and outputs it in hex
*
@@ -126,44 +126,44 @@ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname);
* work as expected at all, but that seems to be a fair trade-off
* for the increased robustness of having printf-warnings work.
*
* Additionally, apr_vformatter allows for arbitrary output methods
* using the apr_vformatter_buff and flush_func.
* Additionally, fspr_vformatter allows for arbitrary output methods
* using the fspr_vformatter_buff and flush_func.
*
* The apr_vformatter_buff has two elements curpos and endpos.
* curpos is where apr_vformatter will write the next byte of output.
* The fspr_vformatter_buff has two elements curpos and endpos.
* curpos is where fspr_vformatter will write the next byte of output.
* It proceeds writing output to curpos, and updating curpos, until
* either the end of output is reached, or curpos == endpos (i.e. the
* buffer is full).
*
* If the end of output is reached, apr_vformatter returns the
* If the end of output is reached, fspr_vformatter returns the
* number of bytes written.
*
* When the buffer is full, the flush_func is called. The flush_func
* can return -1 to indicate that no further output should be attempted,
* and apr_vformatter will return immediately with -1. Otherwise
* and fspr_vformatter will return immediately with -1. Otherwise
* the flush_func should flush the buffer in whatever manner is
* appropriate, re apr_pool_t nitialize curpos and endpos, and return 0.
* appropriate, re fspr_pool_t nitialize curpos and endpos, and return 0.
*
* Note that flush_func is only invoked as a result of attempting to
* write another byte at curpos when curpos >= endpos. So for
* example, it's possible when the output exactly matches the buffer
* space available that curpos == endpos will be true when
* apr_vformatter returns.
* fspr_vformatter returns.
*
* apr_vformatter does not call out to any other code, it is entirely
* fspr_vformatter does not call out to any other code, it is entirely
* self-contained. This allows the callers to do things which are
* otherwise "unsafe". For example, apr_psprintf uses the "scratch"
* otherwise "unsafe". For example, fspr_psprintf uses the "scratch"
* space at the unallocated end of a block, and doesn't actually
* complete the allocation until apr_vformatter returns. apr_psprintf
* would be completely broken if apr_vformatter were to call anything
* complete the allocation until fspr_vformatter returns. fspr_psprintf
* would be completely broken if fspr_vformatter were to call anything
* that used this same pool. Similarly http_bprintf() uses the "scratch"
* space at the end of its output buffer, and doesn't actually note
* that the space is in use until it either has to flush the buffer
* or until apr_vformatter returns.
* or until fspr_vformatter returns.
* </PRE>
*/
APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b),
apr_vformatter_buff_t *c, const char *fmt,
APR_DECLARE(int) fspr_vformatter(int (*flush_func)(fspr_vformatter_buff_t *b),
fspr_vformatter_buff_t *c, const char *fmt,
va_list ap);
/**
@@ -174,16 +174,16 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b),
* @remark If the password entered must be truncated to fit in
* the provided buffer, APR_ENAMETOOLONG will be returned.
* Note that the bufsize paramater is passed by reference for no
* reason; its value will never be modified by the apr_password_get()
* reason; its value will never be modified by the fspr_password_get()
* function.
*/
APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf,
apr_size_t *bufsize);
APR_DECLARE(fspr_status_t) fspr_password_get(const char *prompt, char *pwbuf,
fspr_size_t *bufsize);
/** @} */
/**
* @defgroup apr_ctype ctype functions
* @defgroup fspr_ctype ctype functions
* These macros allow correct support of 8-bit characters on systems which
* support 8-bit characters. Pretty dumb how the cast is required, but
* that's legacy libc for ya. These new macros do not support EOF like
@@ -191,37 +191,37 @@ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf,
* @{
*/
/** @see isalnum */
#define apr_isalnum(c) (isalnum(((unsigned char)(c))))
#define fspr_isalnum(c) (isalnum(((unsigned char)(c))))
/** @see isalpha */
#define apr_isalpha(c) (isalpha(((unsigned char)(c))))
#define fspr_isalpha(c) (isalpha(((unsigned char)(c))))
/** @see iscntrl */
#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
#define fspr_iscntrl(c) (iscntrl(((unsigned char)(c))))
/** @see isdigit */
#define apr_isdigit(c) (isdigit(((unsigned char)(c))))
#define fspr_isdigit(c) (isdigit(((unsigned char)(c))))
/** @see isgraph */
#define apr_isgraph(c) (isgraph(((unsigned char)(c))))
#define fspr_isgraph(c) (isgraph(((unsigned char)(c))))
/** @see islower*/
#define apr_islower(c) (islower(((unsigned char)(c))))
#define fspr_islower(c) (islower(((unsigned char)(c))))
/** @see isascii */
#ifdef isascii
#define apr_isascii(c) (isascii(((unsigned char)(c))))
#define fspr_isascii(c) (isascii(((unsigned char)(c))))
#else
#define apr_isascii(c) (((c) & ~0x7f)==0)
#define fspr_isascii(c) (((c) & ~0x7f)==0)
#endif
/** @see isprint */
#define apr_isprint(c) (isprint(((unsigned char)(c))))
#define fspr_isprint(c) (isprint(((unsigned char)(c))))
/** @see ispunct */
#define apr_ispunct(c) (ispunct(((unsigned char)(c))))
#define fspr_ispunct(c) (ispunct(((unsigned char)(c))))
/** @see isspace */
#define apr_isspace(c) (isspace(((unsigned char)(c))))
#define fspr_isspace(c) (isspace(((unsigned char)(c))))
/** @see isupper */
#define apr_isupper(c) (isupper(((unsigned char)(c))))
#define fspr_isupper(c) (isupper(((unsigned char)(c))))
/** @see isxdigit */
#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
#define fspr_isxdigit(c) (isxdigit(((unsigned char)(c))))
/** @see tolower */
#define apr_tolower(c) (tolower(((unsigned char)(c))))
#define fspr_tolower(c) (tolower(((unsigned char)(c))))
/** @see toupper */
#define apr_toupper(c) (toupper(((unsigned char)(c))))
#define fspr_toupper(c) (toupper(((unsigned char)(c))))
/** @} */
@@ -18,15 +18,15 @@
#define APR_MMAP_H
/**
* @file apr_mmap.h
* @file fspr_mmap.h
* @brief APR MMAP routines
*/
#include "apr.h"
#include "apr_pools.h"
#include "apr_errno.h"
#include "apr_ring.h"
#include "apr_file_io.h" /* for apr_file_t */
#include "fspr.h"
#include "fspr_pools.h"
#include "fspr_errno.h"
#include "fspr_ring.h"
#include "fspr_file_io.h" /* for fspr_file_t */
#ifdef BEOS
#include <kernel/OS.h>
@@ -37,7 +37,7 @@ extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_mmap MMAP (Memory Map) Routines
* @defgroup fspr_mmap MMAP (Memory Map) Routines
* @ingroup APR
* @{
*/
@@ -47,8 +47,8 @@ extern "C" {
/** MMap opened for writing */
#define APR_MMAP_WRITE 2
/** @see apr_mmap_t */
typedef struct apr_mmap_t apr_mmap_t;
/** @see fspr_mmap_t */
typedef struct fspr_mmap_t fspr_mmap_t;
/**
* @remark
@@ -59,9 +59,9 @@ typedef struct apr_mmap_t apr_mmap_t;
* Apache.
*/
/** The MMAP structure */
struct apr_mmap_t {
struct fspr_mmap_t {
/** The pool the mmap structure was allocated out of. */
apr_pool_t *cntxt;
fspr_pool_t *cntxt;
#ifdef BEOS
/** An area ID. Only valid on BeOS */
area_id area;
@@ -72,17 +72,17 @@ struct apr_mmap_t {
/** The start of the real memory page area (mapped view) */
void *mv;
/** The physical start, size and offset */
apr_off_t pstart;
apr_size_t psize;
apr_off_t poffset;
fspr_off_t pstart;
fspr_size_t psize;
fspr_off_t poffset;
#endif
/** The start of the memory mapped area */
void *mm;
/** The amount of data in the mmap */
apr_size_t size;
/** ring of apr_mmap_t's that reference the same
fspr_size_t size;
/** ring of fspr_mmap_t's that reference the same
* mmap'ed region; acts in place of a reference count */
APR_RING_ENTRY(apr_mmap_t) link;
APR_RING_ENTRY(fspr_mmap_t) link;
};
#if APR_HAS_MMAP || defined(DOXYGEN)
@@ -130,10 +130,10 @@ struct apr_mmap_t {
* </PRE>
* @param cntxt The pool to use when creating the mmap.
*/
APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap,
apr_file_t *file, apr_off_t offset,
apr_size_t size, apr_int32_t flag,
apr_pool_t *cntxt);
APR_DECLARE(fspr_status_t) fspr_mmap_create(fspr_mmap_t **newmmap,
fspr_file_t *file, fspr_off_t offset,
fspr_size_t size, fspr_int32_t flag,
fspr_pool_t *cntxt);
/**
* Duplicate the specified MMAP.
@@ -141,15 +141,15 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap,
* @param old_mmap The mmap to duplicate.
* @param p The pool to use for new_mmap.
*/
APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap,
apr_mmap_t *old_mmap,
apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_mmap_dup(fspr_mmap_t **new_mmap,
fspr_mmap_t *old_mmap,
fspr_pool_t *p);
/**
* Remove a mmap'ed.
* @param mm The mmap'ed file.
*/
APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm);
APR_DECLARE(fspr_status_t) fspr_mmap_delete(fspr_mmap_t *mm);
/**
* Move the pointer into the mmap'ed file to the specified offset.
@@ -157,8 +157,8 @@ APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm);
* @param mm The mmap'ed file.
* @param offset The offset to move to.
*/
APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mm,
apr_off_t offset);
APR_DECLARE(fspr_status_t) fspr_mmap_offset(void **addr, fspr_mmap_t *mm,
fspr_off_t offset);
#endif /* APR_HAS_MMAP */
@@ -17,15 +17,15 @@
#ifndef APR_NETWORK_IO_H
#define APR_NETWORK_IO_H
/**
* @file apr_network_io.h
* @file fspr_network_io.h
* @brief APR Network library
*/
#include "apr.h"
#include "apr_pools.h"
#include "apr_file_io.h"
#include "apr_errno.h"
#include "apr_inherit.h"
#include "fspr.h"
#include "fspr_pools.h"
#include "fspr_file_io.h"
#include "fspr_errno.h"
#include "fspr_inherit.h"
#if APR_HAVE_NETINET_IN_H
#include <netinet/in.h>
@@ -36,7 +36,7 @@ extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_network_io Network Routines
* @defgroup fspr_network_io Network Routines
* @ingroup APR
* @{
*/
@@ -57,7 +57,7 @@ extern "C" {
#endif
/**
* @defgroup apr_sockopt Socket option definitions
* @defgroup fspr_sockopt Socket option definitions
* @{
*/
#define APR_SO_LINGER 1 /**< Linger */
@@ -81,7 +81,7 @@ extern "C" {
#define APR_INCOMPLETE_READ 4096 /**< Set on non-blocking sockets
* (timeout != 0) on which the
* previous read() did not fill a buffer
* completely. the next apr_socket_recv()
* completely. the next fspr_socket_recv()
* will first call select()/poll() rather than
* going straight into read(). (Can also
* be set by an application to force a
@@ -97,7 +97,7 @@ extern "C" {
*/
#define APR_TCP_DEFER_ACCEPT 32768 /**< Delay accepting of new connections
* until data is available.
* @see apr_socket_accept_filter
* @see fspr_socket_accept_filter
*/
/** @} */
@@ -107,10 +107,10 @@ typedef enum {
APR_SHUTDOWN_READ, /**< no longer allow read request */
APR_SHUTDOWN_WRITE, /**< no longer allow write requests */
APR_SHUTDOWN_READWRITE /**< no longer allow read or write requests */
} apr_shutdown_how_e;
} fspr_shutdown_how_e;
#define APR_IPV4_ADDR_OK 0x01 /**< @see apr_sockaddr_info_get() */
#define APR_IPV6_ADDR_OK 0x02 /**< @see apr_sockaddr_info_get() */
#define APR_IPV4_ADDR_OK 0x01 /**< @see fspr_sockaddr_info_get() */
#define APR_IPV6_ADDR_OK 0x02 /**< @see fspr_sockaddr_info_get() */
#if (!APR_HAVE_IN_ADDR)
/**
@@ -118,7 +118,7 @@ typedef enum {
* define it ourselves, if the platform doesn't provide it.
*/
struct in_addr {
apr_uint32_t s_addr; /**< storage to hold the IP# */
fspr_uint32_t s_addr; /**< storage to hold the IP# */
};
#endif
@@ -169,7 +169,7 @@ struct in_addr {
typedef enum {
APR_LOCAL,
APR_REMOTE
} apr_interface_e;
} fspr_interface_e;
/**
* The specific declaration of inet_addr's ... some platforms fall back
@@ -177,49 +177,49 @@ typedef enum {
*/
#if APR_HAVE_INET_ADDR
#define apr_inet_addr inet_addr
#define fspr_inet_addr inet_addr
#elif APR_HAVE_INET_NETWORK /* only DGUX, as far as I know */
/**
* @warning
* not generally safe... inet_network() and inet_addr() perform
* different functions */
#define apr_inet_addr inet_network
#define fspr_inet_addr inet_network
#endif
/** A structure to represent sockets */
typedef struct apr_socket_t apr_socket_t;
typedef struct fspr_socket_t fspr_socket_t;
/**
* A structure to encapsulate headers and trailers for apr_socket_sendfile
* A structure to encapsulate headers and trailers for fspr_socket_sendfile
*/
typedef struct apr_hdtr_t apr_hdtr_t;
typedef struct fspr_hdtr_t fspr_hdtr_t;
/** A structure to represent in_addr */
typedef struct in_addr apr_in_addr_t;
typedef struct in_addr fspr_in_addr_t;
/** A structure to represent an IP subnet */
typedef struct apr_ipsubnet_t apr_ipsubnet_t;
typedef struct fspr_ipsubnet_t fspr_ipsubnet_t;
/** @remark use apr_uint16_t just in case some system has a short that isn't 16 bits... */
typedef apr_uint16_t apr_port_t;
/** @remark use fspr_uint16_t just in case some system has a short that isn't 16 bits... */
typedef fspr_uint16_t fspr_port_t;
/** @remark It's defined here as I think it should all be platform safe...
* @see apr_sockaddr_t
* @see fspr_sockaddr_t
*/
typedef struct apr_sockaddr_t apr_sockaddr_t;
typedef struct fspr_sockaddr_t fspr_sockaddr_t;
/**
* APRs socket address type, used to ensure protocol independence
*/
struct apr_sockaddr_t {
struct fspr_sockaddr_t {
/** The pool to use... */
apr_pool_t *pool;
fspr_pool_t *pool;
/** The hostname */
char *hostname;
/** Either a string of the port number or the service name for the port */
char *servname;
/** The numeric port */
apr_port_t port;
fspr_port_t port;
/** The family */
apr_int32_t family;
fspr_int32_t family;
/** How big is the sockaddr we're using? */
apr_socklen_t salen;
fspr_socklen_t salen;
/** How big is the ip address structure we're using? */
int ipaddr_len;
/** How big should the address buffer be? 16 for v4 or 46 for v6
@@ -228,9 +228,9 @@ struct apr_sockaddr_t {
/** This points to the IP address structure within the appropriate
* sockaddr structure. */
void *ipaddr_ptr;
/** If multiple addresses were found by apr_sockaddr_info_get(), this
/** If multiple addresses were found by fspr_sockaddr_info_get(), this
* points to a representation of the next address. */
apr_sockaddr_t *next;
fspr_sockaddr_t *next;
/** Union of either IPv4 or IPv6 sockaddr. */
union {
/** IPv4 sockaddr structure */
@@ -251,13 +251,13 @@ struct apr_sockaddr_t {
/**
* Support reusing the socket on platforms which support it (from disconnect,
* specifically Win32.
* @remark Optional flag passed into apr_socket_sendfile()
* @remark Optional flag passed into fspr_socket_sendfile()
*/
#define APR_SENDFILE_DISCONNECT_SOCKET 1
#endif
/** A structure to encapsulate headers and trailers for apr_socket_sendfile */
struct apr_hdtr_t {
/** A structure to encapsulate headers and trailers for fspr_socket_sendfile */
struct fspr_hdtr_t {
/** An iovec to store the headers sent before the file. */
struct iovec* headers;
/** number of headers in the iovec */
@@ -278,10 +278,10 @@ struct apr_hdtr_t {
* @param protocol The protocol of the socket (e.g., APR_PROTO_TCP).
* @param cont The pool to use
*/
APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock,
APR_DECLARE(fspr_status_t) fspr_socket_create(fspr_socket_t **new_sock,
int family, int type,
int protocol,
apr_pool_t *cont);
fspr_pool_t *cont);
/**
* Shutdown either reading, writing, or both sides of a socket.
@@ -292,18 +292,18 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock,
* APR_SHUTDOWN_WRITE no longer allow write requests
* APR_SHUTDOWN_READWRITE no longer allow read or write requests
* </PRE>
* @see apr_shutdown_how_e
* @see fspr_shutdown_how_e
* @remark This does not actually close the socket descriptor, it just
* controls which calls are still valid on the socket.
*/
APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket,
apr_shutdown_how_e how);
APR_DECLARE(fspr_status_t) fspr_socket_shutdown(fspr_socket_t *thesocket,
fspr_shutdown_how_e how);
/**
* Close a socket.
* @param thesocket The socket to close
*/
APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket);
APR_DECLARE(fspr_status_t) fspr_socket_close(fspr_socket_t *thesocket);
/**
* Bind the socket to its associated port
@@ -312,8 +312,8 @@ APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket);
* @remark This may be where we will find out if there is any other process
* using the selected port.
*/
APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock,
apr_sockaddr_t *sa);
APR_DECLARE(fspr_status_t) fspr_socket_bind(fspr_socket_t *sock,
fspr_sockaddr_t *sa);
/**
* Listen to a bound socket for connections.
@@ -322,8 +322,8 @@ APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock,
* listen queue. If this value is less than zero, the listen
* queue size is set to zero.
*/
APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock,
apr_int32_t backlog);
APR_DECLARE(fspr_status_t) fspr_socket_listen(fspr_socket_t *sock,
fspr_int32_t backlog);
/**
* Accept a new connection request
@@ -333,9 +333,9 @@ APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock,
* @param sock The socket we are listening on.
* @param connection_pool The pool for the new socket.
*/
APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new_sock,
apr_socket_t *sock,
apr_pool_t *connection_pool);
APR_DECLARE(fspr_status_t) fspr_socket_accept(fspr_socket_t **new_sock,
fspr_socket_t *sock,
fspr_pool_t *connection_pool);
/**
* Issue a connection request to a socket either on the same machine
@@ -343,12 +343,12 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new_sock,
* @param sock The socket we wish to use for our side of the connection
* @param sa The address of the machine we wish to connect to.
*/
APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock,
apr_sockaddr_t *sa);
APR_DECLARE(fspr_status_t) fspr_socket_connect(fspr_socket_t *sock,
fspr_sockaddr_t *sa);
/**
* Create apr_sockaddr_t from hostname, address family, and port.
* @param sa The new apr_sockaddr_t.
* Create fspr_sockaddr_t from hostname, address family, and port.
* @param sa The new fspr_sockaddr_t.
* @param hostname The hostname or numeric address string to resolve/parse, or
* NULL to build an address that corresponds to 0.0.0.0 or ::
* @param family The address family to use, or APR_UNSPEC if the system should
@@ -367,24 +367,24 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock,
* isn't NULL and APR_HAVE_IPV6; mutually exclusive
* with APR_IPV4_ADDR_OK
* </PRE>
* @param p The pool for the apr_sockaddr_t and associated storage.
* @param p The pool for the fspr_sockaddr_t and associated storage.
*/
APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa,
APR_DECLARE(fspr_status_t) fspr_sockaddr_info_get(fspr_sockaddr_t **sa,
const char *hostname,
apr_int32_t family,
apr_port_t port,
apr_int32_t flags,
apr_pool_t *p);
fspr_int32_t family,
fspr_port_t port,
fspr_int32_t flags,
fspr_pool_t *p);
/**
* Look up the host name from an apr_sockaddr_t.
* Look up the host name from an fspr_sockaddr_t.
* @param hostname The hostname.
* @param sa The apr_sockaddr_t.
* @param sa The fspr_sockaddr_t.
* @param flags Special processing flags.
*/
APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname,
apr_sockaddr_t *sa,
apr_int32_t flags);
APR_DECLARE(fspr_status_t) fspr_getnameinfo(char **hostname,
fspr_sockaddr_t *sa,
fspr_int32_t flags);
/**
* Parse hostname/IP address with scope id and port.
@@ -416,11 +416,11 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname,
* required, check for addr == NULL in addition to checking the
* return code.
*/
APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr,
APR_DECLARE(fspr_status_t) fspr_parse_addr_port(char **addr,
char **scope_id,
apr_port_t *port,
fspr_port_t *port,
const char *str,
apr_pool_t *p);
fspr_pool_t *p);
/**
* Get name of the current machine
@@ -430,7 +430,7 @@ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr,
* @param cont The pool to use.
* @remark If the buffer was not large enough, an error will be returned.
*/
APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_gethostname(char *buf, int len, fspr_pool_t *cont);
/**
* Return the data associated with the current socket
@@ -438,8 +438,8 @@ APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont);
* @param key The key to associate with the user data.
* @param sock The currently open socket.
*/
APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key,
apr_socket_t *sock);
APR_DECLARE(fspr_status_t) fspr_socket_data_get(void **data, const char *key,
fspr_socket_t *sock);
/**
* Set the data associated with the current socket.
@@ -448,9 +448,9 @@ APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key,
* @param key The key to associate with the data.
* @param cleanup The cleanup to call when the socket is destroyed.
*/
APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data,
APR_DECLARE(fspr_status_t) fspr_socket_data_set(fspr_socket_t *sock, void *data,
const char *key,
apr_status_t (*cleanup)(void*));
fspr_status_t (*cleanup)(void*));
/**
* Send data over a network.
@@ -461,7 +461,7 @@ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data,
* @remark
* <PRE>
* This functions acts like a blocking write by default. To change
* this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
* this behavior, use fspr_socket_timeout_set() or the APR_SO_NONBLOCK
* socket option.
*
* It is possible for both bytes to be sent and an error to be returned.
@@ -469,8 +469,8 @@ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data,
* APR_EINTR is never returned.
* </PRE>
*/
APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf,
apr_size_t *len);
APR_DECLARE(fspr_status_t) fspr_socket_send(fspr_socket_t *sock, const char *buf,
fspr_size_t *len);
/**
* Send multiple packets of data over a network.
@@ -481,7 +481,7 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf,
* @remark
* <PRE>
* This functions acts like a blocking write by default. To change
* this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
* this behavior, use fspr_socket_timeout_set() or the APR_SO_NONBLOCK
* socket option.
* The number of bytes actually sent is stored in argument 3.
*
@@ -490,34 +490,34 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf,
* APR_EINTR is never returned.
* </PRE>
*/
APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock,
APR_DECLARE(fspr_status_t) fspr_socket_sendv(fspr_socket_t *sock,
const struct iovec *vec,
apr_int32_t nvec, apr_size_t *len);
fspr_int32_t nvec, fspr_size_t *len);
/**
* @param sock The socket to send from
* @param where The apr_sockaddr_t describing where to send the data
* @param where The fspr_sockaddr_t describing where to send the data
* @param flags The flags to use
* @param buf The data to send
* @param len The length of the data to send
*/
APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock,
apr_sockaddr_t *where,
apr_int32_t flags, const char *buf,
apr_size_t *len);
APR_DECLARE(fspr_status_t) fspr_socket_sendto(fspr_socket_t *sock,
fspr_sockaddr_t *where,
fspr_int32_t flags, const char *buf,
fspr_size_t *len);
/**
* @param from The apr_sockaddr_t to fill in the recipient info
* @param from The fspr_sockaddr_t to fill in the recipient info
* @param sock The socket to use
* @param flags The flags to use
* @param buf The buffer to use
* @param len The length of the available buffer
*/
APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from,
apr_socket_t *sock,
apr_int32_t flags, char *buf,
apr_size_t *len);
APR_DECLARE(fspr_status_t) fspr_socket_recvfrom(fspr_sockaddr_t *from,
fspr_socket_t *sock,
fspr_int32_t flags, char *buf,
fspr_size_t *len);
#if APR_HAS_SENDFILE || defined(DOXYGEN)
@@ -533,18 +533,18 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from,
* including headers, file, and trailers
* @param flags APR flags that are mapped to OS specific flags
* @remark This functions acts like a blocking write by default. To change
* this behavior, use apr_socket_timeout_set() or the
* this behavior, use fspr_socket_timeout_set() or the
* APR_SO_NONBLOCK socket option.
* The number of bytes actually sent is stored in the len parameter.
* The offset parameter is passed by reference for no reason; its
* value will never be modified by the apr_socket_sendfile() function.
* value will never be modified by the fspr_socket_sendfile() function.
*/
APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock,
apr_file_t *file,
apr_hdtr_t *hdtr,
apr_off_t *offset,
apr_size_t *len,
apr_int32_t flags);
APR_DECLARE(fspr_status_t) fspr_socket_sendfile(fspr_socket_t *sock,
fspr_file_t *file,
fspr_hdtr_t *hdtr,
fspr_off_t *offset,
fspr_size_t *len,
fspr_int32_t flags);
#endif /* APR_HAS_SENDFILE */
@@ -557,7 +557,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock,
* @remark
* <PRE>
* This functions acts like a blocking read by default. To change
* this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
* this behavior, use fspr_socket_timeout_set() or the APR_SO_NONBLOCK
* socket option.
* The number of bytes actually received is stored in argument 3.
*
@@ -567,8 +567,8 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock,
* APR_EINTR is never returned.
* </PRE>
*/
APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock,
char *buf, apr_size_t *len);
APR_DECLARE(fspr_status_t) fspr_socket_recv(fspr_socket_t *sock,
char *buf, fspr_size_t *len);
/**
* Setup socket options for the specified socket
@@ -592,8 +592,8 @@ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock,
* </PRE>
* @param on Value for the option.
*/
APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock,
apr_int32_t opt, apr_int32_t on);
APR_DECLARE(fspr_status_t) fspr_socket_opt_set(fspr_socket_t *sock,
fspr_int32_t opt, fspr_int32_t on);
/**
* Setup socket timeout for the specified socket
@@ -606,8 +606,8 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock,
* t < 0 -- read and write calls block
* </PRE>
*/
APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock,
apr_interval_time_t t);
APR_DECLARE(fspr_status_t) fspr_socket_timeout_set(fspr_socket_t *sock,
fspr_interval_time_t t);
/**
* Query socket options for the specified socket
@@ -628,14 +628,14 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock,
* </PRE>
* @param on Socket option returned on the call.
*/
APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock,
apr_int32_t opt, apr_int32_t *on);
APR_DECLARE(fspr_status_t) fspr_socket_opt_get(fspr_socket_t *sock,
fspr_int32_t opt, fspr_int32_t *on);
/**
* Get Socket fd for the socket passed
* @param sock The socket to quesry for the socket fd
*/
APR_DECLARE(int) apr_socket_fd_get(apr_socket_t *sock);
APR_DECLARE(int) fspr_socket_fd_get(fspr_socket_t *sock);
/**
@@ -643,8 +643,8 @@ APR_DECLARE(int) apr_socket_fd_get(apr_socket_t *sock);
* @param sock The socket to query
* @param t Socket timeout returned from the query.
*/
APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock,
apr_interval_time_t *t);
APR_DECLARE(fspr_status_t) fspr_socket_timeout_get(fspr_socket_t *sock,
fspr_interval_time_t *t);
/**
* Query the specified socket if at the OOB/Urgent data mark
@@ -652,28 +652,28 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock,
* @param atmark Is set to true if socket is at the OOB/urgent mark,
* otherwise is set to false.
*/
APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock,
APR_DECLARE(fspr_status_t) fspr_socket_atmark(fspr_socket_t *sock,
int *atmark);
/**
* Return an apr_sockaddr_t from an apr_socket_t
* @param sa The returned apr_sockaddr_t.
* @param which Which interface do we want the apr_sockaddr_t for?
* Return an fspr_sockaddr_t from an fspr_socket_t
* @param sa The returned fspr_sockaddr_t.
* @param which Which interface do we want the fspr_sockaddr_t for?
* @param sock The socket to use
*/
APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa,
apr_interface_e which,
apr_socket_t *sock);
APR_DECLARE(fspr_status_t) fspr_socket_addr_get(fspr_sockaddr_t **sa,
fspr_interface_e which,
fspr_socket_t *sock);
/**
* Return the IP address (in numeric address string format) in
* an APR socket address. APR will allocate storage for the IP address
* string from the pool of the apr_sockaddr_t.
* string from the pool of the fspr_sockaddr_t.
* @param addr The IP address.
* @param sockaddr The socket address to reference.
*/
APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr,
apr_sockaddr_t *sockaddr);
APR_DECLARE(fspr_status_t) fspr_sockaddr_ip_get(char **addr,
fspr_sockaddr_t *sockaddr);
/**
* See if the IP addresses in two APR socket addresses are
@@ -685,23 +685,23 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr,
* @remark The return value will be non-zero if the addresses
* are equivalent.
*/
APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1,
const apr_sockaddr_t *addr2);
APR_DECLARE(int) fspr_sockaddr_equal(const fspr_sockaddr_t *addr1,
const fspr_sockaddr_t *addr2);
/**
* Return the type of the socket.
* @param sock The socket to query.
* @param type The returned type (e.g., SOCK_STREAM).
*/
APR_DECLARE(apr_status_t) apr_socket_type_get(apr_socket_t *sock,
APR_DECLARE(fspr_status_t) fspr_socket_type_get(fspr_socket_t *sock,
int *type);
/**
* Given an apr_sockaddr_t and a service name, set the port for the service
* @param sockaddr The apr_sockaddr_t that will have its port set
* Given an fspr_sockaddr_t and a service name, set the port for the service
* @param sockaddr The fspr_sockaddr_t that will have its port set
* @param servname The name of the service you wish to use
*/
APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr,
APR_DECLARE(fspr_status_t) fspr_getservbyname(fspr_sockaddr_t *sockaddr,
const char *servname);
/**
* Build an ip-subnet representation from an IP address and optional netmask or
@@ -711,19 +711,19 @@ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr,
* @param mask_or_numbits The input netmask or number-of-bits string, or NULL
* @param p The pool to allocate from
*/
APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub,
APR_DECLARE(fspr_status_t) fspr_ipsubnet_create(fspr_ipsubnet_t **ipsub,
const char *ipstr,
const char *mask_or_numbits,
apr_pool_t *p);
fspr_pool_t *p);
/**
* Test the IP address in an apr_sockaddr_t against a pre-built ip-subnet
* Test the IP address in an fspr_sockaddr_t against a pre-built ip-subnet
* representation.
* @param ipsub The ip-subnet representation
* @param sa The socket address to test
* @return non-zero if the socket address is within the subnet, 0 otherwise
*/
APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa);
APR_DECLARE(int) fspr_ipsubnet_test(fspr_ipsubnet_t *ipsub, fspr_sockaddr_t *sa);
#if APR_HAS_SO_ACCEPTFILTER || defined(DOXYGEN)
/**
@@ -733,7 +733,7 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa);
* @param args Any extra args to the accept filter. Passing NULL here removes
* the accept filter.
*/
apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name,
fspr_status_t fspr_socket_accept_filter(fspr_socket_t *sock, char *name,
char *args);
#endif
@@ -742,7 +742,7 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name,
* @param sock The socket to query.
* @param protocol The returned protocol (e.g., APR_PROTO_TCP).
*/
APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock,
APR_DECLARE(fspr_status_t) fspr_socket_protocol_get(fspr_socket_t *sock,
int *protocol);
/**
@@ -761,7 +761,7 @@ APR_DECLARE_INHERIT_SET(socket);
APR_DECLARE_INHERIT_UNSET(socket);
/**
* @defgroup apr_mcast IP Multicast
* @defgroup fspr_mcast IP Multicast
* @{
*/
@@ -774,14 +774,14 @@ APR_DECLARE_INHERIT_UNSET(socket);
* @param source Source Address to accept transmissions from (non-NULL
* implies Source-Specific Multicast)
*/
APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock,
apr_sockaddr_t *join,
apr_sockaddr_t *iface,
apr_sockaddr_t *source);
APR_DECLARE(fspr_status_t) fspr_mcast_join(fspr_socket_t *sock,
fspr_sockaddr_t *join,
fspr_sockaddr_t *iface,
fspr_sockaddr_t *source);
/**
* Leave a Multicast Group. All arguments must be the same as
* apr_mcast_join.
* fspr_mcast_join.
* @param sock The socket to leave a multicast group
* @param addr The address of the multicast group to leave
* @param iface Address of the interface to use. If NULL is passed, the
@@ -789,10 +789,10 @@ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock,
* @param source Source Address to accept transmissions from (non-NULL
* implies Source-Specific Multicast)
*/
APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock,
apr_sockaddr_t *addr,
apr_sockaddr_t *iface,
apr_sockaddr_t *source);
APR_DECLARE(fspr_status_t) fspr_mcast_leave(fspr_socket_t *sock,
fspr_sockaddr_t *addr,
fspr_sockaddr_t *iface,
fspr_sockaddr_t *source);
/**
* Set the Multicast Time to Live (ttl) for a multicast transmission.
@@ -801,16 +801,16 @@ APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock,
* @remark If the TTL is 0, packets will only be seen by sockets on
* the local machine, and only when multicast loopback is enabled.
*/
APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock,
apr_byte_t ttl);
APR_DECLARE(fspr_status_t) fspr_mcast_hops(fspr_socket_t *sock,
fspr_byte_t ttl);
/**
* Toggle IP Multicast Loopback
* @param sock The socket to set multicast loopback
* @param opt 0=disable, 1=enable
*/
APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock,
apr_byte_t opt);
APR_DECLARE(fspr_status_t) fspr_mcast_loopback(fspr_socket_t *sock,
fspr_byte_t opt);
/**
@@ -818,8 +818,8 @@ APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock,
* @param sock The socket to set the multicast interface on
* @param iface Address of the interface to use for Multicast
*/
APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock,
apr_sockaddr_t *iface);
APR_DECLARE(fspr_status_t) fspr_mcast_interface(fspr_socket_t *sock,
fspr_sockaddr_t *iface);
/** @} */
@@ -17,15 +17,15 @@
#ifndef APR_POLL_H
#define APR_POLL_H
/**
* @file apr_poll.h
* @file fspr_poll.h
* @brief APR Poll interface
*/
#include "apr.h"
#include "apr_pools.h"
#include "apr_errno.h"
#include "apr_inherit.h"
#include "apr_file_io.h"
#include "apr_network_io.h"
#include "fspr.h"
#include "fspr_pools.h"
#include "fspr_errno.h"
#include "fspr_inherit.h"
#include "fspr_file_io.h"
#include "fspr_network_io.h"
#if APR_HAVE_NETINET_IN_H
#include <netinet/in.h>
@@ -36,7 +36,7 @@ extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_poll Poll Routines
* @defgroup fspr_poll Poll Routines
* @ingroup APR
* @{
*/
@@ -56,30 +56,30 @@ extern "C" {
*/
#define APR_POLLSET_THREADSAFE 0x001 /**< Adding or Removing a Descriptor is thread safe */
/** Used in apr_pollfd_t to determine what the apr_descriptor is */
/** Used in fspr_pollfd_t to determine what the fspr_descriptor is */
typedef enum {
APR_NO_DESC, /**< nothing here */
APR_POLL_SOCKET, /**< descriptor refers to a socket */
APR_POLL_FILE, /**< descriptor refers to a file */
APR_POLL_LASTDESC /**< descriptor is the last one in the list */
} apr_datatype_e ;
} fspr_datatype_e ;
/** Union of either an APR file or socket. */
typedef union {
apr_file_t *f; /**< file */
apr_socket_t *s; /**< socket */
} apr_descriptor;
fspr_file_t *f; /**< file */
fspr_socket_t *s; /**< socket */
} fspr_descriptor;
/** @see apr_pollfd_t */
typedef struct apr_pollfd_t apr_pollfd_t;
/** @see fspr_pollfd_t */
typedef struct fspr_pollfd_t fspr_pollfd_t;
/** Poll descriptor set. */
struct apr_pollfd_t {
apr_pool_t *p; /**< associated pool */
apr_datatype_e desc_type; /**< descriptor type */
apr_int16_t reqevents; /**< requested events */
apr_int16_t rtnevents; /**< returned events */
apr_descriptor desc; /**< @see apr_descriptor */
struct fspr_pollfd_t {
fspr_pool_t *p; /**< associated pool */
fspr_datatype_e desc_type; /**< descriptor type */
fspr_int16_t reqevents; /**< requested events */
fspr_int16_t rtnevents; /**< returned events */
fspr_descriptor desc; /**< @see fspr_descriptor */
void *client_data; /**< allows app to associate context */
};
@@ -89,7 +89,7 @@ struct apr_pollfd_t {
*/
/** Opaque structure used for pollset API */
typedef struct apr_pollset_t apr_pollset_t;
typedef struct fspr_pollset_t fspr_pollset_t;
/**
* Setup a pollset object
@@ -100,21 +100,21 @@ typedef struct apr_pollset_t apr_pollset_t;
*
* @remark If flags equals APR_POLLSET_THREADSAFE, then a pollset is
* created on which it is safe to make concurrent calls to
* apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() from
* fspr_pollset_add(), fspr_pollset_remove() and fspr_pollset_poll() from
* separate threads. This feature is only supported on some
* platforms; the apr_pollset_create() call will fail with
* platforms; the fspr_pollset_create() call will fail with
* APR_ENOTIMPL on platforms where it is not supported.
*/
APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
apr_uint32_t size,
apr_pool_t *p,
apr_uint32_t flags);
APR_DECLARE(fspr_status_t) fspr_pollset_create(fspr_pollset_t **pollset,
fspr_uint32_t size,
fspr_pool_t *p,
fspr_uint32_t flags);
/**
* Destroy a pollset object
* @param pollset The pollset to destroy
*/
APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset);
APR_DECLARE(fspr_status_t) fspr_pollset_destroy(fspr_pollset_t *pollset);
/**
* Add a socket or file descriptor to a pollset
@@ -122,36 +122,36 @@ APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset);
* @param descriptor The descriptor to add
* @remark If you set client_data in the descriptor, that value
* will be returned in the client_data field whenever this
* descriptor is signalled in apr_pollset_poll().
* descriptor is signalled in fspr_pollset_poll().
* @remark If the pollset has been created with APR_POLLSET_THREADSAFE
* and thread T1 is blocked in a call to apr_pollset_poll() for
* this same pollset that is being modified via apr_pollset_add()
* in thread T2, the currently executing apr_pollset_poll() call in
* and thread T1 is blocked in a call to fspr_pollset_poll() for
* this same pollset that is being modified via fspr_pollset_add()
* in thread T2, the currently executing fspr_pollset_poll() call in
* T1 will either: (1) automatically include the newly added descriptor
* in the set of descriptors it is watching or (2) return immediately
* with APR_EINTR. Option (1) is recommended, but option (2) is
* allowed for implementations where option (1) is impossible
* or impractical.
*/
APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset,
const apr_pollfd_t *descriptor);
APR_DECLARE(fspr_status_t) fspr_pollset_add(fspr_pollset_t *pollset,
const fspr_pollfd_t *descriptor);
/**
* Remove a descriptor from a pollset
* @param pollset The pollset from which to remove the descriptor
* @param descriptor The descriptor to remove
* @remark If the pollset has been created with APR_POLLSET_THREADSAFE
* and thread T1 is blocked in a call to apr_pollset_poll() for
* this same pollset that is being modified via apr_pollset_remove()
* in thread T2, the currently executing apr_pollset_poll() call in
* and thread T1 is blocked in a call to fspr_pollset_poll() for
* this same pollset that is being modified via fspr_pollset_remove()
* in thread T2, the currently executing fspr_pollset_poll() call in
* T1 will either: (1) automatically exclude the newly added descriptor
* in the set of descriptors it is watching or (2) return immediately
* with APR_EINTR. Option (1) is recommended, but option (2) is
* allowed for implementations where option (1) is impossible
* or impractical.
*/
APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset,
const apr_pollfd_t *descriptor);
APR_DECLARE(fspr_status_t) fspr_pollset_remove(fspr_pollset_t *pollset,
const fspr_pollfd_t *descriptor);
/**
* Block for activity on the descriptor(s) in a pollset
@@ -160,10 +160,10 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset,
* @param num Number of signalled descriptors (output parameter)
* @param descriptors Array of signalled descriptors (output parameter)
*/
APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
apr_interval_time_t timeout,
apr_int32_t *num,
const apr_pollfd_t **descriptors);
APR_DECLARE(fspr_status_t) fspr_pollset_poll(fspr_pollset_t *pollset,
fspr_interval_time_t timeout,
fspr_int32_t *num,
const fspr_pollfd_t **descriptors);
/**
@@ -178,12 +178,12 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
* @remark The number of descriptors signalled is returned in the third argument.
* This is a blocking call, and it will not return until either a
* descriptor has been signalled, or the timeout has expired.
* @remark The rtnevents field in the apr_pollfd_t array will only be filled-
* @remark The rtnevents field in the fspr_pollfd_t array will only be filled-
* in if the return value is APR_SUCCESS.
*/
APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock,
apr_int32_t *nsds,
apr_interval_time_t timeout);
APR_DECLARE(fspr_status_t) fspr_poll(fspr_pollfd_t *aprset, fspr_int32_t numsock,
fspr_int32_t *nsds,
fspr_interval_time_t timeout);
/** @} */
@@ -18,7 +18,7 @@
#define APR_POOLS_H
/**
* @file apr_pools.h
* @file fspr_pools.h
* @brief APR memory allocation
*
* Resource allocation routines...
@@ -30,61 +30,61 @@
* Instead, we maintain pools, and allocate items (both memory and I/O
* handlers) from the pools --- currently there are two, one for per
* transaction info, and one for config info. When a transaction is over,
* we can delete everything in the per-transaction apr_pool_t without fear,
* we can delete everything in the per-transaction fspr_pool_t without fear,
* and without thinking too hard about it either.
*/
#include "apr.h"
#include "apr_errno.h"
#include "apr_general.h" /* for APR_STRINGIFY */
#include "fspr.h"
#include "fspr_errno.h"
#include "fspr_general.h" /* for APR_STRINGIFY */
#define APR_WANT_MEMFUNC /**< for no good reason? */
#include "apr_want.h"
#include "fspr_want.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup apr_pools Memory Pool Functions
* @defgroup fspr_pools Memory Pool Functions
* @ingroup APR
* @{
*/
/** The fundamental pool type */
typedef struct apr_pool_t apr_pool_t;
typedef struct fspr_pool_t fspr_pool_t;
/**
* Declaration helper macro to construct apr_foo_pool_get()s.
* Declaration helper macro to construct fspr_foo_pool_get()s.
*
* This standardized macro is used by opaque (APR) data types to return
* the apr_pool_t that is associated with the data type.
* the fspr_pool_t that is associated with the data type.
*
* APR_POOL_DECLARE_ACCESSOR() is used in a header file to declare the
* accessor function. A typical usage and result would be:
* <pre>
* APR_POOL_DECLARE_ACCESSOR(file);
* becomes:
* APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob);
* APR_DECLARE(fspr_pool_t *) fspr_file_pool_get(fspr_file_t *ob);
* </pre>
* @remark Doxygen unwraps this macro (via doxygen.conf) to provide
* actual help for each specific occurance of apr_foo_pool_get.
* actual help for each specific occurance of fspr_foo_pool_get.
* @remark the linkage is specified for APR. It would be possible to expand
* the macros to support other linkages.
*/
#define APR_POOL_DECLARE_ACCESSOR(type) \
APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \
(const apr_##type##_t *the##type)
APR_DECLARE(fspr_pool_t *) fspr_##type##_pool_get \
(const fspr_##type##_t *the##type)
/**
* Implementation helper macro to provide apr_foo_pool_get()s.
* Implementation helper macro to provide fspr_foo_pool_get()s.
*
* In the implementation, the APR_POOL_IMPLEMENT_ACCESSOR() is used to
* actually define the function. It assumes the field is named "pool".
*/
#define APR_POOL_IMPLEMENT_ACCESSOR(type) \
APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \
(const apr_##type##_t *the##type) \
APR_DECLARE(fspr_pool_t *) fspr_##type##_pool_get \
(const fspr_##type##_t *the##type) \
{ return the##type->pool; }
@@ -116,7 +116,7 @@ typedef struct apr_pool_t apr_pool_t;
* combination with the verbose flag above,
* it will output OWNER in such an event
* prior to aborting. Use the debug
* function apr_pool_owner_set() to switch
* function fspr_pool_owner_set() to switch
* a pools ownership.
*
* When no debug level was specified, assume general debug mode.
@@ -139,7 +139,7 @@ typedef struct apr_pool_t apr_pool_t;
/** A function that is called when allocation fails. */
typedef int (*apr_abortfunc_t)(int retcode);
typedef int (*fspr_abortfunc_t)(int retcode);
/*
* APR memory structure manipulators (pools, tables, and arrays).
@@ -152,74 +152,74 @@ typedef int (*apr_abortfunc_t)(int retcode);
/**
* Setup all of the internal structures required to use pools
* @remark Programs do NOT need to call this directly. APR will call this
* automatically from apr_initialize.
* automatically from fspr_initialize.
* @internal
*/
APR_DECLARE(apr_status_t) apr_pool_initialize(void);
APR_DECLARE(fspr_status_t) fspr_pool_initialize(void);
/**
* Tear down all of the internal structures required to use pools
* @remark Programs do NOT need to call this directly. APR will call this
* automatically from apr_terminate.
* automatically from fspr_terminate.
* @internal
*/
APR_DECLARE(void) apr_pool_terminate(void);
APR_DECLARE(void) fspr_pool_terminate(void);
/*
* Pool creation/destruction
*/
#include "apr_allocator.h"
#include "fspr_allocator.h"
/**
* Create a new pool.
* @param newpool The pool we have just created.
* @param parent The parent pool. If this is NULL, the new pool is a root
* pool. If it is non-NULL, the new pool will inherit all
* of its parent pool's attributes, except the apr_pool_t will
* of its parent pool's attributes, except the fspr_pool_t will
* be a sub-pool.
* @param abort_fn A function to use if the pool cannot allocate more memory.
* @param allocator The allocator to use with the new pool. If NULL the
* allocator of the parent pool will be used.
*/
APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool,
apr_pool_t *parent,
apr_abortfunc_t abort_fn,
apr_allocator_t *allocator);
APR_DECLARE(fspr_status_t) fspr_pool_create_ex(fspr_pool_t **newpool,
fspr_pool_t *parent,
fspr_abortfunc_t abort_fn,
fspr_allocator_t *allocator);
/**
* Debug version of apr_pool_create_ex.
* @param newpool @see apr_pool_create.
* @param parent @see apr_pool_create.
* @param abort_fn @see apr_pool_create.
* @param allocator @see apr_pool_create.
* Debug version of fspr_pool_create_ex.
* @param newpool @see fspr_pool_create.
* @param parent @see fspr_pool_create.
* @param abort_fn @see fspr_pool_create.
* @param allocator @see fspr_pool_create.
* @param file_line Where the function is called from.
* This is usually APR_POOL__FILE_LINE__.
* @remark Only available when APR_POOL_DEBUG is defined.
* Call this directly if you have you apr_pool_create_ex
* Call this directly if you have you fspr_pool_create_ex
* calls in a wrapper function and wish to override
* the file_line argument to reflect the caller of
* your wrapper function. If you do not have
* apr_pool_create_ex in a wrapper, trust the macro
* and don't call apr_pool_create_ex_debug directly.
* fspr_pool_create_ex in a wrapper, trust the macro
* and don't call fspr_pool_create_ex_debug directly.
*/
APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool,
apr_pool_t *parent,
apr_abortfunc_t abort_fn,
apr_allocator_t *allocator,
APR_DECLARE(fspr_status_t) fspr_pool_create_ex_debug(fspr_pool_t **newpool,
fspr_pool_t *parent,
fspr_abortfunc_t abort_fn,
fspr_allocator_t *allocator,
const char *file_line);
#if APR_POOL_DEBUG
#define apr_pool_create_ex(newpool, parent, abort_fn, allocator) \
apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \
#define fspr_pool_create_ex(newpool, parent, abort_fn, allocator) \
fspr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \
APR_POOL__FILE_LINE__)
APR_DECLARE(int) apr_pool_walk_tree_debug(apr_pool_t *pool,
int(*fn)(apr_pool_t *pool, void *data),
APR_DECLARE(int) fspr_pool_walk_tree_debug(fspr_pool_t *pool,
int(*fn)(fspr_pool_t *pool, void *data),
void *data);
APR_DECLARE(void) apr_pool_get_stats(apr_pool_t *pool, unsigned int *alloc, unsigned int *total_alloc, unsigned int *clear);
APR_DECLARE(void) fspr_pool_get_stats(fspr_pool_t *pool, unsigned int *alloc, unsigned int *total_alloc, unsigned int *clear);
#endif
/**
@@ -227,20 +227,20 @@ APR_DECLARE(void) apr_pool_get_stats(apr_pool_t *pool, unsigned int *alloc, unsi
* @param newpool The pool we have just created.
* @param parent The parent pool. If this is NULL, the new pool is a root
* pool. If it is non-NULL, the new pool will inherit all
* of its parent pool's attributes, except the apr_pool_t will
* of its parent pool's attributes, except the fspr_pool_t will
* be a sub-pool.
*/
#if defined(DOXYGEN)
APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool,
apr_pool_t *parent);
APR_DECLARE(fspr_status_t) fspr_pool_create(fspr_pool_t **newpool,
fspr_pool_t *parent);
#else
#if APR_POOL_DEBUG
#define apr_pool_create(newpool, parent) \
apr_pool_create_ex_debug(newpool, parent, NULL, NULL, \
#define fspr_pool_create(newpool, parent) \
fspr_pool_create_ex_debug(newpool, parent, NULL, NULL, \
APR_POOL__FILE_LINE__)
#else
#define apr_pool_create(newpool, parent) \
apr_pool_create_ex(newpool, parent, NULL, NULL)
#define fspr_pool_create(newpool, parent) \
fspr_pool_create_ex(newpool, parent, NULL, NULL)
#endif
#endif
@@ -248,7 +248,7 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool,
* Find the pools allocator
* @param pool The pool to get the allocator from.
*/
APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool);
APR_DECLARE(fspr_allocator_t *) fspr_pool_allocator_get(fspr_pool_t *pool);
/**
* Clear all memory in the pool and run all the cleanups. This also destroys all
@@ -256,58 +256,58 @@ APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool);
* @param p The pool to clear
* @remark This does not actually free the memory, it just allows the pool
* to re-use this memory for the next allocation.
* @see apr_pool_destroy()
* @see fspr_pool_destroy()
*/
APR_DECLARE(void) apr_pool_clear(apr_pool_t *p);
APR_DECLARE(void) fspr_pool_clear(fspr_pool_t *p);
/**
* Debug version of apr_pool_clear.
* @param p See: apr_pool_clear.
* Debug version of fspr_pool_clear.
* @param p See: fspr_pool_clear.
* @param file_line Where the function is called from.
* This is usually APR_POOL__FILE_LINE__.
* @remark Only available when APR_POOL_DEBUG is defined.
* Call this directly if you have you apr_pool_clear
* Call this directly if you have you fspr_pool_clear
* calls in a wrapper function and wish to override
* the file_line argument to reflect the caller of
* your wrapper function. If you do not have
* apr_pool_clear in a wrapper, trust the macro
* and don't call apr_pool_destroy_clear directly.
* fspr_pool_clear in a wrapper, trust the macro
* and don't call fspr_pool_destroy_clear directly.
*/
APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p,
APR_DECLARE(void) fspr_pool_clear_debug(fspr_pool_t *p,
const char *file_line);
#if APR_POOL_DEBUG
#define apr_pool_clear(p) \
apr_pool_clear_debug(p, APR_POOL__FILE_LINE__)
#define fspr_pool_clear(p) \
fspr_pool_clear_debug(p, APR_POOL__FILE_LINE__)
#endif
/**
* Destroy the pool. This takes similar action as apr_pool_clear() and then
* Destroy the pool. This takes similar action as fspr_pool_clear() and then
* frees all the memory.
* @param p The pool to destroy
* @remark This will actually free the memory
*/
APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p);
APR_DECLARE(void) fspr_pool_destroy(fspr_pool_t *p);
/**
* Debug version of apr_pool_destroy.
* @param p See: apr_pool_destroy.
* Debug version of fspr_pool_destroy.
* @param p See: fspr_pool_destroy.
* @param file_line Where the function is called from.
* This is usually APR_POOL__FILE_LINE__.
* @remark Only available when APR_POOL_DEBUG is defined.
* Call this directly if you have you apr_pool_destroy
* Call this directly if you have you fspr_pool_destroy
* calls in a wrapper function and wish to override
* the file_line argument to reflect the caller of
* your wrapper function. If you do not have
* apr_pool_destroy in a wrapper, trust the macro
* and don't call apr_pool_destroy_debug directly.
* fspr_pool_destroy in a wrapper, trust the macro
* and don't call fspr_pool_destroy_debug directly.
*/
APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p,
APR_DECLARE(void) fspr_pool_destroy_debug(fspr_pool_t *p,
const char *file_line);
#if APR_POOL_DEBUG
#define apr_pool_destroy(p) \
apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__)
#define fspr_pool_destroy(p) \
fspr_pool_destroy_debug(p, APR_POOL__FILE_LINE__)
#endif
@@ -321,22 +321,22 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p,
* @param size The amount of memory to allocate
* @return The allocated memory
*/
APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size);
APR_DECLARE(void *) fspr_palloc(fspr_pool_t *p, fspr_size_t size);
/**
* Debug version of apr_palloc
* @param p See: apr_palloc
* @param size See: apr_palloc
* Debug version of fspr_palloc
* @param p See: fspr_palloc
* @param size See: fspr_palloc
* @param file_line Where the function is called from.
* This is usually APR_POOL__FILE_LINE__.
* @return See: apr_palloc
* @return See: fspr_palloc
*/
APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size,
APR_DECLARE(void *) fspr_palloc_debug(fspr_pool_t *p, fspr_size_t size,
const char *file_line);
#if APR_POOL_DEBUG
#define apr_palloc(p, size) \
apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
#define fspr_palloc(p, size) \
fspr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
#endif
/**
@@ -346,25 +346,25 @@ APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size,
* @return The allocated memory
*/
#if defined(DOXYGEN)
APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size);
APR_DECLARE(void *) fspr_pcalloc(fspr_pool_t *p, fspr_size_t size);
#elif !APR_POOL_DEBUG
#define apr_pcalloc(p, size) memset(apr_palloc(p, size), 0, size)
#define fspr_pcalloc(p, size) memset(fspr_palloc(p, size), 0, size)
#endif
/**
* Debug version of apr_pcalloc
* @param p See: apr_pcalloc
* @param size See: apr_pcalloc
* Debug version of fspr_pcalloc
* @param p See: fspr_pcalloc
* @param size See: fspr_pcalloc
* @param file_line Where the function is called from.
* This is usually APR_POOL__FILE_LINE__.
* @return See: apr_pcalloc
* @return See: fspr_pcalloc
*/
APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size,
APR_DECLARE(void *) fspr_pcalloc_debug(fspr_pool_t *p, fspr_size_t size,
const char *file_line);
#if APR_POOL_DEBUG
#define apr_pcalloc(p, size) \
apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
#define fspr_pcalloc(p, size) \
fspr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
#endif
@@ -380,22 +380,22 @@ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size,
* then APR will return an error and expect the calling program to
* deal with the error accordingly.
*/
APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc_t abortfunc,
apr_pool_t *pool);
APR_DECLARE(void) fspr_pool_abort_set(fspr_abortfunc_t abortfunc,
fspr_pool_t *pool);
/**
* Get the abort function associated with the specified pool.
* @param pool The pool for retrieving the abort function.
* @return The abort function for the given pool.
*/
APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool);
APR_DECLARE(fspr_abortfunc_t) fspr_pool_abort_get(fspr_pool_t *pool);
/**
* Get the parent pool of the specified pool.
* @param pool The pool for retrieving the parent pool.
* @return The parent of the given pool.
*/
APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool);
APR_DECLARE(fspr_pool_t *) fspr_pool_parent_get(fspr_pool_t *pool);
/**
* Determine if pool a is an ancestor of pool b.
@@ -405,17 +405,17 @@ APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool);
* of all pools.
* @remark if compiled with APR_POOL_DEBUG, this function will also
* return true if A is a pool which has been guaranteed by the caller
* (using apr_pool_join) to have a lifetime at least as long as some
* (using fspr_pool_join) to have a lifetime at least as long as some
* ancestor of pool B.
*/
APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b);
APR_DECLARE(int) fspr_pool_is_ancestor(fspr_pool_t *a, fspr_pool_t *b);
/**
* Tag a pool (give it a name)
* @param pool The pool to tag
* @param tag The tag
*/
APR_DECLARE(const char *) apr_pool_tag(apr_pool_t *pool, const char *tag);
APR_DECLARE(const char *) fspr_pool_tag(fspr_pool_t *pool, const char *tag);
#if APR_HAS_THREADS
/**
@@ -424,8 +424,8 @@ APR_DECLARE(const char *) apr_pool_tag(apr_pool_t *pool, const char *tag);
* @param mutex The mutex
* @remark The mutex does not protect the destroy operation just the low level allocs.
*/
APR_DECLARE(void) apr_pool_mutex_set(apr_pool_t *pool,
apr_thread_mutex_t *mutex);
APR_DECLARE(void) fspr_pool_mutex_set(fspr_pool_t *pool,
fspr_thread_mutex_t *mutex);
#endif
@@ -453,11 +453,11 @@ APR_DECLARE(void) apr_pool_mutex_set(apr_pool_t *pool,
*
*/
APR_DECLARE(apr_status_t) apr_pool_userdata_set(
APR_DECLARE(fspr_status_t) fspr_pool_userdata_set(
const void *data,
const char *key,
apr_status_t (*cleanup)(void *),
apr_pool_t *pool);
fspr_status_t (*cleanup)(void *),
fspr_pool_t *pool);
/**
* Set the data associated with the current pool
@@ -465,24 +465,24 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set(
* @param key The key to use for association
* @param cleanup The cleanup program to use to cleanup the data (NULL if none)
* @param pool The current pool
* @note same as apr_pool_userdata_set(), except that this version doesn't
* @note same as fspr_pool_userdata_set(), except that this version doesn't
* make a copy of the key (this function is useful, for example, when
* the key is a string literal)
* @warning This should NOT be used if the key could change addresses by
* any means between the apr_pool_userdata_setn() call and a
* subsequent apr_pool_userdata_get() on that key, such as if a
* any means between the fspr_pool_userdata_setn() call and a
* subsequent fspr_pool_userdata_get() on that key, such as if a
* static string is used as a userdata key in a DSO and the DSO could
* be unloaded and reloaded between the _setn() and the _get(). You
* MUST use apr_pool_userdata_set() in such cases.
* MUST use fspr_pool_userdata_set() in such cases.
* @warning More generally, the key and the data to be attached to the
* pool should have a life span at least as long as the pool itself.
*
*/
APR_DECLARE(apr_status_t) apr_pool_userdata_setn(
APR_DECLARE(fspr_status_t) fspr_pool_userdata_setn(
const void *data,
const char *key,
apr_status_t (*cleanup)(void *),
apr_pool_t *pool);
fspr_status_t (*cleanup)(void *),
fspr_pool_t *pool);
/**
* Return the data associated with the current pool.
@@ -490,8 +490,8 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_setn(
* @param key The key for the data to retrieve
* @param pool The current pool.
*/
APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_pool_userdata_get(void **data, const char *key,
fspr_pool_t *pool);
/**
@@ -517,11 +517,11 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key,
* @param child_cleanup The function to call when a child process is about
* to exec - this function is called in the child, obviously!
*/
APR_DECLARE(void) apr_pool_cleanup_register(
apr_pool_t *p,
APR_DECLARE(void) fspr_pool_cleanup_register(
fspr_pool_t *p,
const void *data,
apr_status_t (*plain_cleanup)(void *),
apr_status_t (*child_cleanup)(void *));
fspr_status_t (*plain_cleanup)(void *),
fspr_status_t (*child_cleanup)(void *));
/**
* Remove a previously registered cleanup function.
@@ -535,8 +535,8 @@ APR_DECLARE(void) apr_pool_cleanup_register(
* @remarks For some strange reason only the plain_cleanup is handled by this
* function
*/
APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data,
apr_status_t (*cleanup)(void *));
APR_DECLARE(void) fspr_pool_cleanup_kill(fspr_pool_t *p, const void *data,
fspr_status_t (*cleanup)(void *));
/**
* Replace the child cleanup function of a previously registered cleanup.
@@ -550,11 +550,11 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data,
* @param plain_cleanup The plain cleanup function of the registered cleanup
* @param child_cleanup The function to register as the child cleanup
*/
APR_DECLARE(void) apr_pool_child_cleanup_set(
apr_pool_t *p,
APR_DECLARE(void) fspr_pool_child_cleanup_set(
fspr_pool_t *p,
const void *data,
apr_status_t (*plain_cleanup)(void *),
apr_status_t (*child_cleanup)(void *));
fspr_status_t (*plain_cleanup)(void *),
fspr_status_t (*child_cleanup)(void *));
/**
* Run the specified cleanup function immediately and unregister it.
@@ -567,19 +567,19 @@ APR_DECLARE(void) apr_pool_child_cleanup_set(
* @param data The data to remove from cleanup
* @param cleanup The function to remove from cleanup
*/
APR_DECLARE(apr_status_t) apr_pool_cleanup_run(
apr_pool_t *p,
APR_DECLARE(fspr_status_t) fspr_pool_cleanup_run(
fspr_pool_t *p,
void *data,
apr_status_t (*cleanup)(void *));
fspr_status_t (*cleanup)(void *));
/**
* An empty cleanup function.
*
* Passed to apr_pool_cleanup_register() when no cleanup is required.
* Passed to fspr_pool_cleanup_register() when no cleanup is required.
*
* @param data The data to cleanup, will not be used by this function.
*/
APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data);
APR_DECLARE_NONSTD(fspr_status_t) fspr_pool_cleanup_null(void *data);
/**
* Run all registered child cleanups, in preparation for an exec()
@@ -587,7 +587,7 @@ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data);
* buffers, *don't* wait for subprocesses, and *don't* free any
* memory.
*/
APR_DECLARE(void) apr_pool_cleanup_for_exec(void);
APR_DECLARE(void) fspr_pool_cleanup_for_exec(void);
/** @} */
@@ -615,7 +615,7 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void);
* if the data is allocated in any ancestor of T's pool. This is the
* basis on which the APR_POOL_DEBUG code works -- it tests these ancestor
* relationships for all data inserted into tables. APR_POOL_DEBUG also
* provides tools (apr_pool_find, and apr_pool_is_ancestor) for other
* provides tools (fspr_pool_find, and fspr_pool_is_ancestor) for other
* folks to implement similar restrictions for their own data
* structures.
*
@@ -626,7 +626,7 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void);
* is, the caller guarantees they won't destroy the sub pool
* individually prior to destroying the parent pool.
*
* In this case the caller must call apr_pool_join() to indicate this
* In this case the caller must call fspr_pool_join() to indicate this
* guarantee to the APR_POOL_DEBUG code.
*
* These functions are only implemented when #APR_POOL_DEBUG is set.
@@ -639,14 +639,14 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void);
* @param p The parent pool
* @param sub The subpool
*/
APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub);
APR_DECLARE(void) fspr_pool_join(fspr_pool_t *p, fspr_pool_t *sub);
/**
* Find a pool from something allocated in it.
* @param mem The thing allocated in the pool
* @return The pool it is allocated in
*/
APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem);
APR_DECLARE(fspr_pool_t *) fspr_pool_find(const void *mem);
/**
* Report the number of bytes currently in the pool
@@ -654,28 +654,28 @@ APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem);
* @param recurse Recurse/include the subpools' sizes
* @return The number of bytes
*/
APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse);
APR_DECLARE(fspr_size_t) fspr_pool_num_bytes(fspr_pool_t *p, int recurse);
/**
* Lock a pool
* @param pool The pool to lock
* @param flag The flag
*/
APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag);
APR_DECLARE(void) fspr_pool_lock(fspr_pool_t *pool, int flag);
/* @} */
#else /* APR_POOL_DEBUG or DOXYGEN */
#ifdef apr_pool_join
#undef apr_pool_join
#ifdef fspr_pool_join
#undef fspr_pool_join
#endif
#define apr_pool_join(a,b)
#define fspr_pool_join(a,b)
#ifdef apr_pool_lock
#undef apr_pool_lock
#ifdef fspr_pool_lock
#undef fspr_pool_lock
#endif
#define apr_pool_lock(pool, lock)
#define fspr_pool_lock(pool, lock)
#endif /* APR_POOL_DEBUG or DOXYGEN */
@@ -21,21 +21,21 @@
#ifndef APR_PORTABLE_H
#define APR_PORTABLE_H
/**
* @file apr_portable.h
* @file fspr_portable.h
* @brief APR Portability Routines
*/
#include "apr.h"
#include "apr_pools.h"
#include "apr_thread_proc.h"
#include "apr_file_io.h"
#include "apr_network_io.h"
#include "apr_errno.h"
#include "apr_global_mutex.h"
#include "apr_proc_mutex.h"
#include "apr_time.h"
#include "apr_dso.h"
#include "apr_shm.h"
#include "fspr.h"
#include "fspr_pools.h"
#include "fspr_thread_proc.h"
#include "fspr_file_io.h"
#include "fspr_network_io.h"
#include "fspr_errno.h"
#include "fspr_global_mutex.h"
#include "fspr_proc_mutex.h"
#include "fspr_time.h"
#include "fspr_dso.h"
#include "fspr_shm.h"
#if APR_HAVE_DIRENT_H
#include <dirent.h>
@@ -52,71 +52,71 @@ extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_portabile Portability Routines
* @defgroup fspr_portabile Portability Routines
* @ingroup APR
* @{
*/
#ifdef WIN32
/* The primitives for Windows types */
typedef HANDLE apr_os_file_t;
typedef HANDLE apr_os_dir_t;
typedef SOCKET apr_os_sock_t;
typedef HANDLE apr_os_proc_mutex_t;
typedef HANDLE apr_os_thread_t;
typedef HANDLE apr_os_proc_t;
typedef DWORD apr_os_threadkey_t;
typedef FILETIME apr_os_imp_time_t;
typedef SYSTEMTIME apr_os_exp_time_t;
typedef HANDLE apr_os_dso_handle_t;
typedef HANDLE apr_os_shm_t;
typedef HANDLE fspr_os_file_t;
typedef HANDLE fspr_os_dir_t;
typedef SOCKET fspr_os_sock_t;
typedef HANDLE fspr_os_proc_mutex_t;
typedef HANDLE fspr_os_thread_t;
typedef HANDLE fspr_os_proc_t;
typedef DWORD fspr_os_threadkey_t;
typedef FILETIME fspr_os_imp_time_t;
typedef SYSTEMTIME fspr_os_exp_time_t;
typedef HANDLE fspr_os_dso_handle_t;
typedef HANDLE fspr_os_shm_t;
#elif defined(OS2)
typedef HFILE apr_os_file_t;
typedef HDIR apr_os_dir_t;
typedef int apr_os_sock_t;
typedef HMTX apr_os_proc_mutex_t;
typedef TID apr_os_thread_t;
typedef PID apr_os_proc_t;
typedef PULONG apr_os_threadkey_t;
typedef struct timeval apr_os_imp_time_t;
typedef struct tm apr_os_exp_time_t;
typedef HMODULE apr_os_dso_handle_t;
typedef void* apr_os_shm_t;
typedef HFILE fspr_os_file_t;
typedef HDIR fspr_os_dir_t;
typedef int fspr_os_sock_t;
typedef HMTX fspr_os_proc_mutex_t;
typedef TID fspr_os_thread_t;
typedef PID fspr_os_proc_t;
typedef PULONG fspr_os_threadkey_t;
typedef struct timeval fspr_os_imp_time_t;
typedef struct tm fspr_os_exp_time_t;
typedef HMODULE fspr_os_dso_handle_t;
typedef void* fspr_os_shm_t;
#elif defined(__BEOS__)
#include <kernel/OS.h>
#include <kernel/image.h>
struct apr_os_proc_mutex_t {
struct fspr_os_proc_mutex_t {
sem_id sem;
int32 ben;
};
typedef int apr_os_file_t;
typedef DIR apr_os_dir_t;
typedef int apr_os_sock_t;
typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_t;
typedef thread_id apr_os_thread_t;
typedef thread_id apr_os_proc_t;
typedef int apr_os_threadkey_t;
typedef struct timeval apr_os_imp_time_t;
typedef struct tm apr_os_exp_time_t;
typedef image_id apr_os_dso_handle_t;
typedef void* apr_os_shm_t;
typedef int fspr_os_file_t;
typedef DIR fspr_os_dir_t;
typedef int fspr_os_sock_t;
typedef struct fspr_os_proc_mutex_t fspr_os_proc_mutex_t;
typedef thread_id fspr_os_thread_t;
typedef thread_id fspr_os_proc_t;
typedef int fspr_os_threadkey_t;
typedef struct timeval fspr_os_imp_time_t;
typedef struct tm fspr_os_exp_time_t;
typedef image_id fspr_os_dso_handle_t;
typedef void* fspr_os_shm_t;
#elif defined(NETWARE)
typedef int apr_os_file_t;
typedef DIR apr_os_dir_t;
typedef int apr_os_sock_t;
typedef NXMutex_t apr_os_proc_mutex_t;
typedef NXThreadId_t apr_os_thread_t;
typedef long apr_os_proc_t;
typedef NXKey_t apr_os_threadkey_t;
typedef struct timeval apr_os_imp_time_t;
typedef struct tm apr_os_exp_time_t;
typedef void * apr_os_dso_handle_t;
typedef void* apr_os_shm_t;
typedef int fspr_os_file_t;
typedef DIR fspr_os_dir_t;
typedef int fspr_os_sock_t;
typedef NXMutex_t fspr_os_proc_mutex_t;
typedef NXThreadId_t fspr_os_thread_t;
typedef long fspr_os_proc_t;
typedef NXKey_t fspr_os_threadkey_t;
typedef struct timeval fspr_os_imp_time_t;
typedef struct tm fspr_os_exp_time_t;
typedef void * fspr_os_dso_handle_t;
typedef void* fspr_os_shm_t;
#else
/* Any other OS should go above this one. This is the lowest common
@@ -124,7 +124,7 @@ typedef void* apr_os_shm_t;
*/
/** Basic OS process mutex structure. */
struct apr_os_proc_mutex_t {
struct fspr_os_proc_mutex_t {
#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE
/** Value used for SYS V Semaphore, FCNTL and FLOCK serialization */
int crossproc;
@@ -142,46 +142,46 @@ struct apr_os_proc_mutex_t {
#endif
};
typedef int apr_os_file_t; /**< native file */
typedef DIR apr_os_dir_t; /**< native dir */
typedef int apr_os_sock_t; /**< native dir */
typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_t; /**< native proces
typedef int fspr_os_file_t; /**< native file */
typedef DIR fspr_os_dir_t; /**< native dir */
typedef int fspr_os_sock_t; /**< native dir */
typedef struct fspr_os_proc_mutex_t fspr_os_proc_mutex_t; /**< native proces
* mutex
*/
#if APR_HAS_THREADS && APR_HAVE_PTHREAD_H
typedef pthread_t apr_os_thread_t; /**< native thread */
typedef pthread_key_t apr_os_threadkey_t; /**< native thread address
typedef pthread_t fspr_os_thread_t; /**< native thread */
typedef pthread_key_t fspr_os_threadkey_t; /**< native thread address
* space */
#endif
typedef pid_t apr_os_proc_t; /**< native pid */
typedef struct timeval apr_os_imp_time_t; /**< native timeval */
typedef struct tm apr_os_exp_time_t; /**< native tm */
/** @var apr_os_dso_handle_t
typedef pid_t fspr_os_proc_t; /**< native pid */
typedef struct timeval fspr_os_imp_time_t; /**< native timeval */
typedef struct tm fspr_os_exp_time_t; /**< native tm */
/** @var fspr_os_dso_handle_t
* native dso types
*/
#if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
#include <dl.h>
typedef shl_t apr_os_dso_handle_t;
typedef shl_t fspr_os_dso_handle_t;
#elif defined(DARWIN)
#include <mach-o/dyld.h>
typedef NSModule apr_os_dso_handle_t;
typedef NSModule fspr_os_dso_handle_t;
#else
typedef void * apr_os_dso_handle_t;
typedef void * fspr_os_dso_handle_t;
#endif
typedef void* apr_os_shm_t; /**< native SHM */
typedef void* fspr_os_shm_t; /**< native SHM */
#endif
/**
* @typedef apr_os_sock_info_t
* @typedef fspr_os_sock_info_t
* @brief alias for local OS socket
*/
/**
* everything APR needs to know about an active socket to construct
* an APR socket from it; currently, this is platform-independent
*/
struct apr_os_sock_info_t {
apr_os_sock_t *os_sock; /**< always required */
struct fspr_os_sock_info_t {
fspr_os_sock_t *os_sock; /**< always required */
struct sockaddr *local; /**< NULL if not yet bound */
struct sockaddr *remote; /**< NULL if not connected */
int family; /**< always required (APR_INET, APR_INET6, etc.) */
@@ -189,28 +189,28 @@ struct apr_os_sock_info_t {
int protocol; /**< 0 or actual protocol (APR_PROTO_SCTP, APR_PROTO_TCP, etc.) */
};
typedef struct apr_os_sock_info_t apr_os_sock_info_t;
typedef struct fspr_os_sock_info_t fspr_os_sock_info_t;
#if APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN)
/** Opaque global mutex type */
#define apr_os_global_mutex_t apr_os_proc_mutex_t
/** @return apr_os_global_mutex */
#define apr_os_global_mutex_get apr_os_proc_mutex_get
#define fspr_os_global_mutex_t fspr_os_proc_mutex_t
/** @return fspr_os_global_mutex */
#define fspr_os_global_mutex_get fspr_os_proc_mutex_get
#else
/** Thread and process mutex for those platforms where process mutexes
* are not held in threads.
*/
struct apr_os_global_mutex_t {
apr_pool_t *pool;
apr_proc_mutex_t *proc_mutex;
struct fspr_os_global_mutex_t {
fspr_pool_t *pool;
fspr_proc_mutex_t *proc_mutex;
#if APR_HAS_THREADS
apr_thread_mutex_t *thread_mutex;
fspr_thread_mutex_t *thread_mutex;
#endif /* APR_HAS_THREADS */
};
typedef struct apr_os_global_mutex_t apr_os_global_mutex_t;
typedef struct fspr_os_global_mutex_t fspr_os_global_mutex_t;
APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmutex,
apr_global_mutex_t *pmutex);
APR_DECLARE(fspr_status_t) fspr_os_global_mutex_get(fspr_os_global_mutex_t *ospmutex,
fspr_global_mutex_t *pmutex);
#endif
@@ -221,60 +221,60 @@ APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmute
* @remark On Unix, it is only possible to get a file descriptor from
* an apr file type.
*/
APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile,
apr_file_t *file);
APR_DECLARE(fspr_status_t) fspr_os_file_get(fspr_os_file_t *thefile,
fspr_file_t *file);
/**
* convert the dir from apr type to os specific type.
* @param thedir The os specific dir we are converting to
* @param dir The apr dir to convert.
*/
APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir,
apr_dir_t *dir);
APR_DECLARE(fspr_status_t) fspr_os_dir_get(fspr_os_dir_t **thedir,
fspr_dir_t *dir);
/**
* Convert the socket from an apr type to an OS specific socket
* @param thesock The socket to convert.
* @param sock The os specifc equivelant of the apr socket..
*/
APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock,
apr_socket_t *sock);
APR_DECLARE(fspr_status_t) fspr_os_sock_get(fspr_os_sock_t *thesock,
fspr_socket_t *sock);
/**
* Convert the proc mutex from os specific type to apr type
* @param ospmutex The os specific proc mutex we are converting to.
* @param pmutex The apr proc mutex to convert.
*/
APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex,
apr_proc_mutex_t *pmutex);
APR_DECLARE(fspr_status_t) fspr_os_proc_mutex_get(fspr_os_proc_mutex_t *ospmutex,
fspr_proc_mutex_t *pmutex);
/**
* Get the exploded time in the platforms native format.
* @param ostime the native time format
* @param aprtime the time to convert
*/
APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime,
apr_time_exp_t *aprtime);
APR_DECLARE(fspr_status_t) fspr_os_exp_time_get(fspr_os_exp_time_t **ostime,
fspr_time_exp_t *aprtime);
/**
* Get the imploded time in the platforms native format.
* @param ostime the native time format
* @param aprtime the time to convert
*/
APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime,
apr_time_t *aprtime);
APR_DECLARE(fspr_status_t) fspr_os_imp_time_get(fspr_os_imp_time_t **ostime,
fspr_time_t *aprtime);
/**
* convert the shm from apr type to os specific type.
* @param osshm The os specific shm representation
* @param shm The apr shm to convert.
*/
APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm,
apr_shm_t *shm);
APR_DECLARE(fspr_status_t) fspr_os_shm_get(fspr_os_shm_t *osshm,
fspr_shm_t *shm);
#if APR_HAS_THREADS || defined(DOXYGEN)
/**
* @defgroup apr_os_thread Thread portability Routines
* @defgroup fspr_os_thread Thread portability Routines
* @{
*/
/**
@@ -282,16 +282,16 @@ APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm,
* @param thethd The apr thread to convert
* @param thd The os specific thread we are converting to
*/
APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd,
apr_thread_t *thd);
APR_DECLARE(fspr_status_t) fspr_os_thread_get(fspr_os_thread_t **thethd,
fspr_thread_t *thd);
/**
* convert the thread private memory key to os specific type from an apr type.
* @param thekey The apr handle we are converting from.
* @param key The os specific handle we are converting to.
*/
APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey,
apr_threadkey_t *key);
APR_DECLARE(fspr_status_t) fspr_os_threadkey_get(fspr_os_threadkey_t *thekey,
fspr_threadkey_t *key);
/**
* convert the thread from os specific type to apr type.
@@ -299,9 +299,9 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey,
* @param thethd The os specific thread to convert
* @param cont The pool to use if it is needed.
*/
APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd,
apr_os_thread_t *thethd,
apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_os_thread_put(fspr_thread_t **thd,
fspr_os_thread_t *thethd,
fspr_pool_t *cont);
/**
* convert the thread private memory key from os specific type to apr type.
@@ -309,21 +309,21 @@ APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd,
* @param thekey The os specific handle to convert
* @param cont The pool to use if it is needed.
*/
APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key,
apr_os_threadkey_t *thekey,
apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_os_threadkey_put(fspr_threadkey_t **key,
fspr_os_threadkey_t *thekey,
fspr_pool_t *cont);
/**
* Get the thread ID
*/
APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void);
APR_DECLARE(fspr_os_thread_t) fspr_os_thread_current(void);
/**
* Compare two thread id's
* @param tid1 1st Thread ID to compare
* @param tid2 2nd Thread ID to compare
*/
APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1,
apr_os_thread_t tid2);
APR_DECLARE(int) fspr_os_thread_equal(fspr_os_thread_t tid1,
fspr_os_thread_t tid2);
/** @} */
#endif /* APR_HAS_THREADS */
@@ -337,9 +337,9 @@ APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1,
* @remark On Unix, it is only possible to put a file descriptor into
* an apr file type.
*/
APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file,
apr_os_file_t *thefile,
apr_int32_t flags, apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_os_file_put(fspr_file_t **file,
fspr_os_file_t *thefile,
fspr_int32_t flags, fspr_pool_t *cont);
/**
* convert the file from os specific type to apr type.
@@ -349,24 +349,24 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file,
* @remark On Unix, it is only possible to put a file descriptor into
* an apr file type.
*/
APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file,
apr_os_file_t *thefile,
apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_os_pipe_put(fspr_file_t **file,
fspr_os_file_t *thefile,
fspr_pool_t *cont);
/**
* convert the file from os specific type to apr type.
* @param file The apr file we are converting to.
* @param thefile The os specific pipe to convert
* @param register_cleanup A cleanup will be registered on the apr_file_t
* to issue apr_file_close().
* @param register_cleanup A cleanup will be registered on the fspr_file_t
* to issue fspr_file_close().
* @param cont The pool to use if it is needed.
* @remark On Unix, it is only possible to put a file descriptor into
* an apr file type.
*/
APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file,
apr_os_file_t *thefile,
APR_DECLARE(fspr_status_t) fspr_os_pipe_put_ex(fspr_file_t **file,
fspr_os_file_t *thefile,
int register_cleanup,
apr_pool_t *cont);
fspr_pool_t *cont);
/**
* convert the dir from os specific type to apr type.
@@ -374,35 +374,35 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file,
* @param thedir The os specific dir to convert
* @param cont The pool to use when creating to apr directory.
*/
APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir,
apr_os_dir_t *thedir,
apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_os_dir_put(fspr_dir_t **dir,
fspr_os_dir_t *thedir,
fspr_pool_t *cont);
/**
* Convert a socket from the os specific type to the apr type
* @param sock The pool to use.
* @param thesock The socket to convert to.
* @param cont The socket we are converting to an apr type.
* @remark If it is a true socket, it is best to call apr_os_sock_make()
* @remark If it is a true socket, it is best to call fspr_os_sock_make()
* and provide APR with more information about the socket.
*/
APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock,
apr_os_sock_t *thesock,
apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_os_sock_put(fspr_socket_t **sock,
fspr_os_sock_t *thesock,
fspr_pool_t *cont);
/**
* Create a socket from an existing descriptor and local and remote
* socket addresses.
* @param apr_sock The new socket that has been set up
* @param fspr_sock The new socket that has been set up
* @param os_sock_info The os representation of the socket handle and
* other characteristics of the socket
* @param cont The pool to use
* @remark If you only know the descriptor/handle or if it isn't really
* a true socket, use apr_os_sock_put() instead.
* a true socket, use fspr_os_sock_put() instead.
*/
APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock,
apr_os_sock_info_t *os_sock_info,
apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_os_sock_make(fspr_socket_t **fspr_sock,
fspr_os_sock_info_t *os_sock_info,
fspr_pool_t *cont);
/**
* Convert the proc mutex from os specific type to apr type
@@ -410,9 +410,9 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock,
* @param ospmutex The os specific proc mutex to convert.
* @param cont The pool to use if it is needed.
*/
APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex,
apr_os_proc_mutex_t *ospmutex,
apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_os_proc_mutex_put(fspr_proc_mutex_t **pmutex,
fspr_os_proc_mutex_t *ospmutex,
fspr_pool_t *cont);
/**
* Put the imploded time in the APR format.
@@ -420,9 +420,9 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex,
* @param ostime the time to convert
* @param cont the pool to use if necessary
*/
APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime,
apr_os_imp_time_t **ostime,
apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_os_imp_time_put(fspr_time_t *aprtime,
fspr_os_imp_time_t **ostime,
fspr_pool_t *cont);
/**
* Put the exploded time in the APR format.
@@ -430,9 +430,9 @@ APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime,
* @param ostime the time to convert
* @param cont the pool to use if necessary
*/
APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime,
apr_os_exp_time_t **ostime,
apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_os_exp_time_put(fspr_time_exp_t *aprtime,
fspr_os_exp_time_t **ostime,
fspr_pool_t *cont);
/**
* convert the shared memory from os specific type to apr type.
@@ -443,14 +443,14 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime,
* the memory block mapped. On non-fork architectures, this is typically
* some internal handle to pass the mapping from process to process.
*/
APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **shm,
apr_os_shm_t *osshm,
apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_os_shm_put(fspr_shm_t **shm,
fspr_os_shm_t *osshm,
fspr_pool_t *cont);
#if APR_HAS_DSO || defined(DOXYGEN)
/**
* @defgroup apr_os_dso DSO (Dynamic Loading) Portabiliity Routines
* @defgroup fspr_os_dso DSO (Dynamic Loading) Portabiliity Routines
* @{
*/
/**
@@ -459,23 +459,23 @@ APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **shm,
* @param thedso the os specific handle to convert
* @param pool the pool to use if it is needed
*/
APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **dso,
apr_os_dso_handle_t thedso,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_os_dso_handle_put(fspr_dso_handle_t **dso,
fspr_os_dso_handle_t thedso,
fspr_pool_t *pool);
/**
* convert the apr dso handle into an os specific one
* @param aprdso The apr dso handle to convert
* @param dso The os specific dso to return
*/
APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso,
apr_dso_handle_t *aprdso);
APR_DECLARE(fspr_status_t) fspr_os_dso_handle_get(fspr_os_dso_handle_t *dso,
fspr_dso_handle_t *aprdso);
#if APR_HAS_OS_UUID
/**
* Private: apr-util's apr_uuid module when supported by the platform
* Private: apr-util's fspr_uuid module when supported by the platform
*/
APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data);
APR_DECLARE(fspr_status_t) fspr_os_uuid_get(unsigned char *uuid_data);
#endif
/** @} */
@@ -486,16 +486,16 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data);
* Get the name of the system default characer set.
* @param pool the pool to allocate the name from, if needed
*/
APR_DECLARE(const char*) apr_os_default_encoding(apr_pool_t *pool);
APR_DECLARE(const char*) fspr_os_default_encoding(fspr_pool_t *pool);
/**
* Get the name of the current locale character set.
* @param pool the pool to allocate the name from, if needed
* @remark Defers to apr_os_default_encoding if the current locale's
* @remark Defers to fspr_os_default_encoding if the current locale's
* data can't be retreved on this system.
*/
APR_DECLARE(const char*) apr_os_locale_encoding(apr_pool_t *pool);
APR_DECLARE(const char*) fspr_os_locale_encoding(fspr_pool_t *pool);
/** @} */
@@ -18,20 +18,20 @@
#define APR_PROC_MUTEX_H
/**
* @file apr_proc_mutex.h
* @file fspr_proc_mutex.h
* @brief APR Process Locking Routines
*/
#include "apr.h"
#include "apr_pools.h"
#include "apr_errno.h"
#include "fspr.h"
#include "fspr_pools.h"
#include "fspr_errno.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_proc_mutex Process Locking Routines
* @defgroup fspr_proc_mutex Process Locking Routines
* @ingroup APR
* @{
*/
@@ -48,10 +48,10 @@ typedef enum {
APR_LOCK_PROC_PTHREAD, /**< POSIX pthread process-based locking */
APR_LOCK_POSIXSEM, /**< POSIX semaphore process-based locking */
APR_LOCK_DEFAULT /**< Use the default process lock */
} apr_lockmech_e;
} fspr_lockmech_e;
/** Opaque structure representing a process mutex. */
typedef struct apr_proc_mutex_t apr_proc_mutex_t;
typedef struct fspr_proc_mutex_t fspr_proc_mutex_t;
/* Function definitions */
@@ -72,14 +72,14 @@ typedef struct apr_proc_mutex_t apr_proc_mutex_t;
* APR_LOCK_DEFAULT pick the default mechanism for the platform
* </PRE>
* @param pool the pool from which to allocate the mutex.
* @see apr_lockmech_e
* @see fspr_lockmech_e
* @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports
* APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable.
*/
APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
APR_DECLARE(fspr_status_t) fspr_proc_mutex_create(fspr_proc_mutex_t **mutex,
const char *fname,
apr_lockmech_e mech,
apr_pool_t *pool);
fspr_lockmech_e mech,
fspr_pool_t *pool);
/**
* Re-open a mutex in a child process.
@@ -87,21 +87,21 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
* @param fname A file name to use if the mutex mechanism requires one. This
* argument should always be provided. The mutex code itself will
* determine if it should be used. This filename should be the
* same one that was passed to apr_proc_mutex_create().
* same one that was passed to fspr_proc_mutex_create().
* @param pool The pool to operate on.
* @remark This function must be called to maintain portability, even
* if the underlying lock mechanism does not require it.
*/
APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex,
APR_DECLARE(fspr_status_t) fspr_proc_mutex_child_init(fspr_proc_mutex_t **mutex,
const char *fname,
apr_pool_t *pool);
fspr_pool_t *pool);
/**
* Acquire the lock for the given mutex. If the mutex is already locked,
* the current thread will be put to sleep until the lock becomes available.
* @param mutex the mutex on which to acquire the lock.
*/
APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex);
APR_DECLARE(fspr_status_t) fspr_proc_mutex_lock(fspr_proc_mutex_t *mutex);
/**
* Attempt to acquire the lock for the given mutex. If the mutex has already
@@ -110,19 +110,19 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex);
* if the return value was APR_EBUSY, for portability reasons.
* @param mutex the mutex on which to attempt the lock acquiring.
*/
APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex);
APR_DECLARE(fspr_status_t) fspr_proc_mutex_trylock(fspr_proc_mutex_t *mutex);
/**
* Release the lock for the given mutex.
* @param mutex the mutex from which to release the lock.
*/
APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex);
APR_DECLARE(fspr_status_t) fspr_proc_mutex_unlock(fspr_proc_mutex_t *mutex);
/**
* Destroy the mutex and free the memory associated with the lock.
* @param mutex the mutex to destroy.
*/
APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex);
APR_DECLARE(fspr_status_t) fspr_proc_mutex_destroy(fspr_proc_mutex_t *mutex);
/**
* Destroy the mutex and free the memory associated with the lock.
@@ -130,30 +130,30 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex);
* @note This function is generally used to kill a cleanup on an already
* created mutex
*/
APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex);
APR_DECLARE(fspr_status_t) fspr_proc_mutex_cleanup(void *mutex);
/**
* Return the name of the lockfile for the mutex, or NULL
* if the mutex doesn't use a lock file
*/
APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex);
APR_DECLARE(const char *) fspr_proc_mutex_lockfile(fspr_proc_mutex_t *mutex);
/**
* Display the name of the mutex, as it relates to the actual method used.
* This matches the valid options for Apache's AcceptMutex directive
* @param mutex the name of the mutex
*/
APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex);
APR_DECLARE(const char *) fspr_proc_mutex_name(fspr_proc_mutex_t *mutex);
/**
* Display the name of the default mutex: APR_LOCK_DEFAULT
*/
APR_DECLARE(const char *) apr_proc_mutex_defname(void);
APR_DECLARE(const char *) fspr_proc_mutex_defname(void);
/**
* Get the pool used by this proc_mutex.
* @return apr_pool_t the pool
* @return fspr_pool_t the pool
*/
APR_POOL_DECLARE_ACCESSOR(proc_mutex);
+74
View File
@@ -0,0 +1,74 @@
/* 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_RANDOM_H
#define APR_RANDOM_H
#include <fspr_pools.h>
typedef struct fspr_crypto_hash_t fspr_crypto_hash_t;
typedef void fspr_crypto_hash_init_t(fspr_crypto_hash_t *hash);
typedef void fspr_crypto_hash_add_t(fspr_crypto_hash_t *hash,const void *data,
fspr_size_t bytes);
typedef void fspr_crypto_hash_finish_t(fspr_crypto_hash_t *hash,
unsigned char *result);
/* FIXME: make this opaque */
struct fspr_crypto_hash_t {
fspr_crypto_hash_init_t *init;
fspr_crypto_hash_add_t *add;
fspr_crypto_hash_finish_t *finish;
fspr_size_t size;
void *data;
};
APR_DECLARE(fspr_crypto_hash_t *) fspr_crypto_sha256_new(fspr_pool_t *p);
typedef struct fspr_random_t fspr_random_t;
APR_DECLARE(void) fspr_random_init(fspr_random_t *g,fspr_pool_t *p,
fspr_crypto_hash_t *pool_hash,
fspr_crypto_hash_t *key_hash,
fspr_crypto_hash_t *prng_hash);
APR_DECLARE(fspr_random_t *) fspr_random_standard_new(fspr_pool_t *p);
APR_DECLARE(void) fspr_random_add_entropy(fspr_random_t *g,
const void *entropy_,
fspr_size_t bytes);
APR_DECLARE(fspr_status_t) fspr_random_insecure_bytes(fspr_random_t *g,
void *random,
fspr_size_t bytes);
APR_DECLARE(fspr_status_t) fspr_random_secure_bytes(fspr_random_t *g,
void *random,
fspr_size_t bytes);
APR_DECLARE(void) fspr_random_barrier(fspr_random_t *g);
APR_DECLARE(fspr_status_t) fspr_random_secure_ready(fspr_random_t *r);
APR_DECLARE(fspr_status_t) fspr_random_insecure_ready(fspr_random_t *r);
/* Call this in the child after forking to mix the randomness
pools. Note that its generally a bad idea to fork a process with a
real PRNG in it - better to have the PRNG externally and get the
randomness from there. However, if you really must do it, then you
should supply all your entropy to all the PRNGs - don't worry, they
won't produce the same output.
Note that fspr_proc_fork() calls this for you, so only weird
applications need ever call it themselves.
*/
struct fspr_proc_t;
APR_DECLARE(void) fspr_random_after_fork(struct fspr_proc_t *proc);
#endif /* ndef APR_RANDOM_H */
@@ -28,17 +28,17 @@
#define APR_RING_H
/**
* @file apr_ring.h
* @file fspr_ring.h
* @brief APR Rings
*/
/*
* for offsetof()
*/
#include "apr_general.h"
#include "fspr_general.h"
/**
* @defgroup apr_ring Ring Macro Implementations
* @defgroup fspr_ring Ring Macro Implementations
* @ingroup APR
* A ring is a kind of doubly-linked list that can be manipulated
* without knowing where its head is.
@@ -18,20 +18,20 @@
#define APR_SHM_H
/**
* @file apr_shm.h
* @file fspr_shm.h
* @brief APR Shared Memory Routines
*/
#include "apr.h"
#include "apr_pools.h"
#include "apr_errno.h"
#include "fspr.h"
#include "fspr_pools.h"
#include "fspr_errno.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_shm Shared Memory Routines
* @defgroup fspr_shm Shared Memory Routines
* @ingroup APR
* @{
*/
@@ -40,7 +40,7 @@ extern "C" {
* Private, platform-specific data struture representing a shared memory
* segment.
*/
typedef struct apr_shm_t apr_shm_t;
typedef struct fspr_shm_t fspr_shm_t;
/**
* Create and make accessable a shared memory segment.
@@ -61,14 +61,14 @@ typedef struct apr_shm_t apr_shm_t;
* about the segment within the actual segment. In order to supply
* the caller with the requested size it may be necessary for the
* implementation to request a slightly greater segment length
* from the subsystem. In all cases, the apr_shm_baseaddr_get()
* from the subsystem. In all cases, the fspr_shm_baseaddr_get()
* function will return the first usable byte of memory.
*
*/
APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
apr_size_t reqsize,
APR_DECLARE(fspr_status_t) fspr_shm_create(fspr_shm_t **m,
fspr_size_t reqsize,
const char *filename,
apr_pool_t *pool);
fspr_pool_t *pool);
/**
* Remove shared memory segment associated with a filename.
@@ -79,14 +79,14 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
* name-based shared memory segments, and will return APR_ENOTIMPL on
* platforms without such support.
*/
APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_shm_remove(const char *filename,
fspr_pool_t *pool);
/**
* Destroy a shared memory segment and associated memory.
* @param m The shared memory segment structure to destroy.
*/
APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m);
APR_DECLARE(fspr_status_t) fspr_shm_destroy(fspr_shm_t *m);
/**
* Attach to a shared memory segment that was created
@@ -97,16 +97,16 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m);
* @param pool the pool from which to allocate the shared memory
* structure for this process.
*/
APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
APR_DECLARE(fspr_status_t) fspr_shm_attach(fspr_shm_t **m,
const char *filename,
apr_pool_t *pool);
fspr_pool_t *pool);
/**
* Detach from a shared memory segment without destroying it.
* @param m The shared memory structure representing the segment
* to detach from.
*/
APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m);
APR_DECLARE(fspr_status_t) fspr_shm_detach(fspr_shm_t *m);
/**
* Retrieve the base address of the shared memory segment.
@@ -117,14 +117,14 @@ APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m);
* the base address.
* @return address, aligned by APR_ALIGN_DEFAULT.
*/
APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m);
APR_DECLARE(void *) fspr_shm_baseaddr_get(const fspr_shm_t *m);
/**
* Retrieve the length of a shared memory segment in bytes.
* @param m The shared memory segment from which to retrieve
* the segment length.
*/
APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m);
APR_DECLARE(fspr_size_t) fspr_shm_size_get(const fspr_shm_t *m);
/**
* Get the pool used by this shared memory segment.
@@ -18,12 +18,12 @@
#define APR_SIGNAL_H
/**
* @file apr_signal.h
* @file fspr_signal.h
* @brief APR Signal Handling
*/
#include "apr.h"
#include "apr_pools.h"
#include "fspr.h"
#include "fspr_pools.h"
#if APR_HAVE_SIGNAL_H
#include <signal.h>
@@ -34,7 +34,7 @@ extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_signal Handling
* @defgroup fspr_signal Handling
* @ingroup APR
* @{
*/
@@ -54,21 +54,21 @@ extern "C" {
#endif
/** Function prototype for signal handlers */
typedef void apr_sigfunc_t(int);
typedef void fspr_sigfunc_t(int);
/**
* Set the signal handler function for a given signal
* @param signo The signal (eg... SIGWINCH)
* @param func the function to get called
*/
APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func);
APR_DECLARE(fspr_sigfunc_t *) fspr_signal(int signo, fspr_sigfunc_t * func);
#if defined(SIG_IGN) && !defined(SIG_ERR)
#define SIG_ERR ((apr_sigfunc_t *) -1)
#define SIG_ERR ((fspr_sigfunc_t *) -1)
#endif
#else /* !APR_HAVE_SIGACTION */
#define apr_signal(a, b) signal(a, b)
#define fspr_signal(a, b) signal(a, b)
#endif
@@ -77,28 +77,28 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func);
* @param signum The signal number
* @return The description of the signal
*/
APR_DECLARE(const char *) apr_signal_description_get(int signum);
APR_DECLARE(const char *) fspr_signal_description_get(int signum);
/**
* APR-private function for initializing the signal package
* @internal
* @param pglobal The internal, global pool
*/
void apr_signal_init(apr_pool_t *pglobal);
void fspr_signal_init(fspr_pool_t *pglobal);
/**
* Block the delivery of a particular signal
* @param signum The signal number
* @return status
*/
APR_DECLARE(apr_status_t) apr_signal_block(int signum);
APR_DECLARE(fspr_status_t) fspr_signal_block(int signum);
/**
* Enable the delivery of a particular signal
* @param signum The signal number
* @return status
*/
APR_DECLARE(apr_status_t) apr_signal_unblock(int signum);
APR_DECLARE(fspr_status_t) fspr_signal_unblock(int signum);
/** @} */
@@ -41,15 +41,15 @@
#define APR_STRINGS_H
/**
* @file apr_strings.h
* @file fspr_strings.h
* @brief APR Strings library
*/
#include "apr.h"
#include "apr_errno.h"
#include "apr_pools.h"
#include "fspr.h"
#include "fspr_errno.h"
#include "fspr_pools.h"
#define APR_WANT_IOVEC
#include "apr_want.h"
#include "fspr_want.h"
#if APR_HAVE_STDARG_H
#include <stdarg.h>
@@ -60,7 +60,7 @@ extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_strings String routines
* @defgroup fspr_strings String routines
* @ingroup APR
* @{
*/
@@ -73,7 +73,7 @@ extern "C" {
* this returns <0, if they are equivalent it returns 0, and if the
* first string is greater than second string it retuns >0.
*/
APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b);
APR_DECLARE(int) fspr_strnatcmp(char const *a, char const *b);
/**
* Do a natural order comparison of two strings ignoring the case of the
@@ -84,7 +84,7 @@ APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b);
* this returns <0, if they are equivalent it returns 0, and if the
* first string is greater than second string it retuns >0.
*/
APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b);
APR_DECLARE(int) fspr_strnatcasecmp(char const *a, char const *b);
/**
* duplicate a string into memory allocated out of a pool
@@ -92,7 +92,7 @@ APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b);
* @param s The string to duplicate
* @return The new string
*/
APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s);
APR_DECLARE(char *) fspr_pstrdup(fspr_pool_t *p, const char *s);
/**
* Create a null-terminated string by making a copy of a sequence
@@ -101,12 +101,12 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s);
* @param s The block of characters to duplicate
* @param n The number of characters to duplicate
* @return The new string
* @remark This is a faster alternative to apr_pstrndup, for use
* @remark This is a faster alternative to fspr_pstrndup, for use
* when you know that the string being duplicated really
* has 'n' or more characters. If the string might contain
* fewer characters, use apr_pstrndup.
* fewer characters, use fspr_pstrndup.
*/
APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n);
APR_DECLARE(char *) fspr_pstrmemdup(fspr_pool_t *p, const char *s, fspr_size_t n);
/**
* Duplicate at most n characters of a string into memory allocated
@@ -118,7 +118,7 @@ APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n);
* @remark The amount of memory allocated from the pool is the length
* of the returned string including the NUL terminator
*/
APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n);
APR_DECLARE(char *) fspr_pstrndup(fspr_pool_t *p, const char *s, fspr_size_t n);
/**
* Duplicate a block of memory.
@@ -128,7 +128,7 @@ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n);
* @param n The number of bytes to duplicate
* @return The new block of memory
*/
APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n);
APR_DECLARE(void *) fspr_pmemdup(fspr_pool_t *p, const void *m, fspr_size_t n);
/**
* Concatenate multiple strings, allocating memory out a pool
@@ -136,7 +136,7 @@ APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n);
* @param ... The strings to concatenate. The final string must be NULL
* @return The new string
*/
APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...);
APR_DECLARE_NONSTD(char *) fspr_pstrcat(fspr_pool_t *p, ...);
/**
* Concatenate multiple strings specified in a writev-style vector
@@ -146,8 +146,8 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...);
* @param nbytes (output) strlen of new string (pass in NULL to omit)
* @return The new string
*/
APR_DECLARE(char *) apr_pstrcatv(apr_pool_t *p, const struct iovec *vec,
apr_size_t nvec, apr_size_t *nbytes);
APR_DECLARE(char *) fspr_pstrcatv(fspr_pool_t *p, const struct iovec *vec,
fspr_size_t nvec, fspr_size_t *nbytes);
/**
* printf-style style printing routine. The data is output to a string
@@ -157,7 +157,7 @@ APR_DECLARE(char *) apr_pstrcatv(apr_pool_t *p, const struct iovec *vec,
* @param ap The arguments to use while printing the data
* @return The new string
*/
APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap);
APR_DECLARE(char *) fspr_pvsprintf(fspr_pool_t *p, const char *fmt, va_list ap);
/**
* printf-style style printing routine. The data is output to a string
@@ -167,7 +167,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap);
* @param ... The arguments to use while printing the data
* @return The new string
*/
APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...)
APR_DECLARE_NONSTD(char *) fspr_psprintf(fspr_pool_t *p, const char *fmt, ...)
__attribute__((format(printf,2,3)));
/**
@@ -184,16 +184,16 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...)
* @remark
* <PRE>
* Note the differences between this function and strncpy():
* 1) strncpy() doesn't always NUL terminate; apr_cpystrn() does.
* 1) strncpy() doesn't always NUL terminate; fspr_cpystrn() does.
* 2) strncpy() pads the destination string with NULs, which is often
* unnecessary; apr_cpystrn() does not.
* unnecessary; fspr_cpystrn() does not.
* 3) strncpy() returns a pointer to the beginning of the dst string;
* apr_cpystrn() returns a pointer to the NUL terminator of dst,
* fspr_cpystrn() returns a pointer to the NUL terminator of dst,
* to allow a check for truncation.
* </PRE>
*/
APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src,
apr_size_t dst_size);
APR_DECLARE(char *) fspr_cpystrn(char *dst, const char *src,
fspr_size_t dst_size);
/**
* Strip spaces from a string
@@ -202,7 +202,7 @@ APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src,
* @param src The string to rid the spaces from.
* @return The destination string, dest.
*/
APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src);
APR_DECLARE(char *) fspr_collapse_spaces(char *dest, const char *src);
/**
* Convert the arguments to a program from one string to an array of
@@ -211,66 +211,66 @@ APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src);
* @param argv_out Output location. This is a pointer to an array of strings.
* @param token_context Pool to use.
*/
APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str,
APR_DECLARE(fspr_status_t) fspr_tokenize_to_argv(const char *arg_str,
char ***argv_out,
apr_pool_t *token_context);
fspr_pool_t *token_context);
/**
* Split a string into separate null-terminated tokens. The tokens are
* delimited in the string by one or more characters from the sep
* argument.
* @param str The string to separate; this should be specified on the
* first call to apr_strtok() for a given string, and NULL
* first call to fspr_strtok() for a given string, and NULL
* on subsequent calls.
* @param sep The set of delimiters
* @param last Internal state saved by apr_strtok() between calls.
* @param last Internal state saved by fspr_strtok() between calls.
* @return The next token from the string
*/
APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last);
APR_DECLARE(char *) fspr_strtok(char *str, const char *sep, char **last);
/**
* @defgroup APR_Strings_Snprintf snprintf implementations
* @warning
* These are snprintf implementations based on apr_vformatter().
* These are snprintf implementations based on fspr_vformatter().
*
* Note that various standards and implementations disagree on the return
* value of snprintf, and side-effects due to %n in the formatting string.
* apr_snprintf (and apr_vsnprintf) behaves as follows:
* fspr_snprintf (and fspr_vsnprintf) behaves as follows:
*
* Process the format string until the entire string is exhausted, or
* the buffer fills. If the buffer fills then stop processing immediately
* (so no further %n arguments are processed), and return the buffer
* length. In all cases the buffer is NUL terminated. It will return the
* number of characters inserted into the buffer, not including the
* terminating NUL. As a special case, if len is 0, apr_snprintf will
* terminating NUL. As a special case, if len is 0, fspr_snprintf will
* return the number of characters that would have been inserted if
* the buffer had been infinite (in this case, *buffer can be NULL)
*
* In no event does apr_snprintf return a negative number.
* In no event does fspr_snprintf return a negative number.
* @{
*/
/**
* snprintf routine based on apr_vformatter. This means it understands the
* snprintf routine based on fspr_vformatter. This means it understands the
* same extensions.
* @param buf The buffer to write to
* @param len The size of the buffer
* @param format The format string
* @param ... The arguments to use to fill out the format string.
*/
APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len,
APR_DECLARE_NONSTD(int) fspr_snprintf(char *buf, fspr_size_t len,
const char *format, ...)
__attribute__((format(printf,3,4)));
/**
* vsnprintf routine based on apr_vformatter. This means it understands the
* vsnprintf routine based on fspr_vformatter. This means it understands the
* same extensions.
* @param buf The buffer to write to
* @param len The size of the buffer
* @param format The format string
* @param ap The arguments to use to fill out the format string.
*/
APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format,
APR_DECLARE(int) fspr_vsnprintf(char *buf, fspr_size_t len, const char *format,
va_list ap);
/** @} */
@@ -280,7 +280,7 @@ APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format,
* @param n The number to format
* @return The string representation of the number
*/
APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n);
APR_DECLARE(char *) fspr_itoa(fspr_pool_t *p, int n);
/**
* create a string representation of a long, allocated from a pool
@@ -288,18 +288,18 @@ APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n);
* @param n The number to format
* @return The string representation of the number
*/
APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n);
APR_DECLARE(char *) fspr_ltoa(fspr_pool_t *p, long n);
/**
* create a string representation of an apr_off_t, allocated from a pool
* create a string representation of an fspr_off_t, allocated from a pool
* @param p The pool from which to allocate
* @param n The number to format
* @return The string representation of the number
*/
APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n);
APR_DECLARE(char *) fspr_off_t_toa(fspr_pool_t *p, fspr_off_t n);
/**
* Convert a numeric string into an apr_off_t numeric value.
* Convert a numeric string into an fspr_off_t numeric value.
* @param offset The value of the parsed string.
* @param buf The string to parse. It may contain optional whitespace,
* followed by an optional '+' (positive, default) or '-' (negative)
@@ -312,7 +312,7 @@ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n);
* digits are prefixed with '0x', in which case it will be treated as
* base 16.
*/
APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *buf,
APR_DECLARE(fspr_status_t) fspr_strtoff(fspr_off_t *offset, const char *buf,
char **end, int base);
/**
@@ -330,25 +330,25 @@ APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *buf,
* @return The numeric value of the string. On overflow, errno is set
* to ERANGE.
*/
APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base);
APR_DECLARE(fspr_int64_t) fspr_strtoi64(const char *buf, char **end, int base);
/**
* parse a base-10 numeric string into a 64-bit numeric value.
* Equivalent to apr_strtoi64(buf, (char**)NULL, 10).
* Equivalent to fspr_strtoi64(buf, (char**)NULL, 10).
* @param buf The string to parse
* @return The numeric value of the string
*/
APR_DECLARE(apr_int64_t) apr_atoi64(const char *buf);
APR_DECLARE(fspr_int64_t) fspr_atoi64(const char *buf);
/**
* Format a binary size (magnitiudes are 2^10 rather than 10^3) from an apr_off_t,
* Format a binary size (magnitiudes are 2^10 rather than 10^3) from an fspr_off_t,
* as bytes, K, M, T, etc, to a four character compacted human readable string.
* @param size The size to format
* @param buf The 5 byte text buffer (counting the trailing null)
* @return The buf passed to apr_strfsize()
* @remark All negative sizes report ' - ', apr_strfsize only formats positive values.
* @return The buf passed to fspr_strfsize()
* @remark All negative sizes report ' - ', fspr_strfsize only formats positive values.
*/
APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf);
APR_DECLARE(char *) fspr_strfsize(fspr_off_t size, char *buf);
/** @} */
@@ -18,20 +18,20 @@
#define APR_SUPPORT_H
/**
* @file apr_support.h
* @file fspr_support.h
* @brief APR Support functions
*/
#include "apr.h"
#include "apr_network_io.h"
#include "apr_file_io.h"
#include "fspr.h"
#include "fspr_network_io.h"
#include "fspr_file_io.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_support Internal APR support functions
* @defgroup fspr_support Internal APR support functions
* @ingroup APR
* @{
*/
@@ -41,7 +41,7 @@ extern "C" {
*
* Uses POOL for temporary allocations.
*/
apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s,
fspr_status_t fspr_wait_for_io_or_timeout(fspr_file_t *f, fspr_socket_t *s,
int for_read);
/** @} */
@@ -18,12 +18,12 @@
#define APR_TABLES_H
/**
* @file apr_tables.h
* @file fspr_tables.h
* @brief APR Table library
*/
#include "apr.h"
#include "apr_pools.h"
#include "fspr.h"
#include "fspr_pools.h"
#if APR_HAVE_STDARG_H
#include <stdarg.h> /* for va_list */
@@ -34,7 +34,7 @@ extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_tables Table and Array Functions
* @defgroup fspr_tables Table and Array Functions
* @ingroup APR
* Tables are used to store entirely opaque structures
* for applications, while Arrays are usually used to
@@ -43,15 +43,15 @@ extern "C" {
*/
/** the table abstract data type */
typedef struct apr_table_t apr_table_t;
typedef struct fspr_table_t fspr_table_t;
/** @see apr_array_header_t */
typedef struct apr_array_header_t apr_array_header_t;
/** @see fspr_array_header_t */
typedef struct fspr_array_header_t fspr_array_header_t;
/** An opaque array type */
struct apr_array_header_t {
struct fspr_array_header_t {
/** The pool the array is allocated out of */
apr_pool_t *pool;
fspr_pool_t *pool;
/** The amount of memory allocated for each element of the array */
int elt_size;
/** The number of active elements in the array */
@@ -65,10 +65,10 @@ struct apr_array_header_t {
/**
* The (opaque) structure for string-content tables.
*/
typedef struct apr_table_entry_t apr_table_entry_t;
typedef struct fspr_table_entry_t fspr_table_entry_t;
/** The type for each entry in a string-content table */
struct apr_table_entry_t {
struct fspr_table_entry_t {
/** The key for the current table entry */
char *key; /* maybe NULL in future;
* check when iterating thru table_elts
@@ -76,8 +76,8 @@ struct apr_table_entry_t {
/** The value for the current table entry */
char *val;
/** A checksum for the key, for use by the apr_table internals */
apr_uint32_t key_checksum;
/** A checksum for the key, for use by the fspr_table internals */
fspr_uint32_t key_checksum;
};
/**
@@ -85,21 +85,21 @@ struct apr_table_entry_t {
* @param t The table
* @return An array containing the contents of the table
*/
APR_DECLARE(const apr_array_header_t *) apr_table_elts(const apr_table_t *t);
APR_DECLARE(const fspr_array_header_t *) fspr_table_elts(const fspr_table_t *t);
/**
* Determine if the table is empty
* @param t The table to check
* @return True if empty, False otherwise
*/
APR_DECLARE(int) apr_is_empty_table(const apr_table_t *t);
APR_DECLARE(int) fspr_is_empty_table(const fspr_table_t *t);
/**
* Determine if the array is empty
* @param a The array to check
* @return True if empty, False otherwise
*/
APR_DECLARE(int) apr_is_empty_array(const apr_array_header_t *a);
APR_DECLARE(int) fspr_is_empty_array(const fspr_array_header_t *a);
/**
* Create an array
@@ -108,7 +108,7 @@ APR_DECLARE(int) apr_is_empty_array(const apr_array_header_t *a);
* @param elt_size The size of each element in the array.
* @return The new array
*/
APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p,
APR_DECLARE(fspr_array_header_t *) fspr_array_make(fspr_pool_t *p,
int nelts, int elt_size);
/**
@@ -118,7 +118,7 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p,
* @remark If there are no free spots in the array, then this function will
* allocate new space for the new element.
*/
APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr);
APR_DECLARE(void *) fspr_array_push(fspr_array_header_t *arr);
/** A helper macro for accessing a member of an APR array.
*
@@ -137,7 +137,7 @@ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr);
*
* @return the location where the new object should be placed
*/
#define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary)))
#define APR_ARRAY_PUSH(ary,type) (*((type *)fspr_array_push(ary)))
/**
* Remove an element from an array (as a first-in, last-out stack)
@@ -145,7 +145,7 @@ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr);
* @return Location of the element in the array.
* @remark If there are no elements in the array, NULL is returned.
*/
APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr);
APR_DECLARE(void *) fspr_array_pop(fspr_array_header_t *arr);
/**
* Remove all elements from an array.
@@ -153,7 +153,7 @@ APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr);
* @remark As the underlying storage is allocated from a pool, no
* memory is freed by this operation, but is available for reuse.
*/
APR_DECLARE(void) apr_array_clear(apr_array_header_t *arr);
APR_DECLARE(void) fspr_array_clear(fspr_array_header_t *arr);
/**
* Concatenate two arrays together
@@ -161,30 +161,30 @@ APR_DECLARE(void) apr_array_clear(apr_array_header_t *arr);
* array
* @param src The source array to add to the destination array
*/
APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst,
const apr_array_header_t *src);
APR_DECLARE(void) fspr_array_cat(fspr_array_header_t *dst,
const fspr_array_header_t *src);
/**
* Copy the entire array
* @param p The pool to allocate the copy of the array out of
* @param arr The array to copy
* @return An exact copy of the array passed in
* @remark The alternate apr_array_copy_hdr copies only the header, and arranges
* @remark The alternate fspr_array_copy_hdr copies only the header, and arranges
* for the elements to be copied if (and only if) the code subsequently
* does a push or arraycat.
*/
APR_DECLARE(apr_array_header_t *) apr_array_copy(apr_pool_t *p,
const apr_array_header_t *arr);
APR_DECLARE(fspr_array_header_t *) fspr_array_copy(fspr_pool_t *p,
const fspr_array_header_t *arr);
/**
* Copy the headers of the array, and arrange for the elements to be copied if
* and only if the code subsequently does a push or arraycat.
* @param p The pool to allocate the copy of the array out of
* @param arr The array to copy
* @return An exact copy of the array passed in
* @remark The alternate apr_array_copy copies the *entire* array.
* @remark The alternate fspr_array_copy copies the *entire* array.
*/
APR_DECLARE(apr_array_header_t *) apr_array_copy_hdr(apr_pool_t *p,
const apr_array_header_t *arr);
APR_DECLARE(fspr_array_header_t *) fspr_array_copy_hdr(fspr_pool_t *p,
const fspr_array_header_t *arr);
/**
* Append one array to the end of another, creating a new array in the process.
@@ -193,12 +193,12 @@ APR_DECLARE(apr_array_header_t *) apr_array_copy_hdr(apr_pool_t *p,
* @param second The array to put second in the new array.
* @return A new array containing the data from the two arrays passed in.
*/
APR_DECLARE(apr_array_header_t *) apr_array_append(apr_pool_t *p,
const apr_array_header_t *first,
const apr_array_header_t *second);
APR_DECLARE(fspr_array_header_t *) fspr_array_append(fspr_pool_t *p,
const fspr_array_header_t *first,
const fspr_array_header_t *second);
/**
* Generates a new string from the apr_pool_t containing the concatenated
* Generates a new string from the fspr_pool_t containing the concatenated
* sequence of substrings referenced as elements within the array. The string
* will be empty if all substrings are empty or null, or if there are no
* elements in the array. If sep is non-NUL, it will be inserted between
@@ -208,8 +208,8 @@ APR_DECLARE(apr_array_header_t *) apr_array_append(apr_pool_t *p,
* @param sep The separator to use
* @return A string containing all of the data in the array.
*/
APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p,
const apr_array_header_t *arr,
APR_DECLARE(char *) fspr_array_pstrcat(fspr_pool_t *p,
const fspr_array_header_t *arr,
const char sep);
/**
@@ -219,7 +219,7 @@ APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p,
* @return The new table.
* @warning This table can only store text data
*/
APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts);
APR_DECLARE(fspr_table_t *) fspr_table_make(fspr_pool_t *p, int nelts);
/**
* Create a new table and copy another table into it
@@ -227,14 +227,14 @@ APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts);
* @param t The table to copy
* @return A copy of the table passed in
*/
APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p,
const apr_table_t *t);
APR_DECLARE(fspr_table_t *) fspr_table_copy(fspr_pool_t *p,
const fspr_table_t *t);
/**
* Delete all of the elements from a table
* @param t The table to clear
*/
APR_DECLARE(void) apr_table_clear(apr_table_t *t);
APR_DECLARE(void) fspr_table_clear(fspr_table_t *t);
/**
* Get the value associated with a given key from the table. After this call,
@@ -243,7 +243,7 @@ APR_DECLARE(void) apr_table_clear(apr_table_t *t);
* @param key The key to search for
* @return The value associated with the key, or NULL if the key does not exist.
*/
APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key);
APR_DECLARE(const char *) fspr_table_get(const fspr_table_t *t, const char *key);
/**
* Add a key/value pair to a table, if another element already exists with the
@@ -254,7 +254,7 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key);
* @remark When adding data, this function makes a copy of both the key and the
* value.
*/
APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key,
APR_DECLARE(void) fspr_table_set(fspr_table_t *t, const char *key,
const char *val);
/**
@@ -267,7 +267,7 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key,
* the value, so care should be taken to ensure that the values will
* not change after they have been added..
*/
APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key,
APR_DECLARE(void) fspr_table_setn(fspr_table_t *t, const char *key,
const char *val);
/**
@@ -275,7 +275,7 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key,
* @param t The table to remove data from
* @param key The key of the data being removed
*/
APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key);
APR_DECLARE(void) fspr_table_unset(fspr_table_t *t, const char *key);
/**
* Add data to a table by merging the value with data that has already been
@@ -283,9 +283,9 @@ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key);
* @param t The table to search for the data
* @param key The key to merge data for
* @param val The data to add
* @remark If the key is not found, then this function acts like apr_table_add
* @remark If the key is not found, then this function acts like fspr_table_add
*/
APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key,
APR_DECLARE(void) fspr_table_merge(fspr_table_t *t, const char *key,
const char *val);
/**
@@ -294,9 +294,9 @@ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key,
* @param t The table to search for the data
* @param key The key to merge data for
* @param val The data to add
* @remark If the key is not found, then this function acts like apr_table_addn
* @remark If the key is not found, then this function acts like fspr_table_addn
*/
APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key,
APR_DECLARE(void) fspr_table_mergen(fspr_table_t *t, const char *key,
const char *val);
/**
@@ -308,7 +308,7 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key,
* @remark When adding data, this function makes a copy of both the key and the
* value.
*/
APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key,
APR_DECLARE(void) fspr_table_add(fspr_table_t *t, const char *key,
const char *val);
/**
@@ -321,7 +321,7 @@ APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key,
* value, so care should be taken to ensure that the values will not
* change after they have been added..
*/
APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key,
APR_DECLARE(void) fspr_table_addn(fspr_table_t *t, const char *key,
const char *val);
/**
@@ -331,21 +331,21 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key,
* @param base The table to add at the end of the new table
* @return A new table containing all of the data from the two passed in
*/
APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p,
const apr_table_t *overlay,
const apr_table_t *base);
APR_DECLARE(fspr_table_t *) fspr_table_overlay(fspr_pool_t *p,
const fspr_table_t *overlay,
const fspr_table_t *base);
/**
* Declaration prototype for the iterator callback function of apr_table_do()
* and apr_table_vdo().
* @param rec The data passed as the first argument to apr_table_[v]do()
* Declaration prototype for the iterator callback function of fspr_table_do()
* and fspr_table_vdo().
* @param rec The data passed as the first argument to fspr_table_[v]do()
* @param key The key from this iteration of the table
* @param value The value from this iteration of the table
* @remark Iteration continues while this callback function returns non-zero.
* To export the callback function for apr_table_[v]do() it must be declared
* To export the callback function for fspr_table_[v]do() it must be declared
* in the _NONSTD convention.
*/
typedef int (apr_table_do_callback_fn_t)(void *rec, const char *key,
typedef int (fspr_table_do_callback_fn_t)(void *rec, const char *key,
const char *value);
/**
@@ -362,10 +362,10 @@ typedef int (apr_table_do_callback_fn_t)(void *rec, const char *key,
* are run.
* @return FALSE if one of the comp() iterations returned zero; TRUE if all
* iterations returned non-zero
* @see apr_table_do_callback_fn_t
* @see fspr_table_do_callback_fn_t
*/
APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp,
void *rec, const apr_table_t *t, ...);
APR_DECLARE_NONSTD(int) fspr_table_do(fspr_table_do_callback_fn_t *comp,
void *rec, const fspr_table_t *t, ...);
/**
* Iterate over a table running the provided function once for every
@@ -381,14 +381,14 @@ APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp,
* whose key matches are run.
* @return FALSE if one of the comp() iterations returned zero; TRUE if all
* iterations returned non-zero
* @see apr_table_do_callback_fn_t
* @see fspr_table_do_callback_fn_t
*/
APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp,
void *rec, const apr_table_t *t, va_list vp);
APR_DECLARE(int) fspr_table_vdo(fspr_table_do_callback_fn_t *comp,
void *rec, const fspr_table_t *t, va_list vp);
/** flag for overlap to use apr_table_setn */
/** flag for overlap to use fspr_table_setn */
#define APR_OVERLAP_TABLES_SET (0)
/** flag for overlap to use apr_table_mergen */
/** flag for overlap to use fspr_table_mergen */
#define APR_OVERLAP_TABLES_MERGE (1)
/**
* For each element in table b, either use setn or mergen to add the data
@@ -396,25 +396,25 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp,
* @param a The table to add the data to.
* @param b The table to iterate over, adding its data to table a
* @param flags How to add the table to table a. One of:
* APR_OVERLAP_TABLES_SET Use apr_table_setn
* APR_OVERLAP_TABLES_MERGE Use apr_table_mergen
* APR_OVERLAP_TABLES_SET Use fspr_table_setn
* APR_OVERLAP_TABLES_MERGE Use fspr_table_mergen
* @remark This function is highly optimized, and uses less memory and CPU cycles
* than a function that just loops through table b calling other functions.
*/
/**
*<PRE>
* Conceptually, apr_table_overlap does this:
* Conceptually, fspr_table_overlap does this:
*
* apr_array_header_t *barr = apr_table_elts(b);
* apr_table_entry_t *belt = (apr_table_entry_t *)barr->elts;
* fspr_array_header_t *barr = fspr_table_elts(b);
* fspr_table_entry_t *belt = (fspr_table_entry_t *)barr->elts;
* int i;
*
* for (i = 0; i < barr->nelts; ++i) {
* if (flags & APR_OVERLAP_TABLES_MERGE) {
* apr_table_mergen(a, belt[i].key, belt[i].val);
* fspr_table_mergen(a, belt[i].key, belt[i].val);
* }
* else {
* apr_table_setn(a, belt[i].key, belt[i].val);
* fspr_table_setn(a, belt[i].key, belt[i].val);
* }
* }
*
@@ -427,7 +427,7 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp,
* </PRE>
*/
APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b,
APR_DECLARE(void) fspr_table_overlap(fspr_table_t *a, const fspr_table_t *b,
unsigned flags);
/**
@@ -438,7 +438,7 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b,
* @param flags APR_OVERLAP_TABLES_MERGE to merge, or
* APR_OVERLAP_TABLES_SET to overwrite
*/
APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags);
APR_DECLARE(void) fspr_table_compress(fspr_table_t *t, unsigned flags);
/** @} */
@@ -18,15 +18,15 @@
#define APR_THREAD_COND_H
/**
* @file apr_thread_cond.h
* @file fspr_thread_cond.h
* @brief APR Condition Variable Routines
*/
#include "apr.h"
#include "apr_pools.h"
#include "apr_errno.h"
#include "apr_time.h"
#include "apr_thread_mutex.h"
#include "fspr.h"
#include "fspr_pools.h"
#include "fspr_errno.h"
#include "fspr_time.h"
#include "fspr_thread_mutex.h"
#ifdef __cplusplus
extern "C" {
@@ -35,13 +35,13 @@ extern "C" {
#if APR_HAS_THREADS || defined(DOXYGEN)
/**
* @defgroup apr_thread_cond Condition Variable Routines
* @defgroup fspr_thread_cond Condition Variable Routines
* @ingroup APR
* @{
*/
/** Opaque structure for thread condition variables */
typedef struct apr_thread_cond_t apr_thread_cond_t;
typedef struct fspr_thread_cond_t fspr_thread_cond_t;
/**
* Note: destroying a condition variable (or likewise, destroying or
@@ -56,8 +56,8 @@ typedef struct apr_thread_cond_t apr_thread_cond_t;
* will be stored.
* @param pool the pool from which to allocate the mutex.
*/
APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_thread_cond_create(fspr_thread_cond_t **cond,
fspr_pool_t *pool);
/**
* Put the active calling thread to sleep until signaled to wake up. Each
@@ -71,8 +71,8 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond,
* is released while the thread is asleep, and is again acquired before
* returning from this function.
*/
APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond,
apr_thread_mutex_t *mutex);
APR_DECLARE(fspr_status_t) fspr_thread_cond_wait(fspr_thread_cond_t *cond,
fspr_thread_mutex_t *mutex);
/**
* Put the active calling thread to sleep until signaled to wake up or
@@ -90,9 +90,9 @@ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond,
* will wake up before this time, otherwise the error APR_TIMEUP
* is returned.
*/
APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond,
apr_thread_mutex_t *mutex,
apr_interval_time_t timeout);
APR_DECLARE(fspr_status_t) fspr_thread_cond_timedwait(fspr_thread_cond_t *cond,
fspr_thread_mutex_t *mutex,
fspr_interval_time_t timeout);
/**
* Signals a single thread, if one exists, that is blocking on the given
@@ -101,7 +101,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond,
* is desired, that mutex must be locked while calling this function.
* @param cond the condition variable on which to produce the signal.
*/
APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond);
APR_DECLARE(fspr_status_t) fspr_thread_cond_signal(fspr_thread_cond_t *cond);
/**
* Signals all threads blocking on the given condition variable.
@@ -109,17 +109,17 @@ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond);
* the associated mutex. This will happen in a serialized manner.
* @param cond the condition variable on which to produce the broadcast.
*/
APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond);
APR_DECLARE(fspr_status_t) fspr_thread_cond_broadcast(fspr_thread_cond_t *cond);
/**
* Destroy the condition variable and free the associated memory.
* @param cond the condition variable to destroy.
*/
APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond);
APR_DECLARE(fspr_status_t) fspr_thread_cond_destroy(fspr_thread_cond_t *cond);
/**
* Get the pool used by this thread_cond.
* @return apr_pool_t the pool
* @return fspr_pool_t the pool
*/
APR_POOL_DECLARE_ACCESSOR(thread_cond);
@@ -18,12 +18,12 @@
#define APR_THREAD_MUTEX_H
/**
* @file apr_thread_mutex.h
* @file fspr_thread_mutex.h
* @brief APR Thread Mutex Routines
*/
#include "apr.h"
#include "apr_errno.h"
#include "fspr.h"
#include "fspr_errno.h"
#ifdef __cplusplus
extern "C" {
@@ -32,20 +32,20 @@ extern "C" {
#if APR_HAS_THREADS || defined(DOXYGEN)
/**
* @defgroup apr_thread_mutex Thread Mutex Routines
* @defgroup fspr_thread_mutex Thread Mutex Routines
* @ingroup APR
* @{
*/
/** Opaque thread-local mutex structure */
typedef struct apr_thread_mutex_t apr_thread_mutex_t;
typedef struct fspr_thread_mutex_t fspr_thread_mutex_t;
#define APR_THREAD_MUTEX_DEFAULT 0x0 /**< platform-optimal lock behavior */
#define APR_THREAD_MUTEX_NESTED 0x1 /**< enable nested (recursive) locks */
#define APR_THREAD_MUTEX_UNNESTED 0x2 /**< disable nested locks */
/* Delayed the include to avoid a circular reference */
#include "apr_pools.h"
#include "fspr_pools.h"
/**
* Create and initialize a mutex that can be used to synchronize threads.
@@ -62,15 +62,15 @@ typedef struct apr_thread_mutex_t apr_thread_mutex_t;
* most optimial mutex based on a given platform's performance charateristics,
* it will behave as either a nested or an unnested lock.
*/
APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex,
APR_DECLARE(fspr_status_t) fspr_thread_mutex_create(fspr_thread_mutex_t **mutex,
unsigned int flags,
apr_pool_t *pool);
fspr_pool_t *pool);
/**
* Acquire the lock for the given mutex. If the mutex is already locked,
* the current thread will be put to sleep until the lock becomes available.
* @param mutex the mutex on which to acquire the lock.
*/
APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex);
APR_DECLARE(fspr_status_t) fspr_thread_mutex_lock(fspr_thread_mutex_t *mutex);
/**
* Attempt to acquire the lock for the given mutex. If the mutex has already
@@ -79,23 +79,23 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex);
* if the return value was APR_EBUSY, for portability reasons.
* @param mutex the mutex on which to attempt the lock acquiring.
*/
APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex);
APR_DECLARE(fspr_status_t) fspr_thread_mutex_trylock(fspr_thread_mutex_t *mutex);
/**
* Release the lock for the given mutex.
* @param mutex the mutex from which to release the lock.
*/
APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex);
APR_DECLARE(fspr_status_t) fspr_thread_mutex_unlock(fspr_thread_mutex_t *mutex);
/**
* Destroy the mutex and free the memory associated with the lock.
* @param mutex the mutex to destroy.
*/
APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex);
APR_DECLARE(fspr_status_t) fspr_thread_mutex_destroy(fspr_thread_mutex_t *mutex);
/**
* Get the pool used by this thread_mutex.
* @return apr_pool_t the pool
* @return fspr_pool_t the pool
*/
APR_POOL_DECLARE_ACCESSOR(thread_mutex);
@@ -18,14 +18,14 @@
#define APR_THREAD_PROC_H
/**
* @file apr_thread_proc.h
* @file fspr_thread_proc.h
* @brief APR Thread and Process Library
*/
#include "apr.h"
#include "apr_file_io.h"
#include "apr_pools.h"
#include "apr_errno.h"
#include "fspr.h"
#include "fspr_file_io.h"
#include "fspr_pools.h"
#include "fspr_errno.h"
#if APR_HAVE_STRUCT_RLIMIT
#include <sys/time.h>
@@ -37,7 +37,7 @@ extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_thread_proc Threads and Process Functions
* @defgroup fspr_thread_proc Threads and Process Functions
* @ingroup APR
* @{
*/
@@ -50,12 +50,12 @@ typedef enum {
APR_SHELLCMD_ENV /**< use the shell to invoke the program,
* replicating our environment
*/
} apr_cmdtype_e;
} fspr_cmdtype_e;
typedef enum {
APR_WAIT, /**< wait for the specified process to finish */
APR_NOWAIT /**< do not wait -- just see if it has finished */
} apr_wait_how_e;
} fspr_wait_how_e;
/* I am specifically calling out the values so that the macros below make
* more sense. Yes, I know I don't need to, but I am hoping this makes what
@@ -66,7 +66,7 @@ typedef enum {
APR_PROC_EXIT = 1, /**< process exited normally */
APR_PROC_SIGNAL = 2, /**< process exited due to a signal */
APR_PROC_SIGNAL_CORE = 4 /**< process exited and dumped a core file */
} apr_exit_why_e;
} fspr_exit_why_e;
/** did we exit the process */
#define APR_PROC_CHECK_EXIT(x) (x & APR_PROC_EXIT)
@@ -75,25 +75,25 @@ typedef enum {
/** did we get core */
#define APR_PROC_CHECK_CORE_DUMP(x) (x & APR_PROC_SIGNAL_CORE)
/** @see apr_procattr_io_set */
/** @see fspr_procattr_io_set */
#define APR_NO_PIPE 0
/** @see apr_procattr_io_set */
/** @see fspr_procattr_io_set */
#define APR_FULL_BLOCK 1
/** @see apr_procattr_io_set */
/** @see fspr_procattr_io_set */
#define APR_FULL_NONBLOCK 2
/** @see apr_procattr_io_set */
/** @see fspr_procattr_io_set */
#define APR_PARENT_BLOCK 3
/** @see apr_procattr_io_set */
/** @see fspr_procattr_io_set */
#define APR_CHILD_BLOCK 4
/** @see apr_procattr_limit_set */
/** @see fspr_procattr_limit_set */
#define APR_LIMIT_CPU 0
/** @see apr_procattr_limit_set */
/** @see fspr_procattr_limit_set */
#define APR_LIMIT_MEM 1
/** @see apr_procattr_limit_set */
/** @see fspr_procattr_limit_set */
#define APR_LIMIT_NPROC 2
/** @see apr_procattr_limit_set */
/** @see fspr_procattr_limit_set */
#define APR_LIMIT_NOFILE 3
/**
@@ -119,15 +119,15 @@ typedef enum {
/** @} */
/** The APR process type */
typedef struct apr_proc_t {
typedef struct fspr_proc_t {
/** The process ID */
pid_t pid;
/** Parent's side of pipe to child's stdin */
apr_file_t *in;
fspr_file_t *in;
/** Parent's side of pipe to child's stdout */
apr_file_t *out;
fspr_file_t *out;
/** Parent's side of pipe to child's stdouterr */
apr_file_t *err;
fspr_file_t *err;
#if APR_HAS_PROC_INVOKED || defined(DOXYGEN)
/** Diagnositics/debugging string of the command invoked for
* this process [only present if APR_HAS_PROC_INVOKED is true]
@@ -147,51 +147,51 @@ typedef struct apr_proc_t {
*/
HANDLE hproc;
#endif
} apr_proc_t;
} fspr_proc_t;
/**
* The prototype for APR child errfn functions. (See the description
* of apr_procattr_child_errfn_set() for more information.)
* of fspr_procattr_child_errfn_set() for more information.)
* It is passed the following parameters:
* @param pool Pool associated with the apr_proc_t. If your child
* @param pool Pool associated with the fspr_proc_t. If your child
* error function needs user data, associate it with this
* pool.
* @param err APR error code describing the error
* @param description Text description of type of processing which failed
*/
typedef void (apr_child_errfn_t)(apr_pool_t *proc, apr_status_t err,
typedef void (fspr_child_errfn_t)(fspr_pool_t *proc, fspr_status_t err,
const char *description);
/** Opaque Thread structure. */
typedef struct apr_thread_t apr_thread_t;
typedef struct fspr_thread_t fspr_thread_t;
/** Opaque Thread attributes structure. */
typedef struct apr_threadattr_t apr_threadattr_t;
typedef struct fspr_threadattr_t fspr_threadattr_t;
/** Opaque Process attributes structure. */
typedef struct apr_procattr_t apr_procattr_t;
typedef struct fspr_procattr_t fspr_procattr_t;
/** Opaque control variable for one-time atomic variables. */
typedef struct apr_thread_once_t apr_thread_once_t;
typedef struct fspr_thread_once_t fspr_thread_once_t;
/** Opaque thread private address space. */
typedef struct apr_threadkey_t apr_threadkey_t;
typedef struct fspr_threadkey_t fspr_threadkey_t;
/** Opaque record of child process. */
typedef struct apr_other_child_rec_t apr_other_child_rec_t;
typedef struct fspr_other_child_rec_t fspr_other_child_rec_t;
/**
* The prototype for any APR thread worker functions.
*/
typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(apr_thread_t*, void*);
typedef void *(APR_THREAD_FUNC *fspr_thread_start_t)(fspr_thread_t*, void*);
typedef enum {
APR_KILL_NEVER, /**< process is never sent any signals */
APR_KILL_ALWAYS, /**< process is sent SIGKILL on apr_pool_t cleanup */
APR_KILL_ALWAYS, /**< process is sent SIGKILL on fspr_pool_t cleanup */
APR_KILL_AFTER_TIMEOUT, /**< SIGTERM, wait 3 seconds, SIGKILL */
APR_JUST_WAIT, /**< wait forever for the process to complete */
APR_KILL_ONLY_ONCE /**< send SIGTERM and then wait */
} apr_kill_conditions_e;
} fspr_kill_conditions_e;
/* Thread Function definitions */
@@ -202,16 +202,16 @@ typedef enum {
* @param new_attr The newly created threadattr.
* @param cont The pool to use
*/
APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new_attr,
apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_threadattr_create(fspr_threadattr_t **new_attr,
fspr_pool_t *cont);
/**
* Set if newly created threads should be created in detached state.
* @param attr The threadattr to affect
* @param on Non-zero if detached threads should be created.
*/
APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr,
apr_int32_t on);
APR_DECLARE(fspr_status_t) fspr_threadattr_detach_set(fspr_threadattr_t *attr,
fspr_int32_t on);
/**
* Get the detach state for this threadattr.
@@ -219,15 +219,15 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr,
* @return APR_DETACH if threads are to be detached, or APR_NOTDETACH
* if threads are to be joinable.
*/
APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr);
APR_DECLARE(fspr_status_t) fspr_threadattr_detach_get(fspr_threadattr_t *attr);
/**
* Set the stack size of newly created threads.
* @param attr The threadattr to affect
* @param stacksize The stack size in bytes
*/
APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
apr_size_t stacksize);
APR_DECLARE(fspr_status_t) fspr_threadattr_stacksize_set(fspr_threadattr_t *attr,
fspr_size_t stacksize);
/**
* Set the stack guard area size of newly created threads.
@@ -239,8 +239,8 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
* and increases memory management overhead. Setting the guard area
* size to zero hence trades off reliable behaviour on stack overflow
* for performance. */
APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
apr_size_t guardsize);
APR_DECLARE(fspr_status_t) fspr_threadattr_guardsize_set(fspr_threadattr_t *attr,
fspr_size_t guardsize);
/**
* Create a new thread of execution
@@ -250,40 +250,40 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
* @param data Any data to be passed to the starting function
* @param cont The pool to use
*/
APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new_thread,
apr_threadattr_t *attr,
apr_thread_start_t func,
void *data, apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_thread_create(fspr_thread_t **new_thread,
fspr_threadattr_t *attr,
fspr_thread_start_t func,
void *data, fspr_pool_t *cont);
/**
* stop the current thread
* @param thd The thread to stop
* @param retval The return value to pass back to any thread that cares
*/
APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd,
apr_status_t retval);
APR_DECLARE(fspr_status_t) fspr_thread_exit(fspr_thread_t *thd,
fspr_status_t retval);
/**
* block until the desired thread stops executing.
* @param retval The return value from the dead thread.
* @param thd The thread to join
*/
APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval,
apr_thread_t *thd);
APR_DECLARE(fspr_status_t) fspr_thread_join(fspr_status_t *retval,
fspr_thread_t *thd);
/**
* force the current thread to yield the processor
*/
APR_DECLARE(void) apr_thread_yield(void);
APR_DECLARE(void) fspr_thread_yield(void);
/**
* Initialize the control variable for apr_thread_once. If this isn't
* called, apr_initialize won't work.
* Initialize the control variable for fspr_thread_once. If this isn't
* called, fspr_initialize won't work.
* @param control The control variable to initialize
* @param p The pool to allocate data from.
*/
APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control,
apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_thread_once_init(fspr_thread_once_t **control,
fspr_pool_t *p);
/**
* Run the specified function one time, regardless of how many threads
@@ -294,14 +294,14 @@ APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control,
* if the function has ever been called before.
* @param func The function to call.
*/
APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control,
APR_DECLARE(fspr_status_t) fspr_thread_once(fspr_thread_once_t *control,
void (*func)(void));
/**
* detach a thread
* @param thd The thread to detach
*/
APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd);
APR_DECLARE(fspr_status_t) fspr_thread_detach(fspr_thread_t *thd);
/**
* Return the pool associated with the current thread.
@@ -309,8 +309,8 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd);
* @param key The key to associate with the data
* @param thread The currently open thread.
*/
APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key,
apr_thread_t *thread);
APR_DECLARE(fspr_status_t) fspr_thread_data_get(void **data, const char *key,
fspr_thread_t *thread);
/**
* Return the pool associated with the current thread.
@@ -319,9 +319,9 @@ APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key,
* @param cleanup The cleanup routine to use when the thread is destroyed.
* @param thread The currently open thread.
*/
APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key,
apr_status_t (*cleanup) (void *),
apr_thread_t *thread);
APR_DECLARE(fspr_status_t) fspr_thread_data_set(void *data, const char *key,
fspr_status_t (*cleanup) (void *),
fspr_thread_t *thread);
/**
* Create and initialize a new thread private address space
@@ -329,31 +329,31 @@ APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key,
* @param dest The destructor to use when freeing the private memory.
* @param cont The pool to use
*/
APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key,
APR_DECLARE(fspr_status_t) fspr_threadkey_private_create(fspr_threadkey_t **key,
void (*dest)(void *),
apr_pool_t *cont);
fspr_pool_t *cont);
/**
* Get a pointer to the thread private memory
* @param new_mem The data stored in private memory
* @param key The handle for the desired thread private memory
*/
APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new_mem,
apr_threadkey_t *key);
APR_DECLARE(fspr_status_t) fspr_threadkey_private_get(void **new_mem,
fspr_threadkey_t *key);
/**
* Set the data to be stored in thread private memory
* @param priv The data to be stored in private memory
* @param key The handle for the desired thread private memory
*/
APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv,
apr_threadkey_t *key);
APR_DECLARE(fspr_status_t) fspr_threadkey_private_set(void *priv,
fspr_threadkey_t *key);
/**
* Free the thread private memory
* @param key The handle for the desired thread private memory
*/
APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key);
APR_DECLARE(fspr_status_t) fspr_threadkey_private_delete(fspr_threadkey_t *key);
/**
* Return the pool associated with the current threadkey.
@@ -361,8 +361,8 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key);
* @param key The key associated with the data
* @param threadkey The currently open threadkey.
*/
APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key,
apr_threadkey_t *threadkey);
APR_DECLARE(fspr_status_t) fspr_threadkey_data_get(void **data, const char *key,
fspr_threadkey_t *threadkey);
/**
* Return the pool associated with the current threadkey.
@@ -371,9 +371,9 @@ APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key,
* @param cleanup The cleanup routine to use when the file is destroyed.
* @param threadkey The currently open threadkey.
*/
APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key,
apr_status_t (*cleanup) (void *),
apr_threadkey_t *threadkey);
APR_DECLARE(fspr_status_t) fspr_threadkey_data_set(void *data, const char *key,
fspr_status_t (*cleanup) (void *),
fspr_threadkey_t *threadkey);
#endif
@@ -382,8 +382,8 @@ APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key,
* @param new_attr The newly created procattr.
* @param cont The pool to use
*/
APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new_attr,
apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_procattr_create(fspr_procattr_t **new_attr,
fspr_pool_t *cont);
/**
* Determine if any of stdin, stdout, or stderr should be linked to pipes
@@ -393,15 +393,15 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new_attr,
* @param out Should stdout be a pipe back to the parent?
* @param err Should stderr be a pipe back to the parent?
*/
APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
apr_int32_t in, apr_int32_t out,
apr_int32_t err);
APR_DECLARE(fspr_status_t) fspr_procattr_io_set(fspr_procattr_t *attr,
fspr_int32_t in, fspr_int32_t out,
fspr_int32_t err);
/**
* Set the child_in and/or parent_in values to existing apr_file_t values.
* Set the child_in and/or parent_in values to existing fspr_file_t values.
* @param attr The procattr we care about.
* @param child_in apr_file_t value to use as child_in. Must be a valid file.
* @param parent_in apr_file_t value to use as parent_in. Must be a valid file.
* @param child_in fspr_file_t value to use as child_in. Must be a valid file.
* @param parent_in fspr_file_t value to use as parent_in. Must be a valid file.
* @remark This is NOT a required initializer function. This is
* useful if you have already opened a pipe (or multiple files)
* that you wish to use, perhaps persistently across multiple
@@ -409,37 +409,37 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
* extra function calls by not creating your own pipe since this
* creates one in the process space for you.
*/
APR_DECLARE(apr_status_t) apr_procattr_child_in_set(struct apr_procattr_t *attr,
apr_file_t *child_in,
apr_file_t *parent_in);
APR_DECLARE(fspr_status_t) fspr_procattr_child_in_set(struct fspr_procattr_t *attr,
fspr_file_t *child_in,
fspr_file_t *parent_in);
/**
* Set the child_out and parent_out values to existing apr_file_t values.
* Set the child_out and parent_out values to existing fspr_file_t values.
* @param attr The procattr we care about.
* @param child_out apr_file_t value to use as child_out. Must be a valid file.
* @param parent_out apr_file_t value to use as parent_out. Must be a valid file.
* @param child_out fspr_file_t value to use as child_out. Must be a valid file.
* @param parent_out fspr_file_t value to use as parent_out. Must be a valid file.
* @remark This is NOT a required initializer function. This is
* useful if you have already opened a pipe (or multiple files)
* that you wish to use, perhaps persistently across multiple
* process invocations - such as a log file.
*/
APR_DECLARE(apr_status_t) apr_procattr_child_out_set(struct apr_procattr_t *attr,
apr_file_t *child_out,
apr_file_t *parent_out);
APR_DECLARE(fspr_status_t) fspr_procattr_child_out_set(struct fspr_procattr_t *attr,
fspr_file_t *child_out,
fspr_file_t *parent_out);
/**
* Set the child_err and parent_err values to existing apr_file_t values.
* Set the child_err and parent_err values to existing fspr_file_t values.
* @param attr The procattr we care about.
* @param child_err apr_file_t value to use as child_err. Must be a valid file.
* @param parent_err apr_file_t value to use as parent_err. Must be a valid file.
* @param child_err fspr_file_t value to use as child_err. Must be a valid file.
* @param parent_err fspr_file_t value to use as parent_err. Must be a valid file.
* @remark This is NOT a required initializer function. This is
* useful if you have already opened a pipe (or multiple files)
* that you wish to use, perhaps persistently across multiple
* process invocations - such as a log file.
*/
APR_DECLARE(apr_status_t) apr_procattr_child_err_set(struct apr_procattr_t *attr,
apr_file_t *child_err,
apr_file_t *parent_err);
APR_DECLARE(fspr_status_t) fspr_procattr_child_err_set(struct fspr_procattr_t *attr,
fspr_file_t *child_err,
fspr_file_t *parent_err);
/**
* Set which directory the child process should start executing in.
@@ -448,7 +448,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(struct apr_procattr_t *attr
* the parent currently resides in, when the createprocess call
* is made.
*/
APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr,
APR_DECLARE(fspr_status_t) fspr_procattr_dir_set(fspr_procattr_t *attr,
const char *dir);
/**
@@ -462,16 +462,16 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr,
* APR_PROGRAM_PATH -- Executable program on PATH, copy env
* </PRE>
*/
APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr,
apr_cmdtype_e cmd);
APR_DECLARE(fspr_status_t) fspr_procattr_cmdtype_set(fspr_procattr_t *attr,
fspr_cmdtype_e cmd);
/**
* Determine if the child should start in detached state.
* @param attr The procattr we care about.
* @param detach Should the child start in detached state? Default is no.
*/
APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr,
apr_int32_t detach);
APR_DECLARE(fspr_status_t) fspr_procattr_detach_set(fspr_procattr_t *attr,
fspr_int32_t detach);
#if APR_HAVE_STRUCT_RLIMIT
/**
@@ -486,8 +486,8 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr,
* </PRE>
* @param limit Value to set the limit to.
*/
APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr,
apr_int32_t what,
APR_DECLARE(fspr_status_t) fspr_procattr_limit_set(fspr_procattr_t *attr,
fspr_int32_t what,
struct rlimit *limit);
#endif
@@ -496,29 +496,29 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr,
* encounters an error in the child prior to running the specified program.
* @param attr The procattr describing the child process to be created.
* @param errfn The function to call in the child process.
* @remark At the present time, it will only be called from apr_proc_create()
* @remark At the present time, it will only be called from fspr_proc_create()
* on platforms where fork() is used. It will never be called on other
* platforms, on those platforms apr_proc_create() will return the error
* platforms, on those platforms fspr_proc_create() will return the error
* in the parent process rather than invoke the callback in the now-forked
* child process.
*/
APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr,
apr_child_errfn_t *errfn);
APR_DECLARE(fspr_status_t) fspr_procattr_child_errfn_set(fspr_procattr_t *attr,
fspr_child_errfn_t *errfn);
/**
* Specify that apr_proc_create() should do whatever it can to report
* failures to the caller of apr_proc_create(), rather than find out in
* Specify that fspr_proc_create() should do whatever it can to report
* failures to the caller of fspr_proc_create(), rather than find out in
* the child.
* @param attr The procattr describing the child process to be created.
* @param chk Flag to indicate whether or not extra work should be done
* to try to report failures to the caller.
* @remark This flag only affects apr_proc_create() on platforms where
* @remark This flag only affects fspr_proc_create() on platforms where
* fork() is used. This leads to extra overhead in the calling
* process, but that may help the application handle such
* errors more gracefully.
*/
APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr,
apr_int32_t chk);
APR_DECLARE(fspr_status_t) fspr_procattr_error_check_set(fspr_procattr_t *attr,
fspr_int32_t chk);
/**
* Determine if the child should start in its own address space or using the
@@ -527,8 +527,8 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr,
* @param addrspace Should the child start in its own address space? Default
* is no on NetWare and yes on other platforms.
*/
APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr,
apr_int32_t addrspace);
APR_DECLARE(fspr_status_t) fspr_procattr_addrspace_set(fspr_procattr_t *attr,
fspr_int32_t addrspace);
/**
* Set the username used for running process
@@ -538,7 +538,7 @@ APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr,
* or any other platform having
* APR_PROCATTR_USER_SET_REQUIRES_PASSWORD set.
*/
APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr,
APR_DECLARE(fspr_status_t) fspr_procattr_user_set(fspr_procattr_t *attr,
const char *username,
const char *password);
@@ -547,7 +547,7 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr,
* @param attr The procattr we care about.
* @param groupname The group name used
*/
APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr,
APR_DECLARE(fspr_status_t) fspr_procattr_group_set(fspr_procattr_t *attr,
const char *groupname);
@@ -560,7 +560,7 @@ APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr,
* @remark returns APR_INCHILD for the child, and APR_INPARENT for the parent
* or an error.
*/
APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont);
APR_DECLARE(fspr_status_t) fspr_proc_fork(fspr_proc_t *proc, fspr_pool_t *cont);
#endif
/**
@@ -577,14 +577,14 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont);
* process
* @param pool The pool to use.
* @note This function returns without waiting for the new process to terminate;
* use apr_proc_wait for that.
* use fspr_proc_wait for that.
*/
APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc,
APR_DECLARE(fspr_status_t) fspr_proc_create(fspr_proc_t *new_proc,
const char *progname,
const char * const *args,
const char * const *env,
apr_procattr_t *attr,
apr_pool_t *pool);
fspr_procattr_t *attr,
fspr_pool_t *pool);
/**
* Wait for a child process to die
@@ -612,9 +612,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc,
* APR_CHILD_NOTDONE -- child is still running.
* </PRE>
*/
APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
int *exitcode, apr_exit_why_e *exitwhy,
apr_wait_how_e waithow);
APR_DECLARE(fspr_status_t) fspr_proc_wait(fspr_proc_t *proc,
int *exitcode, fspr_exit_why_e *exitwhy,
fspr_wait_how_e waithow);
/**
* Wait for any current child process to die and return information
@@ -642,11 +642,11 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
* @bug Passing proc as a *proc rather than **proc was an odd choice
* for some platforms... this should be revisited in 1.0
*/
APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,
APR_DECLARE(fspr_status_t) fspr_proc_wait_all_procs(fspr_proc_t *proc,
int *exitcode,
apr_exit_why_e *exitwhy,
apr_wait_how_e waithow,
apr_pool_t *p);
fspr_exit_why_e *exitwhy,
fspr_wait_how_e waithow,
fspr_pool_t *p);
#define APR_PROC_DETACH_FOREGROUND 0 /**< Do not detach */
#define APR_PROC_DETACH_DAEMONIZE 1 /**< Detach */
@@ -657,7 +657,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,
* and become a background process, else it will
* stay in the foreground.
*/
APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize);
APR_DECLARE(fspr_status_t) fspr_proc_detach(int daemonize);
/**
* Register an other_child -- a child associated to its registered
@@ -676,12 +676,12 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize);
* proc->in/out/err handles should be health checked.
* @bug no platform currently tests the pipes health.
*/
APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc,
APR_DECLARE(void) fspr_proc_other_child_register(fspr_proc_t *proc,
void (*maintenance) (int reason,
void *,
int status),
void *data, apr_file_t *write_fd,
apr_pool_t *p);
void *data, fspr_file_t *write_fd,
fspr_pool_t *p);
/**
* Stop watching the specified other child.
@@ -692,7 +692,7 @@ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc,
* themself by loading ocr->next before calling any maintenance
* function.
*/
APR_DECLARE(void) apr_proc_other_child_unregister(void *data);
APR_DECLARE(void) fspr_proc_other_child_unregister(void *data);
/**
* Notify the maintenance callback of a registered other child process
@@ -702,10 +702,10 @@ APR_DECLARE(void) apr_proc_other_child_unregister(void *data);
* @param status The status to pass to the maintenance function
* @remark An example of code using this behavior;
* <pre>
* rv = apr_proc_wait_all_procs(&proc, &exitcode, &status, APR_WAIT, p);
* rv = fspr_proc_wait_all_procs(&proc, &exitcode, &status, APR_WAIT, p);
* if (APR_STATUS_IS_CHILD_DONE(rv)) {
* #if APR_HAS_OTHER_CHILD
* if (apr_proc_other_child_alert(&proc, APR_OC_REASON_DEATH, status)
* if (fspr_proc_other_child_alert(&proc, APR_OC_REASON_DEATH, status)
* == APR_SUCCESS) {
* ; (already handled)
* }
@@ -714,7 +714,7 @@ APR_DECLARE(void) apr_proc_other_child_unregister(void *data);
* [... handling non-otherchild processes death ...]
* </pre>
*/
APR_DECLARE(apr_status_t) apr_proc_other_child_alert(apr_proc_t *proc,
APR_DECLARE(fspr_status_t) fspr_proc_other_child_alert(fspr_proc_t *proc,
int reason,
int status);
@@ -725,7 +725,7 @@ APR_DECLARE(apr_status_t) apr_proc_other_child_alert(apr_proc_t *proc,
* @param ocr The registered other child
* @param reason The reason code (e.g. APR_OC_REASON_RESTART) if still running
*/
APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr,
APR_DECLARE(void) fspr_proc_other_child_refresh(fspr_other_child_rec_t *ocr,
int reason);
/**
@@ -734,14 +734,14 @@ APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr,
* code if the process is no longer healthy.
* @param reason The reason code (e.g. APR_OC_REASON_RESTART) to running processes
*/
APR_DECLARE(void) apr_proc_other_child_refresh_all(int reason);
APR_DECLARE(void) fspr_proc_other_child_refresh_all(int reason);
/**
* Terminate a process.
* @param proc The process to terminate.
* @param sig How to kill the process.
*/
APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig);
APR_DECLARE(fspr_status_t) fspr_proc_kill(fspr_proc_t *proc, int sig);
/**
* Register a process to be killed when a pool dies.
@@ -750,14 +750,14 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig);
* @param how How to kill the process, one of:
* <PRE>
* APR_KILL_NEVER -- process is never sent any signals
* APR_KILL_ALWAYS -- process is sent SIGKILL on apr_pool_t cleanup
* APR_KILL_ALWAYS -- process is sent SIGKILL on fspr_pool_t cleanup
* APR_KILL_AFTER_TIMEOUT -- SIGTERM, wait 3 seconds, SIGKILL
* APR_JUST_WAIT -- wait forever for the process to complete
* APR_KILL_ONLY_ONCE -- send SIGTERM and then wait
* </PRE>
*/
APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *proc,
apr_kill_conditions_e how);
APR_DECLARE(void) fspr_pool_note_subprocess(fspr_pool_t *a, fspr_proc_t *proc,
fspr_kill_conditions_e how);
#if APR_HAS_THREADS
@@ -767,22 +767,22 @@ APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *proc,
* Setup the process for a single thread to be used for all signal handling.
* @warning This must be called before any threads are created
*/
APR_DECLARE(apr_status_t) apr_setup_signal_thread(void);
APR_DECLARE(fspr_status_t) fspr_setup_signal_thread(void);
/**
* Make the current thread listen for signals. This thread will loop
* forever, calling a provided function whenever it receives a signal. That
* functions should return 1 if the signal has been handled, 0 otherwise.
* @param signal_handler The function to call when a signal is received
* apr_status_t apr_signal_thread((int)(*signal_handler)(int signum))
* fspr_status_t fspr_signal_thread((int)(*signal_handler)(int signum))
*/
APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum));
APR_DECLARE(fspr_status_t) fspr_signal_thread(int(*signal_handler)(int signum));
#endif /* (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) && !defined(OS2) */
/**
* Get the child-pool used by the thread from the thread info.
* @return apr_pool_t the pool
* @return fspr_pool_t the pool
*/
APR_POOL_DECLARE_ACCESSOR(thread);
@@ -18,13 +18,13 @@
#define APR_THREAD_RWLOCK_H
/**
* @file apr_thread_rwlock.h
* @file fspr_thread_rwlock.h
* @brief APR Reader/Writer Lock Routines
*/
#include "apr.h"
#include "apr_pools.h"
#include "apr_errno.h"
#include "fspr.h"
#include "fspr_pools.h"
#include "fspr_errno.h"
#ifdef __cplusplus
extern "C" {
@@ -33,13 +33,13 @@ extern "C" {
#if APR_HAS_THREADS
/**
* @defgroup apr_thread_rwlock Reader/Writer Lock Routines
* @defgroup fspr_thread_rwlock Reader/Writer Lock Routines
* @ingroup APR
* @{
*/
/** Opaque read-write thread-safe lock. */
typedef struct apr_thread_rwlock_t apr_thread_rwlock_t;
typedef struct fspr_thread_rwlock_t fspr_thread_rwlock_t;
/**
* Note: The following operations have undefined results: unlocking a
@@ -57,19 +57,19 @@ typedef struct apr_thread_rwlock_t apr_thread_rwlock_t;
* will be stored.
* @param pool the pool from which to allocate the mutex.
*/
APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock,
apr_pool_t *pool);
APR_DECLARE(fspr_status_t) fspr_thread_rwlock_create(fspr_thread_rwlock_t **rwlock,
fspr_pool_t *pool);
/**
* Acquire a shared-read lock on the given read-write lock. This will allow
* multiple threads to enter the same critical section while they have acquired
* the read lock.
* @param rwlock the read-write lock on which to acquire the shared read.
*/
APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock);
APR_DECLARE(fspr_status_t) fspr_thread_rwlock_rdlock(fspr_thread_rwlock_t *rwlock);
/**
* Attempt to acquire the shared-read lock on the given read-write lock. This
* is the same as apr_thread_rwlock_rdlock(), only that the function fails
* is the same as fspr_thread_rwlock_rdlock(), only that the function fails
* if there is another thread holding the write lock, or if there are any
* write threads blocking on the lock. If the function fails for this case,
* APR_EBUSY will be returned. Note: it is important that the
@@ -77,7 +77,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock);
* APR_EBUSY, for portability reasons.
* @param rwlock the rwlock on which to attempt the shared read.
*/
APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock);
APR_DECLARE(fspr_status_t) fspr_thread_rwlock_tryrdlock(fspr_thread_rwlock_t *rwlock);
/**
* Acquire an exclusive-write lock on the given read-write lock. This will
@@ -86,35 +86,35 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwloc
* sleep until it can have exclusive access to the lock.
* @param rwlock the read-write lock on which to acquire the exclusive write.
*/
APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock);
APR_DECLARE(fspr_status_t) fspr_thread_rwlock_wrlock(fspr_thread_rwlock_t *rwlock);
/**
* Attempt to acquire the exclusive-write lock on the given read-write lock.
* This is the same as apr_thread_rwlock_wrlock(), only that the function fails
* This is the same as fspr_thread_rwlock_wrlock(), only that the function fails
* if there is any other thread holding the lock (for reading or writing),
* in which case the function will return APR_EBUSY. Note: it is important
* that the APR_STATUS_IS_EBUSY(s) macro be used to determine if the return
* value was APR_EBUSY, for portability reasons.
* @param rwlock the rwlock on which to attempt the exclusive write.
*/
APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock);
APR_DECLARE(fspr_status_t) fspr_thread_rwlock_trywrlock(fspr_thread_rwlock_t *rwlock);
/**
* Release either the read or write lock currently held by the calling thread
* associated with the given read-write lock.
* @param rwlock the read-write lock to be released (unlocked).
*/
APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock);
APR_DECLARE(fspr_status_t) fspr_thread_rwlock_unlock(fspr_thread_rwlock_t *rwlock);
/**
* Destroy the read-write lock and free the associated memory.
* @param rwlock the rwlock to destroy.
*/
APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock);
APR_DECLARE(fspr_status_t) fspr_thread_rwlock_destroy(fspr_thread_rwlock_t *rwlock);
/**
* Get the pool used by this thread_rwlock.
* @return apr_pool_t the pool
* @return fspr_pool_t the pool
*/
APR_POOL_DECLARE_ACCESSOR(thread_rwlock);
@@ -18,111 +18,111 @@
#define APR_TIME_H
/**
* @file apr_time.h
* @file fspr_time.h
* @brief APR Time Library
*/
#include "apr.h"
#include "apr_pools.h"
#include "apr_errno.h"
#include "fspr.h"
#include "fspr_pools.h"
#include "fspr_errno.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_time Time Routines
* @defgroup fspr_time Time Routines
* @ingroup APR
* @{
*/
/** month names */
APR_DECLARE_DATA extern const char apr_month_snames[12][4];
APR_DECLARE_DATA extern const char fspr_month_snames[12][4];
/** day names */
APR_DECLARE_DATA extern const char apr_day_snames[7][4];
APR_DECLARE_DATA extern const char fspr_day_snames[7][4];
/** number of microseconds since 00:00:00 january 1, 1970 UTC */
typedef apr_int64_t apr_time_t;
typedef fspr_int64_t fspr_time_t;
/** mechanism to properly type apr_time_t literals */
/** mechanism to properly type fspr_time_t literals */
#define APR_TIME_C(val) APR_INT64_C(val)
/** mechanism to properly print apr_time_t values */
/** mechanism to properly print fspr_time_t values */
#define APR_TIME_T_FMT APR_INT64_T_FMT
/** intervals for I/O timeouts, in microseconds */
typedef apr_int64_t apr_interval_time_t;
typedef fspr_int64_t fspr_interval_time_t;
/** short interval for I/O timeouts, in microseconds */
typedef apr_int32_t apr_short_interval_time_t;
typedef fspr_int32_t fspr_short_interval_time_t;
/** number of microseconds per second */
#define APR_USEC_PER_SEC APR_TIME_C(1000000)
/** @return apr_time_t as a second */
#define apr_time_sec(time) ((time) / APR_USEC_PER_SEC)
/** @return fspr_time_t as a second */
#define fspr_time_sec(time) ((time) / APR_USEC_PER_SEC)
/** @return apr_time_t as a usec */
#define apr_time_usec(time) ((time) % APR_USEC_PER_SEC)
/** @return fspr_time_t as a usec */
#define fspr_time_usec(time) ((time) % APR_USEC_PER_SEC)
/** @return apr_time_t as a msec */
#define apr_time_msec(time) (((time) / 1000) % 1000)
/** @return fspr_time_t as a msec */
#define fspr_time_msec(time) (((time) / 1000) % 1000)
/** @return apr_time_t as a msec */
#define apr_time_as_msec(time) ((time) / 1000)
/** @return fspr_time_t as a msec */
#define fspr_time_as_msec(time) ((time) / 1000)
/** @return a second as an apr_time_t */
#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
/** @return a second as an fspr_time_t */
#define fspr_time_from_sec(sec) ((fspr_time_t)(sec) * APR_USEC_PER_SEC)
/** @return a second and usec combination as an apr_time_t */
#define apr_time_make(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC \
+ (apr_time_t)(usec))
/** @return a second and usec combination as an fspr_time_t */
#define fspr_time_make(sec, usec) ((fspr_time_t)(sec) * APR_USEC_PER_SEC \
+ (fspr_time_t)(usec))
/**
* @return the current time
*/
APR_DECLARE(apr_time_t) apr_time_now(void);
APR_DECLARE(fspr_time_t) fspr_time_now(void);
/** @see apr_time_exp_t */
typedef struct apr_time_exp_t apr_time_exp_t;
/** @see fspr_time_exp_t */
typedef struct fspr_time_exp_t fspr_time_exp_t;
/**
* a structure similar to ANSI struct tm with the following differences:
* - tm_usec isn't an ANSI field
* - tm_gmtoff isn't an ANSI field (it's a bsdism)
*/
struct apr_time_exp_t {
struct fspr_time_exp_t {
/** microseconds past tm_sec */
apr_int32_t tm_usec;
fspr_int32_t tm_usec;
/** (0-61) seconds past tm_min */
apr_int32_t tm_sec;
fspr_int32_t tm_sec;
/** (0-59) minutes past tm_hour */
apr_int32_t tm_min;
fspr_int32_t tm_min;
/** (0-23) hours past midnight */
apr_int32_t tm_hour;
fspr_int32_t tm_hour;
/** (1-31) day of the month */
apr_int32_t tm_mday;
fspr_int32_t tm_mday;
/** (0-11) month of the year */
apr_int32_t tm_mon;
fspr_int32_t tm_mon;
/** year since 1900 */
apr_int32_t tm_year;
fspr_int32_t tm_year;
/** (0-6) days since sunday */
apr_int32_t tm_wday;
fspr_int32_t tm_wday;
/** (0-365) days since jan 1 */
apr_int32_t tm_yday;
fspr_int32_t tm_yday;
/** daylight saving time */
apr_int32_t tm_isdst;
fspr_int32_t tm_isdst;
/** seconds east of UTC */
apr_int32_t tm_gmtoff;
fspr_int32_t tm_gmtoff;
};
/**
* convert an ansi time_t to an apr_time_t
* @param result the resulting apr_time_t
* convert an ansi time_t to an fspr_time_t
* @param result the resulting fspr_time_t
* @param input the time_t to convert
*/
APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result,
APR_DECLARE(fspr_status_t) fspr_time_ansi_put(fspr_time_t *result,
time_t input);
/**
@@ -132,76 +132,76 @@ APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result,
* @param input the time to explode
* @param offs the number of seconds offset to apply
*/
APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result,
apr_time_t input,
apr_int32_t offs);
APR_DECLARE(fspr_status_t) fspr_time_exp_tz(fspr_time_exp_t *result,
fspr_time_t input,
fspr_int32_t offs);
/**
* convert a time to its human readable components in GMT timezone
* @param result the exploded time
* @param input the time to explode
*/
APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result,
apr_time_t input);
APR_DECLARE(fspr_status_t) fspr_time_exp_gmt(fspr_time_exp_t *result,
fspr_time_t input);
/**
* convert a time to its human readable components in local timezone
* @param result the exploded time
* @param input the time to explode
*/
APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
apr_time_t input);
APR_DECLARE(fspr_status_t) fspr_time_exp_lt(fspr_time_exp_t *result,
fspr_time_t input);
/**
* Convert time value from human readable format to a numeric apr_time_t
* Convert time value from human readable format to a numeric fspr_time_t
* e.g. elapsed usec since epoch
* @param result the resulting imploded time
* @param input the input exploded time
*/
APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *result,
apr_time_exp_t *input);
APR_DECLARE(fspr_status_t) fspr_time_exp_get(fspr_time_t *result,
fspr_time_exp_t *input);
/**
* Convert time value from human readable format to a numeric apr_time_t that
* Convert time value from human readable format to a numeric fspr_time_t that
* always represents GMT
* @param result the resulting imploded time
* @param input the input exploded time
*/
APR_DECLARE(apr_status_t) apr_time_exp_gmt_get(apr_time_t *result,
apr_time_exp_t *input);
APR_DECLARE(fspr_status_t) fspr_time_exp_gmt_get(fspr_time_t *result,
fspr_time_exp_t *input);
/**
* Sleep for the specified number of micro-seconds.
* @param t desired amount of time to sleep.
* @warning May sleep for longer than the specified time.
*/
APR_DECLARE(void) apr_sleep(apr_interval_time_t t);
APR_DECLARE(void) fspr_sleep(fspr_interval_time_t t);
/** length of a RFC822 Date */
#define APR_RFC822_DATE_LEN (30)
/**
* apr_rfc822_date formats dates in the RFC822
* fspr_rfc822_date formats dates in the RFC822
* format in an efficient manner. It is a fixed length
* format which requires the indicated amount of storage,
* including the trailing NUL terminator.
* @param date_str String to write to.
* @param t the time to convert
*/
APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t);
APR_DECLARE(fspr_status_t) fspr_rfc822_date(char *date_str, fspr_time_t t);
/** length of a CTIME date */
#define APR_CTIME_LEN (25)
/**
* apr_ctime formats dates in the ctime() format
* fspr_ctime formats dates in the ctime() format
* in an efficient manner. it is a fixed length format
* and requires the indicated amount of storage including
* the trailing NUL terminator.
* Unlike ANSI/ISO C ctime(), apr_ctime() does not include
* Unlike ANSI/ISO C ctime(), fspr_ctime() does not include
* a \n at the end of the string.
* @param date_str String to write to.
* @param t the time to convert
*/
APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t);
APR_DECLARE(fspr_status_t) fspr_ctime(char *date_str, fspr_time_t t);
/**
* formats the exploded time according to the format specified
@@ -211,9 +211,9 @@ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t);
* @param format The format for the time string
* @param tm The time to convert
*/
APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize,
apr_size_t max, const char *format,
apr_time_exp_t *tm);
APR_DECLARE(fspr_status_t) fspr_strftime(char *s, fspr_size_t *retsize,
fspr_size_t max, const char *format,
fspr_time_exp_t *tm);
/**
* Improve the clock resolution for the lifetime of the given pool.
@@ -221,7 +221,7 @@ APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize,
* time-sensitive applications, and has no impact on most platforms.
* @param p The pool to associate the finer clock resolution
*/
APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p);
APR_DECLARE(void) fspr_time_clock_hires(fspr_pool_t *p);
/** @} */
@@ -18,20 +18,20 @@
#define APR_USER_H
/**
* @file apr_user.h
* @file fspr_user.h
* @brief APR User ID Services
*/
#include "apr.h"
#include "apr_errno.h"
#include "apr_pools.h"
#include "fspr.h"
#include "fspr_errno.h"
#include "fspr_pools.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup apr_user User and Group ID Services
* @defgroup fspr_user User and Group ID Services
* @ingroup APR
* @{
*/
@@ -40,18 +40,18 @@ extern "C" {
* Structure for determining user ownership.
*/
#ifdef WIN32
typedef PSID apr_uid_t;
typedef PSID fspr_uid_t;
#else
typedef uid_t apr_uid_t;
typedef uid_t fspr_uid_t;
#endif
/**
* Structure for determining group ownership.
*/
#ifdef WIN32
typedef PSID apr_gid_t;
typedef PSID fspr_gid_t;
#else
typedef gid_t apr_gid_t;
typedef gid_t fspr_gid_t;
#endif
#if APR_HAS_USER
@@ -63,9 +63,9 @@ typedef gid_t apr_gid_t;
* @param p The pool from which to allocate working space
* @remark This function is available only if APR_HAS_USER is defined.
*/
APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *userid,
apr_gid_t *groupid,
apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_uid_current(fspr_uid_t *userid,
fspr_gid_t *groupid,
fspr_pool_t *p);
/**
* Get the user name for a specified userid
@@ -74,8 +74,8 @@ APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *userid,
* @param p The pool from which to allocate the string
* @remark This function is available only if APR_HAS_USER is defined.
*/
APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid,
apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_uid_name_get(char **username, fspr_uid_t userid,
fspr_pool_t *p);
/**
* Get the userid (and groupid) for the specified username
@@ -85,8 +85,8 @@ APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid,
* @param p The pool from which to allocate working space
* @remark This function is available only if APR_HAS_USER is defined.
*/
APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *userid, apr_gid_t *groupid,
const char *username, apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_uid_get(fspr_uid_t *userid, fspr_gid_t *groupid,
const char *username, fspr_pool_t *p);
/**
* Get the home directory for the named user
@@ -95,22 +95,22 @@ APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *userid, apr_gid_t *groupid,
* @param p The pool from which to allocate the string
* @remark This function is available only if APR_HAS_USER is defined.
*/
APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname,
APR_DECLARE(fspr_status_t) fspr_uid_homepath_get(char **dirname,
const char *username,
apr_pool_t *p);
fspr_pool_t *p);
/**
* Compare two user identifiers for equality.
* @param left One uid to test
* @param right Another uid to test
* @return APR_SUCCESS if the apr_uid_t strutures identify the same user,
* APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid.
* @return APR_SUCCESS if the fspr_uid_t strutures identify the same user,
* APR_EMISMATCH if not, APR_BADARG if an fspr_uid_t is invalid.
* @remark This function is available only if APR_HAS_USER is defined.
*/
#if defined(WIN32)
APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right);
APR_DECLARE(fspr_status_t) fspr_uid_compare(fspr_uid_t left, fspr_uid_t right);
#else
#define apr_uid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
#define fspr_uid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
#endif
/**
@@ -120,8 +120,8 @@ APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right);
* @param p The pool from which to allocate the string
* @remark This function is available only if APR_HAS_USER is defined.
*/
APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname,
apr_gid_t groupid, apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_gid_name_get(char **groupname,
fspr_gid_t groupid, fspr_pool_t *p);
/**
* Get the groupid for a specified group name
@@ -130,21 +130,21 @@ APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname,
* @param p The pool from which to allocate the string
* @remark This function is available only if APR_HAS_USER is defined.
*/
APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid,
const char *groupname, apr_pool_t *p);
APR_DECLARE(fspr_status_t) fspr_gid_get(fspr_gid_t *groupid,
const char *groupname, fspr_pool_t *p);
/**
* Compare two group identifiers for equality.
* @param left One gid to test
* @param right Another gid to test
* @return APR_SUCCESS if the apr_gid_t strutures identify the same group,
* APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid.
* @return APR_SUCCESS if the fspr_gid_t strutures identify the same group,
* APR_EMISMATCH if not, APR_BADARG if an fspr_gid_t is invalid.
* @remark This function is available only if APR_HAS_USER is defined.
*/
#if defined(WIN32)
APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right);
APR_DECLARE(fspr_status_t) fspr_gid_compare(fspr_gid_t left, fspr_gid_t right);
#else
#define apr_gid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
#define fspr_gid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
#endif
#endif /* ! APR_HAS_USER */
@@ -18,7 +18,7 @@
#define APR_VERSION_H
/**
* @file apr_version.h
* @file fspr_version.h
* @brief APR Versioning Interface
*
* APR's Version
@@ -76,7 +76,7 @@
#define APR_IS_DEV_STRING ""
#endif
/* APR_STRINGIFY is defined here, and also in apr_general.h, so wrap it */
/* APR_STRINGIFY is defined here, and also in fspr_general.h, so wrap it */
#ifndef APR_STRINGIFY
/** Properly quote a value as a string in the C preprocessor */
#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
@@ -102,11 +102,11 @@
/* The C language API to access the version at run time,
* as opposed to compile time. APR_VERSION_ONLY may be defined
* externally when preprocessing apr_version.h to obtain strictly
* externally when preprocessing fspr_version.h to obtain strictly
* the C Preprocessor macro declarations.
*/
#include "apr.h"
#include "fspr.h"
#ifdef __cplusplus
extern "C" {
@@ -121,7 +121,7 @@ typedef struct {
int minor; /**< minor number */
int patch; /**< patch number */
int is_dev; /**< is development (1 or 0) */
} apr_version_t;
} fspr_version_t;
/**
* Return APR's version information information in a numeric form.
@@ -129,10 +129,10 @@ typedef struct {
* @param pvsn Pointer to a version structure for returning the version
* information.
*/
APR_DECLARE(void) apr_version(apr_version_t *pvsn);
APR_DECLARE(void) fspr_version(fspr_version_t *pvsn);
/** Return APR's version information as a string. */
APR_DECLARE(const char *) apr_version_string(void);
APR_DECLARE(const char *) fspr_version_string(void);
#ifdef __cplusplus
}
@@ -14,9 +14,9 @@
* limitations under the License.
*/
#include "apr.h" /* configuration data */
#include "fspr.h" /* configuration data */
/**
* @file apr_want.h
* @file fspr_want.h
* @brief APR Standard Headers Support
*
* <PRE>
@@ -32,12 +32,12 @@
*
* #define APR_WANT_STRFUNC
* #define APR_WANT_MEMFUNC
* #include "apr_want.h"
* #include "fspr_want.h"
*
* The appropriate headers will be included.
*
* Note: it is safe to use this in a header (it won't interfere with other
* headers' or source files' use of apr_want.h)
* headers' or source files' use of fspr_want.h)
* </PRE>
*/