1 //======================================================================== 2 // 3 // Error.h 4 // 5 // Copyright 1996-2003 Glyph & Cog, LLC 6 // 7 //======================================================================== 8 9 #ifndef ERROR_H 10 #define ERROR_H 11 12 #include <aconf.h> 13 14 #ifdef USE_GCC_PRAGMAS 15 #pragma interface 16 #endif 17 18 #include <stdio.h> 19 #include "config.h" 20 #include "gfile.h" 21 22 enum ErrorCategory { 23 errSyntaxWarning, // PDF syntax error which can be worked around; 24 // output will probably be correct 25 errSyntaxError, // PDF syntax error which cannot be worked around; 26 // output will probably be incorrect 27 errConfig, // error in Xpdf config info (xpdfrc file, etc.) 28 errCommandLine, // error in user-supplied parameters, action not 29 // allowed, etc. (only used by command-line tools) 30 errIO, // error in file I/O 31 errNotAllowed, // action not allowed by PDF permission bits 32 errUnimplemented, // unimplemented PDF feature - display will be 33 // incorrect 34 errInternal // internal error - malfunction within the Xpdf code 35 }; 36 37 extern void setErrorCallback(void (*cbk)(void *data, ErrorCategory category, 38 int pos, char *msg), 39 void *data); 40 41 extern void CDECL error(ErrorCategory category, GFileOffset pos, 42 const char *msg, ...); 43 44 #endif 45