Dave,

I have written a fair bit if C code to extend gprolog BUT never called it from 
C but looking at that example, I am not sure I fully understand the question...

> I know how to retrieve the solution from anc(X,john). However, if the query
> is anc(bob,john), then how could I retrieve the return value (true) from the
> gprolog in my C code? I have gone thru gprolog.h for a while. But it seems
> there is not such a func used to get the return value…

The while(res) would seem to me to be what you are after… that is a cursor over 
the result set as it where and presumably returns NULL when there are no more 
answers available… that would seem to indicate then that the return value from 
Pl_Query_Call() is either “true” (non-NULL) or “false” NULL.

Is that perhaps what you meant?

Sean Charles.


_______________________________________________
Users-prolog mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/users-prolog

Reply via email to