Error Handling (C Program)

Error handling is similar to that described for QA Build. The two variables pr_err_mode and print_error will be available to you from the DP4 header files - you do not need to declare them explicitly.

Their meaning is the same as that described in the error handling section for QA Build.

You can extend the range of pr_err_mode. The DP4 function check_printer() is called whenever an output call has been completed from an application. You can trap any value of pr_err_mode by supplying this function in your application. For example:

void check_printer()
{
  if (print_error && pr_err_mode == 3)
    take_action();
}

This function can therefore act as an exception handler for errors arising during output.