"After this call returns successfully" means it returns with
TRUE (i.e. 1)
Declared in SWI-Prolog.h as follows:
typedef foreign_t (*pl_function_t)(); PL_EXPORT(int) PL_register_foreign_in_module(const char *module, const char *name, int arity, pl_function_t func, int flags, ...);
and defined in
pl-fli.c although with a different argument list:
int PL_register_foreign_in_module(const char *module, const char *name, int arity, Func f, int flags, ...)
In shared libraries, this function is called from a specially designated C function that is called on module load so that the predicates implemented implemented by the module become visible.