add new apr functions/macros needed by unimrcp update

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15542 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2009-11-19 14:24:59 +00:00
parent 8e40f02891
commit 65bfe506e2
5 changed files with 46 additions and 1 deletions

View File

@@ -120,6 +120,25 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p,
*/
APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr);
/** A helper macro for accessing a member of an APR array.
*
* @param ary the array
* @param i the index into the array to return
* @param type the type of the objects stored in the array
*
* @return the item at index i
*/
#define APR_ARRAY_IDX(ary,i,type) (((type *)(ary)->elts)[i])
/** A helper macro for pushing elements into an APR array.
*
* @param ary the array
* @param type the type of the objects stored in the array
*
* @return the location where the new object should be placed
*/
#define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary)))
/**
* Remove an element from an array (as a first-in, last-out stack)
* @param arr The array to remove an element from.
@@ -128,6 +147,14 @@ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr);
*/
APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr);
/**
* Remove all elements from an array.
* @param arr The array to remove all elements from.
* @remark As the underlying storage is allocated from a pool, no
* memory is freed by this operation, but is available for reuse.
*/
APR_DECLARE(void) apr_array_clear(apr_array_header_t *arr);
/**
* Concatenate two arrays together
* @param dst The destination array, and the one to go first in the combined