You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kamailio/lib/shm_regex
Andreas Granig 243e32a17b
Start versioning of kamailio-3.1-sipwise in svn.
15 years ago
..
Makefile Start versioning of kamailio-3.1-sipwise in svn. 15 years ago
README Start versioning of kamailio-3.1-sipwise in svn. 15 years ago
shm_regex.c Start versioning of kamailio-3.1-sipwise in svn. 15 years ago
shm_regex.h Start versioning of kamailio-3.1-sipwise in svn. 15 years ago

README

$Id$

Wrapper functions for regcomp, regexec, regfree, and regerror using shared
memory allocators instead of libc malloc/realloc/free. The original functions
are prefixed with "shm_".

The regular expression compiled with shm_regcomp() can be used with shm_regexec()
simultaneously by multiple processes without locking, because regexec has its own
internal locks. It can be later on freed with shm_regfree() when the expression
is no longer used. Note however that

1) shm_regexec allocates shared memory for the pattern buffer when it is successfully
called for the first time.

2) shm_regexec temporary allocates and deallocates memory for storing the registers
for the pmatch array runtime if nmatch and pmatch parameters are not 0. This is
done also in shared memory, therefore use the shared memory wrappers for
regular expression based search-and-replace only if really necessary.

See 'man regex' for the usage and parameters of the functions.

Supported only with GNU C library.