Apache HTTPD
Classes | Typedefs | Functions | Variables
Portability Routines

Classes

struct  apr_os_proc_mutex_t
 
struct  apr_os_sock_info_t
 
struct  apr_os_global_mutex_t
 

Typedefs

typedef int apr_os_file_t
 
typedef DIR apr_os_dir_t
 
typedef int apr_os_sock_t
 
typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_t
 
typedef pid_t apr_os_proc_t
 
typedef struct timeval apr_os_imp_time_t
 
typedef struct tm apr_os_exp_time_t
 
typedef void * apr_os_dso_handle_t
 
typedef void * apr_os_shm_t
 
typedef struct apr_os_sock_info_t apr_os_sock_info_t
 alias for local OS socket
 
typedef struct apr_os_global_mutex_t apr_os_global_mutex_t
 

Functions

 APR_DECLARE (apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmutex
 
 APR_DECLARE (const char *) apr_os_default_encoding(apr_pool_t *pool)
 

Variables

apr_global_mutex_tpmutex
 
apr_file_tfile
 
apr_dir_tdir
 
apr_socket_tsock
 
apr_proc_mutex_t apr_lockmech_emech
 
apr_time_exp_taprtime
 
apr_shm_tshm
 
apr_os_file_tthefile
 
apr_os_file_t apr_int32_t flags
 
apr_os_file_t apr_int32_t apr_pool_tcont
 
apr_os_file_t int register_cleanup
 
apr_os_dir_tthedir
 
apr_os_sock_tthesock
 
apr_os_sock_info_tos_sock_info
 
apr_os_proc_mutex_tospmutex
 
apr_os_imp_time_t ** ostime
 
apr_os_shm_tosshm
 

Detailed Description

Typedef Documentation

◆ apr_os_dir_t

native dir

Definition at line 153 of file apr_portable.h.

◆ apr_os_dso_handle_t

native dso types

Definition at line 176 of file apr_portable.h.

◆ apr_os_exp_time_t

native tm

Definition at line 165 of file apr_portable.h.

◆ apr_os_file_t

native file

Definition at line 152 of file apr_portable.h.

◆ apr_os_global_mutex_t

Definition at line 217 of file apr_portable.h.

◆ apr_os_imp_time_t

native timeval

Definition at line 164 of file apr_portable.h.

◆ apr_os_proc_mutex_t

native process mutex

Definition at line 155 of file apr_portable.h.

◆ apr_os_proc_t

native pid

Definition at line 163 of file apr_portable.h.

◆ apr_os_shm_t

native SHM

Definition at line 178 of file apr_portable.h.

◆ apr_os_sock_info_t

alias for local OS socket

Definition at line 199 of file apr_portable.h.

◆ apr_os_sock_t

native dir

Definition at line 154 of file apr_portable.h.

Function Documentation

◆ APR_DECLARE() [1/2]

APR_DECLARE ( apr_status_t  )

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.

< 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

Definition at line 74 of file apr_atomic.c.

◆ APR_DECLARE() [2/2]

APR_DECLARE ( const char )

Get the name of the system default character set.

Parameters
poolthe pool to allocate the name from, if needed

Get the name of the current locale character set.

Parameters
poolthe pool to allocate the name from, if needed
Remarks
Defers to apr_os_default_encoding() if the current locale's data can't be retrieved on this system.

Return the name of the lockfile for the mutex, or NULL if the mutex doesn't use a lock file

Get the mechanism's name of the mutex, as it relates to the actual method used for the underlying apr_proc_mutex_t.

Parameters
mutexthe mutex to get the mechanism's name from.

Convert text data to base64, and return the results from a pool.

Parameters
pPool to allocate from.
srcThe original string.
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 encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base64 errors).

Convert binary data to base64, and return the results from a pool.

Parameters
pPool to allocate from.
srcThe original buffer.
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 encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base64_binary errors).

Convert base64 or base64url with or without padding to text data, and return the results from a pool.

Parameters
pPool to allocate from.
srcThe base64 string to decode.
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, attempt to decode the full original buffer, 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 decoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the decoding is not possible (see apr_decode_base64_binary errors).

Convert text data to base32, and return the results from a pool.

Parameters
pPool to allocate from.
srcThe original string.
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 encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base32 errors).

Convert binary data to base32, and return the results from a pool.

Parameters
pPool to allocate from.
srcThe original buffer.
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 encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base32_binary errors).

Convert base32 or base32hex with or without padding to text data, and return the results from a pool.

Parameters
pPool to allocate from.
srcThe base32 string to decode.
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, parse RFC4648 Base 32 Encoding. If APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding.
lenIf not NULL, outputs the length of the encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the decoding is not possible (see apr_decode_base32 errors).

Convert text data to base16 (hex), and return the results from a pool.

Parameters
pPool to allocate from.
srcThe original string.
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 encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base16 errors).

Convert binary data to base16 (hex), and return the results from a pool.

Parameters
pPool to allocate from.
srcThe original buffer.
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 encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base16_binary errors).

Convert base16 (hex) and return the results from a pool.

Parameters
pPool to allocate from.
srcThe base16 string to decode.
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, 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 encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the decoding is not possible (see apr_decode_base16 errors).

Perform shell escaping on the provided string, returning the result from the pool.

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

If no characters were escaped, the original string is returned.

Parameters
pPool to allocate from
strThe original string
Returns
the encoded string, allocated from the pool, or the original string if no escaping took place or the string was NULL.

Unescapes a URL, leaving reserved characters intact, returning the result from a pool.

Parameters
pPool to allocate from
urlString to be unescaped in place
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
Returns
A string allocated from the pool on success, the original string if no characters are decoded, or NULL if a bad escape sequence is found or if a character on the forbid list is found, or if the original string was NULL.

Escape a path segment, as defined in RFC1808, returning the result from a pool.

Parameters
pPool to allocate from
strString to be escaped
Returns
A string allocated from the pool on success, the original string if no characters are encoded or the string is NULL.

Converts an OS path to a URL, in an OS dependent way, as defined in RFC1808, returning the result from a pool.

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
pPool to allocate from
strThe original string
partialIf non zero, suppresses the prepending of "./"
Returns
A string allocated from the pool on success, the original string if no characters are encoded 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, returning the result from a pool.

Parameters
pPool to allocate from
strString to be escaped
Returns
A string allocated from the pool on success, the original string if no characters are encoded or if the string was NULL.

Apply entity encoding to a string, returning the result from a pool. Characters are replaced as follows: '<' becomes '&lt;', '>' becomes '&gt;', '&' becomes '&amp;', the double quote becomes '&quot;" and the single quote becomes '\&apos;'. @param p Pool to allocate from @param str The original string @param toasc If non zero, encode non ascii characters @return A string allocated from the pool on success, the original string if no characters are encoded or the string is 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 p Pool to allocate from @param str The original string @return A string allocated from the pool on success, the original string if no characters are encoded or the string is NULL. Escape control characters in a string, as performed by the shell's 'echo' command, and return the results from a pool. 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 p Pool to allocate from @param str The original string @param quote If non zero, encode double quotes @return A string allocated from the pool on success, the original string if no characters are encoded or the string is NULL. Convert binary data to a hex encoding, and return the results from a pool. @param p Pool to allocate from @param src The original buffer @param slen The length of the original buffer @param colon If not zero, insert colon characters between hex digits. @return A zero padded buffer allocated from the pool on success, or NULL if src was NULL. Apply LDAP escaping to binary data, and return the results from a pool. Characters from RFC4514 and RFC4515 are escaped with their hex equivalents. @param p Pool to allocate from @param src The original buffer @param slen 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 @return A zero padded buffer allocated from the pool on success, or NULL if src was NULL. Return the name of the lockfile for the mutex, or NULL if the mutex doesn't use a lock file Get the mechanism's name of the mutex, as it relates to the actual method used for the underlying apr_proc_mutex_t. @param mutex the mutex to get the mechanism's name from. Convert text data to base64, and return the results from a pool. @param p Pool to allocate from. @param src The original string. @param slen The length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination. @param flags If 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. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base64 errors). Convert binary data to base64, and return the results from a pool. @param p Pool to allocate from. @param src The original buffer. @param slen The length of the original buffer. @param flags If 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. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base64_binary errors). Convert base64 or base64url with or without padding to text data, and return the results from a pool. @param p Pool to allocate from. @param src The base64 string to decode. @param slen The length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination. @param flags If APR_ENCODE_NONE, attempt to decode the full original buffer, and return NULL if any bad character is detected. If APR_ENCODE_RELAXED, decode until the first non base64/base64url character. @param len If not NULL, outputs the length of the decoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the decoding is not possible (see apr_decode_base64_binary errors). Convert text data to base32, and return the results from a pool. @param p Pool to allocate from. @param src The original string. @param slen The length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination. @param flags If APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base32 errors). Convert binary data to base32, and return the results from a pool. @param p Pool to allocate from. @param src The original buffer. @param slen The length of the original buffer. @param flags If APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base32_binary errors). Convert base32 or base32hex with or without padding to text data, and return the results from a pool. @param p Pool to allocate from. @param src The base32 string to decode. @param slen The length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination. @param flags If APR_ENCODE_NONE, parse RFC4648 Base 32 Encoding. If APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the decoding is not possible (see apr_decode_base32 errors). Convert text data to base16 (hex), and return the results from a pool. @param p Pool to allocate from. @param src The original string. @param slen The length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination. @param flags If APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If APR_ENCODE_COLON, separate each token with a colon. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base16 errors). Convert binary data to base16 (hex), and return the results from a pool. @param p Pool to allocate from. @param src The original buffer. @param slen The length of the original buffer. @param flags If APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If APR_ENCODE_COLON, separate each token with a colon. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base16_binary errors). Convert base16 (hex) and return the results from a pool. @param p Pool to allocate from. @param src The base16 string to decode. @param slen The length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination. @param flags If APR_ENCODE_NONE, parse RFC4648 Base 16 Encoding. If APR_ENCODE_COLON, allow tokens to be separated with a colon. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the decoding is not possible (see apr_decode_base16 errors). Perform shell escaping on the provided string, returning the result from the pool. Shell escaping causes characters to be prefixed with a '\' character. If no characters were escaped, the original string is returned. @param p Pool to allocate from @param str The original string @return the encoded string, allocated from the pool, or the original string if no escaping took place or the string was NULL. Unescapes a URL, leaving reserved characters intact, returning the result from a pool. @param p Pool to allocate from @param url String to be unescaped in place @param forbid Optional list of forbidden characters, in addition to 0x00 @param reserved Optional list of reserved characters that will be left unescaped @param plus If non zero, '+' is converted to ' ' as per application/x-www-form-urlencoded encoding @return A string allocated from the pool on success, the original string if no characters are decoded, or NULL if a bad escape sequence is found or if a character on the forbid list is found, or if the original string was NULL. Escape a path segment, as defined in RFC1808, returning the result from a pool. @param p Pool to allocate from @param str String to be escaped @return A string allocated from the pool on success, the original string if no characters are encoded or the string is NULL. Converts an OS path to a URL, in an OS dependent way, as defined in RFC1808, returning the result from a pool. 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 "./"). @param p Pool to allocate from @param str The original string @param partial If non zero, suppresses the prepending of "./" @return A string allocated from the pool on success, the original string if no characters are encoded 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, returning the result from a pool. @param p Pool to allocate from @param str String to be escaped @return A string allocated from the pool on success, the original string if no characters are encoded or if the string was NULL. Apply entity encoding to a string, returning the result from a pool. Characters are replaced as follows: '<' becomes '\&lt;', '>' becomes '\&gt;', '&' becomes '\&amp;', the double quote becomes '\&quot;" and the single quote becomes '&apos;'.

Parameters
pPool to allocate from
strThe original string
toascIf non zero, encode non ascii characters
Returns
A string allocated from the pool on success, the original string if no characters are encoded or the string is 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.

Parameters
pPool to allocate from
strThe original string
Returns
A string allocated from the pool on success, the original string if no characters are encoded or the string is NULL.

Escape control characters in a string, as performed by the shell's 'echo' command, and return the results from a pool. 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.

Parameters
pPool to allocate from
strThe original string
quoteIf non zero, encode double quotes
Returns
A string allocated from the pool on success, the original string if no characters are encoded or the string is NULL.

Convert binary data to a hex encoding, and return the results from a pool.

Parameters
pPool to allocate from
srcThe original buffer
slenThe length of the original buffer
colonIf not zero, insert colon characters between hex digits.
Returns
A zero padded buffer allocated from the pool on success, or NULL if src was NULL.

Apply LDAP escaping to binary data, and return the results from a pool. Characters from RFC4514 and RFC4515 are escaped with their hex equivalents.

Parameters
pPool to allocate from
srcThe original buffer
slenThe length of the original buffer
flagsAPR_ESCAPE_LDAP_DN for RFC4514, APR_ESCAPE_LDAP_FILTER for RFC4515, APR_ESCAPE_LDAP_ALL for both
Returns
A zero padded buffer allocated from the pool on success, or NULL if src was NULL.

Definition at line 128 of file dso.c.

Variable Documentation

◆ aprtime

apr_time_t * aprtime

Definition at line 277 of file apr_portable.h.

◆ cont

Definition at line 363 of file apr_portable.h.

◆ dir

apr_dir_t* dir

Definition at line 240 of file apr_portable.h.

◆ file

apr_file_t* file

Definition at line 232 of file apr_portable.h.

◆ flags

Definition at line 363 of file apr_portable.h.

◆ mech

Definition at line 269 of file apr_portable.h.

◆ os_sock_info

apr_os_sock_info_t* os_sock_info

Definition at line 428 of file apr_portable.h.

◆ ospmutex

apr_os_proc_mutex_t * ospmutex

Definition at line 438 of file apr_portable.h.

◆ osshm

apr_os_shm_t* osshm

Definition at line 489 of file apr_portable.h.

◆ ostime

apr_os_exp_time_t ** ostime

Definition at line 466 of file apr_portable.h.

◆ pmutex

apr_proc_mutex_t * pmutex

Definition at line 220 of file apr_portable.h.

◆ register_cleanup

Definition at line 389 of file apr_portable.h.

◆ shm

apr_shm_t* shm

Definition at line 293 of file apr_portable.h.

◆ sock

apr_socket_t* sock

Definition at line 248 of file apr_portable.h.

◆ thedir

apr_os_dir_t* thedir

Definition at line 399 of file apr_portable.h.

◆ thefile

apr_os_file_t * thefile

Definition at line 362 of file apr_portable.h.

◆ thesock

apr_os_sock_t* thesock

Definition at line 414 of file apr_portable.h.