From jan@swi.psy.uva.nl  Thu Nov  9 15:05:07 2000
Received: from gollem.swi.psy.uva.nl (gollem [145.18.152.30])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id PAA02900;
	Thu, 9 Nov 2000 15:05:07 +0100 (MET)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id PAA27709;
	Thu, 9 Nov 2000 15:05:07 +0100
Date: Thu, 9 Nov 2000 15:05:07 +0100
Message-Id: <200011091405.PAA27709@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: Creating a DLL, parameter problem
To: Joerg Herrmann <Joerg.Herrmann@dfki.de>, prolog@swi.psy.uva.nl
In-Reply-To: Joerg Herrmann's message of Thu, 09 Nov 2000 14:04:51 +0100
Phone: +31 - 20 - 525 6121

> I want to create a DLL from a SWI-Prolog source file hello.pl
> As far as I understand your manual, the only way is to write a
> C-Wrapper that calls the intended prolog predicates.
> Below you will find such a wrapper.
> I assume, one has to call plld -share -o <dll-output> pl.c hello.pl
> for creating the dll or a share object under Linux.
> 
> If so, I like to know, how to adjust pl.c attached so that hello/2
> accepts a second argument.
> So far hello/2 gets only the first command line parameter in the case:
> 
>         plld -o test hello.pl pl.c
>         ...
>         test abc def

Actually, you cannot create a DLL from Prolog sources as it stands.  You
can embed the SWI-Prolog engine in an application or DLL and load a
Prolog program into the engine.  However, there is only one such engine
at a time in your process and this engine operates on one Prolog program
(or set of Prolog predicates if you want).

	Regards --- Jan

