On Mon, 8 Nov 1999 17:13:08 +0000 (GMT), Austin Donnelly wrote:

>On Monday, 8 Nov 1999, Asbjoern Pettersen wrote:
>> The GIMP's modules for OS/2 need some extra handling.
>> It's copied into the 3-4 modules C files and it's also not
>> updated.  I want to clean up this code.
>The same problem was occurring on Solaris2.  Yosh has now tweaked some
>of the libtool options so that it should now work.  Do these fixes for
>Solaris2 also fix the problem under OS/2?

I'm not useing libtool. Is it a script ? 
I just wanna solve the problem in the source code and
compile/link with gcc. For OS/2 there is one simple bug but i don't want
to patch this on all 4 modules. The OS/2 code with #ifdef ins't nice to 
look at.

Here is some ugly example from colorsel_gtk.c:

G_MODULE_EXPORT GimpModuleStatus
module_init (GimpModuleInfo **inforet)
  GimpColorSelectorID id;

#ifndef __EMX__
  id = gimp_color_selector_register ("GTK", "gtk.html", &methods);

  if (id)
  color_reg_func reg_func;
  reg_func = (color_reg_func) get_main_func("gimp_color_selector_register");
  if (reg_func && (id = (*reg_func) ("GTK", &methods)))
    info.shutdown_data = id;
    *inforet = &info;
    return GIMP_MODULE_OK;
Here is mine suggestion for module_init() colorsel_gtk.c (and all the other mods):

G_MODULE_EXPORT GimpModuleStatus
module_init (GimpModuleInfo **inforet)
     GimpModuleStatus  status = mod_color_register ("GTK", "gtk.html",inforet);
     return (status);

The "mod_color_register()" is the "old" module_init() .
Simple , cleaner and doing the same.

>> I suggest to create a new file called modregister.c and put
>> all the "register" things there. Modules have to link the new file.
>> The will be no new features only a cleaner design.
>I'm all for a cleaner design.  Ideally we should be doing the same
>thing for all architectures, rather than using nasty #ifdefs
>Also, still to be fixed with the module code is a version check as
>suggested by Tim Janik a long time ago, and unloading modules from the
>idle loop (which should make the perl module self-unloadable).
>I'm not particularly happy with the OS/2 solution, it seems a little
>ugly, but I'm not sure why exactly I don't like it.

* Asbjørn Pettersen           Phone work: +47 77 66 08 91  *
* Kongsberg Spacetec a.s     Phone home: +47 77674022  *
*                              Telefax:    +47 77 65 58 59  *
* Prestvannveien 38          www:http://www.spacetec.no   *
* N-9005 Tromsoe, Norway     email:[EMAIL PROTECTED]  *

Reply via email to