diff options
-rw-r--r-- | Jamfile | 4 | ||||
-rw-r--r-- | base/cpudep.c | 2 | ||||
-rw-r--r-- | include/fitz/sysdep.h | 52 | ||||
-rw-r--r-- | test/pdfrip.c | 14 |
4 files changed, 33 insertions, 39 deletions
@@ -155,7 +155,7 @@ rule HexDump actions HexDump { - xxd -i $(>) | sed -e 's/data_//g;s/, /,/g' > $(<) ; + xxd -i $(>) | sed -e 's/data_//g;s/, /,/g' > $(<) } HexDump data/Dingbats.c : data/Dingbats.cff ; @@ -206,7 +206,7 @@ LINKLIBS on x11pdf = -lX11 -lXext $(LINKLIBS) ; Main pdfclean : test/pdfclean.c ; Main pdfdebug : test/pdfdebug.c ; # Main pdfmerge : test/pdfmerge.c ; -# Main pdfrip : test/pdfrip.c ; +Main pdfrip : test/pdfrip.c ; # Main pdffunction : test/pdffunction.c ; # Main x11pdf : test/x11pdf.c test/ximage.c ; diff --git a/base/cpudep.c b/base/cpudep.c index 4175fafc..779ebbb0 100644 --- a/base/cpudep.c +++ b/base/cpudep.c @@ -9,7 +9,7 @@ Glenn Kennard <d98gk@efd.lth.se> #ifdef WIN32 #define sigjmp_buf jmp_buf -#define sigsetjmp setjmp +#define sigsetjmp(a,b) setjmp(a) #define siglongjmp longjmp #endif diff --git a/include/fitz/sysdep.h b/include/fitz/sysdep.h index 79948d80..4e8b1115 100644 --- a/include/fitz/sysdep.h +++ b/include/fitz/sysdep.h @@ -15,24 +15,36 @@ #include <fcntl.h> /* O_RDONLY & co */ #ifdef HAVE_C99 +# define FZ_FLEX +#else +# define FZ_FLEX 1 +# define restrict +# define inline __inline__ +#endif -#define FZ_FLEX - +#ifdef WIN32 +# define vsnprintf _vsnprintf +# include <io.h> #else +# include <unistd.h> +#endif -#define FZ_FLEX 1 -#define restrict -#define inline __inline__ +#ifndef va_copy #define va_copy(a,b) (a) = (b) +#endif +#ifndef O_BINARY +#define O_BINARY 0 #endif -#ifdef WIN32 +/* + * Extras! Extras! Get them while they're hot! + */ -#define NEED_STRLCPY -#define NEED_STRSEP -#define NEED_GETOPT +/* not supposed to be here, but printf debugging sorta needs it */ +#include <stdio.h> +#ifdef NEED_MATH #define M_E 2.71828182845904523536 #define M_LOG2E 1.44269504088896340736 #define M_LOG10E 0.434294481903251827651 @@ -47,30 +59,8 @@ #define M_2_SQRTPI 1.12837916709551257390 #define M_SQRT2 1.41421356237309504880 #define M_SQRT_2 0.707106781186547524401 - -#define va_copy(a,b) (a) = (b) -#define inline __inline -#define vsnprintf _vsnprintf - -#include <io.h> - -#else - -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -#include <unistd.h> - #endif -/* - * Extras! Extras! Get them while they're hot! - */ - -/* not supposed to be here, but printf debugging sorta needs it */ -#include <stdio.h> - #ifdef NEED_STRLCPY extern int strlcpy(char *dst, const char *src, int n); extern int strlcat(char *dst, const char *src, int n); diff --git a/test/pdfrip.c b/test/pdfrip.c index 6e3f6bef..0da00d2b 100644 --- a/test/pdfrip.c +++ b/test/pdfrip.c @@ -82,7 +82,7 @@ int main(int argc, char **argv) char *filename; pdf_xref *xref; pdf_pagetree *pages; - pdf_outlinetree *outlines; + pdf_outline *outlines; int c; char *password = ""; @@ -106,11 +106,15 @@ int main(int argc, char **argv) filename = argv[optind++]; - error = pdf_openpdf(&xref, filename); + error = pdf_newxref(&xref); if (error) fz_abort(error); - error = pdf_decryptpdf(xref); + error = pdf_loadxref(xref, filename); + if (error) + fz_abort(error); + + error = pdf_decryptxref(xref); if (error) fz_abort(error); @@ -136,7 +140,7 @@ int main(int argc, char **argv) if (outlines) { printf("outlines\n"); - pdf_debugoutlinetree(outlines); + pdf_debugoutline(outlines, 0); printf("\n"); } } @@ -150,7 +154,7 @@ int main(int argc, char **argv) showpage(xref, pdf_getpageobject(pages, page - 1)); } - pdf_closepdf(xref); + pdf_closexref(xref); return 0; } |