1 | //======================================================================== |
2 | // |
3 | // Error.h |
4 | // |
5 | // Copyright 1996-2003 Glyph & Cog, LLC |
6 | // |
7 | //======================================================================== |
8 | |
9 | //======================================================================== |
10 | // |
11 | // Modified under the Poppler project - http://poppler.freedesktop.org |
12 | // |
13 | // All changes made under the Poppler project to this file are licensed |
14 | // under GPL version 2 or later |
15 | // |
16 | // Copyright (C) 2005, 2007 Jeff Muizelaar <jeff@infidigm.net> |
17 | // Copyright (C) 2005, 2018 Albert Astals Cid <aacid@kde.org> |
18 | // Copyright (C) 2005 Kristian Høgsberg <krh@redhat.com> |
19 | // Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com> |
20 | // Copyright (C) 2014 Fabio D'Urso <fabiodurso@hotmail.it> |
21 | // Copyright (C) 2020 Adam Reichold <adam.reichold@t-online.de> |
22 | // |
23 | // To see a description of the changes please see the Changelog file that |
24 | // came with your tarball or type make ChangeLog if you are building from git |
25 | // |
26 | //======================================================================== |
27 | |
28 | #ifndef ERROR_H |
29 | #define ERROR_H |
30 | |
31 | #include <cstdarg> |
32 | #include "poppler-config.h" |
33 | #include "poppler_private_export.h" |
34 | #include "goo/gfile.h" |
35 | #include "goo/GooString.h" |
36 | |
37 | enum ErrorCategory |
38 | { |
39 | errSyntaxWarning, // PDF syntax error which can be worked around; |
40 | // output will probably be correct |
41 | errSyntaxError, // PDF syntax error which can be worked around; |
42 | // output will probably be incorrect |
43 | errConfig, // error in Xpdf config info (xpdfrc file, etc.) |
44 | errCommandLine, // error in user-supplied parameters, action not |
45 | // allowed, etc. (only used by command-line tools) |
46 | errIO, // error in file I/O |
47 | errNotAllowed, // action not allowed by PDF permission bits |
48 | errUnimplemented, // unimplemented PDF feature - display will be |
49 | // incorrect |
50 | errInternal // internal error - malfunction within the Xpdf code |
51 | }; |
52 | |
53 | using ErrorCallback = void (*)(ErrorCategory category, Goffset pos, const char *msg); |
54 | |
55 | extern void POPPLER_PRIVATE_EXPORT setErrorCallback(ErrorCallback cbk); |
56 | |
57 | extern void CDECL POPPLER_PRIVATE_EXPORT error(ErrorCategory category, Goffset pos, const char *msg, ...) GOOSTRING_FORMAT; |
58 | |
59 | #endif |
60 | |