san4023@aim1.tamu.edu (Scott Andrew Nedderman) (02/26/91)
I'm having trouble linking Turbo C with Turbo Prolog. The prolog manual has good examples of calling TC from Prolog but not the other way around. Has anyone had experience with the following Prolog stuff: --------------------------------------------------------------------- GLOBAL DOMAINS a, b, d, descr = symbol c = real slist = symbol* GLOBAL PREDICATES proc(a, b, c, d, slist) - (i, i, i, i, o) language c as "proc" CLAUSES % this clause returns a list of the descriptions (Descr) that match % A, B, C, and D in mydb proc(A, B, C, D, Slist) :- findall(Descr, mydb(A, B, C, _, D, Descr), Slist). --------------------------------------------------------------------- My questions are: How do I call `proc' from Turbo C (including declarations)? How can I pass a "don't care" parameter from Turbo C? The Prolog manual has a TC example similar to the following, but this is lacking something. --------------------------------------------------------------------- struct node { unsigned char functor; /* The type */ char *value; /* A string pointer */ struct node *next; /* A pointer to struct node */ } strlist; void howdy() { strlist *List; printf("I'm in Turbo C\n\n"); proc("Stuff", "More", "_", "Another", List); } --------------------------------------------------------------------- If anyone has examples of the correct way to do this, I would greatly appreciate them. Scott +-----------------------------+-----------------------------------+ | Scott A. Nedderman | Internet: sanhelp@venus.tamu.edu | | Academic Computing Services | Bitnet: sanhelp@tamvenus | | #include "TeXstuff.h" | THEnet: thor::sanhelp | +-----------------------------+-----------------------------------+