Re: PCRE (was Standard library progress)

new topic     » topic index » view thread      » older message » newer message

Matt Lewis wrote:
> 
> 
> I played around with it a little under windows, and got it to build and
> link with the interpreter.  It should actually be fairly small, size
> wise.  The .lib file is less than 200K.  I haven't really done anything
> with it, so all of the code was eliminated, so that's not a very good 
> test.  I figure on Linux, we could probably get away with linking
> dynamically.  PCRE is pretty common, and if we go the package route, we
> can declare the dependency (or ship the .so just in case).
>

Great.

> 
> A bigger question is how to wrap it.  If you're familiar with the library,
> you compile, then execute, etc the regex.  I don't think we should expose
> the user to raw pointers.  Probably a handle, similar to files or c_funcs.
> I'm thinking that the API will be accessible through machine_func calls.
> We'll add regex.e, or something, which will contain those wrappers, plus
> global constants that are used for setting options, etc.
> 

I need to look again at the PCRE api, but one thing I would do is look at how
others have wrapped it into their languages, such as PHP. They will need to be
given some type of handle to represent the regular expression, at minimum. When
we do that, then you wonder about having to free the item when the handle is no
longer in use. I do not see an automatic way of doing that? If there is no
automatic way of doing it, then I see no reason to wrap a pointer, just let them
pass an atom pointer around to the different functions?

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu