The high-level foreign predicate interface was designed to release the programmer from the burden of having to write low-level code to transfer data from XSB to C and vice-versa. Instead, all the user needs to do is to describe each C function and its corresponding Prolog predicates in the .H files. The interface then automatically generates the wrappers that translate Prolog terms and structures to proper C types, and vice-versa. The wrappers are then automatically used when the foreign predicates are compiled.2.1