|
Apache HTTPD
|
Functions | |
| APR_DECLARE (apr_status_t) apr_initialize(void) | |
| APR_DECLARE_NONSTD (void) apr_terminate(void) | |
| APR_DECLARE (void) apr_terminate2(void) | |
Variables | |
| char const *const ** | argv |
| char const *const char const *const ** | env |
| APR_DECLARE | ( | apr_status_t | ) |
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.
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.
| argc | Pointer to the argc that may be corrected |
| argv | Pointer to the argv that may be corrected |
| env | Pointer to the env that may be corrected, may be NULL |
< File is read-only
< File is executable
< all protections
< File is read-only
< File is read-only
< Write by user
<
< Write by group
<
< Write by others
<
< Write by user
<
< Write by group
<
< Write by others
<
< File is executable
< File is executable
< Execute by user
<
< Execute by group
<
< Execute by others
<
< Execute by user
<
< Execute by group
<
< Execute by others
<
< 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
<
< Write by user
<
< 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
<
< Write by group
<
< Write by others
<
< Write by user
<
< Write by group
<
< Write by others
<
< File is executable
< File is executable
< Execute by user
<
< Execute by group
<
< Execute by others
<
< Execute by user
<
< Execute by group
<
< Execute by others
<
< 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
<
< 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
<
< 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 | ( | void | ) |
Tear down any APR internal data structures which aren't torn down automatically, same as apr_terminate()
atexit(apr_terminate) to ensure this is done. apr_terminate2 exists to allow non-c language apps to tear down apr, while apr_terminate() is recommended from c language applications.Register a function to be called when a pool is cleared or destroyed.
Unlike apr_pool_cleanup_register which registers a cleanup that is called AFTER all subpools are destroyed, this function registers a function that will be called before any of the subpools are destroyed.
| p | The pool to register the cleanup with |
| data | The data to pass to the cleanup function. |
| plain_cleanup | The function to call when the pool is cleared or destroyed |
Run the specified cleanup function immediately and unregister it.
The cleanup most recently registered with p having the same values of data and cleanup will be removed and cleanup will be called with data as the argument.
| p | The pool to remove the cleanup from |
| data | The data to remove from cleanup |
| cleanup | The function to remove from cleanup |
Tear down all of the internal structures required to use pools
Clear all memory in the pool and run all the cleanups. This also destroys all subpools.
| p | The pool to clear |
Debug version of apr_pool_clear.
| p | See: apr_pool_clear. |
| file_line | Where the function is called from. This is usually APR_POOL__FILE_LINE__. |
Destroy the pool. This takes similar action as apr_pool_clear() and then frees all the memory.
| p | The pool to destroy |
Debug version of apr_pool_destroy.
| p | See: apr_pool_destroy. |
| file_line | Where the function is called from. This is usually APR_POOL__FILE_LINE__. |
Set the function to be called when an allocation failure occurs.
Tag a pool (give it a name)
| pool | The pool to tag |
| tag | The tag |
Register a function to be called when a pool is cleared or destroyed
| p | The pool to register the cleanup with |
| data | The data to pass to the cleanup function. |
| plain_cleanup | The function to call when the pool is cleared or destroyed |
| child_cleanup | The function to call when a child process is about to exec - this function is called in the child, obviously! |
Remove a previously registered cleanup function.
The cleanup most recently registered with p having the same values of data and cleanup will be removed.
| p | The pool to remove the cleanup from |
| data | The data of the registered cleanup |
| cleanup | The function to remove from cleanup |
Replace the child cleanup function of a previously registered cleanup.
The cleanup most recently registered with p having the same values of data and plain_cleanup will have the registered child cleanup function replaced with child_cleanup.
| p | The pool of the registered cleanup |
| data | The data of the registered cleanup |
| plain_cleanup | The plain cleanup function of the registered cleanup |
| child_cleanup | The function to register as the child cleanup |
Run all registered child cleanups, in preparation for an exec() call in a forked child – close files, etc., but don't flush I/O buffers, don't wait for subprocesses, and don't free any memory.
An APR internal function for fast ucs-2 wide Unicode format conversion to the utf-8 octet-encoded Unicode. This function is used for filename and other resource conversions for platforms providing native Unicode support.
@tip Only the errors APR_EINVAL and APR_INCOMPLETE may occur, the former when the character code is invalid (in or out of context) and the later when more words were expected, but insufficient words remain.
Destroy an allocator
| allocator | The allocator to be destroyed |
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.
| allocator | The allocator to give the mem back to |
| memnode | The memory node to return |
Set the owner of the allocator
| allocator | The allocator to set the owner for |
| pool | The pool that is to own the allocator |
Set the current threshold at which the allocator should start giving blocks back to the system.
| allocator | The allocator to set the threshold on |
| size | The threshold. 0 == unlimited. |
Like apr_cstr_split(), but append to existing array instead of creating a new one. Allocate the copied substrings in pool (i.e., caller decides whether or not to pass array->pool as pool).
Associate a value with a key in a hash table.
| ht | The hash table |
| key | Pointer to the key |
| klen | Length of the key. Can be APR_HASH_KEY_STRING to use the string length. |
| val | Value to associate with the key |
Get the current entry's details from the iteration state.
| hi | The iteration state |
| key | Return pointer for the pointer to the key. |
| klen | Return pointer for the key length. |
| val | Return pointer for the associated value. |
Clear any key/value pairs in the hash table.
| ht | The hash table |
Initialize a PRNG state
| g | The PRNG state |
| p | The pool to allocate from |
| pool_hash | Pool hash functions |
| key_hash | Key hash functions |
| prng_hash | PRNG hash functions |
Mix the randomness pools.
| g | The PRNG state |
| entropy_ | Entropy buffer |
| bytes | Length of entropy_ in bytes |
Ensures that E bits of conditional entropy are mixed into the PRNG before any further randomness is extracted.
| g | The RNG state |
Mix the randomness pools after forking.
| proc | The resulting process handle from apr_proc_fork() |
Free memory using the same mechanism as the skip list.
| sl | The skip list |
| mem | The object to free |
Set the comparison functions to be used for searching the skip list.
| sl | The skip list |
| XXX1 | FIXME |
| XXX2 | FIXME |
Set the indexing functions to the specified comparison functions and rebuild the index.
| sl | The skip list |
| XXX1 | FIXME |
| XXX2 | FIXME |
Remove all elements from the skip list.
| sl | The skip list |
| myfree | A function to be called for each removed element |
Remove each element from the skip list.
| sl | The skip list |
| myfree | A function to be called for each removed element |
Set a predefined maximum height for the skip list.
| sl | The skip list |
| to | The preheight to set, or a nul/negative value to disable. |
Remove all elements from an array.
| arr | The array to remove all elements from. |
Concatenate two arrays together.
| dst | The destination array, and the one to go first in the combined array |
| src | The source array to add to the destination array |
Delete all of the elements from a table.
| t | The table to clear |
Add a key/value pair to a table. If another element already exists with the same key, this will overwrite the old data.
| t | The table to add the data to. |
| key | The key to use (case does not matter) |
| val | The value to add |
Add a key/value pair to a table. If another element already exists with the same key, this will overwrite the old data.
| t | The table to add the data to. |
| key | The key to use (case does not matter) |
| val | The value to add |
Remove data from the table.
| t | The table to remove data from |
| key | The key of the data being removed (case does not matter) |
Add data to a table by merging the value with data that has already been stored. The merging is done by concatenating the two values, separated by the string ", ".
| t | The table to search for the data |
| key | The key to merge data for (case does not matter) |
| val | The data to add |
Add data to a table by merging the value with data that has already been stored. The merging is done by concatenating the two values, separated by the string ", ".
| t | The table to search for the data |
| key | The key to merge data for (case does not matter) |
| val | The data to add |
Add data to a table, regardless of whether there is another element with the same key.
| t | The table to add to |
| key | The key to use |
| val | The value to add. |
Add data to a table, regardless of whether there is another element with the same key.
| t | The table to add to |
| key | The key to use |
| val | The value to add. |
For each element in table b, either use setn or mergen to add the data to table a. Which method is used is determined by the flags passed in.
| a | The table to add the data to. |
| b | The table to iterate over, adding its data to table a |
| flags | How to add the table to table a. One of: APR_OVERLAP_TABLES_SET Use apr_table_setn APR_OVERLAP_TABLES_MERGE Use apr_table_mergen APR_OVERLAP_TABLES_ADD Use apr_table_addn |
apr_array_header_t *barr = apr_table_elts(b); apr_table_entry_t *belt = (apr_table_entry_t *)barr->elts; int i; for (i = 0; i < barr->nelts; ++i) { if (flags & APR_OVERLAP_TABLES_MERGE) { apr_table_mergen(a, belt[i].key, belt[i].val); } else if (flags & APR_OVERLAP_TABLES_ADD) { apr_table_addn(a, belt[i].key, belt[i].val); } else { apr_table_setn(a, belt[i].key, belt[i].val); } }
Except that it is more efficient (less space and cpu-time) especially when b has many elements.
Notice the assumptions on the keys and values in b – they must be in an ancestor of a's pool. In practice b and a are usually from the same pool.
Eliminate redundant entries in a table by either overwriting or merging duplicates.
| t | Table. |
| flags | APR_OVERLAP_TABLES_MERGE to merge, or APR_OVERLAP_TABLES_SET to overwrite, or APR_OVERLAP_TABLES_ADD to add |
Register an other_child – a child associated to its registered maintence callback. This callback is invoked when the process dies, is disconnected or disappears.
| proc | The child process to register. |
| maintenance | maintenance is a function that is invoked with a reason and the data pointer passed here. |
| data | Opaque context data passed to the maintenance function. |
| write_fd | An fd that is probed for writing. If it is ever unwritable then the maintenance is invoked with reason OC_REASON_UNWRITABLE. |
| p | The pool to use for allocating memory. |
write_fd duplicates the proc->out stream, it's really redundant and should be replaced in the APR 1.0 API with a bitflag of which proc->in/out/err handles should be health checked.
no platform currently tests the pipes health.
Stop watching the specified other child.
| data | The data to pass to the maintenance function. This is used to find the process to unregister. |
Test one specific other child processes and invoke the maintenance callback with the appropriate reason code, if still running, or the appropriate reason code if the process is no longer healthy.
| ocr | The registered other child |
| reason | The reason code (e.g. APR_OC_REASON_RESTART) if still running |
Test all registered other child processes and invoke the maintenance callback with the appropriate reason code, if still running, or the appropriate reason code if the process is no longer healthy.
| reason | The reason code (e.g. APR_OC_REASON_RESTART) to running processes |
Register a process to be killed when a pool dies.
| a | The pool to use to define the processes lifetime |
| proc | The process to register |
| how | How to kill the process, one of:
APR_KILL_NEVER -- process is never sent any signals
APR_KILL_ALWAYS -- process is sent SIGKILL on apr_pool_t cleanup
APR_KILL_AFTER_TIMEOUT -- SIGTERM, wait 3 seconds, SIGKILL
APR_JUST_WAIT -- wait forever for the process to complete
APR_KILL_ONLY_ONCE -- send SIGTERM and then wait
|
< File is read-only
< File is executable
< all protections
< File is read-only
< File is read-only
< Write by user
<
< Write by group
<
< Write by others
<
< Write by user
<
< Write by group
<
< Write by others
<
< File is executable
< File is executable
< Execute by user
<
< Execute by group
<
< Execute by others
<
< Execute by user
<
< Execute by group
<
< Execute by others
<
Definition at line 646 of file apr_pools.h.
| APR_DECLARE_NONSTD | ( | void | ) |
Tear down any APR internal data structures which aren't torn down automatically. apr_terminate must be called once for every call to apr_initialize() or apr_app_initialize().
atexit(apr_terminate) to ensure this is called. When using APR from a language other than C that has problems with the calling convention, use apr_terminate2() instead. Definition at line 199 of file apr_general.h.