C Interface

The Logic Server library (.dll and .so) has a functional interface and an object-oriented interface. C programmers call the functional Logic Server interface directly. These are the functions that begin with 'ls' and that are documented in the API Reference. They are defined in logicserver.h.

There are no special considerations when using the Logic Server from C.

Hello Prolog

The sample program in the directory samples/c/hello is a console version of the basic hello program. It includes a make file for Visual C++ users. It is built by linking with the appropriate library in amzi/lib.

Borland C++ users should link with amzi/lib/amzib.lib. This is a .lib file created by running Borland's 'implib' utility on amzi.dll.

Unicode Support

To build a Unicode application, #define _UNICODE for the application.

All of the LSAPI functions that have character strings as arguments or return values have two versions. One version ends in 'A' (for ANSI) and the other ends in 'W' (for wide).

You still use the normal names of each function, but they are #defined to either the 'A' or 'W' version depending on whether or not _UNICODE is defined. If you explicitly want to use an ANSI version of a function in a _UNICODE application, you can explicitly call the 'A' version of the function.

The functions mbstowcs() and wcstombs() are used to convert between wide and multibyte (ANSI) strings, so multibyte character sets can also be used with the Logic Server.

Copyright ©1987-2011 Amzi! inc. All Rights Reserved. Amzi! is a registered trademark and Logic Server is a trademark of Amzi! inc.