PureDocs
Ticket #8 (assigned enhancement)
C Language Plugins
| Reported by: | will | Owned by: | will |
|---|---|---|---|
| Priority: | major | Milestone: | initial-release |
| Component: | base | Keywords: | |
| Cc: |
Description
We should support C language plugins, in the form of shared libraries that either provide or link against a parser for whatever language. Since a lot of languages out there have C-based parsers already, this should provide a quick and easy way to expand PureDocs language support with less effort than specialized Python parsers. The intention was never to require everything be implemented in Python.
The basic idea would be to use the ctypes FFI package included in Python 2.5 (available for previous versions, but not included) to dynamically load specified shared libraries and use a specified API to interact with those libraries. Data-type conversions might be tricky, and it might be necessary to define a C analog to our Python Resource class.
Attachments
Change History
comment:1 Changed 5 years ago by will
- Owner changed from somebody to will
- Status changed from new to assigned
comment:2 Changed 5 years ago by will
A libpuredocs has been added to the repository at source:trunk/lib and puredocs.pdext has been added as a Python extension at source:trunk/lib/puredocs/pdext. libpuredocs has a reasonably complete API for creating a Resource object and setting its properties. pdext is intended to handle C plugin registration and loading, but hasn't been completed.
pdext now just needs to provide a way for C plugins to register themselves for specific mime-types, and dynamically load and register those C plugins, via itself, through entry points.