Hi,

as part of the move towards a new beta, and hopefully a real release
a few weeks after that, the sublib handling in LibGGI has been
rewritten. The log entry is included in this mail. If there's
something unclear feel free to ask. Also feel free to ask if you are
new to GGI and don't understand one bit of this, and I'll try to
answer your questions and put them in some sort of FAQ.

The single sublib entry points and unique names will also make it
a pretty easy task to implement complete static linking of LibGGI:
All you need to do is build a table of the entry points, and change
_ggiLoadDL() to look them up in this table.

---- begin log entry ----
Big rewrite of the sublib handling.
All sublibs now have a single entry point prototyped like this:
typedef int (ggifunc_dlentry)(int func, void **funcptr);

This function is used to get pointers to the real sublib functions.
Currently there are three such functions:

typedef int (ggifunc_open)(struct ggi_visual *vis, struct ggi_dlhandle *dlh,
                           const char *arg, void *argptr, uint32 *dlret);
typedef int (ggifunc_exit)(struct ggi_visual *vis,
                           struct ggi_dlhandle *dlh);
typedef int (ggifunc_close)(struct ggi_visual *vis,
                            struct ggi_dlhandle *dlh);
open replaces GGIdlinit() and close replaces GGIdlcleanup(). exit is a
special function which will rarely be used. It is used when the normal
de-initialization order of sublibs is not sufficient, for example when
an OP_DISPLAY sublib needs to access data in an extension sublib (like
in the mansync case).

open (and exit/close as well) now returns 0 on success and a GGI error
code on error. The GGI_DL_* codes are returned in the *dlret argument.

The name of the entry point is <symprefix><sublibname>, where:
<sublibname> is the name of the library with the last dot and everything
after it stripped.
<symprefix> is GGIdl_ for LibGGI and the Misc extension.
For all other extensions the new symprefix paramater from
ggiExtensionLoadDL() is used for <symprefix>.

_ggiOpenDL() and _ggiAddDL() has been changed to return 0 on success and
a GGI error code on failure.

_ggiZapMode() no longer takes a mask of sublib types to zap, instead it
takes a 'zapall' argument which if non-zero tells LibGGI to zap extension
sublibs and OP_DISPLAY sublibs. Otherwise only OP_GC, OP_DRAW and OP_COLOR
sublibs are zapped.

The ggi_visual_op* structs has been cleaned up so we can initialize all of
them with a single function, so despite the above changes LibGGI is now
actually slightly smaller.

This does not require any changes to applications, full ABI compability
is maintained. Extensions are affected as ggiExtensionLoadDL() now takes
an additional symprefix argument, and all extension sublibs needs to be
changed for the single entry point system.
---- end log entry ----

//Marcus
-- 
-------------------------------+------------------------------------
        Marcus Sundberg        | http://www.stacken.kth.se/~mackan
 Royal Institute of Technology |       Phone: +46 707 295404
       Stockholm, Sweden       |   E-Mail: [EMAIL PROTECTED]

Reply via email to