Skip to content

Commit

Permalink
support compile under mac osx
Browse files Browse the repository at this point in the history
  • Loading branch information
axot committed Apr 1, 2014
1 parent 8fd689e commit 4c33ea9
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/epdfinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

#include <stdbool.h>
#include <assert.h>
#include <err.h>
#include <error.h>
Expand All @@ -32,6 +33,10 @@
#include "epdfinfo.h"
#include "config.h"

#ifdef __APPLE__
# define error printf
#endif


/* declarations */
static arg_t *parse_args(const ctxt_t *ctx, const char *args, size_t len,
Expand Down
59 changes: 59 additions & 0 deletions src/error.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//========================================================================
//
// Error.h
//
// Copyright 1996-2003 Glyph & Cog, LLC
//
//========================================================================

//========================================================================
//
// Modified under the Poppler project - http://poppler.freedesktop.org
//
// All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later
//
// Copyright (C) 2005, 2007 Jeff Muizelaar <jeff@infidigm.net>
// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2005 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
//
//========================================================================

#ifndef ERROR_H
#define ERROR_H

#ifdef USE_GCC_PRAGMAS
#pragma interface
#endif

#include <stdarg.h>
#include "poppler-config.h"
#include "goo/gtypes.h"

enum ErrorCategory {
errSyntaxWarning, // PDF syntax error which can be worked around;
// output will probably be correct
errSyntaxError, // PDF syntax error which can be worked around;
// output will probably be incorrect
errConfig, // error in Xpdf config info (xpdfrc file, etc.)
errCommandLine, // error in user-supplied parameters, action not
// allowed, etc. (only used by command-line tools)
errIO, // error in file I/O
errNotAllowed, // action not allowed by PDF permission bits
errUnimplemented, // unimplemented PDF feature - display will be
// incorrect
errInternal // internal error - malfunction within the Xpdf code
};

typedef enum ErrorCategory ErrorCategory;
extern void setErrorCallback(void (*cbk)(void *data, ErrorCategory category,
Goffset pos, char *msg),
void *data);

extern void CDECL error(ErrorCategory category, Goffset pos, const char *msg, ...);

#endif

0 comments on commit 4c33ea9

Please sign in to comment.