From nissim@math.ufl.edu Mon Jul 30 18:16:01 2001 Received: from smtp.ufl.edu (sp28fe.nerdc.ufl.edu [128.227.128.108]) by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f6UGG1b22069 for ; Mon, 30 Jul 2001 18:16:01 +0200 (MET DST) Received: from computer (p083n177.shands.ufl.edu [10.227.83.177]) by smtp.ufl.edu (8.11.2/8.11.3/2.2.1) with SMTP id f6UGFxv31934 for ; Mon, 30 Jul 2001 12:15:59 -0400 Message-ID: <002801c118ea$4530bb40$b153e30a@computer> From: "Nissim Broudo" To: Date: Mon, 30 Jul 2001 12:24:56 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0025_01C118F2.A4EC0CD0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Subject: [SWIPL] PL_unify This is a multi-part message in MIME format. ------=_NextPart_000_0025_01C118F2.A4EC0CD0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I'm calling SWI-Prolog from C. I need to use the bindings produced by = one query in the input to a second query and I am encountering a = problem. I am using PL_unify. The problem I am encountering is in a = call like this: foreign_t my_query(term_t in) { int rval; term_t temp; char *st =3D "atom_string"; PL_unify_atom_chars(temp, st); rval =3D PL_unify(temp,in); return rval; } Prolog reports an error: 1 ?- my_query(X). ERROR: my_query/1: Caught signal 11 (segv) But if I use the following: foreign_t my_query(term_t in) { int rval; term_t temp; char *st =3D "atom_string"; PL_unify_atom_chars(in, st); return rval; } Prolog reports: X =3D atom_string Any ideas ? Thanks, Nissim Broudo ------=_NextPart_000_0025_01C118F2.A4EC0CD0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I'm calling SWI-Prolog from C.  I = need to use=20 the bindings produced by one query in the input to a second query = and I am=20 encountering a problem.  I am using PL_unify.  The problem I = am=20 encountering is in a call like this:
 
foreign_t my_query(term_t in) = {
 
int rval;
term_t temp;
char *st = =3D=20 "atom_string";
PL_unify_atom_chars(temp, st);
rval =3D=20 PL_unify(temp,in);
 
return rval; }
 
Prolog reports an error:
 
1 ?- my_query(X).
 
ERROR: my_query/1: Caught signal 11=20 (segv)
 
But if I use the = following:
 
foreign_t my_query(term_t in) = {
 
int rval;
term_t temp;
char *st = =3D=20 "atom_string";
PL_unify_atom_chars(in, st);
 
return rval; }
 
Prolog reports:
 
X =3D atom_string
 
Any ideas ?
 
Thanks,
Nissim Broudo
------=_NextPart_000_0025_01C118F2.A4EC0CD0--