Go to the first, previous, next, last section, table of contents.


Error API

You can override the default error handling routines by defining replacements and including them in the link command prior to libkarel. Each error handler is defined separately, so it is possible to redefine one, and use the default behavior of the other two.

Error Handler: void ktr_err_nomem (size_t size)
Library function that is invoked when the Karel engine cannot allocate memory.

Error Handler: void ktr_err_fatal (char * format, ...)
Library function that is invoked when the Karel engine has a fatal error. The default implementation prints the arguments ala fprintf(stderr, format, ...) and exits the program.

Error Handler: void ktr_err_parse (char * format, ...)
Library function that is invoked when the Karel parser has an error. The default implementation prints the arguments ala fprintf(stderr, format, ...) and exits the program.


Go to the first, previous, next, last section, table of contents.