Advertisement
quantumech

Untitled

May 23rd, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.82 KB | None | 0 0
  1. #include <cinterf.h>
  2. #include <stdio.h>
  3.  
  4. int main()
  5. {
  6.     // 1) Initialize XSB runtime. xsb_init_string()'s argument must point to {XSB_DIR}
  7.     //    xsb_init_string() returns 'true' if an error occurs during initialization, hence the error handling
  8.     //    The path works with least problems if it is an absolute path, rather then relative.
  9.     if(xsb_init_string("path/to/XSB"))
  10.     {
  11.         // xsb_get_init_error_message() returns the last error that occured while XSB initializes the runtime
  12.         printf("++XSB failed to initialize with error: %s\n", xsb_get_init_error_message());
  13.         exit(-1);
  14.     }
  15.     else // 2) If XSB successfully initialized
  16.     {
  17.         // Print 'XSB successfully initialized'
  18.         printf("XSB successfully initialized!");
  19.  
  20.         // Terminate XSB
  21.         xsb_close();
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement