Next: , Previous: , Up: Stand-Alone Executables   [Contents][Index]


6.7.4 User-defined Main Programs

Runtime systems may or may not have an automatically generated main program. This is controlled by the --main option to spld. If --main=user is given, then a function user_main() must be supplied:

int user_main(int argc, char *argv[])

user_main() is responsible for initializing the Prolog engine, loading code, and issuing any Prolog queries. An alternative is to use --main=none and write your own main() function.


Send feedback on this subject.