|
HOME
SIP/media Features
High Performance SIP
Small Footprint SIP
Symbian Port
FAQ
Documentation
Licensing
Download
Development (Trac)
Projects using pjsip
Mailing List
Open Source Links
About: PJLIB, PJLIB-UTIL, PJSIP, and PJMEDIA are created by: Benny Prijono <bennylp pjsip.org>
|
|
Home --> Documentations --> PJLIB Reference
Detailed Description
This module provides helper to manipulate array of elements of any size. It provides most used array operations such as insert, erase, and search.
|
Functions |
| void | pj_array_insert (void *array, unsigned elem_size, unsigned count, unsigned pos, const void *value) |
| void | pj_array_erase (void *array, unsigned elem_size, unsigned count, unsigned pos) |
| pj_status_t | pj_array_find (const void *array, unsigned elem_size, unsigned count, pj_status_t(*matching)(const void *value), void **result) |
Function Documentation
| void pj_array_erase |
( |
void * |
array, |
|
|
unsigned |
elem_size, |
|
|
unsigned |
count, |
|
|
unsigned |
pos | |
|
) |
| | |
Erase a value from the array at given position, and rearrange the remaining elements post the erased element.
- Parameters:
-
| array | the array. |
| elem_size | the size of the individual element. |
| count | the current number of elements in the array. |
| pos | the index/position to delete. |
| pj_status_t pj_array_find |
( |
const void * |
array, |
|
|
unsigned |
elem_size, |
|
|
unsigned |
count, |
|
|
pj_status_t(*)(const void *value) |
matching, |
|
|
void ** |
result | |
|
) |
| | |
Search the first value in the array according to matching function.
- Parameters:
-
| array | the array. |
| elem_size | the individual size of the element. |
| count | the number of elements. |
| matching | the matching function, which MUST return PJ_SUCCESS if the specified element match. |
| result | the pointer to the value found. |
- Returns:
- PJ_SUCCESS if value is found, otherwise the error code.
| void pj_array_insert |
( |
void * |
array, |
|
|
unsigned |
elem_size, |
|
|
unsigned |
count, |
|
|
unsigned |
pos, |
|
|
const void * |
value | |
|
) |
| | |
Insert value to the array at the given position, and rearrange the remaining nodes after the position.
- Parameters:
-
| array | the array. |
| elem_size | the size of the individual element. |
| count | the CURRENT number of elements in the array. |
| pos | the position where the new element is put. |
| value | the value to copy to the new element. |
PJLIB Open Source, high performance, small footprint, and very very portable framework
(C)2001-2008 Benny Prijono
|
|