--- ghostscript-6.51/src/eplaser/gdevescv.c.Epson_eplaseren	Fri Aug 24 15:22:01 2001
+++ ghostscript-6.51/src/eplaser/gdevescv.c	Fri Aug 24 15:33:53 2001
@@ -37,8 +37,11 @@
 
  */
 
+#if 0
 #include <stdlib.h>
 #include <unistd.h>
+#endif
+#include <string.h>
 
 #include "math_.h"
 #include "gx.h"
@@ -49,7 +52,7 @@
 #include "gscspace.h"
 #include "gsutil.h"
 #include "gdevvec.h"
-#include "gdevpstr.h"
+#include "spprint.h"
 #include "ghost.h"
 #include "gzstate.h"
 #include "imemory.h"
@@ -92,7 +95,7 @@
     int			prev_feed_mode;
     int			orientation;			/* Êý¸þ */
     bool		faceup;				/* ¥Õ¥§¥¤¥¹»ØÄê */
-    char		MediaType;			/* »æ¼ï */
+    int			MediaType;			/* »æ¼ï */
 
     bool		first_page;
     bool		Duplex;				/* Î¾ÌÌ°õºþ */
@@ -257,7 +260,7 @@
 private int escv_vector_dorect(gx_device_vector * vdev, fixed x0, fixed y0, fixed x1,
 			       fixed y1, gx_path_type_t type);
 private int escv_vector_dopath(gx_device_vector * vdev, const gx_path * ppath,
-			       gx_path_type_t type);
+			       gx_path_type_t type, const gs_matrix *pmat);
 private int escv_beginpath(P2(gx_device_vector * vdev, gx_path_type_t type));
 private int escv_moveto(P6(gx_device_vector * vdev, floatp x0, floatp y0,
 			   floatp x, floatp y, gx_path_type_t type));
@@ -369,7 +372,7 @@
 
 int
 escv_vector_dopath(gx_device_vector * vdev, const gx_path * ppath,
-		   gx_path_type_t type)
+		   gx_path_type_t type, const gs_matrix *pmat)
 {
     bool do_close = (type & gx_path_type_stroke) != 0;
     gs_fixed_rect rect;
@@ -568,7 +571,7 @@
 	}
 
 	/* Output Unit */
-	if (pdev->MediaType && strcmp(pdev->dname, "alc8500") || pdev->faceup ){
+	if (pdev->MediaType && (!!strcmp(pdev->dname, "alc8500")) || pdev->faceup ){
 	    lputs(s, " OU=FU");
 	} else {
 	    lputs(s, " OU=FD");
@@ -707,8 +710,8 @@
     /* Scale ¤ò³Ý¤±¤Æ¤¤¤ë¤Î¤Ï, Ghostscript 5.10/5.50 ¤Î¥Ð¥°¤Î¤¿¤á */
     floatp xscale, yscale;
 
-    xscale = fabs(igs->ctm.xx);
-    yscale = fabs(igs->ctm.xy);
+    xscale = fabs(vdev->state.ctm.xx);
+    yscale = fabs(vdev->state.ctm.xy);
 
     if (xscale == 0 || yscale > xscale)		/* if portrait */
 	width = ceil(width * yscale);
@@ -860,8 +863,8 @@
 
 #if 1
     /* Scale ¤ò³Ý¤±¤Æ¤¤¤ë¤Î¤Ï, Ghostscript 5.10/5.50 ¤Î¥Ð¥°¤Î¤¿¤á */
-    xscale = fabs(igs->ctm.xx);
-    yscale = fabs(igs->ctm.xy);
+    xscale = fabs(vdev->state.ctm.xx);
+    yscale = fabs(vdev->state.ctm.xy);
 
     if (xscale == 0)		/* if portrait */
 	scale = yscale;
@@ -1713,9 +1716,9 @@
 
 /* Process the next piece of an image. */
 private int
-escv_image_plane_data(gx_device * dev,
-		      gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height)
+escv_image_plane_data(gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height, int *rows_used)
 {
+    gx_device * dev = info->dev;
     gx_device_vector *const	vdev = (gx_device_vector *) dev;
     gx_device_escv *const	pdev = (gx_device_escv *) dev;
     gdev_vector_image_enum_t	*pie = (gdev_vector_image_enum_t *) info;
@@ -1861,8 +1864,9 @@
 
 
 private int
-escv_image_end_image(gx_device * dev, gx_image_enum_common_t * info, bool draw_last)
+escv_image_end_image(gx_image_enum_common_t * info, bool draw_last)
 {
+    gx_device * dev = info->dev;
     gx_device_vector		*const vdev = (gx_device_vector *) dev;
     gx_device_escv		*const pdev = (gx_device_escv *) dev;
     gdev_vector_image_enum_t	*pie = (gdev_vector_image_enum_t *) info;
--- ghostscript-6.51/src/eplaser/gdevesmv.c.Epson_eplaseren	Fri Aug 24 15:22:01 2001
+++ ghostscript-6.51/src/eplaser/gdevesmv.c	Fri Aug 24 15:37:16 2001
@@ -34,8 +34,11 @@
 
  */
 
+#if 0
 #include <stdlib.h>
 #include <unistd.h>
+#endif
+#include <string.h>
 
 #include "math_.h"
 #include "gx.h"
@@ -46,7 +49,7 @@
 #include "gscspace.h"
 #include "gsutil.h"
 #include "gdevvec.h"
-#include "gdevpstr.h"
+#include "spprint.h"
 #include "ghost.h"
 #include "gzstate.h"
 #include "imemory.h"
@@ -88,7 +91,7 @@
     int			prev_feed_mode;
     int			orientation;			/* Êý¸þ */
     bool		faceup;				/* ¥Õ¥§¥¤¥¹»ØÄê */
-    char		MediaType;			/* »æ¼ï */
+    int			MediaType;			/* »æ¼ï */
 
     bool		first_page;
     bool		Duplex;				/* Î¾ÌÌ°õºþ */
@@ -261,7 +264,7 @@
 private int esmv_vector_dorect(gx_device_vector * vdev, fixed x0, fixed y0, fixed x1,
 			       fixed y1, gx_path_type_t type);
 private int esmv_vector_dopath(gx_device_vector * vdev, const gx_path * ppath,
-			       gx_path_type_t type);
+			       gx_path_type_t type, const gs_matrix *pmat);
 private int esmv_beginpath(P2(gx_device_vector * vdev, gx_path_type_t type));
 private int esmv_moveto(P6(gx_device_vector * vdev, floatp x0, floatp y0,
 			   floatp x, floatp y, gx_path_type_t type));
@@ -373,7 +376,7 @@
 
 int
 esmv_vector_dopath(gx_device_vector * vdev, const gx_path * ppath,
-		   gx_path_type_t type)
+		   gx_path_type_t type, const gs_matrix *pmat)
 {
     bool do_close = (type & gx_path_type_stroke) != 0;
     gs_fixed_rect rect;
@@ -720,8 +723,8 @@
     /* Scale ¤ò³Ý¤±¤Æ¤¤¤ë¤Î¤Ï, Ghostscript 5.10/5.50 ¤Î¥Ð¥°¤Î¤¿¤á */
     floatp xscale, yscale;
 
-    xscale = fabs(igs->ctm.xx);
-    yscale = fabs(igs->ctm.xy);
+    xscale = fabs(vdev->state.ctm.xx);
+    yscale = fabs(vdev->state.ctm.xy);
 
     if (xscale == 0 || yscale > xscale)		/* if portrait */
 	width = ceil(width * yscale);
@@ -880,8 +883,8 @@
 
 #if 1
     /* Scale ¤ò³Ý¤±¤Æ¤¤¤ë¤Î¤Ï, Ghostscript 5.10/5.50 ¤Î¥Ð¥°¤Î¤¿¤á */
-    xscale = fabs(igs->ctm.xx);
-    yscale = fabs(igs->ctm.xy);
+    xscale = fabs(vdev->state.ctm.xx);
+    yscale = fabs(vdev->state.ctm.xy);
 
     if (xscale == 0)		/* if portrait */
 	scale = yscale;
@@ -1730,9 +1733,9 @@
 
 /* Process the next piece of an image. */
 private int
-esmv_image_plane_data(gx_device * dev,
-		      gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height)
+esmv_image_plane_data(gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height, int *rows_used)
 {
+    gx_device * dev = info->dev;
     gx_device_vector *const	vdev = (gx_device_vector *) dev;
     gx_device_esmv *const	pdev = (gx_device_esmv *) dev;
     gdev_vector_image_enum_t	*pie = (gdev_vector_image_enum_t *) info;
@@ -1892,8 +1895,9 @@
 
 
 private int
-esmv_image_end_image(gx_device * dev, gx_image_enum_common_t * info, bool draw_last)
+esmv_image_end_image(gx_image_enum_common_t * info, bool draw_last)
 {
+    gx_device * dev = info->dev;
     gx_device_vector		*const vdev = (gx_device_vector *) dev;
     gx_device_esmv		*const pdev = (gx_device_esmv *) dev;
     gdev_vector_image_enum_t	*pie = (gdev_vector_image_enum_t *) info;
--- ghostscript-6.51/src/eplaser/gdevescv.mak.Epson_eplaseren	Fri Aug 24 15:23:37 2001
+++ ghostscript-6.51/src/eplaser/gdevescv.mak	Fri Aug 24 15:24:11 2001
@@ -4,9 +4,9 @@
 $(GLOBJ)gdevescv.$(OBJ): $(GLSRC)gdevescv.c $(GLSRC)gdevescv.h $(PDEVH)
 	$(GLCC) -DA4 $(GLO_)gdevescv.$(OBJ) $(C_) $(GLSRC)gdevescv.c
 
-alc8500.dev: $(escv_) page.dev
-	$(SETDEV) alc8500 $(escv_)
+$(DD)alc8500.dev: $(escv_) $(DD)page.dev
+	$(SETDEV) $(DD)alc8500 $(escv_)
 
 
-alc2000.dev: $(escv_) page.dev
-	$(SETDEV) alc2000 $(escv_)
+$(DD)alc2000.dev: $(escv_) $(DD)page.dev
+	$(SETDEV) $(DD)alc2000 $(escv_)
--- ghostscript-6.51/src/eplaser/gdevesmv.mak.Epson_eplaseren	Fri Aug 24 15:23:37 2001
+++ ghostscript-6.51/src/eplaser/gdevesmv.mak	Fri Aug 24 15:24:46 2001
@@ -5,12 +5,12 @@
 $(GLOBJ)gdevesmv.$(OBJ): $(GLSRC)gdevesmv.c $(GLSRC)gdevescv.h $(PDEVH)
 	$(GLCC) -DA4 $(GLO_)gdevesmv.$(OBJ) $(C_) $(GLSRC)gdevesmv.c
 
-epl5800.dev: $(esmv_) page.dev
-	$(SETDEV) epl5800 $(esmv_)
+$(DD)epl5800.dev: $(esmv_) $(DD)page.dev
+	$(SETDEV) $(DD)epl5800 $(esmv_)
 
 
-epl2050.dev: $(esmv_) page.dev
-	$(SETDEV) epl2050 $(esmv_)
+$(DD)epl2050.dev: $(esmv_) $(DD)page.dev
+	$(SETDEV) $(DD)epl2050 $(esmv_)
 
-epl2050p.dev: $(esmv_) page.dev
-	$(SETDEV) epl2050p $(esmv_)
+$(DD)epl2050p.dev: $(esmv_) $(DD)page.dev
+	$(SETDEV) $(DD)epl2050p $(esmv_)
