[PPL-devel] Re: [SWIPL] A question on install() and uninstall() in foreign modules

Jan Wielemaker jan at swi.psy.uva.nl
Wed Jun 12 15:19:42 CEST 2002


Roberto,

> I understand from the documentation that the install() function
> returns an object of type install_t.  However, install_t seems
> to be defined as void in SWI-Prolog.h.  In other words,
> code like
> 
> install_t install() {
>    ppl_initialize();
>    PL_register_extensions(predicates);
> }
> 
> would seem to miss a return statement, but adding a return statement
> would be an error.
> So, what is the purpose of install_t?

Provide whatever is needed to make it visible from the outside world
such as DLL-export statements.  If I would have to design in again,
I would have used an integer return value, so the install function
can signal success/failure.  For now I'll not make any changes until
there is a standard to move toward.

> And why there is not something similar for uninstall()?
> Thanks in advance

Also install_t:

install_t
uninstall()
{ ppl_remove();		/* or whatever; the predicates are removed */
}			/* automatically */

	Cheers --- Jan



More information about the PPL-devel mailing list