summaryrefslogtreecommitdiff
path: root/pxl
diff options
context:
space:
mode:
authorHenry Stiles <henry.stiles@artifex.com>2000-02-17 06:03:02 +0000
committerHenry Stiles <henry.stiles@artifex.com>2000-02-17 06:03:02 +0000
commit43cfdb73c95b7fc4fde2a053265863edac850617 (patch)
treeda519fdec9d5b9161a87bad5c2e6006dfff54e34 /pxl
parenta59cc5af085fd424b412e3fcfb855f82443d2309 (diff)
Changes for language switching, auto sensing, better memory
management, and simpler build system. This code is ALPHA and is expected to change a bit over the next few weeks. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@1102 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'pxl')
-rw-r--r--pxl/pxl.mak4
-rw-r--r--pxl/pxl_msvc.mak137
-rw-r--r--pxl/pxl_top.mak29
-rw-r--r--pxl/pxl_ugcc.mak79
-rw-r--r--pxl/pxtop.c26
5 files changed, 12 insertions, 263 deletions
diff --git a/pxl/pxl.mak b/pxl/pxl.mak
index a11575fb2..83a9e5ba1 100644
--- a/pxl/pxl.mak
+++ b/pxl/pxl.mak
@@ -93,7 +93,7 @@ $(PXLOBJ)pxerrors.$(OBJ): $(PXLSRC)pxerrors.c $(AK)\
$(pxbfont_h) $(pxerrors_h) $(pxfont_h) $(pxparse_h) $(pxptable_h) $(pxstate_h)
$(PXLCCC) $(PXLSRC)pxerrors.c $(PXLO_)pxerrors.$(OBJ)
-$(PXLSRC)pxlver.h: $(PXLSRC)pxl.mak
+$(PXLSRC)pxlver.h:
$(PXLGEN)echogs$(XE) -e .h -w $(PXLSRC)pxlver -n -x 23 "define PXLVERSION"
$(PXLGEN)echogs$(XE) -e .h -a $(PXLSRC)pxlver -s -x 22 $(PXLVERSION) -x 22
$(PXLGEN)echogs$(XE) -e .h -a $(PXLSRC)pxlver -n -x 23 "define PXLBUILDDATE"
@@ -211,7 +211,7 @@ pxl_ops_obj2=$(PXLOBJ)pxink.$(OBJ) $(PXLOBJ)pxpaint.$(OBJ) $(PXLOBJ)pxsessio.$(O
pxl_ops_obj=$(pxl_ops_obj1) $(pxl_ops_obj2)
# Top-level API
-$(TOP_OBJ): $(PXLSRC)pxtop.c $(AK) $(stdio__h)\
+$(PXL_TOP_OBJ): $(PXLSRC)pxtop.c $(AK) $(stdio__h)\
$(gdebug_h) $(gp_h) $(gsdevice_h) $(gserrors_h) $(gsmemory_h)\
$(gsstate_h) $(gsstruct_h) $(gstypes_h) $(gxalloc_h) $(gxstate_h)\
$(pltop_h) $(pxtop_h) $(plparse_h)\
diff --git a/pxl/pxl_msvc.mak b/pxl/pxl_msvc.mak
deleted file mode 100644
index 06f5ee5ff..000000000
--- a/pxl/pxl_msvc.mak
+++ /dev/null
@@ -1,137 +0,0 @@
-# Copyright (C) 1997 Aladdin Enterprises. All rights reserved.
-# Unauthorized use, copying, and/or distribution prohibited.
-
-# pxl_msvc.mak
-# Top-level makefile for PCL XL on Win32 platforms using MS Visual C 4.1 or later
-
-# Define the name of this makefile.
-!ifndef MAKEFILE
-MAKEFILE=..\pxl\pxl_msvc.mak
-!endif
-
-# The build process will put all of its output in this directory:
-!ifndef GENDIR
-GENDIR=.\obj
-!endif
-
-# The sources are taken from these directories:
-!ifndef GLSRCDIR
-GLSRCDIR=..\gs\src
-!endif
-!ifndef PLSRCDIR
-PLSRCDIR=..\pl
-!endif
-!ifndef PXLSRCDIR
-PXLSRCDIR=..\pxl
-!endif
-!ifndef COMMONDIR
-COMMONDIR=..\common
-!endif
-!ifndef JSRCDIR
-JSRCDIR=..\gs\jpeg
-JVERSION=6
-!endif
-!ifndef PSRCDIR
-PSRCDIR=..\gs\libpng
-PVERSION=96
-!endif
-!ifndef ZSRCDIR
-ZSRCDIR=..\gs\zlib
-!endif
-
-
-# If you want to build the individual packages in their own directories,
-# you can define this here, although normally you won't need to do this:
-!ifndef GLGENDIR
-GLGENDIR=$(GENDIR)
-!endif
-!ifndef GLOBJDIR
-GLOBJDIR=$(GENDIR)
-!endif
-!ifndef PLGENDIR
-PLGENDIR=$(GENDIR)
-!endif
-!ifndef PLOBJDIR
-PLOBJDIR=$(GENDIR)
-!endif
-!ifndef PXLGENDIR
-PXLGENDIR=$(GENDIR)
-!endif
-!ifndef PXLOBJDIR
-PXLOBJDIR=$(GENDIR)
-!endif
-
-# Language and configuration. These are actually platform-independent,
-# but we define them here just to keep all parameters in one place.
-CONFIG=6
-TARGET_DEVS=$(PXLOBJDIR)$(D)pxl.dev
-
-# Main file's name
-MAIN_OBJ=$(PLOBJDIR)$(D)plmain.$(OBJ) $(PXLOBJDIR)$(D)pximpl.$(OBJ)
-TOP_OBJ=$(PXLOBJDIR)$(D)pxtop.$(OBJ)
-
-# Executable path\name w/o the .EXE extension
-!ifndef TARGET_XE
-TARGET_XE=$(PXLOBJDIR)\pclxl
-!endif
-
-# Debugging options
-!ifndef DEBUG
-DEBUG=1
-!endif
-!ifndef TDEBUG
-TDEBUG=0
-!endif
-!ifndef NOPRIVATE
-NOPRIVATE=0
-!endif
-
-# Target options
-!ifndef CPU_TYPE
-CPU_TYPE=486
-!endif
-!ifndef FPU_TYPE
-FPU_TYPE=0
-!endif
-
-# Assorted definitions. Some of these should probably be factored out....
-!ifndef GS
-GS=gs386
-!endif
-
-# Define which major version of MSVC is being used (currently, 4 & 5 supported)
-!ifndef MSVC_VERSION
-MSVC_VERSION=5
-!endif
-
-!ifndef DEVICE_DEVS
-DD=$(GLGENDIR)$(D)
-DEVICE_DEVS=$(DD)djet500.dev $(DD)ljet4.dev $(DD)pcxmono.dev $(DD)pcxgray.dev \
- $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcxcmyk.dev \
- $(DD)pbmraw.dev $(DD)pgmraw.dev $(DD)ppmraw.dev $(DD)pkmraw.dev
-
-!endif
-
-# GS options
-#DEVICE_DEVS is defined in the platform-specific file.
-FEATURE_DEVS = $(DD)dps2lib.dev \
- $(DD)path1lib.dev \
- $(DD)patlib.dev \
- $(DD)rld.dev \
- $(DD)roplib.dev \
- $(DD)ttflib.dev \
- $(DD)colimlib.dev \
- $(DD)cielib.dev \
- $(DD)htxlib.dev \
- $(DD)devcmap.dev \
- $(DD)gsnogc.dev
-
-!include $(COMMONDIR)\msvc_top.mak
-
-# Subsystems
-!include $(PLSRCDIR)\pl.mak
-!include $(PXLSRCDIR)\pxl.mak
-
-# Main program.
-!include $(PXLSRCDIR)\pxl_top.mak
-
diff --git a/pxl/pxl_top.mak b/pxl/pxl_top.mak
deleted file mode 100644
index 7e1c7ccf3..000000000
--- a/pxl/pxl_top.mak
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (C) 1997 Aladdin Enterprises. All rights reserved.
-# Unauthorized use, copying, and/or distribution prohibited.
-
-# pxl_top.mak
-# Top-level platform-independent makefile for PCL XL
-
-# This file must be preceded by pxl.mak.
-
-default: $(TARGET_XE)$(XE)
- echo Done.
-
-clean: config-clean clean-not-config-clean
-
-clean-not-config-clean: pl.clean-not-config-clean pxl.clean-not-config-clean
- $(RMN_) $(TARGET_XE)$(XE)
-
-config-clean: pl.config-clean pxl.config-clean
- $(RMN_) *.tr $(GD)devs.tr$(CONFIG) $(GD)ld.tr
- $(RMN_) $(PXLGEN)pconf.h $(PXLGEN)pconfig.h
- $(RM_) $(PXLSRC)pxlver.h
-
-#### Implementation stub
-# Note: we always compile the main program with -DDEBUG.
-$(PXLOBJ)pximpl.$(OBJ): $(PXLSRC)pximpl.c $(AK)\
- $(memory__h) \
- $(scommon_h) \
- $(gxdevice_h) \
- $(pltop_h)
- $(PXLCCC) $(PXLSRC)pximpl.c $(PXLO_)pximpl.$(OBJ)
diff --git a/pxl/pxl_ugcc.mak b/pxl/pxl_ugcc.mak
deleted file mode 100644
index 798e6d138..000000000
--- a/pxl/pxl_ugcc.mak
+++ /dev/null
@@ -1,79 +0,0 @@
-# Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved.
-# Unauthorized use, copying, and/or distribution prohibited.
-
-# pxl_ugcc.mak
-# Top-level makefile for PCL XL on Unix/gcc platforms.
-
-# Define the name of this makefile.
-MAKEFILE=../pxl/pxl_ugcc.mak
-
-# The build process will put all of its output in this directory:
-GENDIR=./obj
-
-# The sources are taken from these directories:
-GLSRCDIR=../gs/src
-PLSRCDIR=../pl
-PXLSRCDIR=../pxl
-COMMONDIR=../common
-
-# specify the location of zlib. We use zlib for bandlist compression.
-ZSRCDIR=../gs/zlib
-ZGENDIR=$(GENDIR)
-ZOBJDIR=$(GENDIR)
-SHARE_ZLIB=0
-
-
-# If you want to build the individual packages in their own directories,
-# you can define this here, although normally you won't need to do this:
-GLGENDIR=$(GENDIR)
-GLOBJDIR=$(GENDIR)
-PLGENDIR=$(GENDIR)
-PLOBJDIR=$(GENDIR)
-PXLGENDIR=$(GENDIR)
-PXLOBJDIR=$(GENDIR)
-
-# Language and configuration. These are actually platform-independent,
-# but we define them here just to keep all parameters in one place.
-CONFIG=6
-TARGET_DEVS=$(PXLOBJDIR)/pxl.dev
-TARGET_XE=$(PXLOBJDIR)/pclxl
-MAIN_OBJ=$(PLOBJDIR)/plmain.$(OBJ) $(PXLOBJDIR)/pximpl.$(OBJ)
-TOP_OBJ=$(PXLOBJDIR)/pxtop.$(OBJ)
-
-# Assorted definitions. Some of these should probably be factored out....
-# We use -O0 for debugging, because optimization confuses gdb.
-# Note that the omission of -Dconst= rules out the use of gcc versions
-# between 2.7.0 and 2.7.2 inclusive. (2.7.2.1 is OK.)
-#GCFLAGS=-Dconst= -Wall -Wpointer-arith -Wstrict-prototypes
-GCFLAGS=-Wall -Wcast-qual -Wpointer-arith -Wstrict-prototypes -Wwrite-strings
-CFLAGS=-g -O0 $(GCFLAGS) $(XCFLAGS)
-LDFLAGS=$(XLDFLAGS)
-EXTRALIBS=
-XINCLUDE=-I/usr/local/X/include
-XLIBDIRS=-L/usr/X11/lib
-XLIBDIR=
-XLIBS=Xt SM ICE Xext X11
-
-CCLD=gcc
-
-DD='$(GLGENDIR)$(D)'
-DEVICE_DEVS=$(DD)x11.dev $(DD)x11mono.dev $(DD)x11alpha.dev $(DD)x11cmyk.dev\
- $(DD)djet500.dev $(DD)ljet4.dev $(DD)cljet5pr.dev $(DD)cljet5c.dev\
- $(DD)pcxmono.dev $(DD)pcxgray.dev\
- $(DD)bmpmono.dev $(DD)bmpamono.dev $(DD)bmpa16m.dev\
- $(DD)pbmraw.dev $(DD)pgmraw.dev $(DD)ppmraw.dev
-
-FEATURE_DEVS=$(DD)colimlib.dev $(DD)dps2lib.dev $(DD)path1lib.dev $(DD)patlib.dev $(DD)psl2cs.dev $(DD)rld.dev $(DD)roplib.dev $(DD)ttflib.dev $(DD)cielib.dev $(DD)pipe.dev
-
-# posync for most unix variants bsd needs fbsdsync.
-SYNC=posync
-
-# Generic makefile
-include $(COMMONDIR)/ugcc_top.mak
-
-# Subsystems
-include $(PLSRCDIR)/pl.mak
-include $(PXLSRCDIR)/pxl.mak
-
-# Main program.
-include $(PXLSRCDIR)/pxl_top.mak
diff --git a/pxl/pxtop.c b/pxl/pxtop.c
index 5137c0c59..17934154a 100644
--- a/pxl/pxtop.c
+++ b/pxl/pxtop.c
@@ -41,15 +41,16 @@ maybe by Artifex.
#include "pltop.h"
/* Define the table of pointers to initialization data. */
-#define init_(init) int init(P1(px_state_t *));
-typedef init_((*px_init_proc));
-#include "pconfig.h"
-#undef init_
+
+typedef int (*px_init_proc) ( px_state_t * );
+
+int pxfont_init(P1(px_state_t *pxs ));
+int pxerrors_init(P1(px_state_t *pxs ));
+
const px_init_proc px_init_table[] = {
-#define init_(init) &init,
-#include "pconfig.h"
-#undef init_
- 0
+ &pxfont_init,
+ &pxerrors_init,
+ 0
};
/* Imported operators */
@@ -178,6 +179,7 @@ pxl_impl_characteristics(
{
static pl_interp_characteristics_t pxl_characteristics = {
"PCL/XL",
+ ") HP-PCL XL;1;1",
"Artifex",
PXLVERSION,
PXLBUILDDATE,
@@ -218,7 +220,6 @@ pxl_impl_allocate_interp_instance(
gs_state *pgs = gs_state_alloc(mem);
px_parser_state_t *st = px_process_alloc(mem); /* parser init, cheap */
px_state_t *pxs = px_state_alloc(mem); /* inits interp state, potentially expensive */
-
/* If allocation error, deallocate & return */
if (!pxli || !pgs || !st || !pxs) {
if (!pxli)
@@ -260,7 +261,6 @@ pxl_impl_set_client_instance(
)
{
pxl_interp_instance_t *pxli = (pxl_interp_instance_t *)instance;
-
pxli->pxs->pjls = client;
return 0;
}
@@ -303,7 +303,6 @@ pxl_impl_set_device(
int code;
pxl_interp_instance_t *pxli = (pxl_interp_instance_t *)instance;
enum {Sbegin, Ssetdevice, Sinitg, Sgsave, Serase, Sdone} stage;
-
stage = Sbegin;
gs_opendevice(device);
@@ -365,7 +364,6 @@ pxl_impl_init_job(
int code = 0;
pxl_interp_instance_t *pxli = (pxl_interp_instance_t *)instance;
gs_memory_status_t status;
-
px_reset_errors(pxli->pxs);
px_process_init(pxli->st, true);
@@ -536,7 +534,6 @@ pxl_impl_dnit_job(
{
int code;
pxl_interp_instance_t *pxli = (pxl_interp_instance_t *)instance;
-
px_stream_header_dnit(&pxli->headerState);
px_state_cleanup(pxli->pxs);
@@ -552,7 +549,6 @@ pxl_impl_remove_device(
int code = 0; /* first error status encountered */
int error;
pxl_interp_instance_t *pxli = (pxl_interp_instance_t *)instance;
-
/* return to original gstate */
gs_grestore_only(pxli->pgs); /* destroys gs_save stack */
/* Deselect device */
@@ -571,7 +567,6 @@ pxl_impl_deallocate_interp_instance(
{
pxl_interp_instance_t *pxli = (pxl_interp_instance_t *)instance;
gs_memory_t *mem = pxli->memory;
-
/* do total dnit of interp state */
px_state_finit(pxli->pxs);
@@ -607,7 +602,6 @@ pxl_end_page_top(
pxl_interp_instance_t *pxli = (pxl_interp_instance_t *)(pxls->client_data);
pl_interp_instance_t *instance = (pl_interp_instance_t *)pxli;
int code = 0;
-
/*
* Check whether it's worth doing a garbage collection.
* Note that this only works if we don't relocate pointers,