pcre: pcre_config returns a long for some parameters and int otherwise

db4
Björn Lindqvist 2013-11-30 18:38:55 +01:00 committed by John Benediktsson
parent 7986d9edc9
commit 4f2cdd070c
1 changed files with 14 additions and 3 deletions

View File

@ -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 ;