[Gambas-devel] Needed Info

Benoît Minisini gambas at ...1...
Sat Feb 11 20:17:01 CET 2012


Le 11/02/2012 02:01, Randall Morgan a écrit :
> Hi Benoit,
>
> Can you expand on the purpose of the following:
>
> /* The following symbols must be declared with EXPORT in a component:
>     - GB
>     - GB_INIT()
>     - GB_EXIT()
> */
>
> I have started the documentation as promised though I still have a lot
> to learn. But while waiting for replies from you I figured I could at
> least start on the documentation for what i do know... But there is
> nothing written on these items except that they must be declared extern.
>
> My guess is: GB is the master Gamabs object.
>
> GB_INIT() is used for initialization of a class, something like a
> constructor?
>
> GB_EXIT() is used to shut down the class cleanly like a destructor?
>
> Any confirmation or additional information would be very helpful.
>
> Thanks
>

GB_INIT() and GB_EXIT() are two mandatory exported functions:
- GB_INIT() is called by the interpreter to initialize the component.
- GB_EXIT() is called by the interpreter to uninitialize the component.

GB is a structure (GB_INTERFACE) that is filled by the interpreter with 
the interpreter API when the component is loaded. So the GB symbol must 
be exported too.

Look at the source of any component to see how they are declared.

Another unrelated point now: as soon as I find time, I will tell you 
what to remove and clean-up in your component. Some GSL functions are 
not useful in Gambas (mainly because they already exist in the 
interpreter), so they should not be implemented in the component.

Regards,

-- 
Benoît Minisini




More information about the Devel mailing list