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
Victor Seva 7e6131e1b4
Imported Upstream version 4.3.0
10 years ago
..
Makefile Imported Upstream version 4.0.1 12 years ago
README Imported Upstream version 4.3.0 10 years ago
shm_regex.c Imported Upstream version 4.3.0 10 years ago
shm_regex.h Imported Upstream version 4.3.0 10 years ago

README

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.