[Gs-devel] Dynamic driver loading

Russell Lang gsview at ghostgum.com.au
Thu Feb 1 03:01:52 PST 2001


Raph wrote:

>    From what I can tell, Ghostscript will need to be linked with
> -export-dynamic or its non-Linux (non-ELF, actually, I think)
> equivalent. Otherwise, drivers won't be able to call into Ghostscript
> as needed. I have no idea whether this option is available on all
> interesting target systems.

On Windows you would have to build the Ghostscript DLL first, then 
each driver would need to link against the .lib file.  Any function 
you wish to call in Ghostscript would need to be marked as exported, 
preferable by using the Microsoft specific __declspec(dllexport).  
There appears to be no way (in Visual C++ 5) to specify "export all".

I think we need to make sure that both Ghostscript and the driver are 
using the same C run time library.  At present Ghostscript is 
statically linked with the C run time library.  Changing to dymamic 
linking will require changes to the install program to make sure the 
CRTL DLL is installed.

While these dynamic driver loading is being considered, one change I 
would like is to change each driver from writing directly to a file 
and instead call a single Ghostscript function for writing printer 
output.  Within Ghostscript this might write to a file or it might 
write directly to the spooler.  In Windows and OS/2, there are 
specific functions that write to the spooler - it is not a normal 
file.  At present Ghostscript writes to a temporary file (possibly 
huge) which then gets copied to the spooler, which doubles the amount 
of disk space required.  If we do this, then the issue of the driver 
using the same run time library as Ghostscript becomes less important 
because the driver would not need to write to a file. This is a major 
change because it would affect every driver in Ghostscript.  


Russell Lang,   Ghostgum Software Pty Ltd
gsview at ghostgum.com.au



More information about the gs-devel mailing list