We introduce a series of examples of how XSB would be called using the string-level interfaces. Simple examples of the register-level interface are given in the XSB/examples/c_calling_XSB subdirectory, in files cmain.c, cmain2.c, ctest.P, and Makefile, but are not discussed in this section.
We structure out discussion by first showing how to construct a C program to call the single-threaded engine alone in Section 3.2.1. This example is mostly pedagogic: with a small amount of extra coding a C program can be constructed to call both the single- and the multi-threaded engine, and these extensions are discussed in Section 3.2.2. Next, we show how to a C program can call and manage multiple XSB threads in Section 3.2.3. Finally, we show how multiple XSB threads can interact with multiple C threads in Section 3.2.3.