|
META TOPICPARENT |
name="JulianSmith" |
|
|
< < | Python version of the gsapi API. |
> > | |
|
There are two approaches that have been tried here: |
|
< < |
- Use SWIG to wrap the functions declared in ghostpdl:psi/iapi.h. This done by ghostpdl:toolbin/gsapiwrap.py. This hasn't been entirely succesfull - SWIG is surprisingly limited at dealing with APIs that use (argc, argv)-style parameters, out-parameters and function pointers. So we end up with lots of manipulation in the SWIG .i file, plus custom front end (e.g. python or c#) code to make things work.
|
> > |
- Use SWIG to wrap the functions declared in ghostpdl:psi/iapi.h. This done by ghostpdl:toolbin/gsapiwrap.py
. This hasn't been entirely succesfull - SWIG is surprisingly limited at dealing with APIs that use (argc, argv) parameters, out-parameters and function pointers. So we end up with lots of manipulation in the SWIG .i file, plus custom front end (e.g. Python or C#) code to make things work.
|
| |
|
< < |
- Use python ctypes. This works pretty well. See ghostpdl:toolbin/gsapi.py which is a python module that, as of 2020-Jun-29, provides all of the ghostpdl:psi/iapi.h API except for gsapi_add_fs() or gsapi_remove_fs(). The drawback here is that it is specific to python - equivalent code would have to be written for each front-end language that is required.
|
> > |
- Use python ctypes. This works pretty well. See ghostpdl:toolbin/gsapi.py
, a self-contained python module that, as of 2020-Jun-29, provides all of the ghostpdl:psi/iapi.h API except for gsapi_add_fs() or gsapi_remove_fs(). The drawback here is that it is specific to python - equivalent code would have to be written for each front-end language that is required.
|
|
|