Apache HTTPD
Classes | Macros | Typedefs | Functions | Variables
Internal Memory Allocation

Classes

struct  apr_memnode_t
 

Macros

#define APR_MEMNODE_T_SIZE   APR_ALIGN_DEFAULT(sizeof(apr_memnode_t))
 
#define APR_ALLOCATOR_MAX_FREE_UNLIMITED   0
 

Typedefs

typedef struct apr_allocator_t apr_allocator_t
 
typedef struct apr_memnode_t apr_memnode_t
 

Functions

 APR_DECLARE (apr_status_t) apr_allocator_create(apr_allocator_t **allocator) __attribute__((nonnull(1)))
 
 APR_DECLARE (void) apr_allocator_destroy(apr_allocator_t *allocator) __attribute__((nonnull(1)))
 
 APR_DECLARE (apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator
 
apr_size_t size __attribute__ ((nonnull(1)))
 
apr_memnode_t *memnode __attribute__ ((nonnull(1, 2)))
 
 APR_DECLARE (apr_size_t) apr_allocator_align(apr_allocator_t *allocator
 
 APR_DECLARE (apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator) __attribute__((nonnull(1)))
 

Variables

apr_size_t size
 

Detailed Description

Macro Definition Documentation

◆ APR_ALLOCATOR_MAX_FREE_UNLIMITED

#define APR_ALLOCATOR_MAX_FREE_UNLIMITED   0

Symbolic constants

Definition at line 67 of file apr_allocator.h.

◆ APR_MEMNODE_T_SIZE

#define APR_MEMNODE_T_SIZE   APR_ALIGN_DEFAULT(sizeof(apr_memnode_t))

The base size of a memory node - aligned.

Definition at line 64 of file apr_allocator.h.

Typedef Documentation

◆ apr_allocator_t

the allocator structure

Definition at line 41 of file apr_allocator.h.

◆ apr_memnode_t

the structure which holds information about the allocation

Definition at line 43 of file apr_allocator.h.

Function Documentation

◆ __attribute__() [1/2]

apr_size_t size __attribute__ ( (nonnull(1))  )

◆ __attribute__() [2/2]

apr_memnode_t *memnode __attribute__ ( (nonnull(1, 2))  )

◆ APR_DECLARE() [1/5]

APR_DECLARE ( apr_memnode_t )

Allocate a block of mem from the allocator

Parameters
allocatorThe allocator to allocate from
sizeThe size of the mem to allocate (excluding the memnode structure)

◆ APR_DECLARE() [2/5]

APR_DECLARE ( apr_pool_t )

Get the current owner of the allocator

Parameters
allocatorThe allocator to get the owner from

Definition at line 272 of file open.c.

◆ APR_DECLARE() [3/5]

APR_DECLARE ( apr_size_t  )

Get the true size that would be allocated for the given size (including the header and alignment).

Parameters
allocatorThe allocator from which to the memory would be allocated
sizeThe size to align
Returns
The aligned size (or zero on apr_size_t overflow)

Definition at line 674 of file buffer.c.

◆ APR_DECLARE() [4/5]

APR_DECLARE ( apr_status_t  )

Create a new allocator

Parameters
allocatorThe allocator we have just created.

Convert text data to base64.

Parameters
destThe destination string, can be NULL to output in len the needed buffer length for encoding.
srcThe original string, can be NULL if dest is NULL and slen is positive or nul.
slenThe length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, emit RFC4648 Base 64 Encoding. If APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_URL, use RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet. If APR_ENCODE_BASE64URL, use RFC7515 base64url Encoding.
lenIf not NULL, outputs the length of the buffer needed for encoding (including the trailing NUL) if dest is NULL, or the actual length of the encoding (excluding the trailing NUL) if dest is not NULL.
Returns
APR_SUCCESS, or APR_EINVAL if slen is not APR_ENCODE_STRING and negative, or APR_NOTFOUND if dest is not NULL and src is NULL, or APR_ENOSPC if dest is NULL and the source length (based on slen or APR_ENCODE_STRING) is too big to encode.

Convert binary data to base64.

Parameters
destThe destination string, can be NULL to output in len the needed buffer length for encoding.
srcThe original buffer, can be NULL if dest is NULL.
slenThe length of the original buffer.
flagsIf APR_ENCODE_NONE, emit RFC4648 Base 64 Encoding. If APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_URL, use RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet. If APR_ENCODE_BASE64URL, use RFC7515 base64url Encoding.
lenIf not NULL, outputs the length of the buffer needed for encoding (including the trailing NUL) if dest is NULL, or the actual length of the encoding (excluding the trailing NUL) if dest is not NULL.
Returns
APR_SUCCESS, or APR_EINVAL if slen is negative, or APR_NOTFOUND if dest is not NULL and src is NULL, or APR_ENOSPC if dest is NULL and the source length (based on slen or APR_ENCODE_STRING) is too big to encode.

Convert base64 or base64url with or without padding to text data.

Parameters
destThe destination string, can be NULL to output in len the needed buffer length for decoding.
srcThe base64 string, can be NULL if dest is NULL and slen is positive or nul.
slenThe length of the base64 string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, attempt to decode the full base64 string, and return NULL if any bad character is detected. If APR_ENCODE_RELAXED, decode until the first non base64/base64url character.
lenIf not NULL, outputs the length of the buffer needed for decoding (including the trailing NUL) if dest is NULL, or the actual length of the decoding (excluding the trailing NUL) if dest is not NULL.
Returns
APR_SUCCESS, or APR_EINVAL if slen is not APR_ENCODE_STRING and negative, or APR_NOTFOUND if dest is not NULL and src is NULL, or APR_ENOSPC if dest is NULL and the source length (based on slen or APR_ENCODE_STRING) is too big to decode, or APR_EINCOMPLETE if the source length (based on slen or APR_ENCODE_STRING) is invalid for a base64 encoding, or APR_BADCH if a non base64 character is present and APR_ENCODE_RELAXED is not specified.

Convert base64 or base64url with or without padding to binary data.

Parameters
destThe destination string, can be NULL to output in len the needed buffer length for decoding.
srcThe base64 string, can be NULL if dest is NULL and slen is positive or nul.
slenThe length of the base64 string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, attempt to decode the full base64 string, and return NULL if any bad character is detected. If APR_ENCODE_RELAXED, decode until the first non base64/base64url character.
lenIf not NULL, outputs the length of the buffer needed for decoding (including the trailing NUL) if dest is NULL, or the actual length of the decoding (excluding the trailing NUL) if dest is not NULL.
Returns
APR_SUCCESS, or APR_EINVAL if slen is not APR_ENCODE_STRING and negative, or APR_NOTFOUND if dest is not NULL and src is NULL, or APR_ENOSPC if dest is NULL and the source length (based on slen or APR_ENCODE_STRING) is too big to decode, or APR_EINCOMPLETE if the source length (based on slen or APR_ENCODE_STRING) is invalid for a base64 encoding, or APR_BADCH if a non base64 character is present and APR_ENCODE_RELAXED is not specified.

Convert text data to base32.

Parameters
destThe destination string, can be NULL to output in len the needed buffer length for encoding.
srcThe original string, can be NULL if dest is NULL and slen is positive or nul.
slenThe length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding.
lenIf not NULL, outputs the length of the buffer needed for encoding (including the trailing NUL) if dest is NULL, or the actual length of the encoding (excluding the trailing NUL) if dest is not NULL.
Returns
APR_SUCCESS, or APR_EINVAL if slen is not APR_ENCODE_STRING and negative, or APR_NOTFOUND if dest is not NULL and src is NULL, or APR_ENOSPC if dest is NULL and the source length (based on slen or APR_ENCODE_STRING) is too big to encode.

Convert binary data to base32.

Parameters
destThe destination string, can be NULL to output in len the needed buffer length for encoding.
srcThe original buffer, can be NULL if dest is NULL.
slenThe length of the original buffer.
flagsIf APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding.
lenIf not NULL, outputs the length of the buffer needed for encoding (including the trailing NUL) if dest is NULL, or the actual length of the encoding (excluding the trailing NUL) if dest is not NULL.
Returns
APR_SUCCESS, or APR_EINVAL if slen is negative, or APR_NOTFOUND if dest is not NULL and src is NULL, or APR_ENOSPC if dest is NULL and the source length (based on slen or APR_ENCODE_STRING) is too big to encode.

Convert base32 or base32hex with or without padding to text data.

Parameters
destThe destination string, can be NULL to output in len the needed buffer length for decoding.
srcThe base32 string, can be NULL if dest is NULL and slen is positive or nul.
slenThe length of the base32 string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, parse RFC4648 Base 32 Encoding. If APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding.
lenIf not NULL, outputs the length of the buffer needed for decoding (including the trailing NUL) if dest is NULL, or the actual length of the decoding (excluding the trailing NUL) if dest is not NULL.
Returns
APR_SUCCESS, or APR_EINVAL if slen is not APR_ENCODE_STRING and negative, or APR_NOTFOUND if dest is not NULL and src is NULL, or APR_ENOSPC if dest is NULL and the source length (based on slen or APR_ENCODE_STRING) is too big to decode, or APR_EINCOMPLETE if the source length (based on slen or APR_ENCODE_STRING) is invalid for a base32 encoding, or APR_BADCH if a non base32 character is present and APR_ENCODE_RELAXED is not specified.

Convert base32 or base32hex with or without padding to binary data.

Parameters
destThe destination string, can be NULL to output in len the needed buffer length for decoding.
srcThe base32 string, can be NULL if dest is NULL and slen is positive or nul.
slenThe length of the base32 string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, parse RFC4648 Base 32 Encoding. If APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding.
lenIf not NULL, outputs the length of the buffer needed for decoding (including the trailing NUL) if dest is NULL, or the actual length of the decoding (excluding the trailing NUL) if dest is not NULL.
Returns
APR_SUCCESS, or APR_EINVAL if slen is not APR_ENCODE_STRING and negative, or APR_NOTFOUND if dest is not NULL and src is NULL, or APR_ENOSPC if dest is NULL and the source length (based on slen or APR_ENCODE_STRING) is too big to decode, or APR_EINCOMPLETE if the source length (based on slen or APR_ENCODE_STRING) is invalid for a base32 encoding, or APR_BADCH if a non base32 character is present and APR_ENCODE_RELAXED is not specified.

Convert text data to base16 (hex).

Parameters
destThe destination string, can be NULL to output in len the needed buffer length for encoding.
srcThe original string, can be NULL if dest is NULL and slen is positive or nul.
slenThe length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If APR_ENCODE_COLON, separate each token with a colon.
lenIf not NULL, outputs the length of the buffer needed for encoding (including the trailing NUL) if dest is NULL, or the actual length of the encoding (excluding the trailing NUL) if dest is not NULL.
Returns
APR_SUCCESS, or APR_EINVAL if slen is not APR_ENCODE_STRING and negative, or APR_NOTFOUND if dest is not NULL and src is NULL, or APR_ENOSPC if dest is NULL and the source length (based on slen or APR_ENCODE_STRING) is too big to encode.

Convert binary data to base16 (hex).

Parameters
destThe destination string, can be NULL to output in len the needed buffer length for encoding.
srcThe original buffer, can be NULL if dest is NULL.
slenThe length of the original buffer.
flagsIf APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If APR_ENCODE_COLON, separate each token with a colon.
lenIf not NULL, outputs the length of the buffer needed for encoding (including the trailing NUL) if dest is NULL, or the actual length of the encoding (excluding the trailing NUL) if dest is not NULL.
Returns
APR_SUCCESS, or APR_EINVAL if slen is negative, or APR_NOTFOUND if dest is not NULL and src is NULL, or APR_ENOSPC if dest is NULL and the source length (based on slen or APR_ENCODE_STRING) is too big to encode.

Convert base16 (hex) to text data.

Parameters
destThe destination string, can be NULL to output in len the needed buffer length for decoding.
srcThe base16 string, can be NULL if dest is NULL and slen is positive or nul.
slenThe length of the base16 string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, parse RFC4648 Base 16 Encoding. If APR_ENCODE_COLON, allow tokens to be separated with a colon.
lenIf not NULL, outputs the length of the buffer needed for decoding (including the trailing NUL) if dest is NULL, or the actual length of the decoding (excluding the trailing NUL) if dest is not NULL.
Returns
APR_SUCCESS, or APR_EINVAL if slen is not APR_ENCODE_STRING and negative, or APR_NOTFOUND if dest is not NULL and src is NULL, or APR_ENOSPC if dest is NULL and the source length (based on slen or APR_ENCODE_STRING) is too big to decode, or APR_EINCOMPLETE if the source length (based on slen or APR_ENCODE_STRING) is invalid for a base16 encoding, or APR_BADCH if a non base16 character is present and APR_ENCODE_RELAXED is not specified.

Convert base16 (hex) to binary data.

Parameters
destThe destination string, can be NULL to output in len the needed buffer length for decoding.
srcThe base16 string, can be NULL if dest is NULL and slen is positive or nul.
slenThe length of the base16 string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, parse RFC4648 Base 16 Encoding. If APR_ENCODE_COLON, allow tokens to be separated with a colon.
lenIf not NULL, outputs the length of the buffer needed for decoding (including the trailing NUL) if dest is NULL, or the actual length of the decoding (excluding the trailing NUL) if dest is not NULL.
Returns
APR_SUCCESS, or APR_EINVAL if slen is not APR_ENCODE_STRING and negative, or APR_NOTFOUND if dest is not NULL and src is NULL, or APR_ENOSPC if dest is NULL and the source length (based on slen or APR_ENCODE_STRING) is too big to decode, or APR_EINCOMPLETE if the source length (based on slen or APR_ENCODE_STRING) is invalid for a base16 encoding, or APR_BADCH if a non base16 character is present and APR_ENCODE_RELAXED is not specified.

Get the value of an environment variable

Parameters
valuethe returned value, allocated from pool
envvarthe name of the environment variable
poolwhere to allocate value and any temporary storage from

Set the value of an environment variable

Parameters
envvarthe name of the environment variable
valuethe value to set
poolwhere to allocate temporary storage from

Delete a variable from the environment

Parameters
envvarthe name of the environment variable
poolwhere to allocate temporary storage from

Perform shell escaping on the provided string.

Shell escaping causes characters to be prefixed with a '\' character.

Parameters
escapedOptional buffer to write the encoded string, can be NULL
strThe original string
slenThe length of the original string, or APR_ESCAPE_STRING
lenIf present, returns the length of the string
Returns
APR_SUCCESS, or APR_NOTFOUND if no changes to the string were detected or the string was NULL

Unescapes a URL, leaving reserved characters intact.

Parameters
escapedOptional buffer to write the encoded string, can be NULL
urlString to be unescaped
slenThe length of the original url, or APR_ESCAPE_STRING
forbidOptional list of forbidden characters, in addition to 0x00
reservedOptional list of reserved characters that will be left unescaped
plusIf non zero, '+' is converted to ' ' as per application/x-www-form-urlencoded encoding
lenIf set, the length of the escaped string will be returned
Returns
APR_SUCCESS on success, APR_NOTFOUND if no characters are decoded or the string is NULL, APR_EINVAL if a bad escape sequence is found, APR_BADCH if a character on the forbid list is found.

Escape a path segment, as defined in RFC1808.

Parameters
escapedOptional buffer to write the encoded string, can be NULL
strThe original string
slenThe length of the original string, or APR_ESCAPE_STRING
lenIf present, returns the length of the string
Returns
APR_SUCCESS, or APR_NOTFOUND if no changes to the string were detected or the string was NULL

Converts an OS path to a URL, in an OS dependent way, as defined in RFC1808. In all cases if a ':' occurs before the first '/' in the URL, the URL should be prefixed with "./" (or the ':' escaped). In the case of Unix, this means leaving '/' alone, but otherwise doing what escape_path_segment() does. For efficiency reasons, we don't use escape_path_segment(), which is provided for reference. Again, RFC 1808 is where this stuff is defined.

If partial is set, os_escape_path() assumes that the path will be appended to something with a '/' in it (and thus does not prefix "./").

Parameters
escapedOptional buffer to write the encoded string, can be NULL
pathThe original string
slenThe length of the original string, or APR_ESCAPE_STRING
partialIf non zero, suppresses the prepending of "./"
lenIf present, returns the length of the string
Returns
APR_SUCCESS, or APR_NOTFOUND if no changes to the string were detected or if the string was NULL

Urlencode a string, as defined in http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1.

Parameters
escapedOptional buffer to write the encoded string, can be NULL
strThe original string
slenThe length of the original string, or APR_ESCAPE_STRING
lenIf present, returns the length of the string
Returns
APR_SUCCESS, or APR_NOTFOUND if no changes to the string were detected or if the stirng was NULL

Apply entity encoding to a string. Characters are replaced as follows: '<' becomes '&lt;', '>' becomes '&gt;', '&' becomes '&amp;', the double quote becomes '&quot;" and the single quote becomes '\&apos;'. If toasc is not zero, any non ascii character will be encoded as '%\#ddd;', where ddd is the decimal code of the character. @param escaped Optional buffer to write the encoded string, can be NULL @param str The original string @param slen The length of the original string, or APR_ESCAPE_STRING @param toasc If non zero, encode non ascii characters @param len If present, returns the length of the string @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were detected or the string was NULL Decodes html entities or numeric character references in a string. If the string to be unescaped is syntactically incorrect, then the following fixups will be made: unknown entities will be left undecoded; references to unused numeric characters will be deleted. In particular, &#00; will not be decoded, but will be deleted. @param unescaped Optional buffer to write the encoded string, can be NULL @param str The original string @param slen The length of the original string, or APR_ESCAPE_STRING @param len If present, returns the length of the string @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were detected or the string was NULL Escape control characters in a string, as performed by the shell's 'echo' command. Characters are replaced as follows: \\a alert (bell), \\b backspace, \\f form feed, \\n new line, \\r carriage return, \\t horizontal tab, \\v vertical tab, \\ backslash. Any non ascii character will be encoded as '\\xHH', where HH is the hex code of the character. If quote is not zero, the double quote character will also be escaped. @param escaped Optional buffer to write the encoded string, can be NULL @param str The original string @param slen The length of the original string, or APR_ESCAPE_STRING @param quote If non zero, encode double quotes @param len If present, returns the length of the string @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were detected or the string was NULL Convert binary data to a hex encoding. @param dest The destination buffer, can be NULL @param src The original buffer @param srclen The length of the original buffer @param colon If not zero, insert colon characters between hex digits. @param len If present, returns the length of the string @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL Convert hex encoded string to binary data. @param dest The destination buffer, can be NULL @param str The original buffer @param slen The length of the original buffer @param colon If not zero, ignore colon characters between hex digits. @param len If present, returns the length of the string @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH if a non hex character is present. Apply LDAP escaping to binary data. Characters from RFC4514 and RFC4515 are escaped with their hex equivalents. @param dest The destination buffer, can be NULL @param src The original buffer @param srclen The length of the original buffer @param flags APR_ESCAPE_LDAP_DN for RFC4514, APR_ESCAPE_LDAP_FILTER for RFC4515, APR_ESCAPE_LDAP_ALL for both @param len If present, returns the length of the string @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL get the specified file's stats. The file is specified by filename, instead of using a pre-opened file. @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_ values @param pool the pool to use to allocate the new file. @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. Open the specified directory. @param new_dir The opened directory descriptor. @param dirname The full path to the directory (use / on all systems) @param pool The pool to use. close the specified directory. @param thedir the directory descriptor to close. 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_ values @param thedir the directory descriptor returned from apr_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. When no more entries are available, APR_ENOENT is returned. Rewind the directory to the first entry. @param thedir the directory descriptor to rewind. Extract the rootpath from the given filepath @param rootpath the root file path returned with APR_SUCCESS or APR_EINCOMPLETE @param filepath the pathname to parse for its root component @param flags the desired rules to apply, from <PRE> APR_FILEPATH_NATIVE Use native path separators (e.g. '\' on Win32) APR_FILEPATH_TRUENAME Tests that the root exists, and makes it proper </PRE> @param p the pool to allocate the new path string from @remark on return, filepath points to the first non-root character in the given filepath. In the simplest example, given a filepath of "/foo", returns the rootpath of "/" and filepath points at "foo". This is far more complex on other platforms, which will canonicalize the root form to a consistant format, given the APR_FILEPATH_TRUENAME flag, and also test for the validity of that root (e.g., that a drive d:/ or network share //machine/foovol/). The function returns APR_ERELATIVE if filepath isn't rooted (an error), APR_EINCOMPLETE if the root path is ambiguous (but potentially legitimate, e.g. "/" on Windows is incomplete because it doesn't specify the drive letter), or APR_EBADPATH if the root is simply invalid. APR_SUCCESS is returned if filepath is an absolute path. Merge additional file path onto the previously processed rootpath @param newpath the merged paths returned @param rootpath the root file path (NULL uses the current working path) @param addpath the path to add to the root path @param flags the desired APR_FILEPATH_ rules to apply when merging @param p the pool to allocate the new path string from @remark if the flag APR_FILEPATH_TRUENAME is given, and the addpath contains wildcard characters ('*', '?') on platforms that don't support such characters within filenames, the paths will be merged, but the result code will be APR_EPATHWILD, and all further segments will not reflect the true filenames including the wildcard and following segments. Split a search path into separate components @param pathelts the returned components of the search path @param liststr the search path (e.g., <tt>getenv("PATH")</tt>) @param p the pool to allocate the array and path components from @remark empty path components do not become part of @a pathelts. @remark the path separator in @a liststr is system specific; e.g., ':' on Unix, ';' on Windows, etc. Merge a list of search path components into a single search path @param liststr the returned search path; may be NULL if @a pathelts is empty @param pathelts the components of the search path @param p the pool to allocate the search path from @remark emtpy strings in the source array are ignored. @remark the path separator in @a liststr is system specific; e.g., ':' on Unix, ';' on Windows, etc. Return the default file path (for relative file names) @param path the default path string returned @param flags optional flag APR_FILEPATH_NATIVE to retrieve the default file path in os-native format. @param p the pool to allocate the default path string from Set the default file path (for relative file names) @param path the default path returned @param p the pool to allocate any working storage 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 apr_os_locale_encoding() and/or apr_os_default_encoding() to get the name of the path encoding if it's not UTF-8. Open the specified file. @param newf The opened file descriptor. @param fname The full path to the file (using / on all systems) @param flag Or'ed value of: @li #APR_FOPEN_READ open for reading @li #APR_FOPEN_WRITE open for writing @li #APR_FOPEN_CREATE create the file if not there @li #APR_FOPEN_APPEND file ptr is set to end prior to all writes @li #APR_FOPEN_TRUNCATE set length to zero if file exists @li #APR_FOPEN_BINARY not a text file @li #APR_FOPEN_BUFFERED buffer the data. Default is non-buffered @li #APR_FOPEN_EXCL return error if #APR_FOPEN_CREATE and file exists @li #APR_FOPEN_DELONCLOSE delete the file after closing @li #APR_FOPEN_XTHREAD Platform dependent tag to open the file for use across multiple threads @li #APR_FOPEN_SHARELOCK Platform dependent support for higher level locked read/write access to support writes across process/machines @li #APR_FOPEN_NOCLEANUP Do not register a cleanup with the pool passed in on the @a pool argument (see below) @li #APR_FOPEN_SENDFILE_ENABLED Open with appropriate platform semantics for sendfile operations. Advisory only, apr_socket_sendfile does not check this flag @li #APR_FOPEN_LARGEFILE Platform dependent flag to enable large file support, see WARNING below @li #APR_FOPEN_SPARSE Platform dependent flag to enable sparse file support, see WARNING below @li #APR_FOPEN_NONBLOCK Platform dependent flag to enable non blocking file io @param perm Access permissions for file. @param pool The pool to use. @remark If perm is #APR_FPROT_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(). Close the specified file. @param file The file descriptor to close. Delete the specified file. @param path The full path to the file (using / on all systems) @param pool The pool to use. @remark If the file is open, it won't be removed until all instances are closed. Rename the specified file. @param from_path The full path to the original file (using / on all systems) @param to_path The full path to the new file (using / on all systems) @param pool The pool to use. @warning If a file exists at the new location, then it will be overwritten. Moving files or directories across devices may not be possible. Create a hard link to the specified file. @param from_path The full path to the original file (using / on all systems) @param to_path The full path to the new file (using / on all systems) @remark Both files must reside on the same device. Copy the specified file to another file. @param from_path The full path to the original file (using / on all systems) @param to_path The full path to the new file (using / on all systems) @param perms Access permissions for the new file if it is created. In place of the usual or'd combination of file permissions, the value #APR_FPROT_FILE_SOURCE_PERMS may be given, in which case the source file's permissions are copied. @param pool The pool to use. @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. Append the specified file to another file. @param from_path The full path to the source file (use / on all systems) @param to_path The full path to the destination file (use / on all systems) @param perms Access permissions for the destination file if it is created. In place of the usual or'd combination of file permissions, the value #APR_FPROT_FILE_SOURCE_PERMS may be given, in which case the source file's permissions are copied. @param pool The pool to use. @remark The new file does not need to exist, it will be created if required. @remark Note that advanced filesystem permissions such as ACLs are not duplicated by this API. The target permissions (including duplicating the source file permissions) are assigned only when the target file does not yet exist. 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. 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 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* 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. 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_stderr(). 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_stderr(). open standard error as an apr file pointer, with flags. @param thefile The apr file to use as stderr. @param flags The flags to open the file with. Only the @li #APR_FOPEN_EXCL @li #APR_FOPEN_BUFFERED @li #APR_FOPEN_XTHREAD @li #APR_FOPEN_SHARELOCK @li #APR_FOPEN_SENDFILE_ENABLED @li #APR_FOPEN_LARGEFILE flags should be used. The #APR_FOPEN_WRITE flag will be set unconditionally. @param pool The pool to allocate the file out of. @remark See remarks for apr_file_open_stderr(). open standard output as an apr file pointer, with flags. @param thefile The apr file to use as stdout. @param flags The flags to open the file with. Only the @li #APR_FOPEN_EXCL @li #APR_FOPEN_BUFFERED @li #APR_FOPEN_XTHREAD @li #APR_FOPEN_SHARELOCK @li #APR_FOPEN_SENDFILE_ENABLED @li #APR_FOPEN_LARGEFILE flags should be used. The #APR_FOPEN_WRITE flag will be set unconditionally. @param pool The pool to allocate the file out of. @remark See remarks for apr_file_open_stderr(). open standard input as an apr file pointer, with flags. @param thefile The apr file to use as stdin. @param flags The flags to open the file with. Only the @li #APR_FOPEN_EXCL @li #APR_FOPEN_BUFFERED @li #APR_FOPEN_XTHREAD @li #APR_FOPEN_SHARELOCK @li #APR_FOPEN_SENDFILE_ENABLED @li #APR_FOPEN_LARGEFILE flags should be used. The #APR_FOPEN_WRITE flag will be set unconditionally. @param pool The pool to allocate the file out of. @remark See remarks for apr_file_open_stderr(). Read data from the specified file. @param thefile The file descriptor to read from. @param buf The buffer to store the data to. @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 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 char was put back into the stream via ungetc, it will be the first character returned. @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. Write data to the specified file. @param thefile The file descriptor to write to. @param buf The buffer which contains the data. @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 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. @remark It is possible for both bytes to be written and an error to be returned. #APR_EINTR is never returned. Write data from iovec array to the specified file. @param thefile The file descriptor to write to. @param vec The array from which to get the data to write to the file. @param nvec The number of elements in the struct iovec array. This must be smaller than #APR_MAX_IOVEC_SIZE. If it isn't, the function will fail with #APR_EINVAL. @param nbytes The number of bytes written. @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 operating system doesn't provide writev(). Read data from the specified file, ensuring that the buffer is filled before returning. @param thefile The file descriptor to read from. @param buf The buffer to store the data to. @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_full() 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 stream via ungetc, it will be the first character returned. @remark It is possible for both bytes to be read and an error to be returned. And if *bytes_read is less than nbytes, an accompanying error is <em>always</em> returned. @remark #APR_EINTR is never returned. Write data to the specified file, ensuring that all of the data is written before returning. @param thefile The file descriptor to write to. @param buf The buffer which contains the data. @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_full() 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 an error. @remark It is possible for both bytes to be written and an error to be returned. And if *bytes_written is less than nbytes, an accompanying error is <em>always</em> returned. @remark #APR_EINTR is never returned. Write data from iovec array to the specified file, ensuring that all of the data is written before returning. @param thefile The file descriptor to write to. @param vec The array from which to get the data to write to the file. @param nvec The number of elements in the struct iovec array. This must be smaller than #APR_MAX_IOVEC_SIZE. If it isn't, the function will fail with #APR_EINVAL. @param nbytes The number of bytes written. @remark apr_file_writev_full() is available even if the underlying operating system doesn't provide writev(). Write a character into the specified file. @param ch The character to write. @param thefile The file descriptor to write to Read a character from the specified file. @param ch The character to read into @param thefile The file descriptor to read from Put a character back onto a specified stream. @param ch The character to write. @param thefile The file descriptor to write to Read a line from the specified file @param str The buffer to store the string in. @param len The length of the string @param thefile The file descriptor to read from @remark The buffer will be NUL-terminated if any characters are stored. The newline at the end of the line will not be stripped. Write the string into the specified file. @param str The string to write. @param thefile The file descriptor to write to Flush the file's buffer. @param thefile The file descriptor to flush Transfer all file modified data and metadata to disk. @param thefile The file descriptor to sync Transfer all file modified data to disk. @param thefile The file descriptor to sync 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. Duplicate the specified file descriptor and close the original @param new_file The old file that is to be closed and reused @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. Move the specified file descriptor to a new pool @param new_file Pointer in which to return the new apr_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 OS dup() operation on the underlying descriptor; it just moves the descriptor's apr_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 Give the specified apr file handle a new buffer @param thefile The file handle that is to be modified @param buffer The buffer @param bufsize The size of the buffer @remark It is possible to add a buffer to previously unbuffered file handles, the #APR_FOPEN_BUFFERED flag will be added to the file handle's flags. Likewise, with buffer=NULL and bufsize=0 arguments it is possible to make a previously buffered file handle unbuffered. Move the read/write file offset to a specified byte within a file. @param thefile The file descriptor @param where How to move the pointer, one of: @li #APR_SET &ndash; set the offset to offset @li #APR_CUR &ndash; add the offset to the current position @li #APR_END &ndash; add the offset to the current file size @param offset The offset to move the pointer to. @remark The third argument is modified to be the offset the pointer was actually moved to. Create an anonymous pipe. @param in The newly created pipe's file for reading. @param out The newly created pipe's file for writing. @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(). \xrefitem bug 11. \xrefitem deprecated 327.@see apr_file_pipe_create_pools() Create an anonymous pipe which portably supports async timeout options. @param in The newly created pipe's file for reading. @param out The newly created pipe's file for writing. @param blocking one of these values defined in apr_thread_proc.h; @li #APR_FULL_BLOCK @li #APR_READ_BLOCK @li #APR_WRITE_BLOCK @li #APR_FULL_NONBLOCK @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(). @remark Some platforms cannot toggle between blocking and nonblocking, and when passing a pipe as a standard handle to an application which does not expect it, a non-blocking stream will fluxor the client app. Use this function rather than apr_file_pipe_create() to create pipes where one or both ends require non-blocking semantics. \xrefitem deprecated 328.@see apr_file_pipe_create_pools() Create an anonymous pipe which portably supports async timeout options, placing each side of the pipe in a different pool. @param in The newly created pipe's file for reading. @param out The newly created pipe's file for writing. @param blocking one of these values defined in apr_thread_proc.h; @li #APR_FULL_BLOCK @li #APR_READ_BLOCK @li #APR_WRITE_BLOCK @li #APR_FULL_NONBLOCK @param pool_in The pool for the reading pipe. @param pool_out The pool for the writing pipe. @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(). @remark Some platforms cannot toggle between blocking and nonblocking, and when passing a pipe as a standard handle to an application which does not expect it, a non-blocking stream will fluxor the client app. Use this function rather than apr_file_pipe_create() to create pipes where one or both ends require non-blocking semantics. Create a named pipe. @param filename The filename of the named pipe @param perm The permissions for the newly created pipe. @param pool The pool to operate on. 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. Set the timeout value for a pipe or manipulate the blocking state. @param thepipe The pipe we are setting a timeout on. @param timeout The timeout value in microseconds. Values < 0 mean wait forever, 0 means do not wait at all. file (un)locking functions. Establish a lock on the specified, open file. The lock may be advisory or mandatory, at the discretion of the platform. The lock applies to the file as a whole, rather than a specific range. Locks are established on a per-thread/process basis; a second lock by the same thread will not block. @param thefile The file to lock. @param type The type of lock to establish on the file. Remove any outstanding locks on the file. @param thefile The file to unlock. accessor and general file_io functions. return the file name of the current file. @param new_path The path of the file. <br> @param thefile The currently open file. Return the data associated with the current file. @param data The user data associated with the file. <br> @param key The key to use for retrieving data associated with this file. @param file The currently open file. Set the data associated with the current file. @param file The currently open file. @param data The user data to associate with the file. <br> @param key The key to use for associating data with the file. @param cleanup The cleanup routine to use when the file is destroyed. set the specified file's permission bits. @param fname The file (name) to apply the permissions to. @param perms The permission bits to apply to the file. @warning Some platforms may not be able to apply all of the available permission bits; #APR_INCOMPLETE will be returned if some permissions are specified which could not be set. @warning Platforms which do not implement this feature will return #APR_ENOTIMPL. Set attributes of the specified file. @param fname The full path to the file (using / on all systems) @param attributes Or'd combination of @li #APR_FILE_ATTR_READONLY - make the file readonly @li #APR_FILE_ATTR_EXECUTABLE - make the file executable @li #APR_FILE_ATTR_HIDDEN - make the file hidden @param attr_mask Mask of valid bits in attributes. @param pool the pool to use. @remark This function should be used in preference to explicit manipulation of the file permissions, because the operations to provide these attributes are platform specific and may involve more than simply setting permission bits. @warning Platforms which do not implement this feature will return #APR_ENOTIMPL. Set the mtime of the specified file. @param fname The full path to the file (using / on all systems) @param mtime The mtime to apply to the file. @param pool The pool to use. @warning Platforms which do not implement this feature will return #APR_ENOTIMPL. Create a new directory on the file system. @param path the path for the directory to be created. (use / on all systems) @param perm Permissions for the new directory. @param pool the pool to use. Creates a new directory on the file system, but behaves like 'mkdir -p'. Creates intermediate directories as required. No error will be reported if PATH already exists. @param path the path for the directory to be created. (use / on all systems) @param perm Permissions for the new directory. @param pool the pool to use. 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. @remark Removing a directory which is in-use (e.g., the current working directory, or during apr_dir_read, or with an open file) is not portable. 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 thefile The file to get information about. Truncate the file's length to the specified offset @param fp The file to truncate @param offset The offset to truncate to. @remark The read/write file offset is repositioned to offset. Set a file to be inherited by child processes. Unset a file from being inherited by child processes. Open a temporary file @param fp The apr file to use as a temporary file. @param templ The template to use when creating a temp file. @param flags The flags to open the file with. If this is zero, the file is opened with #APR_FOPEN_CREATE | #APR_FOPEN_READ | #APR_FOPEN_WRITE | #APR_FOPEN_EXCL | #APR_FOPEN_DELONCLOSE @param p The pool to allocate the file out of. @remark <br> This function generates a unique temporary file name from template. <br> The last six characters of template must be XXXXXX and these are replaced with a string that makes the filename unique. Since it will be modified, template must not be a string constant, but should be declared as a character array. <br> Find an existing directory suitable as a temporary storage location. @param temp_dir The temp directory. @param p The pool to use for any necessary allocations. @remark <br> This function uses an algorithm to search for a directory that an an application can use for temporary storage. Setup any APR internal data structures. This MUST be the first function called for any APR library. It is safe to call apr_initialize several times as long as apr_terminate() is called the same number of times. @remark See apr_app_initialize() if this is an application, rather than a library consumer of apr. Set up an application with normalized argc, argv (and optionally env) in order to deal with platform-specific oddities, such as Win32 services, code pages and signals. This must be the first function called for any APR program. @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. Initialize the arguments for parsing by apr_getopt(). @param os The options structure created for apr_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 3 and 4 are most commonly argc and argv from main(argc, argv) The (*os)->errfn is initialized to fprintf(stderr... but may be overridden. Parse the options initialized by apr_getopt_init(). @param os The apr_opt_t structure returned by apr_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 @param option_ch The next option character parsed @param option_arg The argument following the option character: @return There are four potential status values on exit. They are: <PRE> APR_EOF -- No more options to parse APR_BADCH -- Found a bad option character APR_BADARG -- No argument followed the option flag APR_SUCCESS -- The next option was found. </PRE> Parse the options initialized by apr_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 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 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: <PRE> APR_EOF -- No more options to parse APR_BADCH -- Found a bad option character APR_BADARG -- No argument followed the option flag APR_SUCCESS -- The next option was found. </PRE> When APR_SUCCESS is returned, os->ind gives the index of the first non-option argument. On error, a message will be printed to stdout unless os->err is set to 0. If os->interleave is set to nonzero, options can come after arguments, and os->argv will be permuted to leave non-option arguments at the end (the original argv is unaffected). 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 specialized lock routines. @param mutex the memory address where the newly created mutex will be stored. @param fname A file name to use if the lock mechanism requires one. This argument should always be provided. The lock code itself will determine if it should be used. @param mech The mechanism to use for the interprocess lock, if any; one of <PRE> APR_LOCK_FCNTL APR_LOCK_FLOCK APR_LOCK_SYSVSEM APR_LOCK_POSIXSEM APR_LOCK_PROC_PTHREAD APR_LOCK_DEFAULT pick the default mechanism for the platform APR_LOCK_DEFAULT_TIMED pick the default timed mechanism </PRE> @param pool the pool from which to allocate the mutex. @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. Re-open a mutex in a child process. @param mutex The newly re-opened mutex structure. @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(). @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. 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. Attempt to acquire the lock for the given mutex. If the mutex has already been acquired, the call returns immediately with 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 mutex the mutex on which to attempt the lock acquiring. Attempt to acquire the lock for the given mutex until timeout expires. If the acquisition time outs, the call returns with APR_TIMEUP. @param mutex the mutex on which to attempt the lock acquiring. @param timeout the relative timeout (microseconds). @note A negative or nul timeout means immediate attempt, returning APR_TIMEUP without blocking if it the lock is already acquired. Release the lock for the given mutex. @param mutex the mutex from which to release the lock. Destroy the mutex and free the memory associated with the lock. @param mutex the mutex to destroy. Set mutex permissions. Iterate over a hash table running the provided function once for every element in the hash table. The @p comp function will be invoked for every element in the hash table. @param comp The function to run @param rec The data to pass as the first argument to the function @param ht The hash table to iterate over @return FALSE if one of the comp() iterations returned zero; TRUE if all iterations returned non-zero @see apr_hash_do_callback_fn_t apr_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 @param fmt The format string @param ap The arguments to use to fill out the format string. @remark <PRE> 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 \[ipv6-address\]:port - %%pT takes an apr_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 ('0' is printed if !APR_HAS_THREADS) - %%pm takes an apr_status_t * and prints the appropriate error string (from apr_strerror) corresponding to that error code. - %%pp takes a void * and outputs it in hex - %%pB takes a apr_uint32_t * as bytes and outputs it's apr_strfsize - %%pF same as above, but takes a apr_off_t * - %%pS same as above, but takes a apr_size_t * %%pA, %%pI, %%pT, %%pp are available from APR 1.0.0 onwards (and in 0.9.x). %%pt is only available from APR 1.2.0 onwards. %%pm, %%pB, %%pF and %%pS are only available from APR 1.3.0 onwards. The %%p hacks are to force gcc's printf warning code to skip over a pointer argument without complaining. This does mean that the ANSI-style %%p (output a void * in hex format) won't 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. The apr_vformatter_buff has two elements curpos and endpos. curpos is where apr_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 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 the flush_func should flush the buffer in whatever manner is appropriate, re apr_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. apr_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" 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 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. </PRE> Display a prompt and read in the password from stdin. @param prompt The prompt to display @param pwbuf Buffer to store the password @param bufsize The length of the password buffer. @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() function. Create a socket. @param new_sock The new socket that has been set up. @param family The address family of the socket (e.g., APR_INET). @param type The type of the socket (e.g., SOCK_STREAM). @param protocol The protocol of the socket (e.g., APR_PROTO_TCP). @param cont The pool for the apr_socket_t and associated storage. @note The pool will be used by various functions that operate on the socket. The caller must ensure that it is not used by other threads at the same time. Shutdown either reading, writing, or both sides of a socket. @param thesocket The socket to close @param how How to shutdown the socket. One of: <PRE> APR_SHUTDOWN_READ no longer allow read requests APR_SHUTDOWN_WRITE no longer allow write requests APR_SHUTDOWN_READWRITE no longer allow read or write requests </PRE> @see apr_shutdown_how_e @remark This does not actually close the socket descriptor, it just controls which calls are still valid on the socket. Close a socket. @param thesocket The socket to close Bind the socket to its associated port @param sock The socket to bind @param sa The socket address to bind to @remark This may be where we will find out if there is any other process using the selected port. Listen to a bound socket for connections. @param sock The socket to listen on @param backlog The number of outstanding connections allowed in the sockets listen queue. If this value is less than zero, the listen queue size is set to zero. <br> Accept a new connection request @param new_sock A copy of the socket that is connected to the socket that made the connection request. This is the socket which should be used for all future communication. @param sock The socket we are listening on. @param connection_pool The pool for the new socket. @note The pool will be used by various functions that operate on the socket. The caller must ensure that it is not used by other threads at the same time. Issue a connection request to a socket either on the same machine or a different one. @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. Determine whether the receive part of the socket has been closed by the peer (such that a subsequent call to apr_socket_read would return APR_EOF), if the socket's receive buffer is empty. This function does not block waiting for I/O. @param sock The socket to check @param atreadeof If APR_SUCCESS is returned, *atreadeof is set to non-zero if a subsequent read would return APR_EOF @return an error is returned if it was not possible to determine the status, in which case *atreadeof is not changed. Create apr_sockaddr_t from hostname, address family, and port. @param sa The new apr_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 :: or in case of APR_UNIX family it is absolute socket filename. @param family The address family to use, or APR_UNSPEC if the system should decide. @param port The port number. @param flags Special processing flags: <PRE> APR_IPV4_ADDR_OK first query for IPv4 addresses; only look for IPv6 addresses if the first query failed; only valid if family is APR_UNSPEC and hostname isn't NULL; mutually exclusive with APR_IPV6_ADDR_OK APR_IPV6_ADDR_OK first query for IPv6 addresses; only look for IPv4 addresses if the first query failed; only valid if family is APR_UNSPEC and hostname 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. Copy apr_sockaddr_t src to dst on pool p. @param dst The destination apr_sockaddr_t. @param src The source apr_sockaddr_t. @param p The pool for the apr_sockaddr_t and associated storage. Set the zone of an IPv6 link-local address object. @param sa Socket address object @param zone_id Zone ID (textual "eth0" or numeric "3"). @return Returns APR_EBADIP for non-IPv6 socket or an IPv6 address which isn't link-local. Retrieve the zone of an IPv6 link-local address object. @param sa Socket address object @param name If non-NULL, set to the textual representation of the zone id @param id If non-NULL, set to the integer zone id @param p Pool from which *name is allocated if used. @return Returns APR_EBADIP for non-IPv6 socket or socket without any zone id set, or other error if the interface could not be mapped to a name. @remark Both name and id may be NULL, neither are modified if non-NULL in error cases. Look up the host name from an apr_sockaddr_t. @param hostname The hostname. @param sa The apr_sockaddr_t. @param flags Special processing flags. @remark Results can vary significantly between platforms when processing wildcard socket addresses. Parse hostname/IP address with scope id and port. Any of the following strings are accepted: 8080 (just the port number) www.apache.org (just the hostname) www.apache.org:8080 (hostname and port number) [fe80::1%eth0] (IPv6 numeric address string and scope id) Invalid strings: (empty string) [abc] (not valid IPv6 numeric address string) abc:65536 (invalid port number) @param addr The new buffer containing just the hostname. On output, *addr will be NULL if no hostname/IP address was specfied. @param scope_id The new buffer containing just the scope id. On output, *scope_id will be NULL if no scope id was specified. @param port The port number. On output, *port will be 0 if no port was specified. @subsubsection autotoc_md1 FIXME: 0 is a legal port (per RFC 1700). this should @subsubsection autotoc_md2 return something besides zero if the port is missing. @param str The input string to be parsed. @param p The pool from which *addr and *scope_id are allocated. @remark If scope id shouldn't be allowed, check for scope_id != NULL in addition to checking the return code. If addr/hostname should be required, check for addr == NULL in addition to checking the return code. Get name of the current machine @param buf A buffer to store the hostname in. @param len The maximum length of the hostname that can be stored in the buffer provided. The suggested length is APRMAXHOSTLEN + 1. @param cont The pool to use. @remark If the buffer was not large enough, an error will be returned. Return the data associated with the current socket @param data The user data associated with the socket. @param key The key to associate with the user data. @param sock The currently open socket. Set the data associated with the current socket. @param sock The currently open socket. @param data The user data to associate with the socket. @param key The key to associate with the data. @param cleanup The cleanup to call when the socket is destroyed. Send data over a network. @param sock The socket to send the data over. @param buf The buffer which contains the data to be sent. @param len On entry, the number of bytes to send; on exit, the number of bytes sent. @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 socket option. It is possible for both bytes to be sent and an error to be returned. APR_EINTR is never returned. </PRE> Send multiple buffers over a network. @param sock The socket to send the data over. @param vec The array of iovec structs containing the data to send @param nvec The number of iovec structs in the array @param len Receives the number of bytes actually written @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 socket option. The number of bytes actually sent is stored in argument 4. It is possible for both bytes to be sent and an error to be returned. APR_EINTR is never returned. </PRE> @param sock The socket to send from @param where The apr_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 Read data from a socket. On success, the address of the peer from which the data was sent is copied into the @a from parameter, and the @a len parameter is updated to give the number of bytes written to @a buf. @param from Updated with the address from which the data was received @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 Read data from a network. @param sock The socket to read the data from. @param buf The buffer to store the data in. @param len On entry, the number of bytes to receive; on exit, the number of bytes received. @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 socket option. The number of bytes actually received is stored in argument 3. It is possible for both bytes to be received and an APR_EOF or other error to be returned. APR_EINTR is never returned. </PRE> Setup socket options for the specified socket @param sock The socket to set up. @param opt The option we would like to configure. One of: <PRE> APR_SO_DEBUG -- turn on debugging information APR_SO_KEEPALIVE -- keep connections active APR_SO_LINGER -- lingers on close if data is present APR_SO_NONBLOCK -- Turns blocking on/off for socket When this option is enabled, use the APR_STATUS_IS_EAGAIN() macro to see if a send or receive function could not transfer data without blocking. APR_SO_REUSEADDR -- The rules used in validating addresses supplied to bind should allow reuse of local addresses. APR_SO_SNDBUF -- Set the SendBufferSize APR_SO_RCVBUF -- Set the ReceiveBufferSize APR_SO_FREEBIND -- Allow binding to non-local IP address. </PRE> @param on Value for the option. Setup socket timeout for the specified socket @param sock The socket to set up. @param t Value for the timeout. <PRE> t > 0 -- read and write calls return APR_TIMEUP if specified time elapsess with no data read or written t == 0 -- read and write calls never block t < 0 -- read and write calls block </PRE> Query socket options for the specified socket @param sock The socket to query @param opt The option we would like to query. One of: <PRE> APR_SO_DEBUG -- turn on debugging information APR_SO_KEEPALIVE -- keep connections active APR_SO_LINGER -- lingers on close if data is present APR_SO_NONBLOCK -- Turns blocking on/off for socket APR_SO_REUSEADDR -- The rules used in validating addresses supplied to bind should allow reuse of local addresses. APR_SO_SNDBUF -- Set the SendBufferSize APR_SO_RCVBUF -- Set the ReceiveBufferSize APR_SO_DISCONNECTED -- Query the disconnected state of the socket. (Currently only used on Windows) </PRE> @param on Socket option returned on the call. Query socket timeout for the specified socket @param sock The socket to query @param t Socket timeout returned from the query. Query the specified socket if at the OOB/Urgent data mark @param sock The socket to query @param atmark Is set to true if socket is at the OOB/urgent mark, otherwise is set to false. Return an address associated with a socket; either the address to which the socket is bound locally or the address of the peer to which the socket is connected. @param sa The returned apr_sockaddr_t. @param which Whether to retrieve the local or remote address @param sock The socket to use 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. @param addr The IP address. @param sockaddr The socket address to reference. Write the IP address (in numeric address string format) of the APR socket address @a sockaddr into the buffer @a buf (of size @a buflen). @param sockaddr The socket address to reference. See if the IP addresses in two APR socket addresses are equivalent. Appropriate logic is present for comparing IPv4-mapped IPv6 addresses with IPv4 addresses. @param addr1 One of the APR socket addresses. @param addr2 The other APR socket address. @remark The return value will be non-zero if the addresses are equivalent. See if the IP address in an APR socket address refers to the wildcard address for the protocol family (e.g., INADDR_ANY for IPv4). @param addr The APR socket address to examine. @remark The return value will be non-zero if the address is initialized and is the wildcard address. Return the type of the socket. @param sock The socket to query. @param type The returned type (e.g., SOCK_STREAM). 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 @param servname The name of the service you wish to use Build an ip-subnet representation from an IP address and optional netmask or number-of-bits. @param ipsub The new ip-subnet representation @param ipstr The input IP address string @param mask_or_numbits The input netmask or number-of-bits string, or NULL @param p The pool to allocate from Test the IP address in an apr_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 Return the protocol of the socket. @param sock The socket to query. @param protocol The returned protocol (e.g., APR_PROTO_TCP). Set a socket to be inherited by child processes. Unset a socket from being inherited by child processes. Set socket permissions. Join a Multicast Group @param sock The socket to join a multicast group @param join The address of the multicast group to join @param iface Address of the interface to use. If NULL is passed, the default multicast interface will be used. (OS Dependent) @param source Source Address to accept transmissions from (non-NULL implies Source-Specific Multicast) Leave a Multicast Group. All arguments must be the same as apr_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 default multicast interface will be used. (OS Dependent) @param source Source Address to accept transmissions from (non-NULL implies Source-Specific Multicast) Set the Multicast Time to Live (ttl) for a multicast transmission. @param sock The socket to set the multicast ttl @param ttl Time to live to Assign. 0-255, default=1 @remark If the TTL is 0, packets will only be seen by sockets on the local machine, and only when multicast loopback is enabled. Toggle IP Multicast Loopback @param sock The socket to set multicast loopback @param opt 0=disable, 1=enable Set the Interface to be used for outgoing Multicast Transmissions. @param sock The socket to set the multicast interface on @param iface Address of the interface to use for Multicast Set up a pollset object @param pollset The pointer in which to return the newly created object @param size The maximum number of descriptors that this pollset can hold @param p The pool from which to allocate the pollset @param flags Optional flags to modify the operation of the pollset. @remark If flags contains 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 separate threads. This feature is only supported on some platforms; the apr_pollset_create() call will fail with APR_ENOTIMPL on platforms where it is not supported. @remark If flags contains APR_POLLSET_WAKEABLE, then a pollset is created with an additional internal pipe object used for the apr_pollset_wakeup() call. The actual size of pollset is in that case @a size + 1. This feature is only supported on some platforms; the apr_pollset_create() call will fail with APR_ENOTIMPL on platforms where it is not supported. @remark If flags contains APR_POLLSET_NOCOPY, then the apr_pollfd_t structures passed to apr_pollset_add() are not copied and must have a lifetime at least as long as the pollset. @remark Some poll methods (including APR_POLLSET_KQUEUE, APR_POLLSET_PORT, and APR_POLLSET_EPOLL) do not have a fixed limit on the size of the pollset. For these methods, the size parameter controls the maximum number of descriptors that will be returned by a single call to apr_pollset_poll(). Set up a pollset object @param pollset The pointer in which to return the newly created object @param size The maximum number of descriptors that this pollset can hold @param p The pool from which to allocate the pollset @param flags Optional flags to modify the operation of the pollset. @param method Poll method to use. See #apr_pollset_method_e. If this method cannot be used, the default method will be used unless the APR_POLLSET_NODEFAULT flag has been specified. @remark If flags contains 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 separate threads. This feature is only supported on some platforms; the apr_pollset_create_ex() call will fail with APR_ENOTIMPL on platforms where it is not supported. @remark If flags contains APR_POLLSET_WAKEABLE, then a pollset is created with additional internal pipe object used for the apr_pollset_wakeup() call. The actual size of pollset is in that case size + 1. This feature is only supported on some platforms; the apr_pollset_create_ex() call will fail with APR_ENOTIMPL on platforms where it is not supported. @remark If flags contains APR_POLLSET_NOCOPY, then the apr_pollfd_t structures passed to apr_pollset_add() are not copied and must have a lifetime at least as long as the pollset. @remark Some poll methods (including APR_POLLSET_KQUEUE, APR_POLLSET_PORT, and APR_POLLSET_EPOLL) do not have a fixed limit on the size of the pollset. For these methods, the size parameter controls the maximum number of descriptors that will be returned by a single call to apr_pollset_poll(). Destroy a pollset object @param pollset The pollset to destroy Add a socket or file descriptor to a pollset @param pollset The pollset to which to add the descriptor @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(). @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 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. @remark If the pollset has been created with APR_POLLSET_NOCOPY, the apr_pollfd_t structure referenced by descriptor will not be copied and must have a lifetime at least as long as the pollset. @remark Do not add the same socket or file descriptor to the same pollset multiple times, even if the requested events differ for the different calls to apr_pollset_add(). If the events of interest for a descriptor change, you must first remove the descriptor from the pollset with apr_pollset_remove(), then add it again specifying all requested events. 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 descriptor is not found, APR_NOTFOUND is returned. @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 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. @remark apr_pollset_remove() cannot be used to remove a subset of requested events for a descriptor. The reqevents field in the apr_pollfd_t parameter must contain the same value when removing as when adding. Block for activity on the descriptor(s) in a pollset @param pollset The pollset to use @param timeout The amount of time in microseconds to wait. This is a maximum, not a minimum. If a descriptor is signalled, the function will return before this time. If timeout is negative, the function will block until a descriptor is signalled or until apr_pollset_wakeup() has been called. @param num Number of signalled descriptors (output parameter) @param descriptors Array of signalled descriptors (output parameter) @remark APR_EINTR will be returned if the pollset has been created with APR_POLLSET_WAKEABLE, apr_pollset_wakeup() has been called while waiting for activity, and there were no signalled descriptors at the time of the wakeup call. @remark Multiple signalled conditions for the same descriptor may be reported in one or more returned apr_pollfd_t structures, depending on the implementation. Interrupt the blocked apr_pollset_poll() call. @param pollset The pollset to use @remark If the pollset was not created with APR_POLLSET_WAKEABLE the return value is APR_EINIT. Poll the descriptors in the poll structure @param aprset The poll structure we will be using. @param numsock The number of descriptors we are polling @param nsds The number of descriptors signalled (output parameter) @param timeout The amount of time in microseconds to wait. This is a maximum, not a minimum. If a descriptor is signalled, the function will return before this time. If timeout is negative, the function will block until a descriptor is signalled or until apr_pollset_wakeup() has been called. @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- in if the return value is APR_SUCCESS. Set up a pollcb object @param pollcb The pointer in which to return the newly created object @param size The maximum number of descriptors that a single _poll can return. @param p The pool from which to allocate the pollcb @param flags Optional flags to modify the operation of the pollcb. @remark If flags contains APR_POLLSET_WAKEABLE, then a pollcb is created with an additional internal pipe object used for the apr_pollcb_wakeup() call. The actual size of pollcb is in that case @a size + 1. @remark Pollcb is only supported on some platforms; the apr_pollcb_create() call will fail with APR_ENOTIMPL on platforms where it is not supported. Set up a pollcb object @param pollcb The pointer in which to return the newly created object @param size The maximum number of descriptors that a single _poll can return. @param p The pool from which to allocate the pollcb @param flags Optional flags to modify the operation of the pollcb. @param method Poll method to use. See #apr_pollset_method_e. If this method cannot be used, the default method will be used unless the APR_POLLSET_NODEFAULT flag has been specified. @remark If flags contains APR_POLLSET_WAKEABLE, then a pollcb is created with an additional internal pipe object used for the apr_pollcb_wakeup() call. The actual size of pollcb is in that case @a size + 1. @remark Pollcb is only supported on some platforms; the apr_pollcb_create_ex() call will fail with APR_ENOTIMPL on platforms where it is not supported. Add a socket or file descriptor to a pollcb @param pollcb The pollcb to which to add the descriptor @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_pollcb_poll(). @remark Unlike the apr_pollset API, the descriptor is not copied, and users must retain the memory used by descriptor, as the same pointer will be returned to them from apr_pollcb_poll. @remark Do not add the same socket or file descriptor to the same pollcb multiple times, even if the requested events differ for the different calls to apr_pollcb_add(). If the events of interest for a descriptor change, you must first remove the descriptor from the pollcb with apr_pollcb_remove(), then add it again specifying all requested events. Remove a descriptor from a pollcb @param pollcb The pollcb from which to remove the descriptor @param descriptor The descriptor to remove @remark If the descriptor is not found, APR_NOTFOUND is returned. @remark apr_pollcb_remove() cannot be used to remove a subset of requested events for a descriptor. The reqevents field in the apr_pollfd_t parameter must contain the same value when removing as when adding. Block for activity on the descriptor(s) in a pollcb @param pollcb The pollcb to use @param timeout The amount of time in microseconds to wait. This is a maximum, not a minimum. If a descriptor is signalled, the function will return before this time. If timeout is negative, the function will block until a descriptor is signalled or until apr_pollcb_wakeup() has been called. @param func Callback function to call for each active descriptor. @param baton Opaque baton passed to the callback function. @remark Multiple signalled conditions for the same descriptor may be reported in one or more calls to the callback function, depending on the implementation. @remark APR_EINTR will be returned if the pollset has been created with APR_POLLSET_WAKEABLE and apr_pollcb_wakeup() has been called while waiting for activity. Interrupt the blocked apr_pollcb_poll() call. @param pollcb The pollcb to use @remark If the pollcb was not created with APR_POLLSET_WAKEABLE the return value is APR_EINIT. 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. 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 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. @remark This function is thread-safe, in the sense that multiple threads can safely create subpools of the same parent pool concurrently. Similarly, a subpool can be created by one thread at the same time that another thread accesses the parent pool. Create a new pool. \xrefitem deprecated 330.@see apr_pool_create_unmanaged_ex. Create a new unmanaged pool. @param newpool The pool we have just created. @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 a new allocator will be created with the new pool as owner. @remark An unmanaged pool is a special pool without a parent; it will NOT be destroyed upon apr_terminate. It must be explicitly destroyed by calling apr_pool_destroy, to prevent memory leaks. Use of this function is discouraged, think twice about whether you really really need it. @warning Any child cleanups registered against the new pool, or against sub-pools thereof, will not be executed during an invocation of apr_proc_create(), so resources created in an "unmanaged" pool hierarchy will leak to child processes.

Debug version of apr_pool_create_ex.

Parameters
newpool
See also
apr_pool_create.
Parameters
parent
See also
apr_pool_create.
Parameters
abort_fn
See also
apr_pool_create.
Parameters
allocator
See also
apr_pool_create.
Parameters
file_lineWhere the function is called from. This is usually APR_POOL__FILE_LINE__.
Remarks
Only available when APR_POOL_DEBUG is defined. Call this directly if you have your apr_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.

Debug version of apr_pool_create_core_ex.

Deprecated:
See also
apr_pool_create_unmanaged_ex_debug.

Debug version of apr_pool_create_unmanaged_ex.

Parameters
newpool
See also
apr_pool_create_unmanaged.
Parameters
abort_fn
See also
apr_pool_create_unmanaged.
Parameters
allocator
See also
apr_pool_create_unmanaged.
Parameters
file_lineWhere the function is called from. This is usually APR_POOL__FILE_LINE__.
Remarks
Only available when APR_POOL_DEBUG is defined. Call this directly if you have your apr_pool_create_unmanaged_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_core_ex in a wrapper, trust the macro and don't call apr_pool_create_core_ex_debug directly.

Determine if pool a is an ancestor of pool b.

Parameters
aThe pool to search
bThe pool to search for
Returns
True if a is an ancestor of b, NULL is considered an ancestor of all pools.
Remarks
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 ancestor of pool B.

Set the data associated with the current pool

Parameters
dataThe user data associated with the pool.
keyThe key to use for association
cleanupThe cleanup program to use to cleanup the data (NULL if none)
poolThe current pool
Warning
The data to be attached to the pool should have a life span at least as long as the pool it is being attached to.

Users of APR must take EXTREME care when choosing a key to use for their data. It is possible to accidentally overwrite data by choosing a key that another part of the program is using. Therefore it is advised that steps are taken to ensure that unique keys are used for all of the userdata objects in a particular pool (the same key in two different pools or a pool and one of its subpools is okay) at all times. Careful namespace prefixing of key names is a typical way to help ensure this uniqueness.

Set the data associated with the current pool

Parameters
dataThe user data associated with the pool.
keyThe key to use for association
cleanupThe cleanup program to use to cleanup the data (NULL if none)
poolThe current pool
Note
same as apr_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 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.
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.

Return the data associated with the current pool.

Parameters
dataThe user data associated with the pool.
keyThe key for the data to retrieve
poolThe current pool.

convert the file from apr type to os specific type.

Parameters
thefileThe os specific file we are converting to
fileThe apr file to convert.
Remarks
On Unix, it is only possible to get a file descriptor from an apr file type.

convert the dir from apr type to os specific type.

Parameters
thedirThe os specific dir we are converting to
dirThe apr dir to convert.

Convert the socket from an apr type to an OS specific socket

Parameters
thesockThe socket to convert.
sockThe os specific equivalent of the apr socket..

Convert the proc mutex from apr type to os specific type

Parameters
ospmutexThe os specific proc mutex we are converting to.
pmutexThe apr proc mutex to convert.

Convert the proc mutex from apr type to os specific type, also providing the mechanism used by the apr mutex.

Parameters
ospmutexThe os specific proc mutex we are converting to.
pmutexThe apr proc mutex to convert.
mechThe mechanism used by the apr proc mutex (if not NULL).
Remarks
Allows for disambiguation for platforms with multiple mechanisms available.

Get the exploded time in the platforms native format.

Parameters
ostimethe native time format
aprtimethe time to convert

Get the imploded time in the platforms native format.

Parameters
ostimethe native time format
aprtimethe time to convert

convert the shm from apr type to os specific type.

Parameters
osshmThe os specific shm representation
shmThe apr shm to convert.

convert the file from os specific type to apr type.

Parameters
fileThe apr file we are converting to.
thefileThe os specific file to convert
flagsThe flags that were used to open this file.
contThe pool to use if it is needed.
Remarks
On Unix, it is only possible to put a file descriptor into an apr file type.

convert the file from os specific type to apr type.

Parameters
fileThe apr file we are converting to.
thefileThe os specific pipe to convert
contThe pool to use if it is needed.
Remarks
On Unix, it is only possible to put a file descriptor into an apr file type.

convert the file from os specific type to apr type.

Parameters
fileThe apr file we are converting to.
thefileThe os specific pipe to convert
register_cleanupA cleanup will be registered on the apr_file_t to issue apr_file_close().
contThe pool to use if it is needed.
Remarks
On Unix, it is only possible to put a file descriptor into an apr file type.

convert the dir from os specific type to apr type.

Parameters
dirThe apr dir we are converting to.
thedirThe os specific dir to convert
contThe pool to use when creating to apr directory.

Convert a socket from the os specific type to the APR type. If sock points to NULL, a socket will be created from the pool provided. If **sock does not point to NULL, the structure pointed to by sock will be reused and updated with the given socket.

Parameters
sockThe pool to use.
thesockThe socket to convert to.
contThe socket we are converting to an apr type.
Remarks
If it is a true socket, it is best to call apr_os_sock_make() and provide APR with more information about the socket.

Create a socket from an existing descriptor and local and remote socket addresses.

Parameters
apr_sockThe new socket that has been set up
os_sock_infoThe os representation of the socket handle and other characteristics of the socket
contThe pool to use
Remarks
If you only know the descriptor/handle or if it isn't really a true socket, use apr_os_sock_put() instead.

Convert the proc mutex from os specific type to apr type

Parameters
pmutexThe apr proc mutex we are converting to.
ospmutexThe os specific proc mutex to convert.
contThe pool to use if it is needed.

Convert the proc mutex from os specific type to apr type, using the specified mechanism.

Parameters
pmutexThe apr proc mutex we are converting to.
ospmutexThe os specific proc mutex to convert.
mechThe apr mutex locking mechanism
register_cleanupWhether to destroy the os mutex with the apr one (either on explicit destroy or pool cleanup).
contThe pool to use if it is needed.
Remarks
Allows for disambiguation for platforms with multiple mechanisms available.

Put the imploded time in the APR format.

Parameters
aprtimethe APR time format
ostimethe time to convert
contthe pool to use if necessary

Put the exploded time in the APR format.

Parameters
aprtimethe APR time format
ostimethe time to convert
contthe pool to use if necessary

convert the shared memory from os specific type to apr type.

Parameters
shmThe apr shm representation of osshm
osshmThe os specific shm identity
contThe pool to use if it is needed.
Remarks
On fork()ed architectures, this is typically nothing more than the memory block mapped. On non-fork architectures, this is typically some internal handle to pass the mapping from process to process.

Create and initialize a mutex that can be used to synchronize processes.

Parameters
mutexthe memory address where the newly created mutex will be stored.
fnameA file name to use if the lock mechanism requires one. This argument should always be provided. The lock code itself will determine if it should be used.
mechThe mechanism to use for the interprocess lock, if any; one of
           APR_LOCK_FCNTL
           APR_LOCK_FLOCK
           APR_LOCK_SYSVSEM
           APR_LOCK_POSIXSEM
           APR_LOCK_PROC_PTHREAD
           APR_LOCK_DEFAULT     pick the default mechanism for the platform
poolthe pool from which to allocate the mutex.
See also
apr_lockmech_e
Warning
Check APR_HAS_foo_SERIALIZE defines to see if the platform supports APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable.

Re-open a mutex in a child process.

Parameters
mutexThe newly re-opened mutex structure.
fnameA 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().
poolThe pool to operate on.
Remarks
This function must be called to maintain portability, even if the underlying lock mechanism does not require it.

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.

Parameters
mutexthe mutex on which to acquire the lock.

Attempt to acquire the lock for the given mutex. If the mutex has already been acquired, the call returns immediately with 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.

Parameters
mutexthe mutex on which to attempt the lock acquiring.

Attempt to acquire the lock for the given mutex until timeout expires. If the acquisition time outs, the call returns with APR_TIMEUP.

Parameters
mutexthe mutex on which to attempt the lock acquiring.
timeoutthe relative timeout (microseconds).
Note
A negative or nul timeout means immediate attempt, returning APR_TIMEUP without blocking if it the lock is already acquired.

Release the lock for the given mutex.

Parameters
mutexthe mutex from which to release the lock.

Destroy the mutex and free the memory associated with the lock.

Parameters
mutexthe mutex to destroy.

Destroy the mutex and free the memory associated with the lock.

Parameters
mutexthe mutex to destroy.
Note
This function is generally used to kill a cleanup on an already created mutex

Set mutex permissions.

Generate cryptographically insecure random bytes.

Parameters
gThe RNG state
randomBuffer to fill with random bytes
bytesLength of buffer in bytes

Generate cryptographically secure random bytes.

Parameters
gThe RNG state
randomBuffer to fill with random bytes
bytesLength of buffer in bytes

Return APR_SUCCESS if the cryptographic PRNG has been seeded with enough data, APR_ENOTENOUGHENTROPY otherwise.

Parameters
rThe RNG state

Return APR_SUCCESS if the PRNG has been seeded with enough data, APR_ENOTENOUGHENTROPY otherwise.

Parameters
rThe PRNG state

Create and make accessible a shared memory segment with default properties.

Parameters
mThe shared memory structure to create.
reqsizeThe desired size of the segment.
filenameThe file to use for shared memory on platforms that require it.
poolthe pool from which to allocate the shared memory structure.
Remarks
A note about Anonymous vs. Named shared memory segments: Not all plaforms support anonymous shared memory segments, but in some cases it is prefered over other types of shared memory implementations. Passing a NULL 'file' parameter to this function will cause the subsystem to use anonymous shared memory segments. If such a system is not available, APR_ENOTIMPL is returned.
A note about allocation sizes: On some platforms it is necessary to store some metainformation 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() function will return the first usable byte of memory.

Create and make accessible a shared memory segment with platform- specific processing.

Parameters
mThe shared memory structure to create.
reqsizeThe desired size of the segment.
filenameThe file to use for shared memory on platforms that require it.
poolthe pool from which to allocate the shared memory structure.
flagsmask of APR_SHM_* (defined above)
Remarks
A note about Anonymous vs. Named shared memory segments: Not all plaforms support anonymous shared memory segments, but in some cases it is prefered over other types of shared memory implementations. Passing a NULL 'file' parameter to this function will cause the subsystem to use anonymous shared memory segments. If such a system is not available, APR_ENOTIMPL is returned.
A note about allocation sizes: On some platforms it is necessary to store some metainformation 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() function will return the first usable byte of memory.

Remove named resource associated with a shared memory segment, preventing attachments to the resource, but not destroying it.

Parameters
filenameThe filename associated with shared-memory segment which needs to be removed
poolThe pool used for file operations
Remarks
This function is only supported on platforms which support name-based shared memory segments, and will return APR_ENOTIMPL on platforms without such support. Removing the file while the shm is in use is not entirely portable, caller may use this to enhance obscurity of the resource, but be prepared for the call to fail, and for concurrent attempts to create a resource of the same name to also fail. The pool cleanup of apr_shm_create (apr_shm_destroy) also removes the named resource.

Delete named resource associated with a shared memory segment, preventing attachments to the resource.

Parameters
mThe shared memory segment structure to delete.
Remarks
This function is only supported on platforms which support name-based shared memory segments, and will return APR_ENOTIMPL on platforms without such support. Removing the file while the shm is in use is not entirely portable, caller may use this to enhance obscurity of the resource, but be prepared for the call to fail, and for concurrent attempts to create a resource of the same name to also fail. The pool cleanup of apr_shm_create (apr_shm_destroy) also removes the named resource.

Destroy a shared memory segment and associated memory.

Parameters
mThe shared memory segment structure to destroy.

Attach to a shared memory segment that was created by another process.

Parameters
mThe shared memory structure to create.
filenameThe file used to create the original segment. (This MUST match the original filename.)
poolthe pool from which to allocate the shared memory structure for this process.

Attach to a shared memory segment that was created by another process, with platform-specific processing.

Parameters
mThe shared memory structure to create.
filenameThe file used to create the original segment. (This MUST match the original filename.)
poolthe pool from which to allocate the shared memory structure for this process.
flagsmask of APR_SHM_* (defined above)

Detach from a shared memory segment without destroying it.

Parameters
mThe shared memory structure representing the segment to detach from.

Set shared memory permissions.

Allocate a new skip list

Parameters
slThe pointer in which to return the newly created skip list
pThe pool from which to allocate the skip list (optional).
Remarks
Unlike most APR functions, a pool is optional. If no pool is provided, the C standard library heap functions will be used instead.

Remove a node from the skip list.

Parameters
slThe skip list
iterThe skip list node to remove
myfreeA function to be called for the removed element

Remove an element from the skip list using the specified comparison function for locating the element. In the case of duplicates, the 1st entry will be removed.

Parameters
slThe skip list
dataThe element to remove
myfreeA function to be called for each removed element
compThe comparison function to use for placement into the skip list
Remarks
If the element is not found, 0 will be returned. Otherwise, the heightXXX will be returned.

Remove an element from the skip list using the existing comparison function for locating the element. In the case of duplicates, the 1st entry will be removed.

Parameters
slThe skip list
dataThe element to remove
myfreeA function to be called for each removed element
Remarks
If the element is not found, 0 will be returned. Otherwise, the heightXXX will be returned.
If no comparison function has been set for the skip list, the element will not be removed and 0 will be returned.

Return the height of the list (number of skip paths), in O(1).

Parameters
slThe skip list

Return the predefined maximum height of the skip list.

Parameters
slThe skip list

Create and initialize a new procattr variable

Parameters
new_attrThe newly created procattr.
contThe pool to use

Determine if any of stdin, stdout, or stderr should be linked to pipes when starting a child process.

Parameters
attrThe procattr we care about.
inShould stdin be a pipe back to the parent?
outShould stdout be a pipe back to the parent?
errShould stderr be a pipe back to the parent?
Note
If APR_NO_PIPE, there will be no special channel, the child inherits the parent's corresponding stdio stream. If APR_NO_FILE is specified, that corresponding stream is closed in the child (and will be INVALID_HANDLE_VALUE when inspected on Win32). This can have ugly side effects, as the next file opened in the child on Unix will fall into the stdio stream fd slot!

Set the child_in and/or parent_in values to existing apr_file_t values.

Parameters
attrThe procattr we care about.
child_inapr_file_t value to use as child_in. Must be a valid file.
parent_inapr_file_t value to use as parent_in. Must be a valid file.
Remarks
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. You can save some extra function calls by not creating your own pipe since this creates one in the process space for you.
Bug:
Note that calling this function with two NULL files on some platforms creates an APR_FULL_BLOCK pipe, but this behavior is neither portable nor is it supported.
See also
apr_procattr_io_set instead for simple pipes.

Set the child_out and parent_out values to existing apr_file_t values.

Parameters
attrThe procattr we care about.
child_outapr_file_t value to use as child_out. Must be a valid file.
parent_outapr_file_t value to use as parent_out. Must be a valid file.
Remarks
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.
Bug:
Note that calling this function with two NULL files on some platforms creates an APR_FULL_BLOCK pipe, but this behavior is neither portable nor is it supported.
See also
apr_procattr_io_set instead for simple pipes.

Set the child_err and parent_err values to existing apr_file_t values.

Parameters
attrThe procattr we care about.
child_errapr_file_t value to use as child_err. Must be a valid file.
parent_errapr_file_t value to use as parent_err. Must be a valid file.
Remarks
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.
Bug:
Note that calling this function with two NULL files on some platforms creates an APR_FULL_BLOCK pipe, but this behavior is neither portable nor is it supported.
See also
apr_procattr_io_set instead for simple pipes.

Set which directory the child process should start executing in.

Parameters
attrThe procattr we care about.
dirWhich dir to start in. By default, this is the same dir as the parent currently resides in, when the createprocess call is made.

Set what type of command the child process will call.

Parameters
attrThe procattr we care about.
cmdThe type of command. One of:
           APR_SHELLCMD     --  Anything that the shell can handle
           APR_PROGRAM      --  Executable program   (default) 
           APR_PROGRAM_ENV  --  Executable program, copy environment
           APR_PROGRAM_PATH --  Executable program on PATH, copy env

Determine if the child should start in detached state.

Parameters
attrThe procattr we care about.
detachShould the child start in detached state? Default is no.

Specify an error function to be called in the child process if APR encounters an error in the child prior to running the specified program.

Parameters
attrThe procattr describing the child process to be created.
errfnThe function to call in the child process.
Remarks
At the present time, it will only be called from apr_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 in the parent process rather than invoke the callback in the now-forked child process.

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 the child.

Parameters
attrThe procattr describing the child process to be created.
chkFlag to indicate whether or not extra work should be done to try to report failures to the caller.
Remarks
This flag only affects apr_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.

Determine if the child should start in its own address space or using the current one from its parent

Parameters
attrThe procattr we care about.
addrspaceShould the child start in its own address space? Default is no on NetWare and yes on other platforms.

Set the username used for running process

Parameters
attrThe procattr we care about.
usernameThe username used
passwordUser password if needed. Password is needed on WIN32 or any other platform having APR_PROCATTR_USER_SET_REQUIRES_PASSWORD set.

Set the group used for running process

Parameters
attrThe procattr we care about.
groupnameThe group name used

Register permission set function

Parameters
attrThe procattr we care about.
perms_set_fnPermission set callback
dataData to pass to permission callback function
permsPermissions to set

Create a new process and execute a new program within that process.

Parameters
new_procThe resulting process handle.
prognameThe program to run
argsthe arguments to pass to the new program. The first one should be the program name.
envThe new environment table for the new process. This should be a list of NULL-terminated strings. This argument is ignored for APR_PROGRAM_ENV, APR_PROGRAM_PATH, and APR_SHELLCMD_ENV types of commands.
attrthe procattr we should use to determine how to create the new process
poolThe pool to use.
Note
This function returns without waiting for the new process to terminate; use apr_proc_wait for that.

Wait for a child process to die

Parameters
procThe process handle that corresponds to the desired child process
exitcodeThe returned exit status of the child, if a child process dies, or the signal that caused the child to die. On platforms that don't support obtaining this information, the status parameter will be returned as APR_ENOTIMPL.
exitwhyWhy the child died, the bitwise or of:
           APR_PROC_EXIT         -- process terminated normally
           APR_PROC_SIGNAL       -- process was killed by a signal
           APR_PROC_SIGNAL_CORE  -- process was killed by a signal, and
                                    generated a core dump.
waithowHow should we wait. One of:
           APR_WAIT   -- block until the child process dies.
           APR_NOWAIT -- return immediately regardless of if the 
                         child is dead or not.
Remarks
The child's status is in the return code to this process. It is one of:
           APR_CHILD_DONE     -- child is no longer running.
           APR_CHILD_NOTDONE  -- child is still running.

Wait for any current child process to die and return information about that child.

Parameters
procPointer to NULL on entry, will be filled out with child's information
exitcodeThe returned exit status of the child, if a child process dies, or the signal that caused the child to die. On platforms that don't support obtaining this information, the status parameter will be returned as APR_ENOTIMPL.
exitwhyWhy the child died, the bitwise or of:
           APR_PROC_EXIT         -- process terminated normally
           APR_PROC_SIGNAL       -- process was killed by a signal
           APR_PROC_SIGNAL_CORE  -- process was killed by a signal, and
                                    generated a core dump.
waithowHow should we wait. One of:
           APR_WAIT   -- block until the child process dies.
           APR_NOWAIT -- return immediately regardless of if the 
                         child is dead or not.
pPool to allocate child information out of.
Bug:
Passing proc as a *proc rather than **proc was an odd choice for some platforms... this should be revisited in 1.0

Detach the process from the controlling terminal.

Parameters
daemonizeset to non-zero if the process should daemonize and become a background process, else it will stay in the foreground.

Notify the maintenance callback of a registered other child process that application has detected an event, such as death.

Parameters
procThe process to check
reasonThe reason code to pass to the maintenance function
statusThe status to pass to the maintenance function
Remarks
An example of code using this behavior;
rv = apr_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)
            == APR_SUCCESS) {
        ;  (already handled)
    }
    else
#endif
        [... handling non-otherchild processes death ...]

Terminate a process.

Parameters
procThe process to terminate.
sigHow to kill the process.

Convert an ansi time_t to an apr_time_t

Parameters
resultthe resulting apr_time_t
inputthe time_t to convert

Convert a time to its human readable components using an offset from GMT.

Parameters
resultthe exploded time
inputthe time to explode
offsthe number of seconds offset to apply

Convert a time to its human readable components (GMT).

Parameters
resultthe exploded time
inputthe time to explode

Convert a time to its human readable components in the local timezone.

Parameters
resultthe exploded time
inputthe time to explode

Convert time value from human readable format to a numeric apr_time_t (elapsed microseconds since the epoch).

Parameters
resultthe resulting imploded time
inputthe input exploded time

Convert time value from human readable format to a numeric apr_time_t that always represents GMT.

Parameters
resultthe resulting imploded time
inputthe input exploded time

apr_rfc822_date formats dates in the RFC822 format in an efficient manner. It is a fixed length format which requires APR_RFC822_DATA_LEN bytes of storage, including the trailing NUL terminator.

Parameters
date_strString to write to.
tthe time to convert

apr_ctime formats dates in the ctime() format in an efficient manner. It is a fixed length format and requires APR_CTIME_LEN bytes of storage including the trailing NUL terminator. Unlike ANSI/ISO C ctime(), apr_ctime() does not include a \n at the end of the string.

Parameters
date_strString to write to.
tthe time to convert

Formats the exploded time according to the format specified

Parameters
sstring to write to
retsizeThe length of the returned string
maxThe maximum length of the string
formatThe format for the time string
tmThe time to convert

< File is read-only

< File is executable

< all protections

< File is read-only

< File is read-only

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Write by group

<

Deprecated:
See also
APR_FPROT_GWRITE

< Write by others

<

Deprecated:
See also
APR_FPROT_WWRITE

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Write by group

<

Deprecated:
See also
APR_FPROT_GWRITE

< Write by others

<

Deprecated:
See also
APR_FPROT_WWRITE

< File is executable

< File is executable

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

< Execute by group

<

Deprecated:
See also
APR_FPROT_GEXECUTE

< Execute by others

<

Deprecated:
See also
APR_FPROT_WEXECUTE

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

< Execute by group

<

Deprecated:
See also
APR_FPROT_GEXECUTE

< Execute by others

<

Deprecated:
See also
APR_FPROT_WEXECUTE

< Stat the link not the file itself if it is a link

< Stat the link not the file itself if it is a link

< ->name in proper case

< ->name in proper case

< Access Time

< Create the file if not there

< Open the file for reading

< Open the file for writing

< Delete the file after close

< Open should fail if APR_FOPEN_CREATE and file exists.

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Read by user

<

Deprecated:
See also
APR_FPROT_UREAD

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< ->name in proper case

< Modification Time

< Access Time

< Creation or inode-changed time

< Type

< Size of the file

< Storage size consumed by the file

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< ->name in proper case

< ->name in proper case

< Type

< all protections

< ->name in proper case

< ->name in proper case

< File is read-only

< File is hidden

< File is read-only

< File is read-only

< File is hidden

< File is hidden

< Platform dependent flag to enable * non blocking file io

< Open the file for reading

< Open the file for writing

< Open the file for reading

< Open the file for writing

< Open the file for buffered I/O

< Create the file if not there

< Open should fail if APR_FOPEN_CREATE and file exists.

< Open the file and truncate to 0 length

< Open should fail if APR_FOPEN_CREATE and file exists.

< Create the file if not there

< Open the file and truncate to 0 length

< Append to the end of the file

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Delete the file after close

< Open the file for buffered I/O

< Open the file for writing

< Open the file for writing

< Open the file for reading

< Append to the end of the file

< an atomic unix apr_stat()

< Open the file for writing

< Create the file if not there

< Open the file and truncate to 0 length

< Open the file for writing

< Create the file if not there

< Append to the end of the file

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< File is read-only

< File is executable

< all protections

< File is read-only

< File is read-only

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Write by group

<

Deprecated:
See also
APR_FPROT_GWRITE

< Write by others

<

Deprecated:
See also
APR_FPROT_WWRITE

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Write by group

<

Deprecated:
See also
APR_FPROT_GWRITE

< Write by others

<

Deprecated:
See also
APR_FPROT_WWRITE

< File is executable

< File is executable

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

< Execute by group

<

Deprecated:
See also
APR_FPROT_GEXECUTE

< Execute by others

<

Deprecated:
See also
APR_FPROT_WEXECUTE

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

< Execute by group

<

Deprecated:
See also
APR_FPROT_GEXECUTE

< Execute by others

<

Deprecated:
See also
APR_FPROT_WEXECUTE

< Access Time

< Stat the link not the file itself if it is a link

< Stat the link not the file itself if it is a link

< Stat the link not the file itself if it is a link

< Create the file if not there

< Open the file for reading

< Open the file for writing

< Open should fail if APR_FOPEN_CREATE and file exists.

< Delete the file after close

< Open the file for reading

< Open the file for writing

< Open the file for reading

< Open the file for writing

< Create the file if not there

< Open should fail if APR_FOPEN_CREATE and file exists.

< Open should fail if APR_FOPEN_CREATE and file exists.

< Create the file if not there

< Append to the end of the file

< Open the file and truncate to 0 length

< Platform dependent flag to enable * non blocking file io

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Open the file for buffered I/O

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Open the file for buffered I/O

< Open the file for writing

< Open the file for writing

< Open the file for reading

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

The problem with trying to output the entire iovec is that we cannot maintain the behaviour that a real writev would have. If we iterate over the iovec one at a time, we lose the atomic properties of writev(). The other option is to combine the entire iovec into one buffer that we could then send in one call to write(). This is not reasonable since we do not know how much data an iovec could contain.

The only reasonable option, that maintains the semantics of a real writev(), is to only write the first iovec. Callers of file_writev() must deal with partial writes as they normally would. If you want to ensure an entire iovec is written, use apr_file_writev_full().

< ->name in proper case

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Size of the file

< Size of the file

< dev and inode

< Number of links

< ->name in proper case

< Type

< Type

< ->name in proper case

< File is read-only

< File is hidden

< File is read-only

< File is read-only

< File is hidden

< File is hidden

< Open the file for reading

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

< Platform dependent flag to enable * non blocking file io

< Open the file for reading

< Open the file for writing

< Create the file if not there

< Open should fail if APR_FOPEN_CREATE and file exists.

< Open the file and truncate to 0 length

< Open the file and truncate to 0 length

< Open should fail if APR_FOPEN_CREATE and file exists.

< Create the file if not there

< Delete the file after close

< Open the file for reading

< Open the file for writing

< Platform dependent tag to open the file for use across multiple threads

< Append to the end of the file

< Open the file for buffered I/O

< Platform dependent flag to enable * sparse file support, see WARNING below

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Append to the end of the file

< Open the file for buffered I/O

< Open the file for writing

< Open the file for writing

< Open the file for reading

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Size of the file

< Platform dependent tag to open the file for use across multiple threads

< Size of the file

< Keepalive

< Debug

< Allow broadcast

< Reuse addresses

< Send buffer

< Non-blocking IO

< Linger

< For SCTP sockets, this is mapped * to STCP_NODELAY internally.

< Can read without blocking

< Can read without blocking

< Can read without blocking

< Non-blocking IO

< Non-blocking IO

< Keepalive

< Keepalive

< Keepalive

< Debug

< Debug

< Debug

< Send buffer

< Receive buffer

< Allow broadcast

< Allow broadcast

< Allow broadcast

< Reuse addresses

< Reuse addresses

< Reuse addresses

< Non-blocking IO

< Non-blocking IO

< Non-blocking IO

< Linger

< Linger

< Linger

< Delay accepting of new connections * until data is available. *

See also
apr_socket_accept_filter

< For SCTP sockets, this is mapped * to STCP_NODELAY internally.

< For SCTP sockets, this is mapped * to STCP_NODELAY internally.

< For SCTP sockets, this is mapped * to STCP_NODELAY internally.

< Don't accept IPv4 connections on an * IPv6 listening socket.

< Disconnected

< Keepalive

< Debug

< Reuse addresses

< Non-blocking IO

< Linger

< Can read without blocking

< Can write without blocking

< Priority data available

< Can read without blocking

< Can write without blocking

< Priority data available

< Can read without blocking

< Can read without blocking

< Can write without blocking

< Can write without blocking

< Priority data available

< Priority data available

< Poll operations are interruptable by * apr_pollset_wakeup() or apr_pollcb_wakeup()

< Poll operations are interruptable by * apr_pollset_wakeup() or apr_pollcb_wakeup()

< Can read without blocking

< Do not try to use the default method if * the specified non-default method cannot be * used

< Can read without blocking

< Can read without blocking

< Can write without blocking

< Can write without blocking

< Priority data available

< Priority data available

< Do not try to use the default method if * the specified non-default method cannot be * used

< Do not try to use the default method if * the specified non-default method cannot be * used

< Poll operations are interruptable by * apr_pollset_wakeup() or apr_pollcb_wakeup()

< Do not try to use the default method if * the specified non-default method cannot be * used

< Do not try to use the default method if * the specified non-default method cannot be * used

< Poll operations are interruptable by * apr_pollset_wakeup() or apr_pollcb_wakeup()

< Poll operations are interruptable by * apr_pollset_wakeup() or apr_pollcb_wakeup()

< Poll operations are interruptable by * apr_pollset_wakeup() or apr_pollcb_wakeup()

< Do not try to use the default method if * the specified non-default method cannot be * used

< Do not try to use the default method if * the specified non-default method cannot be * used

< Poll operations are interruptable by * apr_pollset_wakeup() or apr_pollcb_wakeup()

< Poll operations are interruptable by * apr_pollset_wakeup() or apr_pollcb_wakeup()

< Poll operations are interruptable by * apr_pollset_wakeup() or apr_pollcb_wakeup()

< Poll operations are interruptable by * apr_pollset_wakeup() or apr_pollcb_wakeup()

< Poll operations are interruptable by * apr_pollset_wakeup() or apr_pollcb_wakeup()

< Open the file for reading

<

Deprecated:
See also
APR_FOPEN_READ

< Open the file for writing

<

Deprecated:
See also
APR_FOPEN_WRITE

< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)

<

Deprecated:
See also
APR_FOPEN_BINARY

< Create the file if not there

<

Deprecated:
See also
APR_FOPEN_CREATE

< Read by user

<

Deprecated:
See also
APR_FPROT_UREAD

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Disable backslash escaping.

< Slash must be matched by slash.

< Period must be matched by period.

< Match failed.

< Match failed.

< Match failed.

< Match failed.

< Match failed.

< Match failed.

< Match failed.

< Match failed.

< Match failed.

< ->name in proper case

< Open the file for reading

<

Deprecated:
See also
APR_FOPEN_READ

< Open the file for buffered I/O

<

Deprecated:
See also
APR_FOPEN_BUFFERED

< Detach

< Detach

< Detach

< Detach

Definition at line 21 of file apr_atomic.c.

◆ APR_DECLARE() [5/5]

APR_DECLARE ( void  )

Destroy an allocator

Parameters
allocatorThe allocator to be destroyed
Remarks
Any memnodes not given back to the allocator prior to destroying will not be free()d.

Free a list of blocks of mem, giving them back to the allocator. The list is typically terminated by a memnode with its next field set to NULL.

Parameters
allocatorThe allocator to give the mem back to
memnodeThe memory node to return

Set the owner of the allocator

Parameters
allocatorThe allocator to set the owner for
poolThe pool that is to own the allocator
Remarks
Typically pool is the highest level pool using the allocator

Set the current threshold at which the allocator should start giving blocks back to the system.

Parameters
allocatorThe allocator to set the threshold on
sizeThe threshold. 0 == unlimited.

< File is read-only

< File is executable

< all protections

< File is read-only

< File is read-only

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Write by group

<

Deprecated:
See also
APR_FPROT_GWRITE

< Write by others

<

Deprecated:
See also
APR_FPROT_WWRITE

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Write by group

<

Deprecated:
See also
APR_FPROT_GWRITE

< Write by others

<

Deprecated:
See also
APR_FPROT_WWRITE

< File is executable

< File is executable

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

< Execute by group

<

Deprecated:
See also
APR_FPROT_GEXECUTE

< Execute by others

<

Deprecated:
See also
APR_FPROT_WEXECUTE

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

< Execute by group

<

Deprecated:
See also
APR_FPROT_GEXECUTE

< Execute by others

<

Deprecated:
See also
APR_FPROT_WEXECUTE

Definition at line 224 of file apr_pools.h.

Variable Documentation

◆ size

apr_size_t size

Definition at line 115 of file apr_allocator.h.