[comp.lang.prolog] SBProlog to C interface

ciancarini-paolo@cs.yale.edu (paolo ciancarini) (08/31/90)

I need help with parameter passing convention in SBProlog.
The procedural interface is poorly documented,
and examples provided are not useful for me.
I have to implement in C a predicate send/3

send(In_Atom1, In_Atom2, InAtom3)

that is always successful.
I want to implement send/3 with a C program.

I have a C file that contains a procedure

send(a,b,c)
char *a, *b, *c; % a,b,c: input

I added a dummy envelope for my procedure
(as requested by SBProlog)

b_SEND()
{
  register LONG op1,op2,op3;
  register LONG_PTR top;
  op1 = reg[1]; DEREF(op1);
  op2 = reg[2]; DEREF(op2);
  op3 = reg[3]; DEREF(op3);
  send(op1,op2,op3);
}

I follow the instructions given in the SB manual, but when I call
send/3 from inside Prolog I obtain a msg

#builtin 0 is not implemented

and the interpreter aborts!.

Moreover, it seems that my interpreter does not
support the builtin '_$builtin'/1, while the manual
says that it is an online predicate.

What am I missing?

Paolo Ciancarini