pcre: pcre_config returns a long for some parameters and int otherwise
parent
7986d9edc9
commit
4f2cdd070c
|
@ -33,13 +33,24 @@ ERROR: pcre-error value ;
|
|||
utf8-start-byte? [ nip ] [ next-utf8-char ] if
|
||||
] [ 2drop f ] if* ;
|
||||
|
||||
: pcre-config ( what -- value )
|
||||
[ { long } [ pcre_config ] with-out-parameters ] keep
|
||||
: check-bad-option ( err value what -- value )
|
||||
rot 0 = [ drop ] [ bad-option ] if ;
|
||||
|
||||
: pcre-config ( what -- value )
|
||||
[
|
||||
dup {
|
||||
PCRE_CONFIG_MATCH_LIMIT
|
||||
PCRE_CONFIG_MATCH_LIMIT_RECURSION
|
||||
} member? [
|
||||
{ long } [ pcre_config ] with-out-parameters
|
||||
] [
|
||||
{ int } [ pcre_config ] with-out-parameters
|
||||
] if
|
||||
] keep check-bad-option ;
|
||||
|
||||
: pcre-fullinfo ( pcre extra what -- obj )
|
||||
[ { int } [ pcre_fullinfo ] with-out-parameters ] keep
|
||||
rot 0 = [ drop ] [ bad-option ] if ;
|
||||
check-bad-option ;
|
||||
|
||||
: pcre-substring-list ( subject match-array count -- alien )
|
||||
{ void* } [ pcre_get_substring_list drop ] with-out-parameters ;
|
||||
|
|
Loading…
Reference in New Issue