[gs-devel] ESP/GPL GhostScript merger: "pcl3" driver and
undocumented removal of "gs_main_instance_default()"
Till Kamppeter
till.kamppeter at gmail.com
Wed Apr 25 08:52:11 PDT 2007
Thank you very much, now all source files of the "pcl3" driver compile.
Problems now are the following:
1. "pcl3" does not link. I get:
--------------------------------------------------------------------------
./obj/eprnparm.o:(.bss+0x0): multiple definition of `mem'
./obj/gdeveprn.o:(.bss+0x0): first defined here
./obj/eprnrend.o:(.bss+0x0): multiple definition of `mem'
./obj/gdeveprn.o:(.bss+0x0): first defined here
./obj/eprnfs.o:(.bss+0x0): multiple definition of `mem'
./obj/gdeveprn.o:(.bss+0x0): first defined here
./obj/gdevpcl3.o:(.bss+0x0): multiple definition of `mem'
./obj/gdeveprn.o:(.bss+0x0): first defined here
./obj/pclcap.o:(.bss+0x0): multiple definition of `mem'
./obj/gdeveprn.o:(.bss+0x0): first defined here
--------------------------------------------------------------------------
How can I introduce one global variable of type gs_memory_t* so that all
legacy drivers can use it for the "gs_malloc" and "gs_free" calls?
2. You say that your suggested solutions fail in multi-threaded
environments. What should I do? Can I block multi-threading for this
driver (slow printing is better than loosing support for certain printer
models). Or is there any other way to do the task of
"eprn_forget_defaultmatrix"?
These problems show that it is urgent to get all GhostScript built-in
drivers modularized into pluggable OpenPrinting Vector drivers (see
http://www.linux-foundation.org/en/OpenPrinting/Implementation, task 3B).
Till
Stefan Kemper wrote:
> get_minst_from_memory(gs_lib_ctx_get_non_gc_memory_t())->i_ctx_p->pgs
>
> does the same as gs_main_instance_default,
> use of either the earlier method or the above one fails spectacularly
> in a multithreaded environment.
>
> Stefan
>
> On 4/25/07, Till Kamppeter <till.kamppeter at gmail.com> wrote:
>> Thank you very much for your help, but how do I apply this? How do I
>> declare the variable "mem"? With which do I replace
>> "gs_main_instance_default()" then?
>>
>> Till
>>
>> Stefan Kemper wrote:
>> > mem = gs_lib_ctx_get_non_gc_memory_t();
>> > gs_main_instance* get_minst_from_memory(mem);
>> >
>> > Might do the trick for you.
>> >
>> > Stefan
>> >
>> > On 4/25/07, Till Kamppeter <till.kamppeter at gmail.com> wrote:
>> >> Hi,
>> >>
>> >> I tried again to port the "pcl3" driver to GPL GhostScript 8.57. Now I
>> >> have introduced a variable
>> >>
>> >> gs_memory_t *mem;
>> >>
>> >> in contrib/pcl3/eprn/gdeveprn.h to be used with all gs_malloc and
>> >> gs_free calls. Compilation output is the following now:
>> >>
>> >> ------------------------------------------------------------------
>> >> ./contrib/pcl3/eprn/gdeveprn.c: In function 'eprn_set_page_layout':
>> >> ./contrib/pcl3/eprn/gdeveprn.c:665: warning: suggest parentheses
>> around
>> >> && within ||
>> >> ./contrib/pcl3/eprn/gdeveprn.c: In function
>> 'eprn_forget_defaultmatrix':
>> >> ./contrib/pcl3/eprn/gdeveprn.c:1116: warning: implicit declaration of
>> >> function 'gs_main_instance_default'
>> >> ./contrib/pcl3/eprn/gdeveprn.c:1116: error: invalid type argument
>> of '->'
>> >> ------------------------------------------------------------------
>> >>
>> >> The error is caused by the removal of "gs_main_instance_default()"
>> from
>> >> GhostScript and the "pcl3" driver uses it once in
>> >> contrib/pcl3/eprn/gdeveprn.c:
>> >>
>> >> ------------------------------------------------------------------
>> >> -static void eprn_forget_defaultmatrix(void)
>> >> {
>> >> #if EPRN_USE_GSTATE
>> >> /* Old ghostscript versions */
>> >> gs_setdefaultmatrix(igs, NULL);
>> >> #else
>> >> gs_setdefaultmatrix(gs_main_instance_default()->i_ctx_p->pgs,
>> NULL);
>> >> #endif
>> >>
>> >> return;
>> >> }
>> >> -----------------------------------------------------------------
>> >>
>> >> How should I replace this one?
>> >>
>> >> Till
>> >> _______________________________________________
>> >> gs-devel mailing list
>> >> gs-devel at ghostscript.com
>> >> http://www.ghostscript.com/mailman/listinfo/gs-devel
>> >>
>> >
>>
>>
>
More information about the gs-devel
mailing list