another PCRE try

svn: r4322
This commit is contained in:
Matthew Flatt 2006-09-13 10:11:53 +00:00
parent ce0ad68956
commit 2534d8a3a5

View File

@ -7,7 +7,7 @@
(define pcre-compile (define pcre-compile
(get-ffi-obj "pcre_compile" pcre-lib (get-ffi-obj "pcre_compile" pcre-lib
(_fun _bytes _int _pointer _pointer _pointer (_fun _bytes _int _bytes _bytes _pointer
-> _pointer))) -> _pointer)))
(define pcre-study (define pcre-study
(get-ffi-obj "pcre_study" pcre-lib (get-ffi-obj "pcre_study" pcre-lib
@ -19,13 +19,13 @@
_int _int _bytes _int _int _int _bytes _int
-> _int))) -> _int)))
(define random-vector (make-bytes 100))
(define (pcregexp s) (define (pcregexp s)
(let* ([pat (pcre-compile s 0 #f #f #f)] (let* ([pat (pcre-compile s 0 random-vector random-vector #f)]
[extra #f #;(pcre-study pat 0 #f)]) [extra #f #;(pcre-study pat 0 #f)])
(cons pat extra))) (cons pat extra)))
(define random-vector (make-bytes 100))
(define (pcregexp-match re bytes) (define (pcregexp-match re bytes)
(pcre-exec (car re) (cdr re) bytes (bytes-length bytes) (pcre-exec (car re) (cdr re) bytes (bytes-length bytes)
0 0 random-vector 10)) 0 0 random-vector 10))