On Sun, 18 Dec 2005, Martin Nilsson (Opera) @ Pike (-) developers forum wrote:
Featurerequest:
In support.c we currently PIKE_IMPORT to get image_program from the Image module. This is done so that the image storage can be indexed directly on xsize and ysize, instead of calling these methods from the object.
I did however notice that gdkbitmap.pre does apply(o,"xsize",0); get_all_args("internal",1,"%i",&x); pop_stack(); apply(o,"ysize",0); get_all_args("internal",1,"%i",&y); pop_stack(); so I would like to generalize the import of image_program by moving the PIKE_IMPORT call to INIT. But I don't think there is any mechanism for adding code to INIT, so that would be the feature request...
So, since this is done at the c-level, that would mean add set_init_callback(), then in the callback do the same PIKE_MODULE_IMPORT() that is done in those other functions, correct?
Maybe add an INIT { } keyword that would add code to the init callback?
I assume from other messages that PIKE_MODULE_IMPORT() can't be done in PIKE_MODULE_INIT, but can be done in the init callback, correct?