[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C Interface Issue

From: mcculloch
Subject: C Interface Issue
Date: Sat, 15 Dec 2012 10:19:08 -0800 (PST)

I've looked into various prologs and have decided Gnu Prolog is the easiest
to interface to other systems via C routines.  However, there doesn't seem
to be a good way to pass C struct pointers back to prolog for use by other
foreign predicate calls implemented in C.  I think now maybe that might not
be a good idea anyway.

The C interface I want to use creates a structure to represent a connection
to a foreign system, and then requires this structure to subsequently access
the system.  (For those who are curious, the system is mongoDB).  

One option is to create this structure, use it and destroy it every time a
predicate is called that uses that system.  Obviously, this is very
inefficient.  The other option is to provide a predicate that returns the
connection structure back to prolog to provide to other predicates, but this
is exactly what I can't figure out how to do in gprolog.

Any ideas would be greatly appreciated, and of course, any code that I
develop to completion will be shared.


View this message in context: 
Sent from the Gnu - Prolog - Bugs mailing list archive at Nabble.com.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]