Hello community,
here is the log from the commit of package libspectre for openSUSE:Factory
checked in at Mon Nov 16 14:06:08 CET 2009.
--------
--- libspectre/libspectre.changes 2009-02-05 04:13:25.000000000 +0100
+++ /mounts/work_src_done/STABLE/libspectre/libspectre.changes 2009-11-13 12:37:19.000000000 +0100
@@ -1,0 +2,23 @@
+Fri Nov 13 12:16:09 CET 2009 - vuntz@opensuse.org
+
+- Update to version 0.2.3:
+ + Several fixes in the PostScript parser:
+ - Detection of invalid or broken files has been improved. A
+ document scanned without errors with no pages and no format
+ is likely to be an invalid file, or not a PostScript file at
+ all (fdo#19042)
+ - Fix possible uninitialized use of Document media struct
+ contents(fdo#18685)
+ - Fix documents with PJL commands before the initial DSC
+ comments.
+ + Ghostscript is now always run with -dSAFER option
+ + A missing argument in gs command line of PDF exporter was
+ making it always fail for any document in BSD systems
+ (fdo#18826)
+ + Internal copy of ghostscript headers have been removed since
+ they are already installed by ghostscript since version 8.62
+ (fdo#18827)
+- Do not call suse_update_config, and do not reset CFLAGS to
+ default value.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
libspectre-0.2.2.tar.bz2
New:
----
libspectre-0.2.3.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libspectre.spec ++++++
--- /var/tmp/diff_new_pack.bppwdg/_old 2009-11-16 13:23:07.000000000 +0100
+++ /var/tmp/diff_new_pack.bppwdg/_new 2009-11-16 13:23:07.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package libspectre (Version 0.2.2)
+# spec file for package libspectre (Version 0.2.3)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -23,7 +23,7 @@
License: GPL v2 or later
Group: Development/Libraries/C and C++
Summary: Library for Rendering PostScript Documents
-Version: 0.2.2
+Version: 0.2.3
Release: 1
Source0: %name-%version.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -35,13 +35,6 @@
provides a convenient easy to use API for handling and rendering
Postscript documents.
-
-
-Authors:
---------
- Albert Astals Cid
- Carlos Garcia Campos
-
%package -n libspectre1
License: GPL v2 or later
Group: Development/Libraries/C and C++
@@ -52,13 +45,6 @@
provides a convenient easy to use API for handling and rendering
Postscript documents.
-
-
-Authors:
---------
- Albert Astals Cid
- Carlos Garcia Campos
-
%package -n libspectre-devel
License: GPL v2 or later
Group: Development/Libraries/C and C++
@@ -71,20 +57,10 @@
provides a convenient easy to use API for handling and rendering
Postscript documents.
-
-
-Authors:
---------
- Albert Astals Cid
- Carlos Garcia Campos
-
%prep
%setup -q
%build
-# Update config.{guess,sub}
-%{?suse_update_config}
-export CFLAGS="$RPM_OPT_FLAGS"
%configure --disable-static --enable-shared
make %{?jobs:-j %jobs}
++++++ libspectre-0.2.2.tar.bz2 -> libspectre-0.2.3.tar.bz2 ++++++
++++ 62663 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/ChangeLog new/libspectre-0.2.3/ChangeLog
--- old/libspectre-0.2.2/ChangeLog 2008-11-25 17:20:20.000000000 +0100
+++ new/libspectre-0.2.3/ChangeLog 2009-10-18 16:49:36.000000000 +0200
@@ -1,3 +1,138 @@
+commit a25264c609f2d2cc6a837aef6744f58a5f04064f
+Author: Carlos Garcia Campos
+Date: Sun Oct 18 16:15:30 2009 +0200
+
+ Use git tag instead of deprecated git-tag
+
+ Makefile.am | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+commit 8430f85ec06e946ac213cda3ad565f12ae7985af
+Author: Carlos Garcia Campos
+Date: Sat Oct 10 12:47:15 2009 +0200
+
+ Remove internal copy of ghostscript headers
+
+ They should be intalled by ghostscript since version 8.62.
+
+ configure.ac | 1 -
+ libspectre/Makefile.am | 2 -
+ libspectre/ghostscript/Makefile.am | 4 -
+ libspectre/ghostscript/gdevdsp.h | 266 --------------------------------
+ libspectre/ghostscript/iapi.h | 300 ------------------------------------
+ libspectre/ghostscript/ierrors.h | 153 ------------------
+ 6 files changed, 0 insertions(+), 726 deletions(-)
+
+commit 24d97577878a227f1bef88a348f7ac329c5d57ba
+Author: Carlos Garcia Campos
+Date: Sat Oct 10 12:41:17 2009 +0200
+
+ Bump gs requirement to 8.62
+
+ configure.ac | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+commit 40c65518c160e501f890863827074d11aa72ee7f
+Author: Carlos Garcia Campos
+Date: Sat Oct 10 11:44:47 2009 +0200
+
+ [psgetpagebbox] return true if any of the coords are != 0 instead of all of them
+
+ Fixes bug #24132.
+
+ libspectre/ps.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+commit 077182e1fe53131d7c88cc1a0f278403e60bdc32
+Author: Carlos Garcia Campos
+Date: Fri Sep 11 11:49:02 2009 +0200
+
+ Add missing first argument in exporter pdf
+
+ libspectre/spectre-exporter-pdf.c | 5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+commit 0956b7efc4bec37fd8483e1fac0b710c66bd42cb
+Author: Carlos Garcia Campos
+Date: Sun Sep 6 11:08:56 2009 +0200
+
+ Revert "Skip nested documents that don't have BeginDocument and EndDocument but have %PS and %%EOF"
+
+ This reverts commit d2a3abcc066330f893fa53dee8ad71dbc452d95a. This is
+ causing other bugs (see bug #23456) and it doesn't seem to be fixing
+ anything important.
+
+ libspectre/ps.c | 17 -----------------
+ 1 files changed, 0 insertions(+), 17 deletions(-)
+
+commit 724d7e41a2d54ec4a23e68622bc1a2926e3d677e
+Author: Carlos Garcia Campos
+Date: Tue Jun 16 17:04:35 2009 +0200
+
+ Run ghostscript always with -dSAFER option
+
+ libspectre/spectre-device.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+commit 89d7727b2a356a0de166a3072d3240249692210b
+Author: Carlos Garcia Campos
+Date: Tue Apr 21 11:01:24 2009 +0200
+
+ Fix documents with PJL commands before the initial DSC comments
+
+ When using readline to skip the PJL commands, the whole document is
+ skipped because readline considers %PS comments as a nested document. We
+ need to unconditionally skip the lines until the first DSC command is
+ found and continue with the parsing normally.
+
+ libspectre/ps.c | 41 ++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 40 insertions(+), 1 deletions(-)
+
+commit 93d6425bf323b2f0c7846a179e7b77de4d64eab9
+Author: Carlos Garcia Campos
+Date: Sun Apr 19 17:01:49 2009 +0200
+
+ Make sure document media struct contents are never used uninitialized
+
+ Based on a patch by Alexander Myltsev . See bug #18685
+
+ libspectre/ps.c | 57 +++++++++++++++++++++++++++++-------------------------
+ 1 files changed, 31 insertions(+), 26 deletions(-)
+
+commit 42df22b63cafbb4f7f9aa1e3ddc4df61a71a072b
+Author: Carlos Garcia Campos
+Date: Sun Apr 19 15:47:01 2009 +0200
+
+ Improve detection of invalid PS files
+
+ A document scanned without errors with no pages and no format is likely
+ to be an invalid file, or not a PostScript file at all. Since this
+ cannot be detected by the scanner, in this particular case, we try to
+ render the document to set SPECTRE_STATUS_LOAD_ERROR in case it fails to
+ render. Fixes bug #19042.
+
+ libspectre/spectre-document.c | 16 +++++++++++++++-
+ 1 files changed, 15 insertions(+), 1 deletions(-)
+
+commit 38d9d955cf7a6baed877331d60837d9ce1b853c3
+Author: Carlos Garcia Campos
+Date: Sun Mar 22 17:43:06 2009 +0100
+
+ Fix error handling of gsapi_run_* functions
+
+ libspectre/spectre-gs.c | 23 +++++++++++++----------
+ 1 files changed, 13 insertions(+), 10 deletions(-)
+
+commit 6bc295778c964e320e126b5d20f701a1e21c9847
+Author: Carlos Garcia Campos
+Date: Tue Nov 25 17:21:38 2008 +0100
+
+ Update for release 0.2.2
+
+ NEWS | 14 ++++++++++++++
+ configure.ac | 4 ++--
+ 2 files changed, 16 insertions(+), 2 deletions(-)
+
commit b3886dd89f7a3394eed2c9e574909646b6024197
Author: Alexander Myltsev
Date: Mon Nov 24 09:21:13 2008 +0300
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/config.h.in new/libspectre-0.2.3/config.h.in
--- old/libspectre-0.2.2/config.h.in 2008-10-17 19:35:14.000000000 +0200
+++ new/libspectre-0.2.3/config.h.in 2009-10-10 12:40:02.000000000 +0200
@@ -1,5 +1,8 @@
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
/* Define to 1 if you have the header file. */
#undef HAVE_DLFCN_H
@@ -33,6 +36,10 @@
/* Define if the 'vasprintf' function is available. */
#undef HAVE_VASPRINTF
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
/* Name of package */
#undef PACKAGE
@@ -69,6 +76,14 @@
/* Version number of package */
#undef VERSION
-/* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/configure.ac new/libspectre-0.2.3/configure.ac
--- old/libspectre-0.2.2/configure.ac 2008-11-25 17:18:41.000000000 +0100
+++ new/libspectre-0.2.3/configure.ac 2009-10-18 16:48:48.000000000 +0200
@@ -2,7 +2,7 @@
m4_define([spectre_major_version], [0])
m4_define([spectre_minor_version], [2])
-m4_define([spectre_micro_version], [2])
+m4_define([spectre_micro_version], [3])
m4_define([spectre_version],
[spectre_major_version.spectre_minor_version.spectre_micro_version])
@@ -23,7 +23,7 @@
## increment any time the source changes; set to
## 0 if you increment CURRENT
-LT_REVISION=2
+LT_REVISION=3
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
@@ -59,7 +59,7 @@
AC_CHECK_FUNC(vasprintf, [ AC_DEFINE(HAVE_VASPRINTF, 1, [Define if the 'vasprintf' function is available.]) ])
-LIBGS_REQUIRED="8.61"
+LIBGS_REQUIRED="8.62"
AC_CHECK_LIB(gs, gsapi_new_instance, have_libgs=yes, have_libgs=no)
if test "x$have_libgs" = "xyes"; then
@@ -287,7 +287,6 @@
Doxyfile
libspectre/Makefile
libspectre/spectre-version.h
-libspectre/ghostscript/Makefile
test/Makefile
libspectre.pc
])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/libspectre/ghostscript/gdevdsp.h new/libspectre-0.2.3/libspectre/ghostscript/gdevdsp.h
--- old/libspectre-0.2.2/libspectre/ghostscript/gdevdsp.h 2008-09-15 12:21:51.000000000 +0200
+++ new/libspectre-0.2.3/libspectre/ghostscript/gdevdsp.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,266 +0,0 @@
-/* Copyright (C) 2001-2006 Artifex Software, Inc.
- All Rights Reserved.
-
- This software is provided AS-IS with no warranty, either express or
- implied.
-
- This software is distributed under license and may not be copied, modified
- or distributed except as expressly authorized under the terms of that
- license. Refer to licensing information at http://www.artifex.com/
- or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
- San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
-*/
-/* $Id$ */
-/* gdevdsp.h - callback structure for DLL based display device */
-
-#ifndef gdevdsp_INCLUDED
-# define gdevdsp_INCLUDED
-
-/*
- * The callback structure must be provided by calling the
- * Ghostscript APIs in the following order:
- * gsapi_new_instance(&minst);
- * gsapi_set_display_callback(minst, callback);
- * gsapi_init_with_args(minst, argc, argv);
- *
- * Supported parameters and default values are:
- * -sDisplayHandle=16#04d2 or 1234 string
- * Caller supplied handle as a decimal or hexadecimal number
- * in a string. On 32-bit platforms, it may be set
- * using -dDisplayHandle=1234 for backward compatibility.
- * Included as first parameter of all callback functions.
- *
- * -dDisplayFormat=0 long
- * Color format specified using bitfields below.
- * Included as argument of display_size() and display_presize()
- * These can only be changed when the device is closed.
- *
- * The second parameter of all callback functions "void *device"
- * is the address of the Ghostscript display device instance.
- * The arguments "void *handle" and "void *device" together
- * uniquely identify an instance of the display device.
- *
- * A typical sequence of callbacks would be
- * open, presize, memalloc, size, sync, page
- * presize, memfree, memalloc, size, sync, page
- * preclose, memfree, close
- * The caller should not access the image buffer:
- * - before the first sync
- * - between presize and size
- * - after preclose
- * If opening the device fails, you might see the following:
- * open, presize, memalloc, memfree, close
- *
- */
-
-#define DISPLAY_VERSION_MAJOR 2
-#define DISPLAY_VERSION_MINOR 0
-
-#define DISPLAY_VERSION_MAJOR_V1 1 /* before separation format was added */
-#define DISPLAY_VERSION_MINOR_V1 0
-
-/* The display format is set by a combination of the following bitfields */
-
-/* Define the color space alternatives */
-typedef enum {
- DISPLAY_COLORS_NATIVE = (1<<0),
- DISPLAY_COLORS_GRAY = (1<<1),
- DISPLAY_COLORS_RGB = (1<<2),
- DISPLAY_COLORS_CMYK = (1<<3),
- DISPLAY_COLORS_SEPARATION = (1<<19)
-} DISPLAY_FORMAT_COLOR;
-#define DISPLAY_COLORS_MASK 0x8000fL
-
-/* Define whether alpha information, or an extra unused bytes is included */
-/* DISPLAY_ALPHA_FIRST and DISPLAY_ALPHA_LAST are not implemented */
-typedef enum {
- DISPLAY_ALPHA_NONE = (0<<4),
- DISPLAY_ALPHA_FIRST = (1<<4),
- DISPLAY_ALPHA_LAST = (1<<5),
- DISPLAY_UNUSED_FIRST = (1<<6), /* e.g. Mac xRGB */
- DISPLAY_UNUSED_LAST = (1<<7) /* e.g. Windows BGRx */
-} DISPLAY_FORMAT_ALPHA;
-#define DISPLAY_ALPHA_MASK 0x00f0L
-
-/* Define the depth per component for DISPLAY_COLORS_GRAY,
- * DISPLAY_COLORS_RGB and DISPLAY_COLORS_CMYK,
- * or the depth per pixel for DISPLAY_COLORS_NATIVE
- * DISPLAY_DEPTH_2 and DISPLAY_DEPTH_12 have not been tested.
- */
-typedef enum {
- DISPLAY_DEPTH_1 = (1<<8),
- DISPLAY_DEPTH_2 = (1<<9),
- DISPLAY_DEPTH_4 = (1<<10),
- DISPLAY_DEPTH_8 = (1<<11),
- DISPLAY_DEPTH_12 = (1<<12),
- DISPLAY_DEPTH_16 = (1<<13)
- /* unused (1<<14) */
- /* unused (1<<15) */
-} DISPLAY_FORMAT_DEPTH;
-#define DISPLAY_DEPTH_MASK 0xff00L
-
-
-/* Define whether Red/Cyan should come first,
- * or whether Blue/Black should come first
- */
-typedef enum {
- DISPLAY_BIGENDIAN = (0<<16), /* Red/Cyan first */
- DISPLAY_LITTLEENDIAN = (1<<16) /* Blue/Black first */
-} DISPLAY_FORMAT_ENDIAN;
-#define DISPLAY_ENDIAN_MASK 0x00010000L
-
-/* Define whether the raster starts at the top or bottom of the bitmap */
-typedef enum {
- DISPLAY_TOPFIRST = (0<<17), /* Unix, Mac */
- DISPLAY_BOTTOMFIRST = (1<<17) /* Windows */
-} DISPLAY_FORMAT_FIRSTROW;
-#define DISPLAY_FIRSTROW_MASK 0x00020000L
-
-
-/* Define whether packing RGB in 16-bits should use 555
- * or 565 (extra bit for green)
- */
-typedef enum {
- DISPLAY_NATIVE_555 = (0<<18),
- DISPLAY_NATIVE_565 = (1<<18)
-} DISPLAY_FORMAT_555;
-#define DISPLAY_555_MASK 0x00040000L
-
-/* Define the row alignment, which must be equal to or greater than
- * the size of a pointer.
- * The default (DISPLAY_ROW_ALIGN_DEFAULT) is the size of a pointer,
- * 4 bytes (DISPLAY_ROW_ALIGN_4) on 32-bit systems or 8 bytes
- * (DISPLAY_ROW_ALIGN_8) on 64-bit systems.
- */
-typedef enum {
- DISPLAY_ROW_ALIGN_DEFAULT = (0<<20),
- /* DISPLAY_ROW_ALIGN_1 = (1<<20), */ /* not currently possible */
- /* DISPLAY_ROW_ALIGN_2 = (2<<20), */ /* not currently possible */
- DISPLAY_ROW_ALIGN_4 = (3<<20),
- DISPLAY_ROW_ALIGN_8 = (4<<20),
- DISPLAY_ROW_ALIGN_16 = (5<<20),
- DISPLAY_ROW_ALIGN_32 = (6<<20),
- DISPLAY_ROW_ALIGN_64 = (7<<20)
-} DISPLAY_FORMAT_ROW_ALIGN;
-#define DISPLAY_ROW_ALIGN_MASK 0x00700000L
-
-
-#ifndef display_callback_DEFINED
-#define display_callback_DEFINED
-typedef struct display_callback_s display_callback;
-#endif
-
-/*
- * Note that for Windows, the display callback functions are
- * cdecl, not stdcall. This differs from those in iapi.h.
- */
-
-struct display_callback_s {
- /* Size of this structure */
- /* Used for checking if we have been handed a valid structure */
- int size;
-
- /* Major version of this structure */
- /* The major version number will change if this structure changes. */
- int version_major;
-
- /* Minor version of this structure */
- /* The minor version number will change if new features are added
- * without changes to this structure. For example, a new color
- * format.
- */
- int version_minor;
-
- /* New device has been opened */
- /* This is the first event from this device. */
- int (*display_open)(void *handle, void *device);
-
- /* Device is about to be closed. */
- /* Device will not be closed until this function returns. */
- int (*display_preclose)(void *handle, void *device);
-
- /* Device has been closed. */
- /* This is the last event from this device. */
- int (*display_close)(void *handle, void *device);
-
- /* Device is about to be resized. */
- /* Resize will only occur if this function returns 0. */
- /* raster is byte count of a row. */
- int (*display_presize)(void *handle, void *device,
- int width, int height, int raster, unsigned int format);
-
- /* Device has been resized. */
- /* New pointer to raster returned in pimage */
- int (*display_size)(void *handle, void *device, int width, int height,
- int raster, unsigned int format, unsigned char *pimage);
-
- /* flushpage */
- int (*display_sync)(void *handle, void *device);
-
- /* showpage */
- /* If you want to pause on showpage, then don't return immediately */
- int (*display_page)(void *handle, void *device, int copies, int flush);
-
- /* Notify the caller whenever a portion of the raster is updated. */
- /* This can be used for cooperative multitasking or for
- * progressive update of the display.
- * This function pointer may be set to NULL if not required.
- */
- int (*display_update)(void *handle, void *device, int x, int y,
- int w, int h);
-
- /* Allocate memory for bitmap */
- /* This is provided in case you need to create memory in a special
- * way, e.g. shared. If this is NULL, the Ghostscript memory device
- * allocates the bitmap. This will only called to allocate the
- * image buffer. The first row will be placed at the address
- * returned by display_memalloc.
- */
- void *(*display_memalloc)(void *handle, void *device, unsigned long size);
-
- /* Free memory for bitmap */
- /* If this is NULL, the Ghostscript memory device will free the bitmap */
- int (*display_memfree)(void *handle, void *device, void *mem);
-
- /* Added in V2 */
- /* When using separation color space (DISPLAY_COLORS_SEPARATION),
- * give a mapping for one separation component.
- * This is called for each new component found.
- * It may be called multiple times for each component.
- * It may be called at any time between display_size
- * and display_close.
- * The client uses this to map from the separations to CMYK
- * and hence to RGB for display.
- * GS must only use this callback if version_major >= 2.
- * The unsigned short c,m,y,k values are 65535 = 1.0.
- * This function pointer may be set to NULL if not required.
- */
- int (*display_separation)(void *handle, void *device,
- int component, const char *component_name,
- unsigned short c, unsigned short m,
- unsigned short y, unsigned short k);
-};
-
-/* This is the V1 structure, before separation format was added */
-struct display_callback_v1_s {
- int size;
- int version_major;
- int version_minor;
- int (*display_open)(void *handle, void *device);
- int (*display_preclose)(void *handle, void *device);
- int (*display_close)(void *handle, void *device);
- int (*display_presize)(void *handle, void *device,
- int width, int height, int raster, unsigned int format);
- int (*display_size)(void *handle, void *device, int width, int height,
- int raster, unsigned int format, unsigned char *pimage);
- int (*display_sync)(void *handle, void *device);
- int (*display_page)(void *handle, void *device, int copies, int flush);
- int (*display_update)(void *handle, void *device, int x, int y,
- int w, int h);
- void *(*display_memalloc)(void *handle, void *device, unsigned long size);
- int (*display_memfree)(void *handle, void *device, void *mem);
-};
-
-#define DISPLAY_CALLBACK_V1_SIZEOF sizeof(struct display_callback_v1_s)
-
-#endif /* gdevdsp_INCLUDED */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/libspectre/ghostscript/iapi.h new/libspectre-0.2.3/libspectre/ghostscript/iapi.h
--- old/libspectre-0.2.2/libspectre/ghostscript/iapi.h 2008-09-15 12:21:51.000000000 +0200
+++ new/libspectre-0.2.3/libspectre/ghostscript/iapi.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,300 +0,0 @@
-/* Copyright (C) 2001-2006 Artifex Software, Inc.
- All Rights Reserved.
-
- This software is provided AS-IS with no warranty, either express or
- implied.
-
- This software is distributed under license and may not be copied, modified
- or distributed except as expressly authorized under the terms of that
- license. Refer to licensing information at http://www.artifex.com/
- or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
- San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
-*/
-
-/* $Id$ */
-
-/*
- * Public API for Ghostscript interpreter
- * for use both as DLL and for static linking.
- *
- * Should work for Windows, OS/2, Linux, Mac.
- *
- * DLL exported functions should be as similar as possible to imain.c
- * You will need to include "ierrors.h".
- *
- * Current problems:
- * 1. Ghostscript does not support multiple instances.
- * 2. Global variables in gs_main_instance_default()
- * and gsapi_instance_counter
- */
-
-/* Exported functions may need different prefix
- * GSDLLEXPORT marks functions as exported
- * GSDLLAPI is the calling convention used on functions exported
- * by Ghostscript
- * GSDLLCALL is used on callback functions called by Ghostscript
- * When you include this header file in the caller, you may
- * need to change the definitions by defining these
- * before including this header file.
- * Make sure you get the calling convention correct, otherwise your
- * program will crash either during callbacks or soon after returning
- * due to stack corruption.
- */
-
-#ifndef iapi_INCLUDED
-# define iapi_INCLUDED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(_WINDOWS_) || defined(__WINDOWS__)
-# ifndef _Windows
-# define _Windows
-# endif
-#endif
-
-#ifdef _Windows
-# ifndef GSDLLEXPORT
-# define GSDLLEXPORT __declspec(dllexport)
-# endif
-# ifndef GSDLLAPI
-# define GSDLLAPI __stdcall
-# endif
-# ifndef GSDLLCALL
-# define GSDLLCALL __stdcall
-# endif
-#endif /* _Windows */
-
-#if defined(OS2) && defined(__IBMC__)
-# ifndef GSDLLAPI
-# define GSDLLAPI _System
-# endif
-# ifndef GSDLLCALL
-# define GSDLLCALL _System
-# endif
-#endif /* OS2 && __IBMC */
-
-#ifdef __MACOS__
-# pragma export on
-#endif
-
-#ifndef GSDLLEXPORT
-# define GSDLLEXPORT
-#endif
-#ifndef GSDLLAPI
-# define GSDLLAPI
-#endif
-#ifndef GSDLLCALL
-# define GSDLLCALL
-#endif
-
-#if defined(__IBMC__)
-# define GSDLLAPIPTR * GSDLLAPI
-# define GSDLLCALLPTR * GSDLLCALL
-#else
-# define GSDLLAPIPTR GSDLLAPI *
-# define GSDLLCALLPTR GSDLLCALL *
-#endif
-
-#ifndef display_callback_DEFINED
-# define display_callback_DEFINED
-typedef struct display_callback_s display_callback;
-#endif
-
-typedef struct gsapi_revision_s {
- const char *product;
- const char *copyright;
- long revision;
- long revisiondate;
-} gsapi_revision_t;
-
-
-/* Get version numbers and strings.
- * This is safe to call at any time.
- * You should call this first to make sure that the correct version
- * of the Ghostscript is being used.
- * pr is a pointer to a revision structure.
- * len is the size of this structure in bytes.
- * Returns 0 if OK, or if len too small (additional parameters
- * have been added to the structure) it will return the required
- * size of the structure.
- */
-GSDLLEXPORT int GSDLLAPI
-gsapi_revision(gsapi_revision_t *pr, int len);
-
-/*
- * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
- * Ghostscript supports only one instance.
- * The current implementation uses a global static instance
- * counter to make sure that only a single instance is used.
- * If you try to create two instances, the second attempt
- * will return < 0 and set pinstance to NULL.
- * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
- */
-/* Create a new instance of Ghostscript.
- * This instance is passed to most other API functions.
- * The caller_handle will be provided to callback functions.
- */
-
-GSDLLEXPORT int GSDLLAPI
-gsapi_new_instance(void **pinstance, void *caller_handle);
-
-/*
- * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
- * Ghostscript supports only one instance.
- * The current implementation uses a global static instance
- * counter to make sure that only a single instance is used.
- * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
- */
-/* Destroy an instance of Ghostscript
- * Before you call this, Ghostscript must have finished.
- * If Ghostscript has been initialised, you must call gsapi_exit()
- * before gsapi_delete_instance.
- */
-GSDLLEXPORT void GSDLLAPI
-gsapi_delete_instance(void *instance);
-
-/* Set the callback functions for stdio
- * The stdin callback function should return the number of
- * characters read, 0 for EOF, or -1 for error.
- * The stdout and stderr callback functions should return
- * the number of characters written.
- * If a callback address is NULL, the real stdio will be used.
- */
-GSDLLEXPORT int GSDLLAPI
-gsapi_set_stdio(void *instance,
- int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
- int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
- int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len));
-
-/* Set the callback function for polling.
- * This is used for handling window events or cooperative
- * multitasking. This function will only be called if
- * Ghostscript was compiled with CHECK_INTERRUPTS
- * as described in gpcheck.h.
- * The polling function should return 0 if all is well,
- * and negative if it wants ghostscript to abort.
- * The polling function must be fast.
- */
-GSDLLEXPORT int GSDLLAPI gsapi_set_poll(void *instance,
- int (GSDLLCALLPTR poll_fn)(void *caller_handle));
-
-/* Set the display device callback structure.
- * If the display device is used, this must be called
- * after gsapi_new_instance() and before gsapi_init_with_args().
- * See gdevdisp.h for more details.
- */
-GSDLLEXPORT int GSDLLAPI gsapi_set_display_callback(
- void *instance, display_callback *callback);
-
-
-/* Initialise the interpreter.
- * This calls gs_main_init_with_args() in imainarg.c
- * 1. If quit or EOF occur during gsapi_init_with_args(),
- * the return value will be e_Quit. This is not an error.
- * You must call gsapi_exit() and must not call any other
- * gsapi_XXX functions.
- * 2. If usage info should be displayed, the return value will be e_Info
- * which is not an error. Do not call gsapi_exit().
- * 3. Under normal conditions this returns 0. You would then
- * call one or more gsapi_run_*() functions and then finish
- * with gsapi_exit().
- */
-GSDLLEXPORT int GSDLLAPI gsapi_init_with_args(void *instance,
- int argc, char **argv);
-
-/*
- * The gsapi_run_* functions are like gs_main_run_* except
- * that the error_object is omitted.
- * If these functions return <= -100, either quit or a fatal
- * error has occured. You then call gsapi_exit() next.
- * The only exception is gsapi_run_string_continue()
- * which will return e_NeedInput if all is well.
- */
-
-GSDLLEXPORT int GSDLLAPI
-gsapi_run_string_begin(void *instance,
- int user_errors, int *pexit_code);
-
-GSDLLEXPORT int GSDLLAPI
-gsapi_run_string_continue(void *instance,
- const char *str, unsigned int length, int user_errors, int *pexit_code);
-
-GSDLLEXPORT int GSDLLAPI
-gsapi_run_string_end(void *instance,
- int user_errors, int *pexit_code);
-
-GSDLLEXPORT int GSDLLAPI
-gsapi_run_string_with_length(void *instance,
- const char *str, unsigned int length, int user_errors, int *pexit_code);
-
-GSDLLEXPORT int GSDLLAPI
-gsapi_run_string(void *instance,
- const char *str, int user_errors, int *pexit_code);
-
-GSDLLEXPORT int GSDLLAPI
-gsapi_run_file(void *instance,
- const char *file_name, int user_errors, int *pexit_code);
-
-
-/* Exit the interpreter.
- * This must be called on shutdown if gsapi_init_with_args()
- * has been called, and just before gsapi_delete_instance().
- */
-GSDLLEXPORT int GSDLLAPI
-gsapi_exit(void *instance);
-
-/* Visual Tracer */
-/* This function is only for debug purpose clients */
-struct vd_trace_interface_s;
-GSDLLEXPORT void GSDLLAPI
-gsapi_set_visual_tracer(struct vd_trace_interface_s *I);
-
-
-/* function prototypes */
-typedef int (GSDLLAPIPTR PFN_gsapi_revision)(
- gsapi_revision_t *pr, int len);
-typedef int (GSDLLAPIPTR PFN_gsapi_new_instance)(
- void **pinstance, void *caller_handle);
-typedef void (GSDLLAPIPTR PFN_gsapi_delete_instance)(
- void *instance);
-typedef int (GSDLLAPIPTR PFN_gsapi_set_stdio)(void *instance,
- int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
- int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
- int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len));
-typedef int (GSDLLAPIPTR PFN_gsapi_set_poll)(void *instance,
- int(GSDLLCALLPTR poll_fn)(void *caller_handle));
-typedef int (GSDLLAPIPTR PFN_gsapi_set_display_callback)(
- void *instance, display_callback *callback);
-typedef int (GSDLLAPIPTR PFN_gsapi_init_with_args)(
- void *instance, int argc, char **argv);
-typedef int (GSDLLAPIPTR PFN_gsapi_run_string_begin)(
- void *instance, int user_errors, int *pexit_code);
-typedef int (GSDLLAPIPTR PFN_gsapi_run_string_continue)(
- void *instance, const char *str, unsigned int length,
- int user_errors, int *pexit_code);
-typedef int (GSDLLAPIPTR PFN_gsapi_run_string_end)(
- void *instance, int user_errors, int *pexit_code);
-typedef int (GSDLLAPIPTR PFN_gsapi_run_string_with_length)(
- void *instance, const char *str, unsigned int length,
- int user_errors, int *pexit_code);
-typedef int (GSDLLAPIPTR PFN_gsapi_run_string)(
- void *instance, const char *str,
- int user_errors, int *pexit_code);
-typedef int (GSDLLAPIPTR PFN_gsapi_run_file)(void *instance,
- const char *file_name, int user_errors, int *pexit_code);
-typedef int (GSDLLAPIPTR PFN_gsapi_exit)(void *instance);
-typedef void (GSDLLAPIPTR PFN_gsapi_set_visual_tracer)
- (struct vd_trace_interface_s *I);
-
-
-#ifdef __MACOS__
-#pragma export off
-#endif
-
-#ifdef __cplusplus
-} /* extern 'C' protection */
-#endif
-
-#endif /* iapi_INCLUDED */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/libspectre/ghostscript/ierrors.h new/libspectre-0.2.3/libspectre/ghostscript/ierrors.h
--- old/libspectre-0.2.2/libspectre/ghostscript/ierrors.h 2008-09-15 12:21:51.000000000 +0200
+++ new/libspectre-0.2.3/libspectre/ghostscript/ierrors.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,153 +0,0 @@
-/* Copyright (C) 2001-2006 Artifex Software, Inc.
- All Rights Reserved.
-
- This software is provided AS-IS with no warranty, either express or
- implied.
-
- This software is distributed under license and may not be copied, modified
- or distributed except as expressly authorized under the terms of that
- license. Refer to licensing information at http://www.artifex.com/
- or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
- San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
-*/
-
-/* $Id$ */
-/* Definition of error codes */
-
-#ifndef ierrors_INCLUDED
-# define ierrors_INCLUDED
-
-/*
- * DO NOT USE THIS FILE IN THE GRAPHICS LIBRARY.
- * THIS FILE IS PART OF THE POSTSCRIPT INTERPRETER.
- * USE gserrors.h IN THE LIBRARY.
- */
-
-/*
- * A procedure that may return an error always returns
- * a non-negative value (zero, unless otherwise noted) for success,
- * or negative for failure.
- * We use ints rather than an enum to avoid a lot of casting.
- */
-
-/* Define the error name table */
-extern const char *const gs_error_names[];
-
- /* ------ PostScript Level 1 errors ------ */
-
-#define e_unknownerror (-1) /* unknown error */
-#define e_dictfull (-2)
-#define e_dictstackoverflow (-3)
-#define e_dictstackunderflow (-4)
-#define e_execstackoverflow (-5)
-#define e_interrupt (-6)
-#define e_invalidaccess (-7)
-#define e_invalidexit (-8)
-#define e_invalidfileaccess (-9)
-#define e_invalidfont (-10)
-#define e_invalidrestore (-11)
-#define e_ioerror (-12)
-#define e_limitcheck (-13)
-#define e_nocurrentpoint (-14)
-#define e_rangecheck (-15)
-#define e_stackoverflow (-16)
-#define e_stackunderflow (-17)
-#define e_syntaxerror (-18)
-#define e_timeout (-19)
-#define e_typecheck (-20)
-#define e_undefined (-21)
-#define e_undefinedfilename (-22)
-#define e_undefinedresult (-23)
-#define e_unmatchedmark (-24)
-#define e_VMerror (-25) /* must be the last Level 1 error */
-
-#define LEVEL1_ERROR_NAMES\
- "unknownerror", "dictfull", "dictstackoverflow", "dictstackunderflow",\
- "execstackoverflow", "interrupt", "invalidaccess", "invalidexit",\
- "invalidfileaccess", "invalidfont", "invalidrestore", "ioerror",\
- "limitcheck", "nocurrentpoint", "rangecheck", "stackoverflow",\
- "stackunderflow", "syntaxerror", "timeout", "typecheck", "undefined",\
- "undefinedfilename", "undefinedresult", "unmatchedmark", "VMerror"
-
- /* ------ Additional Level 2 errors (also in DPS) ------ */
-
-#define e_configurationerror (-26)
-#define e_undefinedresource (-27)
-#define e_unregistered (-28)
-
-#define LEVEL2_ERROR_NAMES\
- "configurationerror", "undefinedresource", "unregistered"
-
- /* ------ Additional DPS errors ------ */
-
-#define e_invalidcontext (-29)
-/* invalidid is for the NeXT DPS extension. */
-#define e_invalidid (-30)
-
-#define DPS_ERROR_NAMES\
- "invalidcontext", "invalidid"
-
-#define ERROR_NAMES\
- LEVEL1_ERROR_NAMES, LEVEL2_ERROR_NAMES, DPS_ERROR_NAMES
-
- /* ------ Pseudo-errors used internally ------ */
-
-/*
- * Internal code for a fatal error.
- * gs_interpret also returns this for a .quit with a positive exit code.
- */
-#define e_Fatal (-100)
-
-/*
- * Internal code for the .quit operator.
- * The real quit code is an integer on the operand stack.
- * gs_interpret returns this only for a .quit with a zero exit code.
- */
-#define e_Quit (-101)
-
-/*
- * Internal code for a normal exit from the interpreter.
- * Do not use outside of interp.c.
- */
-#define e_InterpreterExit (-102)
-
-/*
- * Internal code that indicates that a procedure has been stored in the
- * remap_proc of the graphics state, and should be called before retrying
- * the current token. This is used for color remapping involving a call
- * back into the interpreter -- inelegant, but effective.
- */
-#define e_RemapColor (-103)
-
-/*
- * Internal code to indicate we have underflowed the top block
- * of the e-stack.
- */
-#define e_ExecStackUnderflow (-104)
-
-/*
- * Internal code for the vmreclaim operator with a positive operand.
- * We need to handle this as an error because otherwise the interpreter
- * won't reload enough of its state when the operator returns.
- */
-#define e_VMreclaim (-105)
-
-/*
- * Internal code for requesting more input from run_string.
- */
-#define e_NeedInput (-106)
-
-/*
- * Internal code for a normal exit when usage info is displayed.
- * This allows Window versions of Ghostscript to pause until
- * the message can be read.
- */
-#define e_Info (-110)
-
-/*
- * Define which error codes require re-executing the current object.
- */
-#define ERROR_IS_INTERRUPT(ecode)\
- ((ecode) == e_interrupt || (ecode) == e_timeout)
-
-#endif /* ierrors_INCLUDED */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/libspectre/ghostscript/Makefile.am new/libspectre-0.2.3/libspectre/ghostscript/Makefile.am
--- old/libspectre-0.2.2/libspectre/ghostscript/Makefile.am 2008-09-15 12:21:51.000000000 +0200
+++ new/libspectre-0.2.3/libspectre/ghostscript/Makefile.am 1970-01-01 01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-EXTRA_DIST = \
- gdevdsp.h \
- iapi.h \
- ierrors.h
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/libspectre/Makefile.am new/libspectre-0.2.3/libspectre/Makefile.am
--- old/libspectre-0.2.2/libspectre/Makefile.am 2008-09-15 12:21:51.000000000 +0200
+++ new/libspectre-0.2.3/libspectre/Makefile.am 2009-10-10 12:42:34.000000000 +0200
@@ -1,5 +1,3 @@
-SUBDIRS = ghostscript
-
INCLUDES = \
-I$(top_builddir) \
-I$(srcdir) \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/libspectre/ps.c new/libspectre-0.2.3/libspectre/ps.c
--- old/libspectre-0.2.2/libspectre/ps.c 2008-11-25 16:18:18.000000000 +0100
+++ new/libspectre-0.2.3/libspectre/ps.c 2009-10-10 11:41:43.000000000 +0200
@@ -194,6 +194,7 @@
static int ps_io_ftell PT((FileData));
static char *readline PT((FileData, long, char **, long *, unsigned int *));
+static char *readlineuntil PT((FileData, long, char **, long *, unsigned int *, char));
static char *gettextline PT((char *));
static char *ps_gettext PT((char *,char **));
static int blank PT((char *));
@@ -445,7 +446,7 @@
* follows, this seems to be a real pjl file. */
if(iscomment(line, "\033%-12345X@PJL")) {
/* read until first DSC comment */
- while(readline(fd, enddoseps, &line, &position, &line_len) && (line[0] != '%')) ;
+ readlineuntil(fd, enddoseps, &line, &position, &line_len, '%');
if(line[0] != '%') {
fprintf(stderr, "psscan error: input files seems to be a PJL file.\n");
ENDMESSAGE(psscan)
@@ -606,8 +607,7 @@
} else if (doc->nummedia == NONE &&
iscomment(line+2, "DocumentMedia:")) {
char w[21], h[21];
- doc->media = (Media)
- PS_malloc(sizeof (MediaStruct));
+ doc->media = (Media) PS_calloc(1, sizeof (MediaStruct));
CHECK_MALLOCED(doc->media);
doc->media[0].name = ps_gettext(line+length("%%DocumentMedia:"),
&next_char);
@@ -616,10 +616,12 @@
doc->media[0].width = _spectre_strtod (w, NULL) + 0.5;
doc->media[0].height = _spectre_strtod (h, NULL) + 0.5;
}
- if (doc->media[0].width != 0 && doc->media[0].height != 0)
+ if (doc->media[0].width != 0 && doc->media[0].height != 0) {
doc->nummedia = 1;
- else
+ } else {
PS_free(doc->media[0].name);
+ doc->media[0].name = NULL;
+ }
}
preread=1;
while (readline(fd, enddoseps, &line, &position, &line_len) &&
@@ -629,7 +631,8 @@
PS_realloc(doc->media,
(doc->nummedia+1)*
sizeof (MediaStruct));
- CHECK_MALLOCED(doc->media);
+ CHECK_MALLOCED(doc->media);
+ memset (doc->media + doc->nummedia, 0, sizeof (MediaStruct));
doc->media[doc->nummedia].name = ps_gettext(line+length("%%+"),
&next_char);
if (doc->media[doc->nummedia].name != NULL) {
@@ -637,10 +640,12 @@
doc->media[doc->nummedia].width = _spectre_strtod (w, NULL) + 0.5;
doc->media[doc->nummedia].height = _spectre_strtod (h, NULL) + 0.5;
}
- if (doc->media[doc->nummedia].width != 0 &&
- doc->media[doc->nummedia].height != 0) doc->nummedia++;
- else
+ if (doc->media[doc->nummedia].width != 0 && doc->media[doc->nummedia].height != 0) {
+ doc->nummedia++;
+ } else {
PS_free(doc->media[doc->nummedia].name);
+ doc->media[doc->nummedia].name = NULL;
+ }
}
}
section_len += line_len;
@@ -648,14 +653,11 @@
} else if (doc->nummedia == NONE &&
iscomment(line+2, "DocumentPaperSizes:")) {
- doc->media = (Media)
- PS_malloc(sizeof (MediaStruct));
+ doc->media = (Media) PS_calloc(1, sizeof (MediaStruct));
CHECK_MALLOCED(doc->media);
doc->media[0].name = ps_gettext(line+length("%%DocumentPaperSizes:"),
&next_char);
if (doc->media[0].name != NULL) {
- doc->media[0].width = 0;
- doc->media[0].height = 0;
for (i=0; papersizes[i].name; i++) {
dmp = (Media)&papersizes[i];
/* Note: Paper size comment uses down cased paper size
@@ -672,10 +674,12 @@
break;
}
}
- if (doc->media[0].width != 0 && doc->media[0].height != 0)
+ if (doc->media[0].width != 0 && doc->media[0].height != 0) {
doc->nummedia = 1;
- else
+ } else {
PS_free(doc->media[0].name);
+ doc->media[0].name = NULL;
+ }
}
while ((cp = ps_gettext(next_char, &next_char))) {
doc->media = (Media)
@@ -683,9 +687,8 @@
(doc->nummedia+1)*
sizeof (MediaStruct));
CHECK_MALLOCED(doc->media);
+ memset (doc->media + doc->nummedia, 0, sizeof (MediaStruct));
doc->media[doc->nummedia].name = cp;
- doc->media[doc->nummedia].width = 0;
- doc->media[doc->nummedia].height = 0;
for (i=0; papersizes[i].name; i++) {
dmp = (Media)&papersizes[i];
/* Note: Paper size comment uses down cased paper size
@@ -693,7 +696,7 @@
* PaperSize comments.
*/
if (_spectre_strcasecmp(doc->media[doc->nummedia].name,
- dmp->name) == 0) {
+ dmp->name) == 0) {
PS_free(doc->media[doc->nummedia].name);
doc->media[doc->nummedia].name =
(char *)PS_malloc(strlen(dmp->name)+1);
@@ -704,10 +707,12 @@
break;
}
}
- if (doc->media[doc->nummedia].width != 0 &&
- doc->media[doc->nummedia].height != 0) doc->nummedia++;
- else
+ if (doc->media[doc->nummedia].width != 0 && doc->media[doc->nummedia].height != 0) {
+ doc->nummedia++;
+ } else {
PS_free(doc->media[doc->nummedia].name);
+ doc->media[doc->nummedia].name = NULL;
+ }
}
preread=1;
while (readline(fd, enddoseps, &line, &position, &line_len) &&
@@ -720,9 +725,8 @@
(doc->nummedia+1)*
sizeof (MediaStruct));
CHECK_MALLOCED(doc->media);
+ memset (doc->media + doc->nummedia, 0, sizeof (MediaStruct));
doc->media[doc->nummedia].name = cp;
- doc->media[doc->nummedia].width = 0;
- doc->media[doc->nummedia].height = 0;
for (i=0; papersizes[i].name; i++) {
dmp = (Media)&papersizes[i];
/* Note: Paper size comment uses down cased paper size
@@ -730,16 +734,18 @@
* PaperSize comments.
*/
if (_spectre_strcasecmp(doc->media[doc->nummedia].name,
- dmp->name) == 0) {
+ dmp->name) == 0) {
doc->media[doc->nummedia].width = dmp->width;
doc->media[doc->nummedia].height = dmp->height;
break;
}
}
- if (doc->media[doc->nummedia].width != 0 &&
- doc->media[doc->nummedia].height != 0) doc->nummedia++;
- else
+ if (doc->media[doc->nummedia].width != 0 && doc->media[doc->nummedia].height != 0) {
+ doc->nummedia++;
+ } else {
PS_free(doc->media[doc->nummedia].name);
+ doc->media[doc->nummedia].name = NULL;
+ }
}
}
section_len += line_len;
@@ -1751,23 +1757,6 @@
}
else
#endif
- if ((line[0] == '%') &&
- positionP && *positionP > enddoseps &&
- (!iscomment(line, "%!PS-AdobeFont") && (iscomment(line,"%!PS") || iscomment(line, "\004%!PS")))) {
- nesting_level=1;
- line = ps_io_fgetchars(fd,-1);
- if (line) *line_lenP += FD_LINE_LEN;
- while (line) {
- if ((line[0] == '%') &&
- (iscomment(line,"%!PS") || iscomment(line, "\004%!PS")))
- nesting_level++;
- else if (IS_COMMENT("EOF"))
- nesting_level--;
- line = ps_io_fgetchars(fd,-1);
- if (line) *line_lenP += FD_LINE_LEN;
- if (nesting_level == 0) break;
- }
- } else
if (!IS_COMMENT("Begin")) {} /* Do nothing */
else if IS_BEGIN("Document:") { /* Skip the EPS without handling its content */
nesting_level=1;
@@ -1847,6 +1836,44 @@
return(FD_BUF+FD_LINE_BEGIN);
}
+/*----------------------------------------------------------*/
+/*
+ readlineuntil()
+ Read the next line in the postscript file until char is found
+ Similar to readline, but it doesn't skip lines.
+*/
+/*----------------------------------------------------------*/
+
+static char * readlineuntil (fd, enddoseps, lineP, positionP, line_lenP, charP)
+ FileData fd;
+ long enddoseps;
+ char **lineP;
+ long *positionP;
+ unsigned int *line_lenP;
+ char charP;
+{
+ char *line;
+
+ if (positionP) *positionP = FD_FILEPOS;
+
+ do {
+ line = ps_io_fgetchars(fd,-1);
+ if (!line) {
+ INFMESSAGE(could not get line)
+ *line_lenP = 0;
+ *lineP = empty_string;
+ ENDMESSAGE(readline)
+ return(NULL);
+ }
+
+ if (positionP) *positionP = FD_FILEPOS;
+ *line_lenP = FD_LINE_LEN;
+ *lineP = FD_BUF+FD_LINE_BEGIN;
+ } while (line[0] != charP);
+
+ return(FD_BUF+FD_LINE_BEGIN);
+}
+
/*###########################################################*/
/*
* pscopyuntil -- copy lines of Postscript from a section of one file
@@ -2233,7 +2260,7 @@
*urx = new_urx;
*ury = new_ury;
- return (new_llx != 0 && new_lly != 0 && new_urx != 0 && new_ury != 0);
+ return (new_llx != 0 || new_lly != 0 || new_urx != 0 || new_ury != 0);
}
/* From Evince */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/libspectre/spectre-device.c new/libspectre-0.2.3/libspectre/spectre-device.c
--- old/libspectre-0.2.2/libspectre/spectre-device.c 2008-11-25 16:15:50.000000000 +0100
+++ new/libspectre-0.2.3/libspectre/spectre-device.c 2009-09-11 11:50:47.000000000 +0200
@@ -215,7 +215,7 @@
args = calloc (sizeof (char *), n_args);
args[arg++] = "libspectre"; /* This value doesn't really matter */
args[arg++] = "-dMaxBitmap=10000000";
- args[arg++] = "-dDELAYSAFER";
+ args[arg++] = "-dSAFER";
args[arg++] = "-dNOPAUSE";
args[arg++] = "-dNOPAGEPROMPT";
args[arg++] = "-sDEVICE=display";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/libspectre/spectre-document.c new/libspectre-0.2.3/libspectre/spectre-document.c
--- old/libspectre-0.2.2/libspectre/spectre-document.c 2008-10-17 19:34:43.000000000 +0200
+++ new/libspectre-0.2.3/libspectre/spectre-document.c 2009-04-19 15:37:16.000000000 +0200
@@ -69,7 +69,6 @@
document->doc = psscan (filename, SCANSTYLE_NORMAL);
if (!document->doc) {
- /* FIXME: OOM | INVALID_PS */
document->status = SPECTRE_STATUS_LOAD_ERROR;
return;
}
@@ -80,6 +79,21 @@
document->doc = NULL;
return;
+ } else if (document->doc->numpages == 0 && !document->doc->format) {
+ /* Make sure it's a valid PS document */
+ unsigned char *data = NULL;
+ int row_length;
+
+ spectre_document_render (document, &data, &row_length);
+ free (data);
+
+ if (spectre_document_status (document)) {
+ document->status = SPECTRE_STATUS_LOAD_ERROR;
+ psdocdestroy (document->doc);
+ document->doc = NULL;
+
+ return;
+ }
}
document->structured = ((!document->doc->epsf && document->doc->numpages > 0) ||
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/libspectre/spectre-exporter-pdf.c new/libspectre-0.2.3/libspectre/spectre-exporter-pdf.c
--- old/libspectre-0.2.2/libspectre/spectre-exporter-pdf.c 2008-09-15 12:21:51.000000000 +0200
+++ new/libspectre-0.2.3/libspectre/spectre-exporter-pdf.c 2009-09-11 11:47:36.000000000 +0200
@@ -27,7 +27,7 @@
spectre_exporter_pdf_begin (SpectreExporter *exporter,
const char *filename)
{
- char *args[8];
+ char *args[9];
int arg = 0;
char *output_file;
@@ -40,6 +40,7 @@
return SPECTRE_STATUS_EXPORTER_ERROR;
}
+ args[arg++] = "libspectre"; /* This value doesn't really matter */
args[arg++] = "-dMaxBitmap=10000000";
args[arg++] = "-dBATCH";
args[arg++] = "-dNOPAUSE";
@@ -50,7 +51,7 @@
args[arg++] = "-c";
args[arg++] = ".setpdfwrite";
- if (!spectre_gs_run (exporter->gs, 8, args)) {
+ if (!spectre_gs_run (exporter->gs, 9, args)) {
free (output_file);
spectre_gs_free (exporter->gs);
exporter->gs = NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/libspectre/spectre-gs.c new/libspectre-0.2.3/libspectre/spectre-gs.c
--- old/libspectre-0.2.2/libspectre/spectre-gs.c 2008-11-23 16:24:44.000000000 +0100
+++ new/libspectre-0.2.3/libspectre/spectre-gs.c 2009-10-10 12:37:02.000000000 +0200
@@ -86,7 +86,7 @@
int error;
static char buf[BUFFER_SIZE];
unsigned int read;
- int wrote;
+ int exit_code;
size_t left = end - begin;
void *ghostscript_instance = gs->ghostscript_instance;
@@ -97,7 +97,7 @@
fseek (fd, begin, SEEK_SET);
- gsapi_run_string_begin (ghostscript_instance, 0, &error);
+ error = gsapi_run_string_begin (ghostscript_instance, 0, &exit_code);
if (critic_error_code (error)) {
fclose (fd);
return FALSE;
@@ -107,10 +107,11 @@
char *set;
set = _spectre_strdup_printf ("%d %d translate\n", -x, -y);
- gsapi_run_string_continue (ghostscript_instance, set, strlen (set),
- 0, &error);
+ error = gsapi_run_string_continue (ghostscript_instance, set, strlen (set),
+ 0, &exit_code);
+ error = error == e_NeedInput ? 0 : error;
free (set);
- if (critic_error_code (error)) {
+ if (error != e_NeedInput && critic_error_code (error)) {
fclose (fd);
return FALSE;
}
@@ -123,8 +124,9 @@
to_read = left;
read = fread (buf, sizeof (char), to_read, fd);
- wrote = gsapi_run_string_continue (ghostscript_instance,
- buf, read, 0, &error);
+ error = gsapi_run_string_continue (ghostscript_instance,
+ buf, read, 0, &exit_code);
+ error = error == e_NeedInput ? 0 : error;
left -= read;
}
@@ -132,7 +134,7 @@
if (critic_error_code (error))
return FALSE;
- gsapi_run_string_end (ghostscript_instance, 0, &error);
+ error = gsapi_run_string_end (ghostscript_instance, 0, &exit_code);
if (critic_error_code (error))
return FALSE;
@@ -195,9 +197,10 @@
const char *str)
{
int error;
+ int exit_code;
- gsapi_run_string_with_length (gs->ghostscript_instance,
- str, strlen (str), 0, &error);
+ error = gsapi_run_string_with_length (gs->ghostscript_instance,
+ str, strlen (str), 0, &exit_code);
return !critic_error_code (error);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/libspectre/spectre-version.h new/libspectre-0.2.3/libspectre/spectre-version.h
--- old/libspectre-0.2.2/libspectre/spectre-version.h 2008-11-25 17:24:18.000000000 +0100
+++ new/libspectre-0.2.3/libspectre/spectre-version.h 2009-10-18 16:49:09.000000000 +0200
@@ -27,11 +27,11 @@
#define SPECTRE_MAJOR_VERSION 0
#define SPECTRE_MINOR_VERSION 2
-#define SPECTRE_MICRO_VERSION 2
+#define SPECTRE_MICRO_VERSION 3
-#define SPECTRE_VERSION_STRING "0.2.2"
+#define SPECTRE_VERSION_STRING "0.2.3"
-#define SPECTRE_VERSION ((0 << 16) | (2 << 8) | (2))
+#define SPECTRE_VERSION ((0 << 16) | (2 << 8) | (3))
SPECTRE_END_DECLS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/Makefile.am new/libspectre-0.2.3/Makefile.am
--- old/libspectre-0.2.2/Makefile.am 2008-10-17 19:34:43.000000000 +0200
+++ new/libspectre-0.2.3/Makefile.am 2009-10-18 16:12:52.000000000 +0200
@@ -84,7 +84,7 @@
scp $(tar_file) $(sha1_file) $(gpg_file) $(RELEASE_UPLOAD_HOST):$(RELEASE_UPLOAD_DIR)
mv $(tar_file) $(sha1_file) $(gpg_file) releases
ssh $(RELEASE_UPLOAD_HOST) "rm -f $(RELEASE_UPLOAD_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(tar_file) $(RELEASE_UPLOAD_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
- git-tag -s -m "libspectre $(SPECTRE_MAJOR_VERSION).$(SPECTRE_MINOR_VERSION).$(SPECTRE_MICRO_VERSION) release" $(SPECTRE_MAJOR_VERSION).$(SPECTRE_MINOR_VERSION).$(SPECTRE_MICRO_VERSION)
+ git tag -s -m "libspectre $(SPECTRE_MAJOR_VERSION).$(SPECTRE_MINOR_VERSION).$(SPECTRE_MICRO_VERSION) release" $(SPECTRE_MAJOR_VERSION).$(SPECTRE_MINOR_VERSION).$(SPECTRE_MICRO_VERSION)
release-publish-message: releases/$(sha1_file)
@echo "Please follow the instructions in RELEASING to push stuff out and"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libspectre-0.2.2/NEWS new/libspectre-0.2.3/NEWS
--- old/libspectre-0.2.2/NEWS 2008-11-25 17:13:49.000000000 +0100
+++ new/libspectre-0.2.3/NEWS 2009-10-18 16:44:57.000000000 +0200
@@ -1,3 +1,30 @@
+libspectre 0.2.3 (18 October 2009)
+==================================
+
+This is another bugfix only release in the libspectre's 0.2 series.
+
+Several fixes in the PostScript parser:
+
+ - Detection of invalid or broken files has been improved. A document
+ scanned without errors with no pages and no format is likely to be
+ an invalid file, or not a PostScript file at all (Bug #19042)
+
+ - Fix possible uninitialized use of Document media struct
+ contents. Thanks to Alexander Myltsev (Bug #18685)
+
+ - Fix documents with PJL commands before the initial DSC comments.
+
+Ghostscript is now always run with -dSAFER option
+
+A missing argument in gs command line of PDF exporter was making it
+always fail for any document in BSD systems. Thanks to Antoine
+Jacoutot who gave me remote access to an OpenBSD system to fix this
+(Bug #18826)
+
+Internal copy of ghostscript headers have been removed since they are
+already installed by ghostscript since version 8.62 (Bug #18827)
+
+
libspectre 0.2.2 (25 November 2008)
===================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org