pcre: handle long values in pcre-config and throw errors.

db4
John Benediktsson 2013-11-23 08:58:52 -08:00
parent 34853bf550
commit df47ff8289
1 changed files with 9 additions and 2 deletions

View File

@ -31,8 +31,15 @@ ERROR: pcre-error value ;
utf8-start-byte? [ nip ] [ next-utf8-char ] if
] [ 2drop f ] if* ;
: pcre-config ( what -- alien )
{ int } [ pcre_config ] with-out-parameters ;
: 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 dup PCRE_ERROR_BADOPTION = [ pcre-error ] when ;
: pcre-fullinfo ( pcre extra what -- obj )
{ int } [ pcre_fullinfo ] with-out-parameters nip ;