GNU software to build or run it.
*/
-/*$Id: gdevprn.c,v 1.11 2001/03/08 15:13:14 mike Exp $ */
+/*$Id: gdevprn.c,v 1.12 2001/03/16 20:42:06 mike Exp $ */
/* Generic printer driver support */
#include "ctype_.h"
#include "gdevprn.h"
{
int code = 0;
gx_device *const pdev = (gx_device *)prdev;
- gx_device_memory * const mdev = (gx_device_memory *)prdev;
- /* The first test here used to be prdev->open. See News for 5.50. */
- if (mdev->base != 0 &&
+ if (prdev->is_open &&
(memcmp(&prdev->space_params, old_sp, sizeof(*old_sp)) != 0 ||
prdev->width != old_width || prdev->height != old_height )
) {
GNU software to build or run it.
*/
-/*$Id: gdevprn.h,v 1.4 2000/03/08 23:14:25 mike Exp $ */
+/*$Id: gdevprn.h,v 1.5 2001/03/16 20:42:06 mike Exp $ */
/* Common header file for memory-buffered printers */
#ifndef gdevprn_INCLUDED
#include "gsutil.h" /* for memflip8x8 */
#include "gxdevice.h"
#include "gxdevmem.h"
-#include "gxclist.h"
+#include "gxcldev.h"
#include "gsparam.h"
/*
GNU software to build or run it.
*/
-/*$Id: gxcldev.h,v 1.2 2000/03/08 23:14:51 mike Exp $ */
+/*$Id: gxcldev.h,v 1.3 2001/03/16 20:42:06 mike Exp $ */
/* Internal definitions for Ghostscript command lists. */
#ifndef gxcldev_INCLUDED
# define gxcldev_INCLUDED
-#include "gxclist.h"
#include "gsropt.h"
#include "gxht.h" /* for gxdht.h */
#include "gxtmap.h" /* ditto */
/* ---------------- Band state ---------------- */
+/* Define the prefix on each command run in the writing buffer. */
+typedef struct cmd_prefix_s cmd_prefix;
+struct cmd_prefix_s {
+ cmd_prefix *next;
+ uint size;
+};
+
+/* Define the pointers for managing a list of command runs in the buffer. */
+/* There is one of these for each band, plus one for band-range commands. */
+typedef struct cmd_list_s {
+ cmd_prefix *head, *tail; /* list of commands for band */
+} cmd_list;
+
/* Remember the current state of one band when writing or reading. */
struct gx_clist_state_s {
gx_color_index colors[2]; /* most recent colors */
ulong cost; /* cost of rendering the band */
};
+/**** MRS: We need to include this here instead of the top to avoid lots of
+ **** pointer errors. Why the f**k does GS have to define so many
+ **** interdependent structures?!?
+ ****/
+#include "gxclist.h"
+
/* The initial values for a band state */
/*static const gx_clist_state cls_initial */
#define cls_initial_values\
* permanent_error, which prevents writing to the command list.
*/
+/**** MRS: Added cast to cdev->states since size of gx_clist_state is unknown ****/
#define FOR_RECTS\
BEGIN\
int yend = y + height;\
return (cdev->permanent_error);\
do {\
int band = y / band_height;\
- gx_clist_state *pcls = cdev->states + band;\
+ gx_clist_state *pcls = ((struct gx_clist_state_s *)cdev->states) + band;\
int band_end = (band + 1) * band_height;\
\
height = min(band_end, yend) - y;\
GNU software to build or run it.
*/
-/*$Id: gxclist.h,v 1.2 2000/03/08 23:14:53 mike Exp $ */
+/*$Id: gxclist.h,v 1.3 2001/03/16 20:42:06 mike Exp $ */
/* Command list definitions for Ghostscript. */
/* Requires gxdevice.h and gxdevmem.h */
#define ts_bits(cldev,pts) (ts_mask(pts) + (cldev)->tile_band_mask_size)
} tile_slot;
-/* Define the prefix on each command run in the writing buffer. */
-typedef struct cmd_prefix_s cmd_prefix;
-struct cmd_prefix_s {
- cmd_prefix *next;
- uint size;
-};
-
-/* Define the pointers for managing a list of command runs in the buffer. */
-/* There is one of these for each band, plus one for band-range commands. */
-typedef struct cmd_list_s {
- cmd_prefix *head, *tail; /* list of commands for band */
-} cmd_list;
/*
* In order to keep the per-band state down to a reasonable size,
byte *cbuf; /* start of command buffer */
byte *cnext; /* next slot in command buffer */
byte *cend; /* end of command buffer */
- cmd_list *ccl; /* &clist_state.list of last command */
+ cmd_list *ccl; /* &clist_state.list of last command */
cmd_list band_range_list; /* list of band-range commands */
- int band_range_min, band_range_max; /* range for list */
+ int band_range_min, band_range_max; /* range for list */
uint tile_max_size; /* max size of a single tile (bytes) */
uint tile_max_count; /* max # of hash table entries */
gx_strip_bitmap tile_params; /* current tile parameters */
GNU software to build or run it.
*/
-/*$Id: gxclmem.c,v 1.5 2001/02/07 01:25:40 mike Exp $ */
+/*$Id: gxclmem.c,v 1.6 2001/03/16 20:42:06 mike Exp $ */
/* RAM-based command list implementation */
#include "memory_.h"
#include "gx.h"
} /* end else (when we are compressing) */
#endif /* HAVE_LIBZ */
- return (0);
+ return (ecode);
}
int /* returns # of chars actually written */
GNU software to build or run it.
*/
-/*$Id: gxclpath.c,v 1.2 2000/03/08 23:14:53 mike Exp $ */
+/*$Id: gxclpath.c,v 1.3 2001/03/16 20:42:06 mike Exp $ */
/* Higher-level path operations for band lists */
#include "math_.h"
#include "memory_.h"
gx_clist_state *pcls = cldev->states;
int i;
- for (i = cldev->nbands; --i >= 0; ++pcls)
+ for (i = cldev->nbands - 1; i >= 0; i --, pcls ++)
pcls->known &= unknown;
}
GNU software to build or run it.
*/
-/*$Id: gxclpath.h,v 1.2 2000/03/08 23:14:53 mike Exp $ */
+/*$Id: gxclpath.h,v 1.3 2001/03/16 20:42:06 mike Exp $ */
/* Extends (requires) gxcldev.h */
#ifndef gxclpath_INCLUDED
/* Write out values of any unknown parameters. */
#define cmd_do_write_unknown(cldev, pcls, must_know)\
- ( ~(pcls)->known & (must_know) ?\
+ ( ~((pcls)->known) & (must_know) ?\
cmd_write_unknown(cldev, pcls, must_know) : 0 )
int cmd_write_unknown(P3(gx_device_clist_writer * cldev, gx_clist_state * pcls,
uint must_know));
GNU software to build or run it.
*/
-/*$Id: gxclutil.c,v 1.1 2000/03/08 23:14:54 mike Exp $ */
+/*$Id: gxclutil.c,v 1.2 2001/03/16 20:42:06 mike Exp $ */
/* Command list writing utilities. */
#include "memory_.h"
if (code < 0)
return code;
++dp;
- cmd_putxy(pcls->tile_phase, dp);
pcls->tile_phase.x = px;
pcls->tile_phase.y = py;
+ cmd_putxy(pcls->tile_phase, dp);
return 0;
}