From jan@swi.psy.uva.nl Fri Jun  1 10:21:21 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f518LL324754;
	Fri, 1 Jun 2001 10:21:21 +0200 (MET DST)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f518LL002499;
	Fri, 1 Jun 2001 10:21:21 +0200
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: Mehmet Donderler <mdonder@cs.bilkent.edu.tr>, prolog@swi.psy.uva.nl
Subject: Re: [SWIPL] Passing Results from Prolog!
Date: Fri, 1 Jun 2001 10:18:04 +0200
X-Mailer: KMail [version 1.0.29.2]
Content-Type: text/plain
References: <Pine.SOL.3.92.1010601101051.698A-100000@didim>
In-Reply-To: <Pine.SOL.3.92.1010601101051.698A-100000@didim>
MIME-Version: 1.0
Message-Id: <01060110212001.01465@gollem>
Content-Transfer-Encoding: 8bit

On Fri, 01 Jun 2001, Mehmet Donderler wrote:
>Dear all:
>
>I have some C code from which I call Prolog predicates, and I would like
>to have the values returned so as to use them in my C code. It is possible
>to do that with JPL (Java Prolog Interface), and it should also be
>possible to obtain the results from Prolog predicates using C
>as well. I would be very grateful if you could suggest me a method whereby
>I could pass the results from Prolog to my C code since I could not find
>a way to do so except for writing the results in a file within the Prolog
>environment and then reading that file from within my C code.

There are numerous examples and a complete chapter on that in the
manual.  There are also some things on the Twiki web and various
detailed issues in the history of this list.

If you are happy(ier) with C++, look at SWI-cpp.h, which is documented
in ...\pl\doc\packages\pl2cpp.html

	--- Jan

