#include #include #include #include #include "sqlinfoprint.h" extern struct sqlca sqlca; void check_error (const char *filename, const unsigned int linenum) { /* * Check for an error from the OpenGL API. */ GLenum errCode = glGetError (); if (errCode != GL_NO_ERROR) { const GLubyte *errString = gluErrorString (errCode); error_at_line (EXIT_FAILURE, errno, filename, linenum, "OpenGL Error %s", errString); } /* * Check for an error from the Database API. */ if (sqlinfoprint ("DB Error", &sqlca, filename, linenum) == 1) exit (EXIT_FAILURE); return; }