diff -rc2N gs25/NEWS gs251/NEWS *** gs25/NEWS Wed Aug 19 00:55:21 1992 --- gs251/NEWS Thu Sep 10 16:58:50 1992 *************** *** 26,29 **** --- 26,175 ---- README. + Version 2.5.1 (9/11/92) + ============= + + This is the usual bug fix re-release. + + Procedures + ---------- + + Fixes bugs: + - The makefile rules for compiled fonts had a circular + dependency. + - `make begin' didn't work properly on all platforms. + + Ensures that all batch files end with a newline. (The absence of the + newline was confusing the GNU diff program.) + + Documents the fact that the -dASCIIOUT switch no longer exists. + + Utilities + --------- + + Fixes bugs: + - pstoppm didn't `bind' its internal procedures. + - grestoreall would undo the output device selected by + pstoppm. + + Changes the utilities for reading and writing Type 1 character + outlines so they can work with stack representations as well as + arrays. + + Removes the pfbtogs.ps, phonbook.ps, and showpbm.ps utilities from + the distribution. + + Adds a gslj utility to parallel gslp and gsdj. + + Platforms + --------- + + Adds the DeskJet 500C drivers (cdeskjet/cdj*) to the MS-DOS / Borland + C++, MS-DOS / Watcom C/386, and MS-Windows configurations. + + Removes the PCX file driver from the MS Windows executable, because + the static data segment exceeded 64K. + + Makes some changes in the Unix System V platform file (gp_sysv.c) and + in time_.h and unixtail.mak to accommodate the 3B1. + + Fonts + ----- + + Fixes bugs: + - The Charter-Italic font was named bchi.pfa rather than + bchri.pfa. + - The Cyrillic fonts (cyr.gsf, cyri.gsf) were omitted from + the fileset. + - Ghostscript incorrectly assumed that all Type 1 fonts had a + FontInfo dictionary. + - .loadfont used false PFBDecode, so a few .PFB fonts would + get errors because the first eexec byte would be whitespace. + + Changes font2c and its supporting code so that compiled fonts are + location-independent. + + Drivers + ------- + + Fixes bugs: + - The margins for the H-P printers were still wrong. + - The H-P drivers accidentally cleared the compression seed + row when switching compression modes. + - Some of the H-P drivers used the wrong control codes for + skipping blank lines. + + Adds user-supported drivers for the AT&T 3B1 console device, and for + the NEC P6+ printer. + + Updates the SunView driver with a new version supplied by a(nother) + user. + + Changes the X Windows driver so the Ghostscript window doesn't get + input focus. + + Changes the common code for the printer drivers so that if it can + allocate a full bitmap but there isn't at least a minimum amount of + memory left afterwards, it switches to banding. + + Changes the Windows driver so it handles devices with more than 8 + bits per pixel. (We haven't been able to test this.) + + Adds a read-only PageCount device property (for printer devices + only). + + Changes all Aladdin-supported drivers to clip drawing requests to the + ((0,0), (width,height)) rectangle of device space. + + Interpreter + ----------- + + Fixes bugs: + - Closing a NullEncode filter always gave an ioerror. + - If a single-character name occurred 1 character before the + end of an input buffer, the character would be doubled. + - The procedures in gs_statd.ps didn't use "bind". + - pathforall would cause an addressing fault if the path + consisted of only a moveto. + - Setting the page size didn't work properly with devices + with rotated coordinate systems. + - If an error occurred, and the error object wasn't the last + element of its procedure, the interpreter would re-execute the error + object after running the error handler. + - Memory devices didn't get resized if HWSize was changed, + leading to out-of-bounds memory accesses. + + Moves revision and revisiondate from gs_init.ps to iinit.c. Adds a + -v switch that just prints these out. + + Arranges things so that if Ghostscript is reading from a pipe (`-' + switch on the command line) and encounters an error, it exits with + status 1 rather than 0. + + Changes the interpreter interface so the caller explicitly passes a + pointer for storing an error object. + + Library + ------- + + Fixes bugs: + - The automatic adjustment of the scaling for variant paper + sizes caused the image to get expanded when it should have been + contracted, and vice versa. + - The curve flattener insisted that each line segment be no + more than 2 x the flatness in length, leading to an enormous number + of segments even when not necessary for accuracy. + - flattenpath and strokepath discarded a trailing moveto. + - strokepath treated "0-width" lines as really having a width + of zero, rather than one pixel. + - Buffered devices weren't closed and reopened if the amount + of buffer space was changed. + - stroke used the line cap at the beginning of each subpath + even if the subpath was closed. + + Removes the requirement that the clipping rectangle fall in the + non-negative quadrant of device space. (This was causing problems + for Ghostview, but removing it required adding the extra clipping + step to the drawing routines in the drivers.) + Version 2.5 (8/18/92) =========== diff -rc2N gs25/README gs251/README *** gs25/README Wed Aug 19 00:55:27 1992 --- gs251/README Wed Sep 9 03:11:52 1992 *************** *** 20,26 **** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! *************************************************** ! * This file describes version 2.5 of Ghostscript. * ! *************************************************** ******** --- 20,26 ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! ***************************************************** ! * This file describes version 2.5.1 of Ghostscript. * ! ***************************************************** ******** *************** *** 227,231 **** Palo Alto, CA 94306 voice (415)322-0103 ! (no fax yet, but soon) ...{uunet,decwrl}!aladdin!ghost ghost@aladdin.com --- 227,231 ---- Palo Alto, CA 94306 voice (415)322-0103 ! fax (415)322-1734 ...{uunet,decwrl}!aladdin!ghost ghost@aladdin.com *************** *** 250,254 **** - Several people have asked for a program that will take PostScript code and reconstruct some reasonable ASCII form of the ! input, if this is possible. Ghostscript's -dASCIIOUT switch does a fair job of extracting the strings and their placement on the page, but that's only the easy half of the job: a second pass is needed to --- 250,254 ---- - Several people have asked for a program that will take PostScript code and reconstruct some reasonable ASCII form of the ! input, if this is possible. Ghostscript's gs_2asc.ps utility does a fair job of extracting the strings and their placement on the page, but that's only the easy half of the job: a second pass is needed to *************** *** 306,310 **** Windows driver), Ian MacPhedran (for a sixel driver), ! Jim Mayer (for improving the DeskJet driver), Richard Mlynarik (for a nearly overwhelming volume of improvements and suggestions), --- 306,310 ---- Windows driver), Ian MacPhedran (for a sixel driver), ! Jim Mayer (for help with the DeskJet and LaserJet drivers), Richard Mlynarik (for a nearly overwhelming volume of improvements and suggestions), diff -rc2N gs25/bcwin.mak gs251/bcwin.mak *** gs25/bcwin.mak Sat Aug 15 11:10:54 1992 --- gs251/bcwin.mak Mon Sep 7 14:03:28 1992 *************** *** 163,166 **** --- 163,167 ---- CCC=$(CC) -W $(CO) -c CCD=$(CC) -W -O -c + CCCF=$(CC) $(GENOPT) $(PLATOPT) $(FPFLAGS) -mh CC0=$(CC) -W -c CCINT=$(CC) -W -c *************** *** 179,185 **** # Choose the device(s) to include. See devs.mak for details. ! DEVICE_DEVS=mswin.dev epson.dev bj10e.dev paintjet.dev DEVICE_DEVS2=deskjet.dev djet500.dev laserjet.dev ljetplus.dev ljet2p.dev ljet3.dev ! DEVICE_DEVS4=gifmono.dev gif8.dev pcxmono.dev pcx16.dev pcx256.dev bit.dev !include "gs.mak" !include "devs.mak" --- 180,187 ---- # Choose the device(s) to include. See devs.mak for details. ! DEVICE_DEVS=mswin.dev epson.dev bj10e.dev DEVICE_DEVS2=deskjet.dev djet500.dev laserjet.dev ljetplus.dev ljet2p.dev ljet3.dev ! DEVICE_DEVS3=cdeskjet.dev cdjcolor.dev cdjmono.dev paintjet.dev pjetxl.dev ! DEVICE_DEVS5=gifmono.dev gif8.dev bit.dev !include "gs.mak" !include "devs.mak" *************** *** 210,213 **** --- 212,216 ---- BEGINFILES=gs.res gs*.ico + CCBEGIN=$(CCC) *.c iutilasm.$(OBJ): iutilasm.asm diff -rc2N gs25/bdftops.ps gs251/bdftops.ps *** gs25/bdftops.ps Sat Jul 25 17:45:22 1992 --- gs251/bdftops.ps Wed Aug 19 11:14:30 1992 *************** *** 59,95 **** % in the standard encoding. mark (exclamdown) [/exclam] ! (fraction) [/slash] (florin) [/f] ! (quotesingle) [/quoteright] ! (quotedblleft) [/quotedbl] (guillemotleft) [/less /less] (guilsinglleft) [/less] (guilsinglright) [/greater] ! (fi) [/f /i] ! (fl) [/f /l] ! (endash) [/hyphen /hyphen] (periodcentered) [/asterisk] - (bullet) [/asterisk] - (quotesinglbase) [/quotesingle] - (quotedblbase) [/quotedbl] - (quotedblright) [/quotedbl] - (guillemotright) [/greater /greater] - (ellipsis) [/period /period /period] (questiondown) [/question] ! (grave) [/quoteleft] ! (acute) [/quoteright] ! (circumflex) [/asciicircum] (tilde) [/asciitilde] - (dieresis) [/quotedbl] - (cedilla) [/comma] - (hungarumlaut) [/quotedbl] - (emdash) [/hyphen /hyphen /hyphen] - (AE) [/A /E] - (OE) [/O /E] - (ae) [/a /e] - (dotlessi) [/i] - (oe) [/o /e] - (germandbls) [/s /s] dicttomark /composites exch def --- 59,95 ---- % in the standard encoding. mark + (AE) [/A /E] + (OE) [/O /E] + (acute) [/quoteright] + (ae) [/a /e] + (bullet) [/asterisk] + (cedilla) [/comma] + (circumflex) [/asciicircum] + (dieresis) [/quotedbl] + (dotlessi) [/i] + (ellipsis) [/period /period /period] + (emdash) [/hyphen /hyphen /hyphen] + (endash) [/hyphen /hyphen] (exclamdown) [/exclam] ! (fi) [/f /i] ! (fl) [/f /l] (florin) [/f] ! (fraction) [/slash] ! (germandbls) [/s /s] ! (grave) [/quoteleft] (guillemotleft) [/less /less] + (guillemotright) [/greater /greater] (guilsinglleft) [/less] (guilsinglright) [/greater] ! (hungarumlaut) [/quotedbl] ! (oe) [/o /e] (periodcentered) [/asterisk] (questiondown) [/question] ! (quotedblbase) [/comma /comma] ! (quotedblleft) [/quotedbl] ! (quotedblright) [/quotedbl] ! (quotesinglbase) [/comma] ! (quotesingle) [/quoteright] (tilde) [/asciitilde] dicttomark /composites exch def *************** *** 115,118 **** --- 115,119 ---- /Eacute /Ecircumflex /Edieresis /Egrave /Iacute /Icircumflex /Idieresis /Igrave + /Lslash /Ntilde /Oacute /Ocircumflex /Odieresis /Ograve /Otilde *************** *** 125,128 **** --- 126,130 ---- /eacute /ecircumflex /edieresis /egrave /iacute /icircumflex /idieresis /igrave + /lslash /ntilde /oacute /ocircumflex /odieresis /ograve /otilde *************** *** 138,144 **** } forall /cent [/c /slash] /sterling [/L /hyphen] /yen [/Y /equal] - /daggerdbl [/bar /equal] dicttomark /accentedchars exch def --- 140,147 ---- } forall /cent [/c /slash] + /daggerdbl [/bar /equal] + /divide [/colon /hyphen] /sterling [/L /hyphen] /yen [/Y /equal] dicttomark /accentedchars exch def diff -rc2N gs25/ccfont.h gs251/ccfont.h *** gs25/ccfont.h Mon Jun 1 02:21:04 1992 --- gs251/ccfont.h Tue Aug 18 14:22:58 1992 *************** *** 23,44 **** /* Define type-specific refs for initializing arrays. */ #define ref_(t) struct { struct tas_s tas; t value; } - typedef struct { short len; const char _ds *str; } const_charray; - typedef struct { byte encx, charx; } charindex; - #define array_v(n,p,ea)\ - { {(t_array< #include + #include /* for ctime */ /* *************** *** 27,31 **** * Usage: echogs [-w[b] file | -a[b] file] [-n] ! (-x hexstring | -q string | -s | -i | -r file)* [-] string* * Echoes string(s), or the binary equivalent of hexstring(s). * If -w, writes to file; if -a, appends to file; if neither, --- 28,33 ---- * Usage: echogs [-w[b] file | -a[b] file] [-n] ! (-D | -x hexstring | -q string | -s | -i | -r file)* ! [-] string* * Echoes string(s), or the binary equivalent of hexstring(s). * If -w, writes to file; if -a, appends to file; if neither, *************** *** 32,35 **** --- 34,38 ---- * writes to stdout. -wb and -ab open the file in binary mode. * If -n, does not append a newline to the output. -s writes a space. + * -D means insert the date and time. * -i means read from stdin, treating each line as an argument. * -r means read from a named file in the same way. *************** *** 113,116 **** --- 116,127 ---- in = stdin; break; + case 'D': /* insert date/time */ + { long t; + char str[26]; + time(&t); + strcpy(str, ctime(&t)); + str[24] = 0; /* remove \n */ + fputs(str, out); + } break; case 'X': /* treat literals as hex */ hexx = 1; diff -rc2N gs25/ega.tr gs251/ega.tr *** gs25/ega.tr Fri Apr 24 02:17:04 1992 --- gs251/ega.tr Tue Sep 1 01:21:28 1992 *************** *** 1 **** ! ega gdevpcfb gdevegaa,ega,ega, --- 1 ---- ! ega gdevpcfb gdevegaa,ega,ega,+ diff -rc2N gs25/font2c.ps gs251/font2c.ps *** gs25/font2c.ps Tue Aug 11 05:52:14 1992 --- gs251/font2c.ps Thu Aug 20 05:42:52 1992 *************** *** 72,76 **** % but don't let the protection actually take effect. /protected % do first so // will work ! systemdict wcheck { 1500 dict } { null } ifelse def systemdict wcheck --- 72,76 ---- % but don't let the protection actually take effect. /protected % do first so // will work ! systemdict wcheck { 1500 dict } { 1 dict } ifelse def systemdict wcheck *************** *** 107,117 **** % or be prepared to use wcca instead. /wbx ! { 8#1000 add 8 (0000) cvrs dup 0 (\\) 0 get put ws ! } bind def ! /wcst [ ! 32 { /wbx load } repeat ! 95 { /wb load } repeat ! 129 { /wbx load } repeat ! ] def ("\\) { wcst exch { (\\) ws wb } put } forall /wcs --- 107,118 ---- % or be prepared to use wcca instead. /wbx ! { 8#1000 add 8 (0000) cvrs dup 0 (\\) 0 get put ws ! } bind def ! /wcst ! [ ! 32 { /wbx load } repeat ! 95 { /wb load } repeat ! 129 { /wbx load } repeat ! ] def ("\\) { wcst exch { (\\) ws wb } put } forall /wcs *************** *** 126,131 **** % Write a C string as an array of character values. % We only need this because of line and literal length limitations. ! /wcca ! { 100 ({) 3 -1 roll { exch ws exch dup 19 ge { () wl pop 0 } if 1 add --- 127,132 ---- % Write a C string as an array of character values. % We only need this because of line and literal length limitations. ! /wca % string prefix suffix -> ! { 0 4 -2 roll exch { exch ws exch dup 19 ge { () wl pop 0 } if 1 add *************** *** 132,136 **** exch wt (,) } forall ! pop pop (}) ws } bind def --- 133,140 ---- exch wt (,) } forall ! pop pop ws ! } bind def ! /wcca ! { ({\n) (}) wca } bind def *************** *** 148,151 **** --- 152,177 ---- % ------ Object writing ------ % + /wnstring 128 string def + + % Write a string/name or null as an element of a string/name/null array. */ + /wsn + { dup null eq + { pop (\t255,255,) wl + } + { dup type /nametype eq { wnstring cvs } if + dup length 256 idiv wt (,) ws + dup length 256 mod wt + (,) (,\n) wca + } + ifelse + } bind def + % Write a packed string/name/null array. + /wsna % name (string/name/null)* -> + { (\tstatic const char ) ws exch wt ([] = {) wl + { wsn } forall + (\t0\n};) wl + } bind def + + % Write a named object. Return true if this was possible. % Legal types are: boolean, integer, name, real, string, *************** *** 157,161 **** forall exch pop } bind def - /wnstring 128 string def /wott 7 dict dup begin /arraytype --- 183,186 ---- *************** *** 169,201 **** } bind def /booleantype ! { exch (static const ref_(ushort) ) ws wt ( = boolean_v\() ws ! { (1) } { (0) } ifelse ws (\);) wl true } bind def /dicttype ! { pop alldictdict exch known } bind def /integertype ! { exch (static const ref_(long) ) ws wt ( = integer_v\() ws wt (\);) wl true } bind def /nametype ! { exch (static const ref_(const char *) ) ws wt ( = name_v\() ws ! wnstring cvs dup length wt (,) ws wcs % OK, names are short ! (\);) wl true } bind def /realtype ! { exch (static const ref_(float) ) ws wt ( = real_v\() ws wt (\);) wl true } bind def /stringtype ! { dup can_wcs ! { exch (static const ref_(const char *) ) ws wt ( = string_v\() ws ! dup length wt (,) ws wcs (\);) wl true ! } ! { (static const char ) ws 1 index wt (_[] = ) ws wcca (;) wl ! dup dup (static const ref_(const char *) ) ws wt ! ( = string_v\(sizeof\() ws wt (_\),) ws wt (_\);) wl true ! } ! ifelse } bind def end def --- 194,228 ---- } bind def /booleantype ! { { (\tmake_true\(&) } { (\tmake_false\(&) } ifelse ws ! wt (\);) wl true } bind def /dicttype ! { dup alldicts exch known ! { alldicts exch get (\t) ws exch wt ( = ) ws wt (;) wl true } ! { pop pop false } ! ifelse } bind def /integertype ! { (\tmake_int\(&) ws exch wt (, ) ws wt (\);) wl true } bind def /nametype ! { (\tcode = (*pprocs->name_create)\(&) ws exch wt ! (, ) ws wnstring cvs wcs % OK, names are short ! (\);) wl ! (\tif ( code < 0 ) return code;) wl ! true } bind def /realtype ! { (\tmake_real\(&) ws exch wt (, ) ws wt (\);) wl true } bind def /stringtype ! { ({\tstatic const char s_[] = ) ws ! dup dup can_wcs { wcs } { wcca } ifelse ! (;) wl ! (\tmake_string\(&) ws exch wt ! (, a_readonly, ) ws length wt (, (const byte *)s_\);) wl ! (}) wl true } bind def end def *************** *** 208,221 **** % Write an array (called by wo). ! /wta % name wproc array -> ! { dup 4 1 roll ! dup length 0 eq { pop {0} } if ! 2 index wt (_array[] = {\n) exch ! { exch ws 1 index exec ! (\)) ws (,\n) } ! forall pop pop (\n};\nstatic const ref_(const ref *) ) ws ! dup wt ( = array_v\() ws 1 index length wt (, ) ws ! wt (_array, ) ws wpa (\);) wl } bind def /woatt [ --- 235,253 ---- % Write an array (called by wo). ! /wnuma % name array C_type type_v -> ! { ({\tstatic const ref_\() ws exch ws ! (\) a_[] = {) wl exch ! dup length 0 eq ! { (\t0) wl } ! { dup ! { (\t) ws 2 index ws (\() ws wt (\),) wl ! } forall ! } ! ifelse ! (\t};) wl exch pop ! (\tmake_array\(&) ws exch wt ! (, ) ws dup wpa (, ) ws length wt ! (, (ref *)a_\);) wl (}) wl } bind def /woatt [ *************** *** 222,259 **** % Integers { { type /integertype eq } ! { (static const ref_(long) ) ws { (integer_v\() ws wt } exch wta true } } % Integers + reals { { type dup /integertype eq exch /realtype eq or } ! { (static const ref_(float) ) ws { (real_v\() ws wt } exch wta true } } % Strings + nulls - /a_name null def % predefine so we can use store, not def - /a_body null def { { type dup /nulltype eq exch /stringtype eq or } ! { % Write the strings first with wcca ! /a_body exch store ! /a_name exch store ! [ 0 1 a_body length 1 sub ! { dup a_body exch get dup null eq ! { exch pop } ! { exch wtstring cvs (_) concatstrings ! a_name wtstring cvs exch concatstrings ! (static const char ) ws dup ws ([] = ) ws exch wcca (;) wl ! } ! ifelse ! } for ! ] ! % Make the protections match ! prot_opers a_body getpa get exec ! a_name exch ! % Now write the array itself ! (static const ref_(const char *) ) ws ! { dup null eq ! { pop (null_v\() ws } ! { (string_v\(sizeof\() ws dup ws (\),) ws ws } ! ifelse ! } ! exch wta true } } --- 254,270 ---- % Integers { { type /integertype eq } ! { (long) (integer_v) wnuma true } } % Integers + reals { { type dup /integertype eq exch /realtype eq or } ! { (float) (real_v) wnuma true } } % Strings + nulls { { type dup /nulltype eq exch /stringtype eq or } ! { ({) ws dup (sa_) exch wsna ! exch (\tcode = (*pprocs->string_array_create)\(&) ws wt ! (, sa_, ) ws dup length wt (, ) ws wpa (\);) wl ! (\tif ( code < 0 ) return code;) wl ! (}) wl true } } *************** *** 266,306 **** % Write a named dictionary. We assume the ref is already declared. /wd % name dict ! { ({) wl dup [ exch ! { 2 copy wo { pop } ! { pop pop } ! ifelse } forall ] ! dup (static const char _ds *str_keys_[] = {) wl ! { wncs (,) wl % OK, key names are short ! } ! forall (0\n};) wl ! (static const ref _ds *values_[] = {\n) exch ! { exch ws ! % Fill in the real value for dictionaries later. ! dup alldictdict exch known { pop (static_null) } if ! ((const ref _ds *)&) ws wt (,\n) ! } ! forall pop (\n};) wl (\tstatic const cfont_dict_keys keys_ =) wl ! (\t { 0, 0, str_keys_, countof\(str_keys_\) - 1, 1, ) ws dup wpa (, ) ws dup wva ( };) wl (\tcode = \(*pprocs->ref_dict_create\)\(&) ws 1 index wt ! (, &keys_, &values_[0]\);) wl (\tif (code < 0) return code;) wl ! % Now fill in the values that reference dictionaries, ! % which are created dynamically. ! { pop dup alldictdict exch known ! { (\tcode = \(*pprocs->dict_put\)\(&) ws 1 index wt ! (, ) ws dup wncs (, &) ws wt (\);) wl ! (\tif (code < 0) return code;) wl ! } ! { pop ! } ! ifelse ! } ! forall pop (}) wl } bind def --- 277,300 ---- % Write a named dictionary. We assume the ref is already declared. /wd % name dict ! { ({) ws ! (\tref v_[) ws dup length wt (];) wl ! dup [ exch ! { counttomark 2 sub wtstring cvs ! (v_[) exch concatstrings (]) concatstrings exch wo not { pop } ! if } forall ] ! % stack: array of keys (names) ! ({) ws dup (str_keys_) exch wsna (\tstatic const cfont_dict_keys keys_ =) wl ! (\t { 0, 0, ) ws length wt (, 1, ) ws dup wpa (, ) ws dup wva ( };) wl (\tcode = \(*pprocs->ref_dict_create\)\(&) ws 1 index wt ! (, &keys_, str_keys_, &v_[0]\);) wl (\tif (code < 0) return code;) wl ! pop pop (}) wl + (}) wl } bind def *************** *** 312,316 **** 2 index (static const charindex enc_keys_[] = {) wl ! 0 exch { pop decoding 1 index known { decoding exch get ({) ws dup -8 bitshift wt --- 306,310 ---- 2 index (static const charindex enc_keys_[] = {) wl ! [ exch 0 exch { pop decoding 1 index known { decoding exch get ({) ws dup -8 bitshift wt *************** *** 318,345 **** 1 add dup 5 mod 0 eq { (\n) ws } if } ! { pop } ifelse } forall pop ({0,0}\n};) wl % Other keys ! 2 index ! (static const char _ds *str_keys_[] = {) wl ! { pop decoding 1 index known ! { pop ! } ! { (\t) ws wtstring cvs wcs % OK, key names are short ! (,) wl ! } ! ifelse ! } ! forall ! (\t0\n};) wl % Values, with those corresponding to stdkeys first. (static const ) ws 1 index ws 2 index - ( values_[] = {\n) exch { decoding 2 index known ! { exch pop exch ws (\t) ws 1 index exec (,\n) } { pop pop } ifelse --- 312,329 ---- 1 add dup 5 mod 0 eq { (\n) ws } if } ! { exch } ifelse } forall pop + ] ({0,0}\n};) wl % Other keys ! (str_keys_) exch wsna % Values, with those corresponding to stdkeys first. (static const ) ws 1 index ws + ( values_[] = {) wl 2 index { decoding 2 index known ! { exch pop 1 index exec } { pop pop } ifelse *************** *** 346,365 **** } forall ! 3 index { decoding 2 index known { pop pop } ! { exch pop exch ws (\t) ws 1 index exec (,\n) } ifelse } ! forall pop ! (\n};) wl % Actual creation code (static const cfont_dict_keys keys_ = {) wl (\tenc_keys_, countof\(enc_keys_\) - 1,) wl ! (\tstr_keys_, countof\(str_keys_\) - 1, 0, ) ws pop pop dup wpa (, ) ws wva () wl (};) wl ! (\tcode = \(*pprocs->) ws ws (_dict_create\)\(&) ws ws (, &keys_, &values_[0]\);) wl (\tif ( code < 0 ) return code;) wl } bind def --- 330,350 ---- } forall ! 2 index { decoding 2 index known { pop pop } ! { exch pop 1 index exec } ifelse } ! forall ! (\t0\n};) wl % Actual creation code (static const cfont_dict_keys keys_ = {) wl (\tenc_keys_, countof\(enc_keys_\) - 1,) wl ! (\t) ws 2 index length wt ( - \(countof\(enc_keys_\) - 1\), 0, ) ws pop pop dup wpa (, ) ws wva () wl (};) wl ! (\tcode = \(*pprocs->) ws ws (_dict_create\)\(&) ws ws ! (, &keys_, str_keys_, &values_[0]\);) wl (\tif ( code < 0 ) return code;) wl } bind def *************** *** 399,414 **** % Define all the dictionaries we know about. % wo uses this when writing out dictionaries. ! [ (Font) (FontInfo) (CharStrings) (Private) encodingnames Font /Encoding get known not { % Make a fake entry for Encoding, for later ! (Encoding) } if ! Font /Metrics known { (Metrics) } if ! ] ! dup /alldictnames exch def ! dup length 1 sub 1 exch getinterval % drop Font ! dup length dict begin { dup def } forall ! currentdict end /alldictdict exch def % Write out the boilerplate. --- 384,400 ---- % Define all the dictionaries we know about. % wo uses this when writing out dictionaries. ! /alldicts 10 dict def ! alldicts begin ! Font /Font def ! { /FontInfo /CharStrings /Private } ! { dup Font exch get exch def } ! forall encodingnames Font /Encoding get known not { % Make a fake entry for Encoding, for later ! Font /Encoding get /Encoding def } if ! Font /Metrics known { Font /Metrics get /Metrics def } if ! end % Write out the boilerplate. *************** *** 445,448 **** --- 431,435 ---- (#include "std.h") wl (#include "iref.h") wl + (#include "store.h") wl (#include "ccfont.h") wl () wl *************** *** 450,463 **** % Write the procedure prologue. (#ifdef __PROTOTYPES__) wl ! (int) wl ! fontprocname ws ((const cfont_procs _ds *pprocs, ref *pfont)) wl (#else) wl ! (int) wl ! fontprocname ws ((pprocs, pfont) const cfont_procs _ds *pprocs; ref *pfont;) wl (#endif) wl ({\tint code;) wl ! (\tstatic const ref_(long) static_null = null_v();) wl ! alldictnames ! { (\tref ) ws ws (;) wl } forall --- 437,449 ---- % Write the procedure prologue. (#ifdef __PROTOTYPES__) wl ! (int huge) wl ! fontprocname ws ((const cfont_procs *pprocs, ref *pfont)) wl (#else) wl ! (int huge) wl ! fontprocname ws ((pprocs, pfont) const cfont_procs *pprocs; ref *pfont;) wl (#endif) wl ({\tint code;) wl ! alldicts ! { exch pop (\tref ) ws wt (;) wl } forall *************** *** 466,481 **** % Write out the CharStrings. - % We write the strings with wcca first, and save the mapping in a dictionary. ({) wl ! 0 CharStrings ! { exch pop ! charmap 1 index 3 index put ! (static const char cs) ws 1 index wt ([] = ) ws wcca (;) wl ! 1 add ! } forall pop ! (CharStrings) (string) CharStrings (const_charray) ! { ({sizeof\(cs) ws charmap exch get dup wt ! (\),cs) ws wt (}) ws ! } wcd (}) wl --- 452,457 ---- % Write out the CharStrings. ({) wl ! (CharStrings) (string) CharStrings (char) { wsn } wcd (}) wl *************** *** 483,487 **** Font /Metrics known { ({) wl ! (Metrics) (num) Metrics (float) { wtstring cvs ws } wcd (}) wl } --- 459,463 ---- Font /Metrics known { ({) wl ! (Metrics) (num) Metrics (float) { (\t) ws wtstring cvs ws (,) wl } wcd (}) wl } *************** *** 493,503 **** % Write out the Encoding vector, if it isn't standard. encodingnames Encoding known not ! { (\t{ static const char _ds *str_elts_[] = {\n) ! Encoding ! { exch ws wtstring cvs wcs % OK, character names are short ! (,\n) ! } ! forall pop (\n};) wl ! (\tcode = \(*pprocs->name_array_create\)\(&Encoding, str_elts_, countof\(str_elts_\)\);) wl (\tif (code < 0) return code;) wl (}) wl --- 469,475 ---- % Write out the Encoding vector, if it isn't standard. encodingnames Encoding known not ! { (str_elts_) Encoding wsna ! (\tcode = \(*pprocs->name_array_create\)\(&Encoding, str_elts_, ) ws ! Encoding length wt (\);) wl (\tif (code < 0) return code;) wl (}) wl diff -rc2N gs25/fonts.doc gs251/fonts.doc *** gs25/fonts.doc Mon Aug 10 14:44:40 1992 --- gs251/fonts.doc Mon Sep 7 14:20:42 1992 *************** *** 31,42 **** The fonts included with Ghostscript come in several parts: ! - Font data in files *.gsf and *.pfa: each file defines one (transformable) font specified in outline form. - BuildChar procedures in gs_fonts.ps: these provide the ! algorithms for interpreting the data in the .gsf or .pfa files. - The Fontmap file: this relates Ghostscript font names to .gsf ! or .pfa file names. Currently, most of the fonts supplied with Ghostscript are based on --- 31,42 ---- The fonts included with Ghostscript come in several parts: ! - Font data in files *.gsf: each file defines one (transformable) font specified in outline form. - BuildChar procedures in gs_fonts.ps: these provide the ! algorithms for interpreting the data in the .gsf files. - The Fontmap file: this relates Ghostscript font names to .gsf ! file names. Currently, most of the fonts supplied with Ghostscript are based on *************** *** 122,135 **** ===================== ! The program bdftops.ps (and invoking shell script bdftops.bat or bdftops) ! converts these bitmap files to Ghostscript input, using the Ghostscript ! ``type1imagepath'' operator to convert the bitmaps into outlines. ! ! If you want to add fonts of your own, you need to do two things. First, ! edit Fontmap to include an entry for your new font at the end. The format ! for entries is documented in the Fontmap file. Second, you need to ! prepare the .gsf file. If you are converting a file from BDF format, the ! Ghostscript distribution already includes a program for doing this: run ! the shell command bdftops [ ...] [] --- 122,147 ---- ===================== ! Ghostscript can use any Type 1 or Type 3 font that is acceptable to other ! PostScript language interpreters. Ghostscript also provides a way to ! construct a Type 1 font from a bitmap font in BDF format, which is a ! popular format in the Unix world. ! ! If you want to add fonts of your own, you must edit Fontmap to include an ! entry for your new font at the end. The format for entries is documented ! in the Fontmap file. Since later entries in Fontmap override earlier ! entries, any fonts you add will supersede the corresponding fonts supplied ! with Ghostscript. ! ! In the PC world, Type 1 fonts are customarily given names ending in .PFA ! or .PFB. Ghostscript can use these directly; you just need to make the ! entry in Fontmap. If you are going to use a commercial Type 1 font (such ! as fonts obtained in conjunction with Adobe Type Manager) with ! Ghostscript, please read carefully the license that accompanies the font; ! Aladdin Enterprises and the Free Software Foundation take no ! responsibility for any possible violations of such licenses. ! ! If you want to convert a BDF file to a scalable outline, use the program ! bdftops.ps (and invoking shell script bdftops.bat or bdftops). Run the ! shell command bdftops [ ...] [] *************** *** 136,153 **** e.g., bdftops pzdr.bdf ZapfDingbats.afm pzdr.gsf ZapfDingbats 4100000 ! You may find it helpful to read, and to add an entry to, the fonts.mak ! file, which is a makefile for converting the standard Ghostscript fonts. - There is a similar utility to convert files from .PFB form to plain text - .gsf form. Run the shell command - pfbtogs <.PFB_file_name> - e.g., - pfbtogs timesrmn.pfb ptmr.gsf - Files in .PFA form can be used directly by Ghostscript -- no conversion is - required, just an entry in Fontmap. - - Starting in release 2.4, Ghostscript can also use .PFB fonts directly: you - don't have to run pfbtogs, just put the .PFB file in the Fontmap. - Precompiling fonts ================== --- 148,155 ---- e.g., bdftops pzdr.bdf ZapfDingbats.afm pzdr.gsf ZapfDingbats 4100000 ! Then make an entry for the .gsf file in Fontmap as described above. You ! may find it helpful to read, and to add an entry to, the fonts.mak file, ! which is a makefile for converting the standard Ghostscript fonts. Precompiling fonts ================== *************** *** 204,217 **** ccfonts_=ugly.$(OBJ) ptmri.$(OBJ) Then find the line that says ! $(SHP)gsaddmod ccfonts -font Ugly Add your own fonts to the end of this line, e.g., ! $(SHP)gsaddmod ccfonts -font Ugly Times_Italic Notice that you must replace `-' by `_' in the font name. If the line gets too long, add another line of the same form, e.g., ! $(SHP)gsaddmod ccfonts -font Ugly ! $(SHP)gsaddmod ccfonts -font Times_Italic Now find the lines that say ugly.$(OBJ): ugly.c $(CCFONT) ! $(CC) $(CCFLAGS) -c ugly.c Add a similar pair of lines for each font, separating these entries from the existing entries and from each other by a blank line. (The makefile --- 206,219 ---- ccfonts_=ugly.$(OBJ) ptmri.$(OBJ) Then find the line that says ! $(SHP)gsaddmod ccfonts_ -font Ugly Add your own fonts to the end of this line, e.g., ! $(SHP)gsaddmod ccfonts_ -font Ugly Times_Italic Notice that you must replace `-' by `_' in the font name. If the line gets too long, add another line of the same form, e.g., ! $(SHP)gsaddmod ccfonts_ -font Ugly ! $(SHP)gsaddmod ccfonts_ -font Times_Italic Now find the lines that say ugly.$(OBJ): ugly.c $(CCFONT) ! $(CCCF) ugly.c Add a similar pair of lines for each font, separating these entries from the existing entries and from each other by a blank line. (The makefile *************** *** 218,225 **** includes lines for a few more fonts than this already.) In our example, ugly.$(OBJ): ugly.c $(CCFONT) ! $(CC) $(CCFLAGS) -c ugly.c ptmri.$(OBJ): ptmri.c $(CCFONT) ! $(CC) $(CCFLAGS) -c ptmri.c Finally, run `make'. The executable will now include the fonts you added. --- 220,227 ---- includes lines for a few more fonts than this already.) In our example, ugly.$(OBJ): ugly.c $(CCFONT) ! $(CCCF) ugly.c ptmri.$(OBJ): ptmri.c $(CCFONT) ! $(CCCF) ptmri.c Finally, run `make'. The executable will now include the fonts you added. *************** *** 253,259 **** Then when you add the font to the gsaddmod line in the makefile, use the short name, not the actual font name, e.g., ! $(SHP)gsaddmod ccfonts -font pncbi instead of ! $(SHP)gsaddmod ccfonts -font NewCenturySchlbk_BoldItalic Everything else is as described above. --- 255,261 ---- Then when you add the font to the gsaddmod line in the makefile, use the short name, not the actual font name, e.g., ! $(SHP)gsaddmod ccfonts_ -font pncbi instead of ! $(SHP)gsaddmod ccfonts_ -font NewCenturySchlbk_BoldItalic Everything else is as described above. diff -rc2N gs25/gconfig.c gs251/gconfig.c *** gs25/gconfig.c Mon Jun 1 02:38:10 1992 --- gs251/gconfig.c Thu Aug 20 14:06:52 1992 *************** *** 40,45 **** * device_(gs_xxx_device) * for each installed device, - * font_("0.font_xxx", font_xxx, zfont_xxx) - * for each compiled font, * oper_(xxx_op_defs) * for each operator option, and --- 40,43 ---- *************** *** 64,69 **** const char *gs_init_file = GS_INIT; ! /* Operators and fonts are handled in iinit.c and iccfont.c. */ ! #define font_(fname, fproc, zfproc) #define oper_(defs) #define psfile_(fns) --- 62,66 ---- const char *gs_init_file = GS_INIT; ! /* Operators are handled in iinit.c. */ #define oper_(defs) #define psfile_(fns) diff -rc2N gs25/gdev3b1.c gs251/gdev3b1.c *** gs25/gdev3b1.c --- gs251/gdev3b1.c Thu Sep 10 17:34:32 1992 *************** *** 0 **** --- 1,609 ---- + /* Copyright (C) 1992 Aladdin Enterprises. All rights reserved. + Distributed by Free Software Foundation, Inc. + + This file is part of Ghostscript. + + Ghostscript is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY. No author or distributor accepts responsibility + to anyone for the consequences of using it or for whether it serves any + particular purpose or works at all, unless he says so in writing. Refer + to the Ghostscript General Public License for full details. + + Everyone is granted permission to copy, modify and redistribute + Ghostscript, but only under the conditions described in the Ghostscript + General Public License. A copy of this license is supposed to have been + given to you along with Ghostscript so you can know your rights and + responsibilities. It should be in a file named COPYING. Among other + things, the copyright notice and this notice must be preserved on all + copies. */ + + /* + * gdev3b1.c + * + * This is a driver for the AT&T 3b1/7300/UnixPC console display. + * + * The image is built in a buffer the size of the page. Once complete, + * a screen-sized subset is copied to the screen, and one can scroll + * through the entire image (move with "vi" or arrow keys). + * + * Written by Andy Fyfe, andy@cs.caltech.edu. + */ + + #include "gx.h" + #include "gxdevice.h" + #include "gserrors.h" + + #include + #include + #include + + typedef struct gx_device_att3b1_s { + gx_device_common; + int fd; /* window file descriptor */ + uchar *screen; /* pointer to screen image */ + ushort line_size; /* size of single screen line in bytes */ + ulong screen_size; /* size of screen image in bytes */ + int screen_width, screen_height; /* size of screen used */ + int page; /* page number */ + #ifdef ATT3B1_PERF + char *no_output, *no_fill, *no_copy; + #endif + } gx_device_att3b1; + #define att3b1dev ((gx_device_att3b1 *)dev) + + #define XDPI 100 /* to get a more-or-less square aspect ratio */ + #define YDPI 72 + #define XSIZE (8.5 * XDPI) /* 8.5 x 11 inch page, by default */ + #define YSIZE (11 * YDPI) + + static const ushort masks[] = { 0, + 0x0001, 0x0003, 0x0007, 0x000f, + 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, + 0x1fff, 0x3fff, 0x7fff, 0xffff, + }; + static uchar reverse_bits[256] = { + 0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240, + 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248, + 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244, + 12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252, + 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242, + 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250, + 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, 182, 118, 246, + 14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254, + 1, 129, 65, 193, 33, 161, 97, 225, 17, 145, 81, 209, 49, 177, 113, 241, + 9, 137, 73, 201, 41, 169, 105, 233, 25, 153, 89, 217, 57, 185, 121, 249, + 5, 133, 69, 197, 37, 165, 101, 229, 21, 149, 85, 213, 53, 181, 117, 245, + 13, 141, 77, 205, 45, 173, 109, 237, 29, 157, 93, 221, 61, 189, 125, 253, + 3, 131, 67, 195, 35, 163, 99, 227, 19, 147, 83, 211, 51, 179, 115, 243, + 11, 139, 75, 203, 43, 171, 107, 235, 27, 155, 91, 219, 59, 187, 123, 251, + 7, 135, 71, 199, 39, 167, 103, 231, 23, 151, 87, 215, 55, 183, 119, 247, + 15, 143, 79, 207, 47, 175, 111, 239, 31, 159, 95, 223, 63, 191, 127, 255 + }; + + dev_proc_open_device(att3b1_open); + dev_proc_close_device(att3b1_close); + dev_proc_fill_rectangle(att3b1_fill_rectangle); + dev_proc_copy_mono(att3b1_copy_mono); + dev_proc_output_page(att3b1_output_page); + + private gx_device_procs att3b1_procs = { + att3b1_open, + gx_default_get_initial_matrix, + gx_default_sync_output, + att3b1_output_page, + att3b1_close, + gx_default_map_rgb_color, + gx_default_map_color_rgb, + att3b1_fill_rectangle, + gx_default_tile_rectangle, + att3b1_copy_mono, + gx_default_copy_color, + gx_default_draw_line, + gx_default_get_bits, + gx_default_get_props, + gx_default_put_props + }; + + gx_device_att3b1 gs_att3b1_device = { + sizeof(gx_device_att3b1), + &att3b1_procs, + "att3b1", + XSIZE, YSIZE, + XDPI, YDPI, + no_margins, + dci_black_and_white, + 0, + -1, 0, 0, /* fd, screen, line_size, */ + 0, 0, 0, 0, /* screen size width and height, page */ + #ifdef ATT3B1_PERF + 0, 0, 0, /* no_output, no_fill, no_copy */ + #endif + }; + + int + att3b1_open(gx_device *dev) + { + struct uwdata uw; + #ifdef ATT3B1_PERF + char *getenv(const char *); + #endif + + if (att3b1dev->fd >= 0) { + close(att3b1dev->fd); + att3b1dev->fd = -1; + } + + if (att3b1dev->screen != NULL) { + gs_free((char *)att3b1dev->screen, + att3b1dev->screen_size, 1, "att3b1_open"); + att3b1dev->screen = 0; + att3b1dev->screen_size = 0; + } + + att3b1dev->fd = open("/dev/tty", 2); + if (att3b1dev->fd < 0) { + lprintf1("att3b1_open: open /dev/tty failed [%d]\n", errno); + return_error(gs_error_ioerror); + } + + if (ioctl(att3b1dev->fd, WIOCGETD, &uw) < 0) { + lprintf1("att3b1_open: window WIOCGETD ioctl failed [%d]\n", errno); + att3b1_close(dev); + return_error(gs_error_ioerror); + } + + /* we need an even number of bytes per line */ + att3b1dev->line_size = ((att3b1dev->width + 15) / 16) * 2; + att3b1dev->screen_size = att3b1dev->line_size * att3b1dev->height; + + att3b1dev->screen = + (uchar *)gs_malloc(att3b1dev->screen_size, 1, "att3b1_open"); + if (att3b1dev->screen == NULL) { + att3b1_close(dev); + return_error(gs_error_VMerror); + } + + att3b1dev->screen_width = (uw.uw_width < att3b1dev->width) ? uw.uw_width + : att3b1dev->width; + att3b1dev->screen_height = (uw.uw_height < att3b1dev->width) ? uw.uw_height + : att3b1dev->height; + att3b1dev->page = 1; + + #ifdef ATT3B1_PERF + att3b1dev->no_output = getenv("GS_NOOUTPUT"); + att3b1dev->no_fill = getenv("GS_NOFILL"); + att3b1dev->no_copy = getenv("GS_NOCOPY"); + #endif + + return 0; + } + + int + att3b1_close(gx_device *dev) + { + if (att3b1dev->fd >= 0) { + close(att3b1dev->fd); + att3b1dev->fd = -1; + } + + if (att3b1dev->screen != NULL) { + gs_free((char *)att3b1dev->screen, + att3b1dev->screen_size, 1, "att3b1_close"); + att3b1dev->screen = 0; + att3b1dev->screen_size = 0; + } + + return 0; + } + + int + att3b1_fill_rectangle(gx_device *dev, int x, int y, int w, int h, + gx_color_index colour) + { + int o, b, wl, wr, w2; + ushort *p, *q, maskl, maskr; + + #ifdef ATT3B1_PERF + if (att3b1dev->no_fill) return 0; + #endif + + fit_fill(dev, x, y, w, h); + + p = (ushort *)&att3b1dev->screen[(ushort)y*att3b1dev->line_size] + x/16; + o = x % 16; + b = 16 - o; + wl = (w < b) ? w : b; + maskl = masks[wl] << o; + w -= wl; + wr = w % 16; + maskr = masks[wr]; + + if (colour == 0) { + maskl = ~maskl; + maskr = ~maskr; + while (h-- > 0) { + q = p; + w2 = w; + *q++ &= maskl; + while (w2 >= 16) { + *q++ = 0; + w2 -= 16; + } + *q &= maskr; + p += (att3b1dev->line_size / 2); + } + } + else { + while (h-- > 0) { + q = p; + w2 = w; + *q++ |= maskl; + while (w2 >= 16) { + *q++ = 0xffff; + w2 -= 16; + } + *q |= maskr; + p += (att3b1dev->line_size / 2); + } + } + + return 0; + } + + #ifdef __GNUC__ + #define rotate(value, count) \ + asm("ror%.l %2,%0" : "=d" (value) : "0" (value), "d" (count)) + #else + #define rotate(value, count) \ + value = (value >> count) | (value << (32-count)) + #endif + + int + att3b1_copy_mono(gx_device *dev, const uchar *data, + int data_x, int raster, gx_bitmap_id id, + int x, int y, int width, int height, + gx_color_index colour0, gx_color_index colour1) + { + const ushort *src_p, *src_q; + ushort *dst_p, *dst_q; + ulong bits, mask, *p; + int src_o, src_b, dst_o, dst_b, op; + int w1, w2; + + #ifdef ATT3B1_PERF + if (att3b1dev->no_copy) return 0; + #endif + + fit_copy(dev, data, data_x, raster, id, x, y, width, height); + if (colour1 == colour0) /* vacuous case */ + return att3b1_fill_rectangle(dev, x, y, width, height, colour0); + + /* + * In what follows, we're assuming that each row of the input bitmap + * is short-aligned, that is, that both "data" and "raster" are even. + */ + src_p = ((const ushort *)data) + data_x/16; + src_o = data_x % 16; + src_b = 16 - src_o; + + dst_p = (ushort *)&att3b1dev->screen[(ushort)y*att3b1dev->line_size] + x/16; + dst_o = x % 16; + dst_b = 16 - dst_o; + + op = (int)colour0 * 3 + (int)colour1 + 4; + + while (height-- > 0) { + w2 = width; + src_q = src_p; + dst_q = dst_p; + + while (w2 > 0) { + w1 = (w2 < 16) ? w2 : 16; + mask = masks[w1]; + /* + * We are assuming that the bitmap "data" is typically aligned. + * Thus the test for this special case is typically a win over + * a 16-bit shift. + */ + if (src_o == 0) + bits = *src_q++; + else { + bits = *((ulong *)src_q) >> src_b; + bits &= 0xffff; + src_q++; + } + if (w1 <= 8) + bits = reverse_bits[bits>>8]; + else + bits = (reverse_bits[bits&0xff] << 8) | reverse_bits[bits>>8]; + /* + * While the input bit map is assumed to be typically aligned, we + * assume that the place in the image is not. Thus we don't + * separate out the aligned case. Doing so would cost a test, + * and only reduce the average shift by about 1. + */ + p = (ulong *)dst_q; + switch(op) { + case 1: /* not src and dst */ + bits = ~(bits & mask); + rotate(bits,dst_b); + *p &= bits; + break; + case 2: /* src or dst */ + bits = bits & mask; + rotate(bits,dst_b); + *p |= bits; + break; + case 3: /* src and dst */ + bits = bits | ~mask; + rotate(bits,dst_b); + *p &= bits; + break; + case 5: /* src */ + rotate(bits,dst_b); + rotate(mask,dst_b); + *p = (*p & ~mask) | (bits & mask); + break; + case 6: /* not src or dst */ + bits = ~bits & mask; + rotate(bits,dst_b); + *p |= bits; + break; + case 7: /* not src */ + rotate(bits,dst_b); + rotate(mask,dst_b); + *p = (*p & ~mask) | (~bits & mask); + break; + } + dst_q++; + w2 -= w1; + } + + src_p += (raster / 2); + dst_p += (att3b1dev->line_size / 2); + } + + return 0; + } + + int + att3b1_output_page(gx_device *dev, int num_copies, int flush) + { + struct urdata ur; + struct utdata ut, ut_orig; + struct termio old, new; + int xorigin = 0; + int yorigin = 0; + int inverted = 0; + int ch; + ushort *p; + ushort save_image[WINWIDTH * WINHEIGHT / 16]; + static int getKeyboard(gx_device *); + + #ifdef ATT3B1_PERF + if (att3b1dev->no_output) return 0; + #endif + + /* + * save screen state + */ + + ioctl(att3b1dev->fd, TCGETA, &old); + new = old; + new.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL); + new.c_cc[VMIN] = 1; + ioctl(att3b1dev->fd, TCSETAF, &new); + + ut_orig.ut_num = WTXTSLK1; + ioctl(att3b1dev->fd, WIOCGETTEXT, &ut_orig); + + ur.ur_srcbase = 0; + ur.ur_srcwidth = 0; + ur.ur_srcx = 0; + ur.ur_srcy = 0; + ur.ur_dstbase = save_image; + ur.ur_dstwidth = WINWIDTH / 8; + ur.ur_dstx = 0; + ur.ur_dsty = 0; + ur.ur_width = att3b1dev->screen_width; + ur.ur_height = att3b1dev->screen_height; + ur.ur_srcop = SRCSRC; + ur.ur_dstop = DSTSRC; + ur.ur_pattern = 0; + ioctl(att3b1dev->fd, WIOCRASTOP, &ur); + + /* + * initialize + */ + + write(att3b1dev->fd, "\a\033[=1C", 6); + + ur.ur_srcbase = (ushort *)att3b1dev->screen; + ur.ur_srcwidth = att3b1dev->line_size; + ur.ur_dstbase = 0; + ur.ur_dstwidth = 0; + + /* + * allow one to move the screen window through the entire image + */ + + while (1) { + ur.ur_srcx = xorigin; + ur.ur_srcy = yorigin; + + if (ioctl(att3b1dev->fd, WIOCRASTOP, &ur) < 0) { + lprintf1( + "att3b1_output_page: window WIOCRASTOP ioctl failed [%d]\n", + errno); + return_error(gs_error_ioerror); + } + + ut.ut_num = WTXTSLK1; + sprintf(ut.ut_text, + "%s %d, top right (%d,%d), size (%d,%d), press when done.", + flush ? "Showpage" : "Copypage", att3b1dev->page, xorigin, yorigin, + att3b1dev->width, att3b1dev->height); + ioctl(att3b1dev->fd, WIOCSETTEXT, &ut); + + ch = getKeyboard(dev); + + switch(ch) { + case 'h': + xorigin -= att3b1dev->x_pixels_per_inch/4; + break; + + case 'k': + yorigin -= att3b1dev->y_pixels_per_inch/2; + break; + + case 'l': + xorigin += att3b1dev->x_pixels_per_inch/4; + break; + + case 'j': + yorigin += att3b1dev->y_pixels_per_inch/2; + break; + + case 'H': + xorigin = 0; + break; + + case 'K': + yorigin = 0; + break; + + case 'L': + xorigin = att3b1dev->width - att3b1dev->screen_width; + break; + + case 'J': + yorigin = att3b1dev->height - att3b1dev->screen_height; + break; + + case '\f': + case 'r' : + xorigin = 0; + yorigin = 0; + break; + + case 'I': + for (p = (ushort *)att3b1dev->screen; + p < (ushort *)&att3b1dev->screen[att3b1dev->screen_size]; ++p) + *p = ~ *p; + inverted = !inverted; + break; + + case 'q': + case 'x': + case '\003': /* control-C */ + case '\004': /* control-D */ + case 'n': + case 'f': + case ' ': + case '\n': + case '\r': + if (flush) + att3b1dev->page++; + else if (inverted) /* restore inverted image for copypage */ + for (p = (ushort *)att3b1dev->screen; + p < (ushort *)&att3b1dev->screen[att3b1dev->screen_size]; ++p) + *p = ~ *p; + ur.ur_srcbase = save_image; + ur.ur_srcwidth = WINWIDTH / 8; + ur.ur_srcx = 0; + ur.ur_srcy = 0; + ioctl(att3b1dev->fd, WIOCRASTOP, &ur); + ioctl(att3b1dev->fd, WIOCSETTEXT, &ut_orig); + ioctl(att3b1dev->fd, TCSETAF, &old); + write(att3b1dev->fd, "\033[=0C", 5); + return 0; + + case -1: + return_error(gs_error_ioerror); + } + + if (xorigin >= att3b1dev->width - att3b1dev->screen_width) + xorigin = att3b1dev->width - att3b1dev->screen_width; + if (xorigin < 0) + xorigin = 0; + if (yorigin >= att3b1dev->height - att3b1dev->screen_height) + yorigin = att3b1dev->height - att3b1dev->screen_height; + if (yorigin < 0) + yorigin = 0; + } + } + + static int + get_char(gx_device *dev) + { + char ch; + int count; + + count = read(att3b1dev->fd, &ch, 1); + if (count == 0) + return 'q'; + else if (count < 0) + return -1; + else + return ch; + } + + static int + getKeyboard(gx_device *dev) + { + char ch; + + ch = get_char(dev); + + if (ch != '\033') + return ch; + + /* + * If the char is escape, try and interpret escape sequences and return + * an equivalent single character. + */ + + switch (get_char(dev)) { + case '[': + switch(get_char(dev)) { + case 'A': /* up arrow */ + case 'T': /* shift up arrow */ + return 'k'; + case 'B': /* down arrow */ + case 'S': /* shift down arrow */ + return 'j'; + case 'C': /* right arrow */ + return 'l'; + case 'D': /* left arrow */ + return 'h'; + case 'H': /* home */ + return 'r'; + case 'U': /* page down */ + return 'J'; + case 'V': /* page up */ + return 'K'; + } + break; + case 'O': + switch(get_char(dev)) { + case 'k': /* exit */ + case 'K': /* shift exit */ + case 'w': /* cancl */ + case 'W': /* shift cancl */ + return 'q'; + } + break; + case 'N': + switch(get_char(dev)) { + case 'h': /* next */ + return 'f'; + case 'L': /* shift right arrow */ + return 'l'; + case 'K': /* shift left arrow */ + return 'h'; + } + break; + } + return '\0'; + } diff -rc2N gs25/gdevbgi.c gs251/gdevbgi.c *** gs25/gdevbgi.c Sat Aug 15 04:59:48 1992 --- gs251/gdevbgi.c Sun Sep 6 19:12:28 1992 *************** *** 62,66 **** }; #define bgi_dev ((gx_device_bgi *)dev) ! static gx_device_procs bgi_procs = { bgi_open, gx_default_get_initial_matrix, --- 62,66 ---- }; #define bgi_dev ((gx_device_bgi *)dev) ! private gx_device_procs bgi_procs = { bgi_open, gx_default_get_initial_matrix, diff -rc2N gs25/gdevbj10.c gs251/gdevbj10.c *** gs25/gdevbj10.c Tue Jul 21 05:35:12 1992 --- gs251/gdevbj10.c Sun Sep 6 19:17:48 1992 *************** *** 42,46 **** private int bj10e_print_page(gx_device_printer *pdev, FILE *prn_stream) ! { int line_size = gx_device_bytes_per_scan_line((gx_device *)pdev, 1); int xres = pdev->x_pixels_per_inch; int yres = pdev->y_pixels_per_inch; --- 42,46 ---- private int bj10e_print_page(gx_device_printer *pdev, FILE *prn_stream) ! { int line_size = gx_device_raster((gx_device *)pdev, 1); int xres = pdev->x_pixels_per_inch; int yres = pdev->y_pixels_per_inch; diff -rc2N gs25/gdevcdj.c gs251/gdevcdj.c *** gs25/gdevcdj.c Wed Aug 19 00:55:32 1992 --- gs251/gdevcdj.c Thu Sep 10 16:56:50 1992 *************** *** 229,235 **** * unit of transposition from pixels to planes in 24-bit mode; it's hardly * worth trying to save a few bytes by being less generous in other modes. */ ! int line_size = gdev_prn_bytes_per_scan_line(pdev); int line_size_words = (line_size + W - 1) / W; int plane_size = (line_size + 23) / 24; int buffer_size = plane_size * 24; int paper_size = gdev_pcl_paper_size((gx_device *)pdev); --- 229,236 ---- * unit of transposition from pixels to planes in 24-bit mode; it's hardly * worth trying to save a few bytes by being less generous in other modes. */ ! int line_size = gdev_prn_raster(pdev); int line_size_words = (line_size + W - 1) / W; int plane_size = (line_size + 23) / 24; + int plane_size_words = (plane_size + W - 1) / W; int buffer_size = plane_size * 24; int paper_size = gdev_pcl_paper_size((gx_device *)pdev); *************** *** 245,253 **** case DJ500C_COLOUR: plane_size *= 3; /* should really have divided by 8, not 24 */ ! storage_size_words = plane_size / W * (8 + 3 + 3 + 2); /* data, plane, prev_plane, out_data */ break; case DJ500C_COLOUR_FS: ! storage_size_words = plane_size / W * (24 * I + 24 + 3 + 3 + 2) + W_XTRA; /* errors, data, plane, prev_plane, out_data, XTRA */ shingling = 2; /* this is a maximum-quality mode */ --- 246,254 ---- case DJ500C_COLOUR: plane_size *= 3; /* should really have divided by 8, not 24 */ ! storage_size_words = plane_size_words * (8 + 3 + 3 + 2); /* data, plane, prev_plane, out_data */ break; case DJ500C_COLOUR_FS: ! storage_size_words = plane_size_words * (24 * I + 24 + 3 + 3 + 2) + W_XTRA; /* errors, data, plane, prev_plane, out_data, XTRA */ shingling = 2; /* this is a maximum-quality mode */ *************** *** 255,259 **** case DJ500C_MONO: plane_size *= 24; /* (ie. same as buffer size) */ ! storage_size_words = plane_size / W * (1 + 1 + 2); /* plane, prev_plane, out_data */ break; --- 256,260 ---- case DJ500C_MONO: plane_size *= 24; /* (ie. same as buffer size) */ ! storage_size_words = plane_size_words * (1 + 1 + 2); /* plane, prev_plane, out_data */ break; diff -rc2N gs25/gdevdjet.c gs251/gdevdjet.c *** gs25/gdevdjet.c Wed Aug 19 00:55:38 1992 --- gs251/gdevdjet.c Thu Sep 10 05:49:12 1992 *************** *** 52,57 **** * * Maximum printing width = 2400 dots = 8" ! * All Deskjets have 1/2" unprintable bottom margin * * Note that the margins defined just below here apply only to the DeskJet; * the paper size, width and height apply to the LaserJet as well. --- 52,62 ---- * * Maximum printing width = 2400 dots = 8" ! * Maximum recommended printing height = 3100 dots = 10 1/3" * + * All Deskjets have 1/2" unprintable bottom margin. + * The recommendation comes from the HP Software Developer's Guide for + * the DeskJet 500, DeskJet PLUS, and DeskJet printers, version C.01.00 + * of 12/1/90. + * * Note that the margins defined just below here apply only to the DeskJet; * the paper size, width and height apply to the LaserJet as well. *************** *** 59,64 **** /* Margins are left, bottom, right, top. */ ! #define DESKJET_MARGINS_LETTER 0.25, 0.40, 0.25, 0.40 ! #define DESKJET_MARGINS_A4 0.15, 0.40, 0.15, 0.05 #ifndef A4 --- 64,74 ---- /* Margins are left, bottom, right, top. */ ! /* DeskJet values from Jim Mayer mayer@wrc.xerox.com. */ ! #define DESKJET_MARGINS_LETTER 0.25, 0.597, 0.25, 0.07 ! #define DESKJET_MARGINS_A4 0.15, 0.597, 0.15, 0.07 ! /* Similar margins for the LaserJet, */ ! /* from Eddy Andrews eeandrew@pyr.swan.ac.uk. */ ! #define LASERJET_MARGINS_A4 0.25, 0.20, 0.25, 0.00 ! #define LASERJET_MARGINS_LETTER 0.35, 0.20, 0.35, 0.00 #ifndef A4 *************** *** 66,69 **** --- 76,80 ---- # define HEIGHT_10THS 110 # define DESKJET_MARGINS DESKJET_MARGINS_LETTER + # define LASERJET_MARGINS LASERJET_MARGINS_LETTER #else # define WIDTH_10THS 83 /* 210mm */ *************** *** 70,73 **** --- 81,85 ---- # define HEIGHT_10THS 117 /* 297mm */ # define DESKJET_MARGINS DESKJET_MARGINS_A4 + # define LASERJET_MARGINS LASERJET_MARGINS_A4 #endif *************** *** 166,169 **** --- 178,182 ---- hpjet_open(gx_device *pdev) { /* Change the margins if necessary. */ + const float _ds *m; #define ppdev ((gx_device_printer *)pdev) if ( ppdev->print_page == djet_print_page || *************** *** 173,184 **** { static const float m_a4[4] = { DESKJET_MARGINS_A4 }; static const float m_letter[4] = { DESKJET_MARGINS_LETTER }; ! const float _ds *m = ! (gdev_pcl_paper_size(pdev) == PAPER_SIZE_A4 ? m_a4 : ! m_letter); ! pdev->l_margin = m[0]; ! pdev->b_margin = m[1]; ! pdev->r_margin = m[2]; ! pdev->t_margin = m[3]; } return gdev_prn_open(pdev); } --- 186,202 ---- { static const float m_a4[4] = { DESKJET_MARGINS_A4 }; static const float m_letter[4] = { DESKJET_MARGINS_LETTER }; ! m = (gdev_pcl_paper_size(pdev) == PAPER_SIZE_A4 ? m_a4 : ! m_letter); ! } ! else /* LaserJet */ ! { static const float m_a4[4] = { LASERJET_MARGINS_A4 }; ! static const float m_letter[4] = { LASERJET_MARGINS_LETTER }; ! m = (gdev_pcl_paper_size(pdev) == PAPER_SIZE_A4 ? m_a4 : ! m_letter); } + pdev->l_margin = m[0]; + pdev->b_margin = m[1]; + pdev->r_margin = m[2]; + pdev->t_margin = m[3]; return gdev_prn_open(pdev); } *************** *** 240,246 **** int out_count; int compression = -1; ! static const char from2to3[] = "\033*rB\033*r1A\033*b3m"; int penalty_from2to3 = strlen(from2to3); ! static const char from3to2[] = "\033*rB\033*r1A\033*b2m"; int penalty_from3to2 = strlen(from3to2); int paper_size = gdev_pcl_paper_size((gx_device *)pdev); --- 258,264 ---- int out_count; int compression = -1; ! static const char *from2to3 = "\033*b3M"; int penalty_from2to3 = strlen(from2to3); ! static const char *from3to2 = "\033*b2M"; int penalty_from3to2 = strlen(from3to2); int paper_size = gdev_pcl_paper_size((gx_device *)pdev); *************** *** 302,309 **** /* Skip blank lines if any */ else if ( num_blank_lines != 0 ) ! { /* If we can do mode 3 compression, */ ! /* clear our record of the seed row. */ ! memset(prev_row, 0, line_size); ! if ( num_blank_lines < MIN_SKIP_LINES ) { /* Moving down from current position */ /* causes head motion on the DeskJet, so */ --- 320,324 ---- /* Skip blank lines if any */ else if ( num_blank_lines != 0 ) ! { if ( num_blank_lines < MIN_SKIP_LINES ) { /* Moving down from current position */ /* causes head motion on the DeskJet, so */ *************** *** 310,315 **** /* if the number of lines is small, */ /* we're better off printing blanks. */ ! /* Make sure we clear the seed row. */ ! fputs("\033*by0", prn_stream); for ( ; num_blank_lines > 1; num_blank_lines-- ) fputs("w", prn_stream); --- 325,335 ---- /* if the number of lines is small, */ /* we're better off printing blanks. */ ! if ( compression == 3 ) ! { /* Switch to mode 2 compression so */ ! /* we can zero the seed row. */ ! fputs(from3to2, prn_stream); ! compression == 2; ! } ! fputs("\033*b0", prn_stream); for ( ; num_blank_lines > 1; num_blank_lines-- ) fputs("w", prn_stream); *************** *** 317,322 **** } else ! { fprintf(prn_stream, "\033*b%dY", num_blank_lines); } } num_blank_lines = 0; --- 337,345 ---- } else ! { fprintf(prn_stream, "\033*p+%dY", ! num_blank_lines * y_dots_per_pixel); } + /* Either way, clear the seed row. */ + memset(prev_row, 0, line_size); } num_blank_lines = 0; *************** *** 335,341 **** int count2 = gdev_pcl_mode2compress(data_words, end_data, out_row_alt); - /* The switching penalty is quite large, */ - /* because PCL demands that we end raster */ - /* graphics and start it again.... */ int penalty3 = (compression == 3 ? 0 : penalty_from2to3); --- 358,361 ---- diff -rc2N gs25/gdevgif.c gs251/gdevgif.c *** gs25/gdevgif.c Tue Jul 21 05:38:32 1992 --- gs251/gdevgif.c Sun Sep 6 19:23:04 1992 *************** *** 330,334 **** private int gif_print_page(gx_device_printer *pdev, FILE *file) ! { int raster = gdev_prn_bytes_per_scan_line(pdev); int height = pdev->height; int depth = pdev->color_info.depth; --- 330,334 ---- private int gif_print_page(gx_device_printer *pdev, FILE *file) ! { int raster = gdev_prn_raster(pdev); int height = pdev->height; int depth = pdev->color_info.depth; diff -rc2N gs25/gdevmem.h gs251/gdevmem.h *** gs25/gdevmem.h Tue Mar 31 03:40:42 1992 --- gs251/gdevmem.h Thu Sep 10 17:12:46 1992 *************** *** 57,60 **** --- 57,61 ---- extern dev_proc_open_device(mem_open); extern dev_proc_get_initial_matrix(mem_get_initial_matrix); + extern dev_proc_close_device(mem_close); extern dev_proc_get_bits(mem_get_bits); #define mem_procs(map_rgb_color, map_color_rgb, copy_mono, copy_color, fill_rectangle)\ *************** *** 63,67 **** gx_default_sync_output,\ gx_default_output_page,\ ! gx_default_close_device,\ map_rgb_color, /* differs */\ map_color_rgb, /* differs */\ --- 64,68 ---- gx_default_sync_output,\ gx_default_output_page,\ ! mem_close,\ map_rgb_color, /* differs */\ map_color_rgb, /* differs */\ *************** *** 109,113 **** 0, /* initial bytes_le (filled in by mem_open) */\ 0, /* invert (filled in for mono) */\ ! 0, (byte *)0 /* palette (filled in for color) */\ } --- 110,115 ---- 0, /* initial bytes_le (filled in by mem_open) */\ 0, /* invert (filled in for mono) */\ ! 0, (byte *)0, /* palette (filled in for color) */\ ! { 0, 0 } /* alloc, free */\ } *************** *** 114,123 **** /* Macro for casting gx_device argument */ #define mdev ((gx_device_memory *)dev) - - /* Macro for rectangle arguments (x,y,w,h) */ - #define check_rect()\ - if ( w <= 0 || h <= 0 ) return 0;\ - if ( (x | y) < 0 || x > mdev->width - w || y > mdev->height - h )\ - return -1 /* --- 116,119 ---- diff -rc2N gs25/gdevmem1.c gs251/gdevmem1.c *** gs25/gdevmem1.c Wed Aug 12 18:20:46 1992 --- gs251/gdevmem1.c Thu Sep 10 17:14:08 1992 *************** *** 22,26 **** /* for Ghostscript library. */ #include "memory_.h" ! #include "gs.h" #include "gxdevice.h" #include "gxdevmem.h" /* semi-public definitions */ --- 22,27 ---- /* for Ghostscript library. */ #include "memory_.h" ! #include "gx.h" ! #include "gserrors.h" #include "gxdevice.h" #include "gxdevmem.h" /* semi-public definitions */ *************** *** 53,62 **** } - /* Compute the raster (bytes per scan line). */ - uint - gdev_mem_raster(const gx_device_memory *dev) - { return (((ulong)(dev->width) * dev->color_info.depth + 31) >> 5) << 2; - } - /* Compute the size of the bitmap storage, */ /* including the space for the scan line pointer table. */ --- 54,57 ---- *************** *** 67,77 **** } ! /* 'Open' the memory device and create the scan line table. */ int mem_open(gx_device *dev) ! { byte *scan_line = mdev->base; uint raster = mdev->raster = gdev_mem_raster((gx_device_memory *)dev); ! byte **pptr = (byte **)(scan_line + (uint)dev->height * raster); ! byte **pend = pptr + dev->height; mdev->line_ptrs = pptr; while ( pptr < pend ) --- 62,85 ---- } ! /* Open a memory device, allocating the data area if appropriate, */ ! /* and create the scan line table. */ int mem_open(gx_device *dev) ! { byte *scan_line; uint raster = mdev->raster = gdev_mem_raster((gx_device_memory *)dev); ! byte **pptr; ! byte **pend; ! if ( mdev->memory_procs.alloc != 0 ) ! { /* Allocate the data now. */ ! ulong size = gdev_mem_bitmap_size(mdev); ! if ( (uint)size != size ) ! return gs_error_limitcheck; ! mdev->base = (byte *)(*mdev->memory_procs.alloc)(1, (uint)size, "mem_open"); ! if ( mdev->base == 0 ) ! return gs_error_VMerror; ! } ! scan_line = mdev->base; ! pptr = (byte **)(scan_line + (uint)dev->height * raster); ! pend = pptr + dev->height; mdev->line_ptrs = pptr; while ( pptr < pend ) *************** *** 129,132 **** --- 137,149 ---- } + /* Close a memory device, freeing the data area if appropriate. */ + int + mem_close(gx_device *dev) + { if ( mdev->memory_procs.free != 0 ) + (*mdev->memory_procs.free)((char *)mdev->base, + 1, (uint)gdev_mem_bitmap_size(mdev), "mem_close"); + return 0; + } + /* Copy one or more scan lines to a client. */ #undef chunk *************** *** 134,139 **** int mem_get_bits(gx_device *dev, int y, byte *str, uint size, int pad_to_word) ! { uint bytes_per_line = ! gx_device_bytes_per_scan_line(dev, pad_to_word); byte *src = scan_line_base(mdev, y); byte *dest = str; --- 151,155 ---- int mem_get_bits(gx_device *dev, int y, byte *str, uint size, int pad_to_word) ! { uint bytes_per_line = gx_device_raster(dev, pad_to_word); byte *src = scan_line_base(mdev, y); byte *dest = str; *************** *** 197,201 **** byte fill; declare_scan_ptr(dest); ! check_rect(); setup_rect(dest); #define write_loop(stat)\ --- 213,217 ---- byte fill; declare_scan_ptr(dest); ! fit_fill(dev, x, y, w, h); setup_rect(dest); #define write_loop(stat)\ *************** *** 326,330 **** register int skew; register uint invert; ! check_rect(); #if gx_no_color_value != -1 /* hokey! */ if ( zero == gx_no_color_index ) zero = -1; --- 342,346 ---- register int skew; register uint invert; ! fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); #if gx_no_color_value != -1 /* hokey! */ if ( zero == gx_no_color_index ) zero = -1; diff -rc2N gs25/gdevmem2.c gs251/gdevmem2.c *** gs25/gdevmem2.c Thu Apr 30 00:31:54 1992 --- gs251/gdevmem2.c Thu Sep 10 17:17:36 1992 *************** *** 22,26 **** /* for Ghostscript library. */ #include "memory_.h" ! #include "gs.h" #include "gxdevice.h" #include "gxdevmem.h" /* semi-public definitions */ --- 22,26 ---- /* for Ghostscript library. */ #include "memory_.h" ! #include "gx.h" #include "gxdevice.h" #include "gxdevmem.h" /* semi-public definitions */ *************** *** 109,113 **** int x, int y, int w, int h, gx_color_index color) { declare_scan_ptr(dest); ! check_rect(); setup_rect(dest); while ( h-- > 0 ) --- 109,113 ---- int x, int y, int w, int h, gx_color_index color) { declare_scan_ptr(dest); ! fit_fill(dev, x, y, w, h); setup_rect(dest); while ( h-- > 0 ) *************** *** 126,130 **** int first_bit; declare_scan_ptr(dest); ! check_rect(); setup_rect(dest); line = base + (sourcex >> 3); --- 126,130 ---- int first_bit; declare_scan_ptr(dest); ! fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); setup_rect(dest); line = base + (sourcex >> 3); *************** *** 181,185 **** const byte *base, int sourcex, int sraster, gx_bitmap_id id, int x, int y, int w, int h) ! { check_rect(); return copy_byte_rect(mdev, base + x_to_byte(sourcex), sraster, x_to_byte(x), y, x_to_byte(w), h); --- 181,185 ---- const byte *base, int sourcex, int sraster, gx_bitmap_id id, int x, int y, int w, int h) ! { fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); return copy_byte_rect(mdev, base + x_to_byte(sourcex), sraster, x_to_byte(x), y, x_to_byte(w), h); *************** *** 234,238 **** int x, int y, int w, int h, gx_color_index color) { declare_scan_ptr(dest); ! check_rect(); setup_rect(dest); while ( h-- > 0 ) --- 234,238 ---- int x, int y, int w, int h, gx_color_index color) { declare_scan_ptr(dest); ! fit_fill(dev, x, y, w, h); setup_rect(dest); while ( h-- > 0 ) *************** *** 253,257 **** int first_bit; declare_scan_ptr(dest); ! check_rect(); setup_rect(dest); line = base + (sourcex >> 3); --- 253,257 ---- int first_bit; declare_scan_ptr(dest); ! fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); setup_rect(dest); line = base + (sourcex >> 3); *************** *** 288,292 **** const byte *base, int sourcex, int sraster, gx_bitmap_id id, int x, int y, int w, int h) ! { check_rect(); return copy_byte_rect(mdev, base + x_to_byte(sourcex), sraster, x_to_byte(x), y, x_to_byte(w), h); --- 288,292 ---- const byte *base, int sourcex, int sraster, gx_bitmap_id id, int x, int y, int w, int h) ! { fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); return copy_byte_rect(mdev, base + x_to_byte(sourcex), sraster, x_to_byte(x), y, x_to_byte(w), h); *************** *** 358,362 **** { declare_unpack_color(r, g, b, color); declare_scan_ptr(dest); ! check_rect(); setup_rect(dest); while ( h-- > 0 ) --- 358,362 ---- { declare_unpack_color(r, g, b, color); declare_scan_ptr(dest); ! fit_fill(dev, x, y, w, h); setup_rect(dest); while ( h-- > 0 ) *************** *** 379,383 **** declare_unpack_color(r1, g1, b1, one); declare_scan_ptr(dest); ! check_rect(); setup_rect(dest); line = base + (sourcex >> 3); --- 379,383 ---- declare_unpack_color(r1, g1, b1, one); declare_scan_ptr(dest); ! fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); setup_rect(dest); line = base + (sourcex >> 3); *************** *** 414,418 **** const byte *base, int sourcex, int sraster, gx_bitmap_id id, int x, int y, int w, int h) ! { check_rect(); return copy_byte_rect(mdev, base + x_to_byte(sourcex), sraster, x_to_byte(x), y, x_to_byte(w), h); --- 414,418 ---- const byte *base, int sourcex, int sraster, gx_bitmap_id id, int x, int y, int w, int h) ! { fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); return copy_byte_rect(mdev, base + x_to_byte(sourcex), sraster, x_to_byte(x), y, x_to_byte(w), h); *************** *** 450,454 **** { gx_color_index a_color = arrange_bytes(color); declare_scan_ptr(dest); ! check_rect(); setup_rect(dest); while ( h-- > 0 ) --- 450,454 ---- { gx_color_index a_color = arrange_bytes(color); declare_scan_ptr(dest); ! fit_fill(dev, x, y, w, h); setup_rect(dest); while ( h-- > 0 ) *************** *** 471,475 **** int first_bit; declare_scan_ptr(dest); ! check_rect(); setup_rect(dest); line = base + (sourcex >> 3); --- 471,475 ---- int first_bit; declare_scan_ptr(dest); ! fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); setup_rect(dest); line = base + (sourcex >> 3); *************** *** 506,510 **** const byte *base, int sourcex, int sraster, gx_bitmap_id id, int x, int y, int w, int h) ! { check_rect(); return copy_byte_rect(mdev, base + x_to_byte(sourcex), sraster, x_to_byte(x), y, x_to_byte(w), h); --- 506,510 ---- const byte *base, int sourcex, int sraster, gx_bitmap_id id, int x, int y, int w, int h) ! { fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); return copy_byte_rect(mdev, base + x_to_byte(sourcex), sraster, x_to_byte(x), y, x_to_byte(w), h); diff -rc2N gs25/gdevmem3.c gs251/gdevmem3.c *** gs25/gdevmem3.c Sat May 2 16:21:18 1992 --- gs251/gdevmem3.c Thu Sep 10 17:16:04 1992 *************** *** 22,26 **** /* for Ghostscript library. */ #include "memory_.h" ! #include "gs.h" #include "gxdevice.h" #include "gxdevmem.h" /* semi-public definitions */ --- 22,26 ---- /* for Ghostscript library. */ #include "memory_.h" ! #include "gx.h" #include "gxdevice.h" #include "gxdevmem.h" /* semi-public definitions */ *************** *** 77,81 **** int x, int y, int w, int h, gx_color_index color) { int code; ! check_rect(); /* Patch the width in the device temporarily. */ dev->width <<= 1; --- 77,81 ---- int x, int y, int w, int h, gx_color_index color) { int code; ! fit_fill(dev, x, y, w, h); /* Patch the width in the device temporarily. */ dev->width <<= 1; *************** *** 109,113 **** static byte bmask[4] = { 0xc0, 0x30, 0xc, 3 }; declare_scan_ptr(dest); ! check_rect(); setup_rect(dest); line = base + (sourcex >> 3); --- 109,113 ---- static byte bmask[4] = { 0xc0, 0x30, 0xc, 3 }; declare_scan_ptr(dest); ! fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); setup_rect(dest); line = base + (sourcex >> 3); *************** *** 150,154 **** int x, int y, int w, int h) { int code; ! check_rect(); /* Use monobit copy_mono. */ /* Patch the width in the device temporarily. */ --- 150,154 ---- int x, int y, int w, int h) { int code; ! fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); /* Use monobit copy_mono. */ /* Patch the width in the device temporarily. */ *************** *** 185,189 **** int x, int y, int w, int h, gx_color_index color) { int code; ! check_rect(); /* Patch the width in the device temporarily. */ dev->width <<= 2; --- 185,189 ---- int x, int y, int w, int h, gx_color_index color) { int code; ! fit_fill(dev, x, y, w, h); /* Patch the width in the device temporarily. */ dev->width <<= 2; *************** *** 217,221 **** byte first_mask, b0, b1; declare_scan_ptr(dest); ! check_rect(); setup_rect(dest); line = base + (sourcex >> 3); --- 217,221 ---- byte first_mask, b0, b1; declare_scan_ptr(dest); ! fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); setup_rect(dest); line = base + (sourcex >> 3); *************** *** 258,262 **** int x, int y, int w, int h) { int code; ! check_rect(); /* Use monobit copy_mono. */ /* Patch the width in the device temporarily. */ --- 258,262 ---- int x, int y, int w, int h) { int code; ! fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); /* Use monobit copy_mono. */ /* Patch the width in the device temporarily. */ diff -rc2N gs25/gdevmswn.c gs251/gdevmswn.c *** gs25/gdevmswn.c Sat Aug 15 04:28:50 1992 --- gs251/gdevmswn.c Thu Sep 10 18:10:50 1992 *************** *** 47,57 **** /* Forward references */ ! private LPLOGPALETTE win_makepalette(P1(gx_device_win *)); ! private void win_makeimg(P1(gx_device_win *)); ! private void win_addtool(P2(gx_device_win *, int)); ! private void win_maketools(P2(gx_device_win *, HDC)); ! private void win_destroytools(P1(gx_device_win *)); ! private void win_nomemory(); ! private void win_update(P2(gx_device_win *, int)); private const char FAR imgname[] = "Ghostscript Image"; --- 47,57 ---- /* Forward references */ ! private LPLOGPALETTE near win_makepalette(P1(gx_device_win *)); ! private void near win_makeimg(P1(gx_device_win *)); ! private void near win_addtool(P2(gx_device_win *, int)); ! private void near win_maketools(P2(gx_device_win *, HDC)); ! private void near win_destroytools(P1(gx_device_win *)); ! private void near win_nomemory(); ! private void near win_update(P2(gx_device_win *, int)); private const char FAR imgname[] = "Ghostscript Image"; *************** *** 110,114 **** }; #define wdev ((gx_device_win *)dev) ! static gx_device_procs win_procs = { win_open, gx_default_get_initial_matrix, --- 110,114 ---- }; #define wdev ((gx_device_win *)dev) ! private gx_device_procs win_procs = { win_open, gx_default_get_initial_matrix, *************** *** 144,147 **** --- 144,148 ---- { HDC hdc; int i; + int depth; win_makeimg(wdev); *************** *** 159,164 **** /* Find out if the device supports color */ /* We recognize 2, 16 or 256 color devices */ ! wdev->nColors = 1 << (GetDeviceCaps(hdc,PLANES) * GetDeviceCaps(hdc,BITSPIXEL)); ! if ( wdev->nColors >= 256 ) { /* use 64 static colors and 166 dynamic colors from 8 planes */ static const gx_device_color_info win_256color = dci_color(8,31,4); dev->color_info = win_256color; --- 160,165 ---- /* Find out if the device supports color */ /* We recognize 2, 16 or 256 color devices */ ! depth = GetDeviceCaps(hdc,PLANES) * GetDeviceCaps(hdc,BITSPIXEL); ! if ( depth >= 8 ) { /* use 64 static colors and 166 dynamic colors from 8 planes */ static const gx_device_color_info win_256color = dci_color(8,31,4); dev->color_info = win_256color; *************** *** 165,169 **** wdev->nColors = 64; } ! else if ( wdev->nColors >= 16 ) { static const gx_device_color_info win_16color = dci_color(4, 2, 3); dev->color_info = win_16color; --- 166,170 ---- wdev->nColors = 64; } ! else if ( depth >= 4 ) { static const gx_device_color_info win_16color = dci_color(4, 2, 3); dev->color_info = win_16color; *************** *** 402,409 **** gx_color_index color) { ! if ( w > 0 && h > 0 ) { fill_rect(x, y, w, h, color); - win_update(wdev, h); } return 0; --- 403,410 ---- gx_color_index color) { ! fit_fill(dev, x, y, w, h); { fill_rect(x, y, w, h, color); } + win_update(wdev, h); return 0; *************** *** 418,422 **** int x, int y, int w, int h, gx_color_index czero, gx_color_index cone, int px, int py) ! { if ( w <= 0 || h <= 0 ) return 0; if ( czero != gx_no_color_index && cone != gx_no_color_index ) { fill_rect(x, y, w, h, czero); --- 419,423 ---- int x, int y, int w, int h, gx_color_index czero, gx_color_index cone, int px, int py) ! { fit_fill(dev, x, y, w, h); if ( czero != gx_no_color_index && cone != gx_no_color_index ) { fill_rect(x, y, w, h, czero); *************** *** 512,515 **** --- 513,518 ---- BYTE *aptr = aBit; + fit_copy(dev, base, sourcex, raster, id, x, y, w, h); + if ( sourcex & ~7 ) { base += sourcex >> 3; *************** *** 600,604 **** const byte *base, int sourcex, int raster, gx_bitmap_id id, int x, int y, int w, int h) ! { if ( gx_device_has_color(dev) ) { switch(dev->color_info.depth) { --- 603,610 ---- const byte *base, int sourcex, int raster, gx_bitmap_id id, int x, int y, int w, int h) ! { ! fit_copy(dev, base, sourcex, raster, id, x, y, w, h); ! ! if ( gx_device_has_color(dev) ) { switch(dev->color_info.depth) { *************** *** 670,674 **** /* make image window */ ! private void win_makeimg(gx_device_win *wdev) { HMENU sysmenu; --- 676,680 ---- /* make image window */ ! private void near win_makeimg(gx_device_win *wdev) { HMENU sysmenu; *************** *** 686,690 **** /* out of memory error exit with message box */ ! private void win_nomemory() { --- 692,696 ---- /* out of memory error exit with message box */ ! private void near win_nomemory() { *************** *** 694,698 **** ! private LPLOGPALETTE win_makepalette(gx_device_win *wdev) { int i, val; --- 700,704 ---- ! private LPLOGPALETTE near win_makepalette(gx_device_win *wdev) { int i, val; *************** *** 734,738 **** ! private void win_addtool(gx_device_win *wdev, int i) { --- 740,744 ---- ! private void near win_addtool(gx_device_win *wdev, int i) { *************** *** 742,746 **** ! private void win_maketools(gx_device_win *wdev, HDC hdc) { int i; --- 748,752 ---- ! private void near win_maketools(gx_device_win *wdev, HDC hdc) { int i; *************** *** 760,764 **** ! private void win_destroytools(gx_device_win *wdev) { int i; --- 766,770 ---- ! private void near win_destroytools(gx_device_win *wdev) { int i; *************** *** 772,776 **** ! private void win_update(gx_device_win *wdev, int amount) { /* Update the image screen every 5 seconds, */ --- 778,782 ---- ! private void near win_update(gx_device_win *wdev, int amount) { /* Update the image screen every 5 seconds, */ diff -rc2N gs25/gdevnp6.c gs251/gdevnp6.c *** gs25/gdevnp6.c --- gs251/gdevnp6.c Thu Sep 3 07:12:34 1992 *************** *** 0 **** --- 1,230 ---- + /* Copyright (C) 1989, 1990, 1991, 1992 Aladdin Enterprises. All rights reserved. + Distributed by Free Software Foundation, Inc. + + This file is part of Ghostscript. + + Ghostscript is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY. No author or distributor accepts responsibility + to anyone for the consequences of using it or for whether it serves any + particular purpose or works at all, unless he says so in writing. Refer + to the Ghostscript General Public License for full details. + + Everyone is granted permission to copy, modify and redistribute + Ghostscript, but only under the conditions described in the Ghostscript + General Public License. A copy of this license is supposed to have been + given to you along with Ghostscript so you can know your rights and + responsibilities. It should be in a file named COPYING. Among other + things, the copyright notice and this notice must be preserved on all + copies. */ + + /* gdevnp6.c */ + /* NEC p6+ dot-matrix printer driver for Ghostscript */ + #include "gdevprn.h" + /************************************************ + * This driver is only for the (360 * 360) dpi resolution. + * For all other resolutions of the NEC p6+ use the epson-driver. + * I do not know if this driver works correctly on a NEC p6 or a p60. + * Report me if it works even on a p6 and a p60, please. Also send me + * bug reports. + * Most of the code is from the epson-driver. I just changed it a little bit + * to print 360 dpi vertical. Also I deleted the 9-pin printer code that is + * of no use here. + * Marcus Haebler, 10.08.92 + * email: haebler@dmswwu1a.uni-muenster.de + ************************************************/ + + #ifndef X_DPI + # define X_DPI 360 /* pixels per inch */ + #endif + #ifndef Y_DPI + # define Y_DPI 360 /* pixels per inch */ + #endif + + /* The device descriptors */ + private dev_proc_print_page (necp6_print_page); + gx_device_printer gs_necp6_device = + prn_device (prn_std_procs, "necp6", + 85, /* width_10ths, 8.5" */ + 110, /* height_10ths, 11" */ + X_DPI, Y_DPI, + 0, 0, 0.5, 0, /* margins */ + 1, necp6_print_page); + + /* ------ Internal routines ------ */ + + /* Forward references */ + private void necp6_output_run (P4 (byte *, int, FILE *, int)); + + /* Send the page to the printer. */ + private int + necp6_print_page (gx_device_printer * pdev, FILE * prn_stream) + { + int line_size = gdev_mem_bytes_per_scan_line ((gx_device *) pdev); + int in_size = line_size * 24; /* we need 24 lines */ + byte *in = (byte *) gs_malloc (in_size, 1, "necp6_print_page(in)"); + int out_size = ((pdev->width + 7) & -8) * 3; + byte *out = (byte *) gs_malloc (out_size, 1, "necp6_print_page(out)"); + int skip = 0, lnum = 0, pass; + + /* Check allocations */ + if (in == 0 || out == 0) + { + if (in) + gs_free ((char *) in, in_size, 1, "necp6_print_page(in)"); + if (out) + gs_free ((char *) out, out_size, 1, "necp6_print_page(out)"); + return -1; + } + + /* Initialize the printer and reset the margins. */ + fwrite ("\033@\033P\033l\000\r\033Q", 1, 10, prn_stream); + fputc ((int) (pdev->width / pdev->x_pixels_per_inch * 10) + 2, + prn_stream); + + /* Print lines of graphics */ + while (lnum < pdev->height) + { + byte *inp = in; + byte *in_end = in + line_size; + byte *out_end = out; + byte *out_blk; + register byte *outp; + int lcnt, lcnt2, offset_; + + /* Copy 1 scan line and test for all zero. */ + gdev_prn_copy_scan_lines (pdev, lnum, in, line_size); + if (in[0] == 0 && + !memcmp ((char *) in, (char *) in + 1, line_size - 1) + ) + { + lnum++; + skip++; + continue; + } + + /* Vertical tab to the appropriate position. */ + while (skip > 255) + { + fprintf (prn_stream, "\0343\377\012"); + skip -= 255; + } + if (skip) + fprintf (prn_stream, "\0343%c\012", skip); + + /* Copy the rest of the scan lines. */ + for (offset_ = 0; offset_ <= 1; offset_++) + { + lcnt = 1; + for (lcnt2 = offset_; lcnt2 <= 45; lcnt2 += 2) + lcnt += gdev_prn_copy_scan_lines (pdev, lnum + 2 + lcnt2, + in + line_size * (lcnt2 / 2 + 1), + line_size); + if (lcnt < 24) + memset (in + lcnt * line_size, 0, + in_size - lcnt * line_size); + + /* We have to 'transpose' blocks of 8 pixels x 8 lines, */ + /* because that's how the printer wants the data. */ + /* And because we are in a 24-pin mode, we have to */ + /* transpose groups of 3 lines at a time. */ + + for (; inp < in_end; inp++, out_end += 24) + { + gdev_prn_transpose_8x8 (inp, line_size, out_end, 3); + gdev_prn_transpose_8x8 (inp + line_size * 8, line_size, out_end + 1, 3); + gdev_prn_transpose_8x8 (inp + line_size * 16, line_size, out_end + 2, 3); + } + /* Remove trailing 0s. */ + while (out_end > out && out_end[-1] == 0 && + out_end[-2] == 0 && out_end[-3] == 0 + ) + out_end -= 3; + + for (pass = 1; pass <= 2; pass++) + { + for (out_blk = outp = out; outp < out_end;) + { /* Skip a run of leading 0s. */ + /* At least 10 are needed to make tabbing worth it. */ + /* We do everything by 3's because we have 24 pins */ + + if (*outp == 0 && outp + 12 <= out_end && + outp[1] == 0 && outp[2] == 0 && + (outp[3] | outp[4] | outp[5]) == 0 && + (outp[6] | outp[7] | outp[8]) == 0 && + (outp[9] | outp[10] | outp[11]) == 0 + ) + { + byte *zp = outp; + int tpos; + byte *newp; + outp += 12; + while (outp + 3 <= out_end && *outp == 0 && + outp[1] == 0 && outp[2] == 0 + ) + outp += 3; + tpos = (outp - out) / 108; + newp = out + tpos * 108; + if (newp > zp + 10) + { /* Output preceding bit data. */ + if (zp > out_blk) /* only false at */ + /* beginning of line */ + necp6_output_run (out_blk, (int) (zp - out_blk), + prn_stream, pass); + /* Tab over to the appropriate position. */ + fprintf (prn_stream, "\033D%c%c\t", tpos, 0); + out_blk = outp = newp; + } + } + else + outp += 3; + } + if (outp > out_blk) + necp6_output_run (out_blk, (int) (outp - out_blk), + prn_stream, pass); + + fputc ('\r', prn_stream); + } + if (offset_ == 0) + { + fprintf (prn_stream, "\0343\001\012"); /* 1/360 inch */ + gdev_prn_copy_scan_lines (pdev, (1 + lnum), in, line_size); + memset (in + line_size, 0, in_size - line_size); + inp = in; + in_end = in + line_size; + out_end = out; + } + } + skip = 47; + lnum += 48; + } + + /* Eject the page and reinitialize the printer */ + fputs ("\f\033@", prn_stream); + fflush (prn_stream); + + gs_free ((char *) out, out_size, 1, "necp6_print_page(out)"); + gs_free ((char *) in, in_size, 1, "necp6_print_page(in)"); + return 0; + } + + /* Output a single graphics command. */ + /* pass=0 for all columns, 1 for even columns, 2 for odd columns. */ + private void + necp6_output_run (byte * data, int count, FILE * prn_stream, int pass) + { + int xcount = count / 3; + fprintf (prn_stream, "\033*\050%c%c", xcount & 0xff, xcount >> 8); + if (!pass) + fwrite (data, 1, count, prn_stream); + else + { /* Only write every other column of 3 bytes. */ + int which = pass; + byte *dp = data; + register int i, j; + for (i = 0; i < xcount; i++, which++) + for (j = 0; j < 3; j++, dp++) + { + putc (((which & 1) ? *dp : 0), prn_stream); + } + } + } diff -rc2N gs25/gdevpbm.c gs251/gdevpbm.c *** gs25/gdevpbm.c Wed Jun 24 16:55:42 1992 --- gs251/gdevpbm.c Sun Sep 6 19:22:40 1992 *************** *** 177,182 **** private int pbm_begin_page(gx_device_pbm *bdev, FILE *pstream, pbm_cursor _ss *pcur) ! { uint line_size = ! gdev_prn_bytes_per_scan_line((gx_device_printer *)bdev); byte *data = (byte *)gs_malloc(line_size, 1, "pbm_begin_page"); if ( data == 0 ) --- 177,181 ---- private int pbm_begin_page(gx_device_pbm *bdev, FILE *pstream, pbm_cursor _ss *pcur) ! { uint line_size = gdev_prn_raster((gx_device_printer *)bdev); byte *data = (byte *)gs_malloc(line_size, 1, "pbm_begin_page"); if ( data == 0 ) diff -rc2N gs25/gdevpcfb.c gs251/gdevpcfb.c *** gs25/gdevpcfb.c Sat Aug 15 09:11:08 1992 --- gs251/gdevpcfb.c Thu Sep 10 17:23:24 1992 *************** *** 321,332 **** { case 0x10: /* EGA */ ! gx_device_adjust_resolution(dev, 640, 350); break; case 0x12: /* VGA */ ! gx_device_adjust_resolution(dev, 640, 480); break; case 0x5b: /* Trident */ case 0x29: /* Tseng */ ! gx_device_adjust_resolution(dev, 800, 600); break; case 0x37: /* EIZO */ ! gx_device_adjust_resolution(dev, 1024, 768); break; } if ( ega_save_mode < 0 ) ega_save_mode = ega_get_mode(); --- 321,332 ---- { case 0x10: /* EGA */ ! gx_device_adjust_resolution(dev, 640, 350, 1); break; case 0x12: /* VGA */ ! gx_device_adjust_resolution(dev, 640, 480, 1); break; case 0x5b: /* Trident */ case 0x29: /* Tseng */ ! gx_device_adjust_resolution(dev, 800, 600, 1); break; case 0x37: /* EIZO */ ! gx_device_adjust_resolution(dev, 1024, 768, 1); break; } if ( ega_save_mode < 0 ) ega_save_mode = ega_get_mode(); *************** *** 361,365 **** fb_ptr save_dest; int other_color = -1; ! validate_rect(); while ( h > fb_dev->max_rop_height ) { unsigned mrh = fb_dev->max_rop_height; --- 361,365 ---- fb_ptr save_dest; int other_color = -1; ! fit_copy(dev, base, sourcex, raster, id, x, y, w, h); while ( h > fb_dev->max_rop_height ) { unsigned mrh = fb_dev->max_rop_height; *************** *** 571,575 **** int ex = w + bitx; fb_ptr fbline; ! validate_rect(); while ( h > fb_dev->max_rop_height ) { unsigned mrh = fb_dev->max_rop_height; --- 571,575 ---- int ex = w + bitx; fb_ptr fbline; ! fit_copy(dev, base, sourcex, raster, id, x, y, w, h); while ( h > fb_dev->max_rop_height ) { unsigned mrh = fb_dev->max_rop_height; *************** *** 614,618 **** gx_color_index color) { rop_params params; ! validate_rect(); while ( h > fb_dev->max_rop_height ) { unsigned mrh = fb_dev->max_rop_height; --- 614,618 ---- gx_color_index color) { rop_params params; ! fit_fill(dev, x, y, w, h); while ( h > fb_dev->max_rop_height ) { unsigned mrh = fb_dev->max_rop_height; *************** *** 654,657 **** --- 654,658 ---- int const_bits, maps; int ymod, yleft; + fit_fill(dev, x, y, w, h); while ( h > fb_dev->max_rop_height ) { int mod_height = *************** *** 668,672 **** czero, cone, px, py); /* Following is similar to aligned case of copy_mono */ - validate_rect(); params.dest = mk_fb_ptr(x, y); params.draster = fb_dev->raster; --- 669,672 ---- diff -rc2N gs25/gdevpcfb.h gs251/gdevpcfb.h *** gs25/gdevpcfb.h Sat Jul 25 03:27:22 1992 --- gs251/gdevpcfb.h Thu Sep 10 17:22:14 1992 *************** *** 132,139 **** #define out_g_mask(mask) outportb(graph_addr+1, mask) #define regen 0xa000 - - /* Macro for validating rectangle parameters x, y, w, h */ - #define validate_rect()\ - if ( w <= 0 || h <= 0 ) return 0;\ - if ( x < 0 || y < 0 || x + w > dev->width || y + h > dev->height )\ - return_error(gs_error_rangecheck) --- 132,133 ---- diff -rc2N gs25/gdevpcx.c gs251/gdevpcx.c *** gs25/gdevpcx.c Tue Jul 21 05:39:24 1992 --- gs251/gdevpcx.c Sun Sep 6 19:22:08 1992 *************** *** 179,183 **** pcx_write_page(gx_device_printer *pdev, FILE *file, pcx_header _ss *phdr, int planar) ! { int raster = gdev_prn_bytes_per_scan_line(pdev); int height = pdev->height; int depth = pdev->color_info.depth; --- 179,183 ---- pcx_write_page(gx_device_printer *pdev, FILE *file, pcx_header _ss *phdr, int planar) ! { int raster = gdev_prn_raster(pdev); int height = pdev->height; int depth = pdev->color_info.depth; diff -rc2N gs25/gdevpe.c gs251/gdevpe.c *** gs25/gdevpe.c Thu Jun 4 16:04:04 1992 --- gs251/gdevpe.c Sun Sep 6 19:12:18 1992 *************** *** 51,55 **** dev_proc_copy_mono(pe_copy_mono); ! static gx_device_procs pe_procs = { pe_open, gx_default_get_initial_matrix, --- 51,55 ---- dev_proc_copy_mono(pe_copy_mono); ! private gx_device_procs pe_procs = { pe_open, gx_default_get_initial_matrix, diff -rc2N gs25/gdevprn.c gs251/gdevprn.c *** gs25/gdevprn.c Sat Aug 15 05:38:08 1992 --- gs251/gdevprn.c Thu Sep 10 15:27:10 1992 *************** *** 59,63 **** gx_device_procs *pprocs = pdev->procs; ulong mem_space; ! byte *base; if ( mdev == 0 ) return_error(gs_error_rangecheck); --- 59,64 ---- gx_device_procs *pprocs = pdev->procs; ulong mem_space; ! byte *base = 0; ! char *left = 0; if ( mdev == 0 ) return_error(gs_error_rangecheck); *************** *** 69,84 **** if ( mem_space >= ppdev->max_bitmap || mem_space != (uint)mem_space || /* too big to allocate */ ! (base = (byte *)gs_malloc((uint)mem_space, 1, "printer buffer")) == 0 /* can't allocate */ ) ! { /* Buffer the image in a command list. */ uint space; int code; for ( space = ppdev->use_buffer_space; ; ) ! { base = (byte *)gs_malloc(space, 1, ! "command list buffer"); if ( base != 0 ) break; if ( (space >>= 1) < PRN_MIN_BUFFER_SPACE ) return_error(gs_error_VMerror); /* no hope */ ! } open_c: pcldev->data = base; pcldev->data_size = space; --- 70,91 ---- if ( mem_space >= ppdev->max_bitmap || mem_space != (uint)mem_space || /* too big to allocate */ ! (base = (byte *)gs_malloc((uint)mem_space, 1, "printer buffer(open)")) == 0 || /* can't allocate */ ! (PRN_MIN_MEMORY_LEFT != 0 && ! (left = gs_malloc(PRN_MIN_MEMORY_LEFT, 1, "printer memory left")) == 0) /* not enough left */ ) ! { /* Buffer the image in a command list. */ uint space; int code; + /* Release the buffer if we allocated it. */ + if ( base != 0 ) + gs_free((char *)base, (uint)mem_space, 1, + "printer buffer(open)"); for ( space = ppdev->use_buffer_space; ; ) ! { base = (byte *)gs_malloc(space, 1, ! "command list buffer(open)"); if ( base != 0 ) break; if ( (space >>= 1) < PRN_MIN_BUFFER_SPACE ) return_error(gs_error_VMerror); /* no hope */ ! } open_c: pcldev->data = base; pcldev->data_size = space; *************** *** 89,93 **** /* Try opening the command list, to see if we allocated */ /* enough buffer space. */ ! code = (*gs_clist_device.procs->open_device)((gx_device *)pcldev); if ( code < 0 ) { /* If there wasn't enough room, and we haven't */ --- 96,100 ---- /* Try opening the command list, to see if we allocated */ /* enough buffer space. */ ! code = (*gs_clist_device_procs.open_device)((gx_device *)pcldev); if ( code < 0 ) { /* If there wasn't enough room, and we haven't */ *************** *** 97,104 **** ) { gs_free((char *)base, space, 1, ! "command list buffer"); space <<= 1; base = (byte *)gs_malloc(space, 1, ! "command list buffer"); ppdev->buf = base; if ( base != 0 ) goto open_c; --- 104,111 ---- ) { gs_free((char *)base, space, 1, ! "command list buffer(retry open)"); space <<= 1; base = (byte *)gs_malloc(space, 1, ! "command list buffer(retry open)"); ppdev->buf = base; if ( base != 0 ) goto open_c; *************** *** 113,120 **** pcldev->bfile = ppdev->cbfile; pcldev->bfile_end_pos = 0; ! ppdev->mod_procs = *gs_clist_device.procs; ! } else ! { /* Render entirely in memory. */ ppdev->buffer_space = 0; ppdev->ccfile = NULL; --- 120,130 ---- pcldev->bfile = ppdev->cbfile; pcldev->bfile_end_pos = 0; ! ppdev->mod_procs = gs_clist_device_procs; ! } else ! { /* Render entirely in memory. */ ! /* Release the leftover memory. */ ! gs_free(left, PRN_MIN_MEMORY_LEFT, 1, ! "printer memory left"); ppdev->buffer_space = 0; ppdev->ccfile = NULL; *************** *** 122,126 **** pmemdev->base = base; ppdev->mod_procs = *mdev->procs; ! } /* Synthesize the procedure vector. */ /* Rendering operations come from the memory or clist device, */ --- 132,136 ---- pmemdev->base = base; ppdev->mod_procs = *mdev->procs; ! } /* Synthesize the procedure vector. */ /* Rendering operations come from the memory or clist device, */ *************** *** 142,148 **** private const gs_prop_item props_prn[] = { prop_def("BufferSpace", prt_int), prop_def("MaxBitmap", prt_int), ! prop_def("OutputFile", prt_string) }; --- 152,161 ---- private const gs_prop_item props_prn[] = { + /* Read-write properties. */ prop_def("BufferSpace", prt_int), prop_def("MaxBitmap", prt_int), ! prop_def("OutputFile", prt_string), ! /* Read-only properties. */ ! prop_def("PageCount", prt_int) }; *************** *** 159,162 **** --- 172,176 ---- pi[2].value.a.p.s = ppdev->fname; pi[2].value.a.size = -1; + pi[3].value.i = ppdev->page_count; } return start + sizeof(props_prn) / sizeof(gs_prop_item); *************** *** 164,167 **** --- 178,182 ---- /* Put properties. */ + /* Note that setting the buffer sizes closes the device. */ int gdev_prn_put_props(gx_device *pdev, gs_prop_item *plist, int count) *************** *** 177,181 **** code = gs_error_rangecheck; else ! ppdev->use_buffer_space = known[0]->value.i; } if ( known[1] != 0 ) --- 192,198 ---- code = gs_error_rangecheck; else ! { ppdev->use_buffer_space = known[0]->value.i; ! if ( code == 0 ) code = 1; ! } } if ( known[1] != 0 ) *************** *** 194,199 **** --- 211,225 ---- memcpy(ppdev->fname, pn->value.a.p.s, size); ppdev->fname[size] = 0; + if ( code == 0 ) code = 1; } } + if ( code < 0 ) + return_error(code); + /* If we're changing the buffer sizes, close the device; */ + /* gs_putdeviceprops will reopen it. */ + if ( pdev->is_open && code ) + { int ccode = gs_closedevice(pdev); + if ( ccode < 0 ) return ccode; + } return code; } *************** *** 217,221 **** if ( ppdev->buffer_space ) /* reinitialize clist for writing */ ! code = (*gs_clist_device.procs->output_page)(pdev, num_copies, flush); return code; --- 243,247 ---- if ( ppdev->buffer_space ) /* reinitialize clist for writing */ ! code = (*gs_clist_device_procs.output_page)(pdev, num_copies, flush); return code; *************** *** 236,240 **** { /* Free the buffer */ gs_free((char *)ppdev->buf, (uint)ppdev->buffer_space, 1, ! "command list buffer"); } else --- 262,266 ---- { /* Free the buffer */ gs_free((char *)ppdev->buf, (uint)ppdev->buffer_space, 1, ! "command list buffer(close)"); } else *************** *** 241,245 **** { /* Free the memory device bitmap */ gs_free(pmemdev->base, (uint)gdev_mem_bitmap_size(pmemdev), ! 1, "printer buffer"); } if ( ppdev->file != NULL ) --- 267,271 ---- { /* Free the memory device bitmap */ gs_free(pmemdev->base, (uint)gdev_mem_bitmap_size(pmemdev), ! 1, "printer buffer(close)"); } if ( ppdev->file != NULL ) *************** *** 296,301 **** /* Get the size of a scan line for copying. */ uint ! gdev_prn_bytes_per_scan_line(gx_device_printer *pdev) ! { return gx_device_bytes_per_scan_line((gx_device *)pdev, 0); } --- 322,327 ---- /* Get the size of a scan line for copying. */ uint ! gdev_prn_raster(gx_device_printer *pdev) ! { return gx_device_raster((gx_device *)pdev, 0); } *************** *** 304,308 **** gdev_prn_get_bits(gx_device_printer *pdev, int y, byte *str, uint size, int pad) { int swap = (*pdev->procs->get_bits)((gx_device *)pdev, y, str, size, pad); ! uint line_size = gdev_prn_bytes_per_scan_line(pdev); /* If monobit, trim off trailing garbage. */ if ( pad ) --- 330,334 ---- gdev_prn_get_bits(gx_device_printer *pdev, int y, byte *str, uint size, int pad) { int swap = (*pdev->procs->get_bits)((gx_device *)pdev, y, str, size, pad); ! uint line_size = gdev_prn_raster(pdev); /* If monobit, trim off trailing garbage. */ if ( pad ) *************** *** 341,345 **** code = gdev_prn_get_bits(pdev, y, str, size, 0); if ( code < 0 ) return code; ! return size / gdev_prn_bytes_per_scan_line(pdev); } --- 367,371 ---- code = gdev_prn_get_bits(pdev, y, str, size, 0); if ( code < 0 ) return code; ! return size / gdev_prn_raster(pdev); } diff -rc2N gs25/gdevprn.h gs251/gdevprn.h *** gs25/gdevprn.h Sun Aug 2 15:49:42 1992 --- gs251/gdevprn.h Sun Sep 6 19:20:58 1992 *************** *** 31,35 **** /* Define the parameters for the printer rendering method. */ ! /* If the entire bitmap fits in PRN_MAX_BITMAP, render in RAM, */ /* otherwise use a command list with a size of PRN_BUFFER_SPACE. */ /* (These are "properties" that can be changed by a Ghostscript program.) */ --- 31,36 ---- /* Define the parameters for the printer rendering method. */ ! /* If the entire bitmap fits in PRN_MAX_BITMAP, and there is at least */ ! /* PRN_MIN_MEMORY_LEFT memory left after allocating it, render in RAM, */ /* otherwise use a command list with a size of PRN_BUFFER_SPACE. */ /* (These are "properties" that can be changed by a Ghostscript program.) */ *************** *** 38,41 **** --- 39,43 ---- # define PRN_MAX_BITMAP 32000 # define PRN_BUFFER_SPACE 25000 + # define PRN_MIN_MEMORY_LEFT 32000 #else /* 32-bit machines have great big hulking RAMs.... */ *************** *** 42,45 **** --- 44,48 ---- # define PRN_MAX_BITMAP 10000000L # define PRN_BUFFER_SPACE 1000000L + # define PRN_MIN_MEMORY_LEFT 500000L #endif #define PRN_MIN_BUFFER_SPACE 10000 /* give up if less than this */ *************** *** 171,175 **** /* Common procedures defined in gdevprn.c */ int gdev_prn_open_printer(P1(gx_device *)); ! uint gdev_prn_bytes_per_scan_line(P1(gx_device_printer *)); int gdev_prn_copy_scan_lines(P4(gx_device_printer *, int, byte *, uint)); int gdev_prn_get_bits(P5(gx_device_printer *, int, byte *, uint, int)); --- 174,178 ---- /* Common procedures defined in gdevprn.c */ int gdev_prn_open_printer(P1(gx_device *)); ! uint gdev_prn_raster(P1(gx_device_printer *)); int gdev_prn_copy_scan_lines(P4(gx_device_printer *, int, byte *, uint)); int gdev_prn_get_bits(P5(gx_device_printer *, int, byte *, uint, int)); *************** *** 178,182 **** /* BACKWARD COMPATIBILITY */ #define gdev_mem_bytes_per_scan_line(dev)\ ! gdev_prn_bytes_per_scan_line((gx_device_printer *)(dev)) #define gdev_prn_transpose_8x8(inp,ils,outp,ols)\ memflip8x8(inp,ils,outp,ols) --- 181,185 ---- /* BACKWARD COMPATIBILITY */ #define gdev_mem_bytes_per_scan_line(dev)\ ! gdev_prn_raster((gx_device_printer *)(dev)) #define gdev_prn_transpose_8x8(inp,ils,outp,ols)\ memflip8x8(inp,ils,outp,ols) diff -rc2N gs25/gdevs3ga.c gs251/gdevs3ga.c *** gs25/gdevs3ga.c Sat Aug 15 09:30:26 1992 --- gs251/gdevs3ga.c Thu Sep 10 17:25:08 1992 *************** *** 130,134 **** s3_fill_rectangle(gx_device *dev, int x, int y, int w, int h, gx_color_index color) ! { validate_rect(); s3_wait_fifo(); outport(s3_fore_mix, 0x27); --- 130,134 ---- s3_fill_rectangle(gx_device *dev, int x, int y, int w, int h, gx_color_index color) ! { fit_fill(dev, x, y, w, h); s3_wait_fifo(); outport(s3_fore_mix, 0x27); *************** *** 146,157 **** const byte *base, int sourcex, int raster, gx_bitmap_id id, int x, int y, int w, int h, gx_color_index czero, gx_color_index cone) ! { int i, j; ! const int sbit = sourcex & 7; ! const byte *sptr = base + (sourcex >> 3); ! const int run = (sbit + w + 7) >> 3; ! const byte lmask = 0xff >> sbit; byte lmerge = 0; int cache_index, cache_x, cache_y; ! validate_rect(); /* See whether the cache is applicable. */ if ( id != gx_no_bitmap_id && w <= cell_width - 7 && --- 146,161 ---- const byte *base, int sourcex, int raster, gx_bitmap_id id, int x, int y, int w, int h, gx_color_index czero, gx_color_index cone) ! { int sbit; ! const byte *sptr; ! int run; ! byte lmask; byte lmerge = 0; int cache_index, cache_x, cache_y; ! int i, j; ! fit_copy(dev, base, sourcex, raster, id, x, y, w, h); ! sbit = sourcex & 7; ! sptr = base + (sourcex >> 3); ! run = (sbit + w + 7) >> 3; ! lmask = 0xff >> sbit; /* See whether the cache is applicable. */ if ( id != gx_no_bitmap_id && w <= cell_width - 7 && diff -rc2N gs25/gdevsun.c gs251/gdevsun.c *** gs25/gdevsun.c Thu Jul 9 12:44:40 1992 --- gs251/gdevsun.c Thu Sep 10 17:33:26 1992 *************** *** 35,38 **** --- 35,47 ---- #endif + #ifdef A4 + # define PAPER_X 8.27 /* A4 paper */ + # define PAPER_Y 11.69 + #endif + + #ifndef PAPER_X + # define PAPER_X 8.5 /* US letter paper */ + # define PAPER_Y 11 + #endif /* Procedures */ dev_proc_open_device(sun_open); *************** *** 76,80 **** Pixrect pr; int truecolor; /* use truecolor mapping */ ! gx_color_index ncols; /* allocated colors */ byte *red, *green, *blue; /* colormap */ char cmsname[sizeof(CMSNAME)+9];/* color map name */ --- 85,89 ---- Pixrect pr; int truecolor; /* use truecolor mapping */ ! int freecols; /* unallocated colors */ byte *red, *green, *blue; /* colormap */ char cmsname[sizeof(CMSNAME)+9];/* color map name */ *************** *** 112,116 **** &sun_procs, "sunview", ! (int)(8.5*DEFAULT_DPI), (int)(11*DEFAULT_DPI), /* x and y extent */ DEFAULT_DPI, DEFAULT_DPI, /* x and y density */ no_margins, --- 121,125 ---- &sun_procs, "sunview", ! (int)(PAPER_X*DEFAULT_DPI), (int)(PAPER_Y*DEFAULT_DPI), /* x and y extent */ DEFAULT_DPI, DEFAULT_DPI, /* x and y density */ no_margins, *************** *** 122,131 **** #define xdev ((gx_device_sun *)dev) - /* Macro to validate arguments */ - #define check_rect()\ - if ( w <= 0 || h <= 0 ) return 0;\ - if ( x < 0 || x > xdev->width - w || y < 0 || y > xdev->height - h )\ - return -1 - /* * The macros below define the colormap configuration used on 8-bit --- 131,134 ---- *************** *** 182,186 **** --- 185,194 ---- */ #define ALL_COLS (1 << DEPTH) /* 256 */ + #define CMS_SIZE ALL_COLS /* cut down to 64 or 128 for + more cooperative behaviour */ + #if (RGB_COLS > CMS_SIZE) /* one is reserved for the scrollbar */ + CMS_SIZE_too_small_for_color_cube + #endif #if (RGB_BITS < 0) || (RGB_BITS > DEPTH) Display_does_not_support_this_many_colors *************** *** 235,240 **** xdev->frame = window_create(NULL, FRAME, FRAME_LABEL, "ghostscript", ! WIN_HEIGHT, xdev->width + 20, ! WIN_HEIGHT, xdev->height + 40, 0); if (xdev->frame == (Frame)0) return -1; --- 243,251 ---- xdev->frame = window_create(NULL, FRAME, FRAME_LABEL, "ghostscript", ! WIN_WIDTH, min(xdev->width + 24, 900), ! WIN_HEIGHT, min(xdev->height + 36, 900), ! WIN_Y, 0, ! WIN_X, 200, ! 0); if (xdev->frame == (Frame)0) return -1; *************** *** 247,252 **** CANVAS_COLOR24, TRUE, #endif ! WIN_VERTICAL_SCROLLBAR, scrollbar_create(0), ! WIN_HORIZONTAL_SCROLLBAR, scrollbar_create(0), 0); xdev->pw = canvas_pixwin(xdev->canvas); --- 258,262 ---- CANVAS_COLOR24, TRUE, #endif ! CANVAS_RETAINED, FALSE, 0); xdev->pw = canvas_pixwin(xdev->canvas); *************** *** 261,265 **** */ static gx_device_color_info color_ci = ! #if (RGB_COLS < ALL_COLS) dci_color(DEPTH, 31, MAX_COLS); #else --- 271,275 ---- */ static gx_device_color_info color_ci = ! #if (RGB_COLS < CMS_SIZE) dci_color(DEPTH, 31, MAX_COLS); #else *************** *** 298,302 **** ) { ! gx_color_index j; /* --- 308,313 ---- ) { ! int j; ! int color; /* *************** *** 303,311 **** * Create the pre-allocated colorcube. */ ! xdev->red = (byte *)malloc(ALL_COLS); ! xdev->green = (byte *)malloc(ALL_COLS); ! xdev->blue = (byte *)malloc(ALL_COLS); if (!xdev->red || !xdev->green || !xdev->blue) { ! eprintf("gs: no memory for colomap\n"); return -1; } --- 314,322 ---- * Create the pre-allocated colorcube. */ ! xdev->red = (byte *)malloc(CMS_SIZE); ! xdev->green = (byte *)malloc(CMS_SIZE); ! xdev->blue = (byte *)malloc(CMS_SIZE); if (!xdev->red || !xdev->green || !xdev->blue) { ! eprintf("gs: no memory for colormap\n"); return -1; } *************** *** 330,348 **** * (ALL_COLS - 1); } #else /* !FAKE_TRUE_COLOR */ /* ! * Black and white are allocated in the first two slots, * so as to be compatible with the monochrome colormap. * This prevents most text etc. to go technicolor as focus * changes into the ghostscript window. ! */ ! cms_monochromeload(xdev->red, xdev->green, xdev->blue); /* ! * The remaining slots up to RGB_COLS-1 are filled with ! * evenly spaced points from the colorcube. */ ! for ( j = 2; j < RGB_COLS; j++ ) { ! int color = j - 1; /* bit pattern corresponding to color */ xdev->red[j] = (double)((color & RED_MASK) >> (GREEN_BITS + BLUE_BITS)) --- 341,370 ---- * (ALL_COLS - 1); } + + xdev->freecols = 0; #else /* !FAKE_TRUE_COLOR */ /* ! * Black and white are allocated in the last two slots, * so as to be compatible with the monochrome colormap. * This prevents most text etc. to go technicolor as focus * changes into the ghostscript window. ! * ! * The requirement that these two entries be at the end ! * of the colormap makes it most convenient to allocate ! * the remmaining entries from back to the front as well. ! * Therefore xdev->freecols is the minimal allocated ! * color index, and decreases as new ones are allocated. ! */ ! j = CMS_SIZE - 2; ! cms_monochromeload(xdev->red + j, ! xdev->green + j, ! xdev->blue + j); /* ! * The remaining slots down to CMS_SIZE - RGB_COLS are filled ! * with evenly spaced points from the colorcube. */ ! for ( color = 1; color < RGB_COLS - 1; color++ ) { ! j--; xdev->red[j] = (double)((color & RED_MASK) >> (GREEN_BITS + BLUE_BITS)) *************** *** 358,377 **** * (ALL_COLS - 1); } ! #endif /* FAKE_TRUE_COLOR */ /* ! * Set the high-water mark to the end of the colorcube. */ ! xdev->ncols = j; /* ! * The unusued entries are filled so that the last entry is * always different from the 0th entry. This is a requirement * for SunWindows. */ ! for ( ; j < ALL_COLS; j++) { xdev->red[j] = xdev->green[j] = xdev->blue[j] = ! ~xdev->red[0]; } /* --- 380,400 ---- * (ALL_COLS - 1); } ! /* ! * Set the low-water mark to the beginning of the colorcube. */ ! xdev->freecols = j; /* ! * The unused entries are filled so that the last entry is * always different from the 0th entry. This is a requirement * for SunWindows. */ ! for (j-- ; j >= 0 ; j--) { xdev->red[j] = xdev->green[j] = xdev->blue[j] = ! ~xdev->red[CMS_SIZE - 1]; } + #endif /* FAKE_TRUE_COLOR */ /* *************** *** 380,388 **** sprintf(xdev->cmsname, "%s-%d", CMSNAME, getpid()); pw_setcmsname(xdev->pw, xdev->cmsname); ! pw_putcolormap(xdev->pw, 0, ALL_COLS, xdev->red, xdev->green, xdev->blue); } else { ! xdev->ncols = 0; xdev->red = (byte *)0; xdev->green = (byte *)0; --- 403,411 ---- sprintf(xdev->cmsname, "%s-%d", CMSNAME, getpid()); pw_setcmsname(xdev->pw, xdev->cmsname); ! pw_putcolormap(xdev->pw, 0, CMS_SIZE, xdev->red, xdev->green, xdev->blue); } else { ! xdev->freecols = 0; xdev->red = (byte *)0; xdev->green = (byte *)0; *************** *** 390,393 **** --- 413,424 ---- } + /* + * Reset to retained after colormap length is changed + */ + window_set(xdev->canvas, + CANVAS_RETAINED, TRUE, + WIN_VERTICAL_SCROLLBAR, scrollbar_create(0), + WIN_HORIZONTAL_SCROLLBAR, scrollbar_create(0), + 0); window_set(xdev->frame, WIN_SHOW, TRUE, 0); /* Interpose a destroy function to keep Ghostscript from */ *************** *** 415,419 **** xdev->canvas = (Canvas)0; xdev->pw = (Pixwin *)0; ! xdev->ncols = 0; if (xdev->red) free(xdev->red); --- 446,450 ---- xdev->canvas = (Canvas)0; xdev->pw = (Pixwin *)0; ! xdev->freecols = 0; if (xdev->red) free(xdev->red); *************** *** 447,451 **** else if ( !xdev->truecolor ) { byte red_val, green_val, blue_val; ! gx_color_index i; static int warn = 1; --- 478,482 ---- else if ( !xdev->truecolor ) { byte red_val, green_val, blue_val; ! int i; static int warn = 1; *************** *** 462,466 **** * This includes the pre-allocated default color cube. */ ! for (i = 0; i < xdev->ncols; i++) { if (xdev->red[i] == red_val && xdev->green[i] == green_val && --- 493,497 ---- * This includes the pre-allocated default color cube. */ ! for (i = CMS_SIZE - 1; i >= xdev->freecols; i--) { if (xdev->red[i] == red_val && xdev->green[i] == green_val && *************** *** 476,481 **** * match the colorcube entries. IF NOT, WE WILL LOOP * FOREVER! */ ! if (xdev->ncols == ALL_COLS) { if (warn) { eprintf("gs: last spare color map entry allocated\n"); --- 507,514 ---- * match the colorcube entries. IF NOT, WE WILL LOOP * FOREVER! + * NOTE: Leave the zero'th colormap entry alone lest the + * scrollbar be colored. */ ! if (xdev->freecols <= 1) { if (warn) { eprintf("gs: last spare color map entry allocated\n"); *************** *** 492,499 **** xdev->blue[i] = blue_val; pw_setcmsname(xdev->pw, xdev->cmsname); ! pw_putcolormap(xdev->pw, xdev->ncols, 1, &xdev->red[i], &xdev->green[i], &xdev->blue[i]); ! xdev->ncols++; return i; } --- 525,532 ---- xdev->blue[i] = blue_val; pw_setcmsname(xdev->pw, xdev->cmsname); ! pw_putcolormap(xdev->pw, i, 1, &xdev->red[i], &xdev->green[i], &xdev->blue[i]); ! xdev->freecols = i; return i; } *************** *** 518,522 **** * We just use the colormap to map back to rgb values. */ ! if (color >= xdev->ncols) { eprintf1("gs: attempt to get RGB values for unallocated color index %d\n", color); return -1; --- 551,555 ---- * We just use the colormap to map back to rgb values. */ ! if (color < xdev->freecols || color >= CMS_SIZE) { eprintf1("gs: attempt to get RGB values for unallocated color index %d\n", color); return -1; *************** *** 550,554 **** sun_fill_rectangle(register gx_device *dev, int x, int y, int w, int h, gx_color_index color) ! { check_rect(); pw_write(xdev->pw, x, y, w, h, PIX_SRC | PIX_COLOR((int)(color)), --- 583,587 ---- sun_fill_rectangle(register gx_device *dev, int x, int y, int w, int h, gx_color_index color) ! { fit_fill(dev, x, y, w, h); pw_write(xdev->pw, x, y, w, h, PIX_SRC | PIX_COLOR((int)(color)), *************** *** 570,574 **** register int i; ! int nbytes = h * raster; extern struct pixrectops mem_ops; #if !arch_is_big_endian /* need to swap bits & bytes */ --- 603,607 ---- register int i; ! int nbytes; extern struct pixrectops mem_ops; #if !arch_is_big_endian /* need to swap bits & bytes */ *************** *** 577,581 **** #endif ! check_rect(); xdev->pr.pr_ops = &mem_ops; --- 610,615 ---- #endif ! fit_copy(dev, base, sourcex, raster, id, x, y, w, h); ! nbytes = h * raster; xdev->pr.pr_ops = &mem_ops; *************** *** 632,636 **** (gx_color_index)0, (gx_color_index)1); ! check_rect(); xdev->pr.pr_ops = &mem_ops; --- 666,670 ---- (gx_color_index)0, (gx_color_index)1); ! fit_copy(dev, base, sourcex, raster, id, x, y, w, h); xdev->pr.pr_ops = &mem_ops; diff -rc2N gs25/gdevsvga.c gs251/gdevsvga.c *** gs25/gdevsvga.c Sat Aug 15 09:42:30 1992 --- gs251/gdevsvga.c Thu Sep 10 17:28:40 1992 *************** *** 50,59 **** private int svga_save_mode = -1; - /* Macro for validating rectangle parameters x and w. */ - /* set_pixel_ptr implicitly validates y and h. */ - #define validate_rect_x()\ - if ( w <= 0 ) return 0;\ - if ( x < 0 || x + w > dev->width ) return_error(gs_error_rangecheck) - /* ------ Internal routines ------ */ --- 50,53 ---- *************** *** 62,70 **** /* Construct a pointer for writing a pixel. */ /* Assume 64K pages, 64K granularity. */ #define set_pixel_ptr(ptr, fbdev, x, y, wnum)\ { ulong index = (ulong)(y) * fbdev->raster + (uint)(x);\ if ( (uint)(index >> 16) != fbdev->page )\ ! { if ( y < 0 || y >= fbdev->height ) return_error(gs_error_rangecheck);\ ! (*fbdev->set_page)(fbdev, (fbdev->page = index >> 16), wnum);\ }\ ptr = (fb_ptr)MK_PTR(regen, (ushort)index);\ --- 56,64 ---- /* Construct a pointer for writing a pixel. */ /* Assume 64K pages, 64K granularity. */ + /* We know that y is within bounds. */ #define set_pixel_ptr(ptr, fbdev, x, y, wnum)\ { ulong index = (ulong)(y) * fbdev->raster + (uint)(x);\ if ( (uint)(index >> 16) != fbdev->page )\ ! { (*fbdev->set_page)(fbdev, (fbdev->page = index >> 16), wnum);\ }\ ptr = (fb_ptr)MK_PTR(regen, (ushort)index);\ *************** *** 86,90 **** ) { fb_dev->mode = mip; ! gx_device_adjust_resolution(dev, mip->width, mip->height); return 0; } --- 80,84 ---- ) { fb_dev->mode = mip; ! gx_device_adjust_resolution(dev, mip->width, mip->height, 1); return 0; } *************** *** 202,211 **** int x, int y, int w, int h, gx_color_index czero, gx_color_index cone) { register int xi; ! uint skip = fb_dev->raster - w; int yi; fb_ptr ptr = (fb_ptr)0; ! const byte *srow = base + (sourcex >> 3); ! uint imask = 0x80 >> (sourcex & 7); ! validate_rect_x(); #define izero (int)czero #define ione (int)cone --- 196,208 ---- int x, int y, int w, int h, gx_color_index czero, gx_color_index cone) { register int xi; ! uint skip; int yi; fb_ptr ptr = (fb_ptr)0; ! const byte *srow; ! uint imask; ! fit_copy(dev, base, sourcex, raster, id, x, y, w, h); ! skip = fb_dev->raster - w; ! srow = base + (sourcex >> 3); ! imask = 0x80 >> (sourcex & 7); #define izero (int)czero #define ione (int)cone *************** *** 243,250 **** int x, int y, int w, int h) { int xi, yi; ! int skip = raster - w; ! const byte *sptr = base + sourcex; fb_ptr ptr; ! validate_rect_x(); for ( yi = y; yi - y < h; yi++ ) { ptr = 0; --- 240,249 ---- int x, int y, int w, int h) { int xi, yi; ! int skip; ! const byte *sptr; fb_ptr ptr; ! fit_copy(dev, base, sourcex, raster, id, x, y, w, h); ! skip = raster - w; ! sptr = base + sourcex; for ( yi = y; yi - y < h; yi++ ) { ptr = 0; *************** *** 267,271 **** int yi; fb_ptr ptr; ! if ( x < 0 || x + w > dev->width ) return -1; /* skip w */ set_pixel_write_ptr(ptr, fb_dev, x, y); /* Most fills are very small and don't cross a page boundary. */ --- 266,270 ---- int yi; fb_ptr ptr; ! fit_fill(dev, x, y, w, h); set_pixel_write_ptr(ptr, fb_dev, x, y); /* Most fills are very small and don't cross a page boundary. */ *************** *** 497,501 **** return_error(gs_error_rangecheck); /* mode not available */ fb_dev->mode = mip; ! gx_device_adjust_resolution(dev, mip->width, mip->height); fb_dev->info.vesa.bios_set_page = info.win_func_ptr; /* Reset the raster per the VESA info. */ --- 496,500 ---- return_error(gs_error_rangecheck); /* mode not available */ fb_dev->mode = mip; ! gx_device_adjust_resolution(dev, mip->width, mip->height, 1); fb_dev->info.vesa.bios_set_page = info.win_func_ptr; /* Reset the raster per the VESA info. */ diff -rc2N gs25/gdevx.c gs251/gdevx.c *** gs25/gdevx.c Wed May 13 06:50:38 1992 --- gs251/gdevx.c Fri Sep 11 16:27:59 1992 *************** *** 26,29 **** --- 26,32 ---- #include "memory_.h" #include "x_.h" + #include "gserrors.h" + #include "gsprops.h" + #include "gsutil.h" /* for props_extract */ #include "gxdevice.h" #include "gdevx.h" *************** *** 66,69 **** --- 69,73 ---- private dev_proc_copy_color(x_copy_color); private dev_proc_draw_line(x_draw_line); + private dev_proc_put_props(x_put_props); /* The device descriptor */ *************** *** 83,87 **** gx_default_get_bits, gx_default_get_props, ! gx_default_put_props }; --- 87,91 ---- gx_default_get_bits, gx_default_get_props, ! x_put_props }; *************** *** 152,165 **** #define xdev ((gx_device_X *)dev) - /* Macros to validate and coerce arguments */ - #define check_rect_extent()\ - if ( x + w > xdev->width ) w = xdev->width - x;\ - if ( y + h > xdev->height ) h = xdev->height - y;\ - if ( w <= 0 || h <= 0 ) return 0 - #define check_rect()\ - if ( x < 0 ) w += x, x = 0;\ - if ( y < 0 ) h += y, y = 0;\ - check_rect_extent() - /* If XPutImage doesn't work, do it ourselves. */ private void alt_put_image(); --- 156,159 ---- *************** *** 331,335 **** x_fill_rectangle(register gx_device *dev, int x, int y, int w, int h, gx_color_index color) ! { check_rect(); set_fill_style(FillSolid); set_fore_color(color_index_to_pixel(color)); --- 325,329 ---- x_fill_rectangle(register gx_device *dev, int x, int y, int w, int h, gx_color_index color) ! { fit_fill(dev, x, y, w, h); set_fill_style(FillSolid); set_fore_color(color_index_to_pixel(color)); *************** *** 362,366 **** p_zero = color_index_to_pixel(zero), p_one = color_index_to_pixel(one); ! check_rect(); /* Check for a colored tile. We should implement this */ --- 356,360 ---- p_zero = color_index_to_pixel(zero), p_one = color_index_to_pixel(one); ! fit_fill(dev, x, y, w, h); /* Check for a colored tile. We should implement this */ *************** *** 496,504 **** fc = p_one; ! /* We need a different version of check_rect, because */ ! /* we have to adjust the source coordinates too. */ ! if ( x < 0 ) w += x, sourcex -= x, x = 0; ! if ( y < 0 ) h += y, base -= y * raster, y = 0; ! check_rect_extent(); xdev->image.width = raster << 3; --- 490,494 ---- fc = p_one; ! fit_copy(dev, base, sourcex, raster, id, x, y, w, h); xdev->image.width = raster << 3; *************** *** 652,656 **** if ( h < 0 ) y = y1, h = - h; w++; h++; ! check_rect(); update_add(dev, x, y, w, h); } --- 642,646 ---- if ( h < 0 ) y = y1, h = - h; w++; h++; ! fit_fill(dev, x, y, w, h); update_add(dev, x, y, w, h); } *************** *** 657,660 **** --- 647,719 ---- return 0; } + + /* Set the device properties. We reimplement this so we can resize */ + /* the window and avoid closing and reopening the device. */ + private const gs_prop_item x_props[] = { + prop_def("HWResolution", prt_float_array), + prop_def("HWSize", prt_int_array), + /* Slots for arrays */ + prop_float, prop_float, + prop_int, prop_int, + }; + private int + x_put_props(gx_device *dev, gs_prop_item *plist, int count) + { gs_prop_item *known[2]; + int code = 0; + gx_device_X temp_dev; + temp_dev = *xdev; + props_extract(plist, count, x_props, 2, known, 0); + if ( known[1] != 0 ) + { if ( known[1]->value.a.size != 2 ) + known[1]->status = pv_typecheck, + code = gs_error_typecheck; + else + { gs_prop_item *ap = known[1]->value.a.p.v; + if ( ap[0].value.i <= 0 || ap[0].value.i > 0x7fff || + ap[1].value.i <= 0 || ap[1].value.i > 0x7fff + ) + known[1]->status = pv_rangecheck, + code = gs_error_rangecheck; + else + { temp_dev.width = ap[0].value.i; + temp_dev.height = ap[1].value.i; + } + } + } + if ( known[0] != 0 ) + { if ( known[0]->value.a.size != 2 ) + known[0]->status = pv_typecheck, + code = gs_error_typecheck; + else + { gs_prop_item *ap = known[0]->value.a.p.v; + if ( ap[0].value.f <= 0 || ap[1].value.f <= 0 ) + known[0]->status = pv_rangecheck, + code = gs_error_rangecheck; + else + { temp_dev.x_pixels_per_inch = ap[0].value.f; + temp_dev.y_pixels_per_inch = ap[1].value.f; + } + } + } + if ( code < 0 ) + return_error(code); + dev->x_pixels_per_inch = temp_dev.x_pixels_per_inch; + dev->y_pixels_per_inch = temp_dev.y_pixels_per_inch; + dev->width = temp_dev.width; + dev->height = temp_dev.height; + /* If the device is open, resize the window. */ + /* Don't do this if Ghostview is active. */ + if ( dev->is_open && (known[0] != 0 || known[1] != 0) && !xdev->ghostview ) + { XResizeWindow(xdev->dpy, xdev->win, dev->width, dev->height); + if ( xdev->bpixmap != (Pixmap)0 ) + { XFreePixmap(xdev->dpy, xdev->bpixmap); + xdev->bpixmap = (Pixmap)0; + } + xdev->dest = 0; + gdev_x_clear_window(xdev); + } + return gx_default_put_props(dev, plist, count); + } + /* ------ Screen update procedures ------ */ diff -rc2N gs25/gdevxini.c gs251/gdevxini.c *** gs25/gdevxini.c Tue May 12 12:21:56 1992 --- gs251/gdevxini.c Tue Sep 8 18:46:26 1992 *************** *** 64,67 **** --- 64,70 ---- } orientation; + /* Forward references */ + void gdev_x_clear_window(P1(gx_device_X *)); + /* Open the X device */ int *************** *** 68,71 **** --- 71,75 ---- gdev_x_open(register gx_device_X *xdev) { XSizeHints sizehints; + static XWMHints wm_hints = {InputHint,0}; /*<--- Avoid input focus*/ int border_width; char *border_width_str, *border_color_str; *************** *** 94,97 **** --- 98,102 ---- exit(1); } + xdev->dest = 0; if ( (window_id = getenv("GHOSTVIEW")) ) { if ( !(xdev->ghostview = sscanf(window_id, "%d %d", *************** *** 452,463 **** strlen(PROGRAM_NAME)); XSetNormalHints(xdev->dpy, xdev->win, &sizehints); ! ! if ( use_backing ) ! xdev->bpixmap = ! XCreatePixmap(xdev->dpy, xdev->win, ! xdev->width, xdev->height, ! xdev->vinfo->depth); ! else ! xdev->bpixmap = (Pixmap)0; } --- 457,461 ---- strlen(PROGRAM_NAME)); XSetNormalHints(xdev->dpy, xdev->win, &sizehints); ! XSetWMHints(xdev->dpy, xdev->win, &wm_hints); /*<--- Avoid input focus*/ } *************** *** 473,502 **** LineSolid, CapButt, JoinMiter); ! /* Clear the destination pixmap to avoid initializing with garbage. */ ! if ( xdev->dest != (Pixmap)0 ) ! { XSetForeground(xdev->dpy, xdev->gc, pixel_white); ! XFillRectangle(xdev->dpy, xdev->dest, xdev->gc, ! 0, 0, xdev->width, xdev->height); ! } ! else ! { xdev->dest = (xdev->bpixmap != (Pixmap)0 ? ! xdev->bpixmap : (Pixmap)xdev->win); ! } ! ! /* Clear the background pixmap to avoid initializing with garbage. */ ! if ( xdev->bpixmap != (Pixmap)0 ) ! { if ( !xdev->ghostview ) ! XSetWindowBackgroundPixmap(xdev->dpy, xdev->win, xdev->bpixmap); ! XSetForeground(xdev->dpy, xdev->gc, pixel_white); ! XFillRectangle(xdev->dpy, xdev->bpixmap, xdev->gc, ! 0, 0, xdev->width, xdev->height); ! } ! ! /* Initialize foreground and background colors */ ! xdev->back_color = pixel_white; ! XSetBackground(xdev->dpy, xdev->gc, pixel_white); ! xdev->fore_color = pixel_white; ! XSetForeground(xdev->dpy, xdev->gc, pixel_white); ! xdev->colors_or = xdev->colors_and = pixel_white; if ( !xdev->ghostview ) --- 471,475 ---- LineSolid, CapButt, JoinMiter); ! gdev_x_clear_window(xdev); if ( !xdev->ghostview ) *************** *** 511,515 **** else { /* Create an unmapped window, that the window manager will ignore. ! * This invisble window will be used to receive "next page" * events from ghostview */ XSetWindowAttributes attributes; --- 484,488 ---- else { /* Create an unmapped window, that the window manager will ignore. ! * This invisible window will be used to receive "next page" * events from ghostview */ XSetWindowAttributes attributes; *************** *** 529,531 **** --- 502,545 ---- XSync(xdev->dpy, 0); return 0; + } + + /* Allocate the backing pixmap, if any, and clear the window. */ + void + gdev_x_clear_window(gx_device_X *xdev) + { if ( !xdev->ghostview ) + { if ( use_backing ) + xdev->bpixmap = + XCreatePixmap(xdev->dpy, xdev->win, + xdev->width, xdev->height, + xdev->vinfo->depth); + else + xdev->bpixmap = (Pixmap)0; + } + + /* Clear the destination pixmap to avoid initializing with garbage. */ + if ( xdev->dest != (Pixmap)0 ) + { XSetForeground(xdev->dpy, xdev->gc, pixel_white); + XFillRectangle(xdev->dpy, xdev->dest, xdev->gc, + 0, 0, xdev->width, xdev->height); + } + else + { xdev->dest = (xdev->bpixmap != (Pixmap)0 ? + xdev->bpixmap : (Pixmap)xdev->win); + } + + /* Clear the background pixmap to avoid initializing with garbage. */ + if ( xdev->bpixmap != (Pixmap)0 ) + { if ( !xdev->ghostview ) + XSetWindowBackgroundPixmap(xdev->dpy, xdev->win, xdev->bpixmap); + XSetForeground(xdev->dpy, xdev->gc, pixel_white); + XFillRectangle(xdev->dpy, xdev->bpixmap, xdev->gc, + 0, 0, xdev->width, xdev->height); + } + + /* Initialize foreground and background colors */ + xdev->back_color = pixel_white; + XSetBackground(xdev->dpy, xdev->gc, pixel_white); + xdev->fore_color = pixel_white; + XSetForeground(xdev->dpy, xdev->gc, pixel_white); + xdev->colors_or = xdev->colors_and = pixel_white; } diff -rc2N gs25/gp_dosfb.c gs251/gp_dosfb.c *** gs25/gp_dosfb.c Thu Jun 11 15:58:28 1992 --- gs251/gp_dosfb.c Sun Sep 6 19:19:04 1992 *************** *** 133,137 **** private int save_graphics(gx_device *dev) ! { uint row_size = gx_device_bytes_per_scan_line(dev, 0); char row_buf[row_buf_size]; int count = row_buf_size / row_size; --- 133,137 ---- private int save_graphics(gx_device *dev) ! { uint row_size = gx_device_raster(dev, 0); char row_buf[row_buf_size]; int count = row_buf_size / row_size; *************** *** 166,170 **** restore_graphics(gx_device *dev) { FILE *gfile; ! uint row_size = gx_device_bytes_per_scan_line(dev, 0); char row_buf[row_buf_size]; int y; --- 166,170 ---- restore_graphics(gx_device *dev) { FILE *gfile; ! uint row_size = gx_device_raster(dev, 0); char row_buf[row_buf_size]; int y; diff -rc2N gs25/gp_sysv.c gs251/gp_sysv.c *** gs25/gp_sysv.c Fri May 8 03:00:36 1992 --- gs251/gp_sysv.c Fri Sep 4 16:18:28 1992 *************** *** 24,32 **** /* that a few System V platforms don't provide. */ #include ! #Include ! #include #include #include #include /* rename */ --- 24,32 ---- /* that a few System V platforms don't provide. */ #include ! #include "time_.h" #include #include #include + #include /* rename */ *************** *** 46,50 **** /* gettimeofday */ ! #define HZ 100 /* see sys/params.h */ int gettimeofday(struct timeval *tvp, struct timezone *tzp) --- 46,52 ---- /* gettimeofday */ ! #ifndef HZ ! # define HZ 100 /* see sys/param.h */ ! #endif int gettimeofday(struct timeval *tvp, struct timezone *tzp) *************** *** 55,58 **** --- 57,62 ---- if (!offset) { time(&offset); + /* call localtime to set the timezone variable */ + localtime(&offset); offset -= (times(&tms) / HZ); } *************** *** 60,62 **** --- 64,67 ---- tvp->tv_sec = ticks/HZ + offset; tvp->tv_usec = (ticks % HZ) * (1000*1000/HZ); + tzp->tz_minuteswest = timezone/60; } diff -rc2N gs25/gs.c gs251/gs.c *** gs25/gs.c Wed Aug 19 00:55:44 1992 --- gs251/gs.c Sun Sep 6 03:16:08 1992 *************** *** 62,65 **** --- 62,67 ---- extern int gs_log_errors; extern gx_device *gx_device_list[]; + extern const int gs_revision; + extern const char *gs_revisiondate; /* *************** *** 97,100 **** --- 99,103 ---- private void argproc(P1(const char *)); private void cmdproc(P1(const char *)); + private void print_revision(P0()); private int esc_strlen(P1(const char *)); private void esc_strcat(P2(char *, const char *)); *************** *** 138,147 **** 0 }; ! extern gx_device gs_clist_device; /* gx_clist_device */ ! static gx_device *cldevs[2] = ! { &gs_clist_device, ! 0 ! }; ! gx_device **pdevs[4]; gx_device ***ppdev; gx_device **pdev; --- 141,145 ---- 0 }; ! gx_device **pdevs[3]; gx_device ***ppdev; gx_device **pdev; *************** *** 148,153 **** pdevs[0] = gx_device_list; pdevs[1] = (gx_device **)mdevs; ! pdevs[2] = cldevs; ! pdevs[3] = 0; for ( ppdev = pdevs; *ppdev != 0; ppdev++ ) for ( pdev = *ppdev; *pdev != 0; pdev++ ) --- 146,150 ---- pdevs[0] = gx_device_list; pdevs[1] = (gx_device **)mdevs; ! pdevs[2] = 0; for ( ppdev = pdevs; *ppdev != 0; ppdev++ ) for ( pdev = *ppdev; *pdev != 0; pdev++ ) *************** *** 211,215 **** swproc("-dNOPAUSE"); gs_init2(); /* Finish initialization */ ! run_string("(%stdin) (r) file cvx execute"); break; case 'A': /* trace allocator */ --- 208,212 ---- swproc("-dNOPAUSE"); gs_init2(); /* Finish initialization */ ! run_string("(%stdin) (r) file cvx execute0"); break; case 'A': /* trace allocator */ *************** *** 223,226 **** --- 220,224 ---- case 'h': /* print help */ case '?': /* ditto */ + print_revision(); fputs(gs_help1, stdout); { int i; *************** *** 335,338 **** --- 333,339 ---- break; } + case 'v': /* print revision */ + print_revision(); + gs_exit(0); case 'Z': if ( !*arg ) *************** *** 404,408 **** run_string(const char *str) { int exit_code; ! int code = gs_run_string(str, gs_user_errors, &exit_code); zflush((ref *)0); /* flush stdout */ zflushpage((ref *)0); /* force display update */ --- 405,410 ---- run_string(const char *str) { int exit_code; ! ref error_object; ! int code = gs_run_string(str, gs_user_errors, &exit_code, &error_object); zflush((ref *)0); /* flush stdout */ zflushpage((ref *)0); /* force display update */ *************** *** 417,421 **** gs_exit(exit_code); default: ! gs_debug_dump_stack(code); gs_exit(255); } --- 419,423 ---- gs_exit(exit_code); default: ! gs_debug_dump_stack(code, &error_object); gs_exit(255); } *************** *** 473,475 **** --- 475,487 ---- } fclose(f); + } + + /* Print the revision and revision date. */ + private void + print_revision() + { int sub_rev = gs_revision % 10; + fprintf(stdout, "%s %d.%d", PROGRAM_NAME, gs_revision / 100, + (gs_revision / 10) % 10); + if ( sub_rev != 0 ) fprintf(stdout, ".%d", sub_rev); + fprintf(stdout, " (%s)\n", gs_revisiondate); } diff -rc2N gs25/gs.mak gs251/gs.mak *** gs25/gs.mak Thu Aug 13 18:41:58 1992 --- gs251/gs.mak Tue Sep 8 05:19:30 1992 *************** *** 32,39 **** # FEATURE_DEVS - the optional features to include in the # executable. Current features are: ! # dps - support for Display PostScript extensions. ! # *** PARTIALLY IMPLEMENTED, SEE language.doc. *** ! # level2 - support for PostScript Level 2 extensions. ! # *** PARTIALLY IMPLEMENTED, SEE language.doc. *** # compfont - support for composite (type 0) fonts. # *** NOT IMPLEMENTED YET. *** --- 32,39 ---- # FEATURE_DEVS - the optional features to include in the # executable. Current features are: ! # dps - (partial) support for Display PostScript extensions: ! # see language.doc for details. ! # level2 - (partial) support for PostScript Level 2 ! # extensions: see language.doc for details. # compfont - support for composite (type 0) fonts. # *** NOT IMPLEMENTED YET. *** *************** *** 54,57 **** --- 54,60 ---- # XE - the extension for executable files (e.g., null or .exe). # OBJ - the extension for relocatable object files (e.g., o or obj). + # BEGINFILES - the list of files that `make begin' should delete. + # CCBEGIN - the compilation command for `make begin', normally + # $(CCC) *.c. # CCC - the C invocation for normal compilation. # CCD - the C invocation for files that store into frame buffers or *************** *** 60,63 **** --- 63,68 ---- # CC0 - a C invocation with the fewest possible flags. Needed because # MS-DOS limits the length of command lines to 128 characters. + # CCCF - the C invocation for compiled fonts. Needed because MS-DOS + # requires using the 'huge' memory model for these. # CCINT - the C invocation for compiling the main interpreter module, # normally the same as CCC: this is needed because the *************** *** 89,93 **** mostlyclean realclean distclean clean: rm -f *.$(OBJ) *.a core gmon.out ! rm -f *.dev *.d_* arch.h gconfig.h obj*.tr lib*.tr rm -f t _temp_* _temp_*.* *.map *.sym rm -f ansi2knr$(XE) echogs$(XE) genarch$(XE) uniq$(XE) --- 94,98 ---- mostlyclean realclean distclean clean: rm -f *.$(OBJ) *.a core gmon.out ! rm -f *.dev *.d_* arch.h gconfig*.h obj*.tr lib*.tr rm -f t _temp_* _temp_*.* *.map *.sym rm -f ansi2knr$(XE) echogs$(XE) genarch$(XE) uniq$(XE) *************** *** 100,104 **** rm -f arch.h genarch$(XE) $(BEGINFILES) make arch.h ! - $(CCC) *.c rm -f gconfig.$(OBJ) gdev*.$(OBJ) gp_*.$(OBJ) gsmisc.$(OBJ) rm -f iccfont.$(OBJ) iinit.$(OBJ) interp.$(OBJ) --- 105,109 ---- rm -f arch.h genarch$(XE) $(BEGINFILES) make arch.h ! - $(CCBEGIN) rm -f gconfig.$(OBJ) gdev*.$(OBJ) gp_*.$(OBJ) gsmisc.$(OBJ) rm -f iccfont.$(OBJ) iinit.$(OBJ) interp.$(OBJ) *************** *** 168,171 **** --- 173,177 ---- gsstate_h=gsstate.h $(gscolor_h) gstype1_h=gstype1.h + gsuid_h=gsuid.h gsutil_h=gsutil.h *************** *** 197,201 **** ### Executable code ! gsutil.$(OBJ): gsutil.c \ $(std_h) $(gsprops_h) $(gsutil_h) --- 203,207 ---- ### Executable code ! gsutil.$(OBJ): gsutil.c $(AK) \ $(std_h) $(gsprops_h) $(gsutil_h) *************** *** 312,322 **** gdevmem1.$(OBJ): gdevmem1.c $(AK) \ ! $(gs_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem2.$(OBJ): gdevmem2.c $(AK) \ ! $(gs_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem3.$(OBJ): gdevmem3.c $(AK) \ ! $(gs_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) ###### Files dependent on the installed devices, features, and platform. --- 318,328 ---- gdevmem1.$(OBJ): gdevmem1.c $(AK) \ ! $(gx_h) $(gserrors_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem2.$(OBJ): gdevmem2.c $(AK) \ ! $(gx_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem3.$(OBJ): gdevmem3.c $(AK) \ ! $(gx_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) ###### Files dependent on the installed devices, features, and platform. *************** *** 323,327 **** # Generating gconfig.h also generates obj*.tr and lib.tr. ! gconfig.h obj.tr objw.tr lib.tr: devs.mak $(MAKEFILE) echogs$(XE) $(UNIQ) \ $(DEVICE_DEVS) $(DEVICE_DEVS2) $(DEVICE_DEVS3) $(DEVICE_DEVS4) $(DEVICE_DEVS5)\ $(FEATURE_DEVS) $(PLATFORM).dev --- 329,334 ---- # Generating gconfig.h also generates obj*.tr and lib.tr. ! gconfig.h obj.tr objw.tr lib.tr: \ ! devs.mak $(MAKEFILE) echogs$(XE) $(UNIQ) \ $(DEVICE_DEVS) $(DEVICE_DEVS2) $(DEVICE_DEVS3) $(DEVICE_DEVS4) $(DEVICE_DEVS5)\ $(FEATURE_DEVS) $(PLATFORM).dev *************** *** 397,401 **** ialloc.$(OBJ): ialloc.c $(AK) $(gs_h) $(gdebug_h) $(alloc_h) $(astate_h) ! iccfont.$(OBJ): iccfont.c $(GH) gconfig.h \ $(ghost_h) $(alloc_h) $(ccfont_h) $(dict_h) $(dstack_h) $(errors_h) $(iutil_h) $(name_h) $(oper_h) $(save_h) $(store_h) --- 404,408 ---- ialloc.$(OBJ): ialloc.c $(AK) $(gs_h) $(gdebug_h) $(alloc_h) $(astate_h) ! iccfont.$(OBJ): iccfont.c $(GH) gconfigf.h \ $(ghost_h) $(alloc_h) $(ccfont_h) $(dict_h) $(dstack_h) $(errors_h) $(iutil_h) $(name_h) $(oper_h) $(save_h) $(store_h) *************** *** 463,468 **** zprops.$(OBJ): zprops.c $(OP) \ ! $(alloc_h) $(dict_h) $(name_h) $(store_h) \ ! $(gsprops_h) $(gsmatrix_h) $(gxdevice_h) zrelbit.$(OBJ): zrelbit.c $(OP) $(store_h) $(dict_h) --- 470,475 ---- zprops.$(OBJ): zprops.c $(OP) \ ! $(alloc_h) $(dict_h) $(name_h) $(state_h) $(store_h) \ ! $(gsprops_h) $(gsmatrix_h) $(gxdevice_h) $(gsstate_h) zrelbit.$(OBJ): zrelbit.c $(OP) $(store_h) $(dict_h) *************** *** 641,655 **** $(SHP)gssetmod ccfonts $(ccfonts_) iccfont.$(OBJ) $(SHP)gsaddmod ccfonts -oper ccfonts - $(SHP)gsaddmod ccfonts -font Ugly ugly.$(OBJ): ugly.c $(CCFONT) ncrr.$(OBJ): ncrr.c $(CCFONT) psyr.$(OBJ): psyr.c $(CCFONT) ptmr.$(OBJ): ptmr.c $(CCFONT) pzdr.$(OBJ): pzdr.c $(CCFONT) # ----------------------------- Main program ------------------------------ # --- 648,672 ---- $(SHP)gssetmod ccfonts $(ccfonts_) iccfont.$(OBJ) $(SHP)gsaddmod ccfonts -oper ccfonts + gconfigf.h: $(MAKEFILE) + $(SHP)gssetmod ccfonts_ + $(SHP)gsaddmod ccfonts_ -font Ugly + rm -f gconfigf.h + mv ccfonts_.d_f gconfigf.h + ugly.$(OBJ): ugly.c $(CCFONT) + $(CCCF) ugly.c ncrr.$(OBJ): ncrr.c $(CCFONT) + $(CCCF) ncrr.c psyr.$(OBJ): psyr.c $(CCFONT) + $(CCCF) psyr.c ptmr.$(OBJ): ptmr.c $(CCFONT) + $(CCCF) ptmr.c pzdr.$(OBJ): pzdr.c $(CCFONT) + $(CCCF) pzdr.c # ----------------------------- Main program ------------------------------ # diff -rc2N gs25/gs_fonts.ps gs251/gs_fonts.ps *** gs25/gs_fonts.ps Tue Aug 11 03:17:56 1992 --- gs251/gs_fonts.ps Thu Sep 10 05:24:36 1992 *************** *** 64,68 **** % that these entries are present in the built-in fonts.) /.buildfont1x ! { dup dup /FontInfo get dup dup /UnderlinePosition known exch /UnderlineThickness known and { pop pop % entries already present --- 64,71 ---- % that these entries are present in the built-in fonts.) /.buildfont1x ! { dup /FontInfo known not ! { dup /FontInfo 2 dict put } ! if ! dup dup /FontInfo get dup dup /UnderlinePosition known exch /UnderlineThickness known and { pop pop % entries already present *************** *** 283,290 **** % .PFB files. We can't save the packing status anywhere, % so we need two separate control paths. currentpacking { false setpacking { dup read not { -1 } if ! 2 copy unread 16#80 eq { false /PFBDecode filter } if cvx exec } stopped % split up `execute' --- 286,296 ---- % .PFB files. We can't save the packing status anywhere, % so we need two separate control paths. + % Also, we would like to use `false /PFBDecode filter', + % but this occasionally produces a whitespace character as + % the first of an eexec section, so we can't do it. currentpacking { false setpacking { dup read not { -1 } if ! 2 copy unread 16#80 eq { true /PFBDecode filter } if cvx exec } stopped % split up `execute' *************** *** 293,297 **** } { { dup read not { -1 } if ! 2 copy unread 16#80 eq { false /PFBDecode filter } if cvx exec } execute --- 299,303 ---- } { { dup read not { -1 } if ! 2 copy unread 16#80 eq { true /PFBDecode filter } if cvx exec } execute diff -rc2N gs25/gs_init.ps gs251/gs_init.ps *** gs25/gs_init.ps Wed Aug 19 00:55:52 1992 --- gs251/gs_init.ps Thu Sep 3 13:40:10 1992 *************** *** 110,117 **** .stderr flushfile pop pop pop setmatrix initclip} odef - % The "revision" is the Ghostscript release number x 100 + the sub-release. - /gsrevision 250 def - /gsrevisiondate - (8/18/92) def /handleerror {errordict /handleerror get exec} bind def --- 110,113 ---- *************** *** 132,136 **** /pstack {0 1 count 3 sub {index ==} for} def /quit {0 .quit} odef - /revision gsrevision def /run {dup type /filetype eq { true } --- 128,131 ---- *************** *** 149,155 **** /stack {0 1 count 3 sub {index =} for} bind def /start { QUIET not ! {(Ghostscript ) print gsrevision 10 idiv 10 div =only ! gsrevision 10 mod dup 0 ne { (.) print =only } { pop } ifelse ! ( \() print gsrevisiondate print (\)\n) print ( Copyright (C) 1990, 1992 Aladdin Enterprises, Menlo Park, CA.\n) print ( All rights reserved.\n) print --- 144,150 ---- /stack {0 1 count 3 sub {index =} for} bind def /start { QUIET not ! {(Ghostscript ) print revision 10 idiv 10 div =only ! revision 10 mod dup 0 ne { (.) print =only } { pop } ifelse ! ( \() print revisiondate print (\)\n) print ( Copyright (C) 1990, 1992 Aladdin Enterprises, Menlo Park, CA.\n) print ( All rights reserved.\n) print *************** *** 327,330 **** --- 322,328 ---- /execute {stopped $error /newerror get and {handleerror} if} odef + % Define an execute analogue of run0. + /execute0 + {stopped $error /newerror get and {handleerror flush 1 .quit} if} bind def % Define a special version of `run' that aborts on errors. diff -rc2N gs25/gs_statd.ps gs251/gs_statd.ps *** gs25/gs_statd.ps Sat Aug 15 08:35:32 1992 --- gs251/gs_statd.ps Mon Sep 7 20:55:10 1992 *************** *** 32,48 **** % so the page dimensions must be the first two elements of the procedure. ! /letter {612 792 //statusdict begin .setpagesize end} def ! /note {540 720 //statusdict begin .setpagesize end} def ! /legal {612 1008 //statusdict begin .setpagesize end} def ! /a3 {842 1190 //statusdict begin .setpagesize end} def ! /a4 {595 842 //statusdict begin .setpagesize end} def ! /a5 {421 595 //statusdict begin .setpagesize end} def ! /a6 {297 421 //statusdict begin .setpagesize end} def ! /b4 {709 1002 //statusdict begin .setpagesize end} def ! /flsa {612 936 //statusdict begin .setpagesize end} def % U.S. foolscap ! /flse {612 936 //statusdict begin .setpagesize end} def % European foolscap ! /halfletter {396 612 //statusdict begin .setpagesize end} def ! /11x17 {792 1224 //statusdict begin .setpagesize end} def % 11x17 portrait ! /ledger {1224 792 //statusdict begin .setpagesize end} def % 11x17 landscape end --- 32,48 ---- % so the page dimensions must be the first two elements of the procedure. ! /letter {612 792 //statusdict begin .setpagesize end} bind def ! /note {540 720 //statusdict begin .setpagesize end} bind def ! /legal {612 1008 //statusdict begin .setpagesize end} bind def ! /a3 {842 1190 //statusdict begin .setpagesize end} bind def ! /a4 {595 842 //statusdict begin .setpagesize end} bind def ! /a5 {421 595 //statusdict begin .setpagesize end} bind def ! /a6 {297 421 //statusdict begin .setpagesize end} bind def ! /b4 {709 1002 //statusdict begin .setpagesize end} bind def ! /flsa {612 936 //statusdict begin .setpagesize end} bind def % U.S. foolscap ! /flse {612 936 //statusdict begin .setpagesize end} bind def % European foolscap ! /halfletter {396 612 //statusdict begin .setpagesize end} bind def ! /11x17 {792 1224 //statusdict begin .setpagesize end} bind def % 11x17 portrait ! /ledger {1224 792 //statusdict begin .setpagesize end} bind def % 11x17 landscape end *************** *** 63,93 **** /ramsize 4194304 def /hardwareiomode 0 def ! /sethardwareiomode {pop} def /softwareiomode 0 def ! /setsoftwareiomode {pop} def /dosysstart false def ! /setdosysstart {pop} def /allowjobreset true def ! /setallowjobreset {pop} def /defaultpaperfamily 0 def ! /setdefaultpaperfamily {pop} def /defaultpapertray 0 def ! /setdefaultpapertray {pop} def /defaulttrayswitch false def ! /setdefaulttrayswitch {pop} def % Tray and format selection ! /11x17tray {} def ! /a3tray {} def ! /a4tray {} def ! /a5tray {} def ! /a6tray {} def ! /b4tray {} def ! /flsatray {} def ! /flsetray {} def ! /halflettertray {} def ! /legaltray {} def ! /lettertray {} def % Per-job parameters --- 63,93 ---- /ramsize 4194304 def /hardwareiomode 0 def ! /sethardwareiomode {pop} bind def /softwareiomode 0 def ! /setsoftwareiomode {pop} bind def /dosysstart false def ! /setdosysstart {pop} bind def /allowjobreset true def ! /setallowjobreset {pop} bind def /defaultpaperfamily 0 def ! /setdefaultpaperfamily {pop} bind def /defaultpapertray 0 def ! /setdefaultpapertray {pop} bind def /defaulttrayswitch false def ! /setdefaulttrayswitch {pop} bind def % Tray and format selection ! /11x17tray {} bind def ! /a3tray {} bind def ! /a4tray {} bind def ! /a5tray {} bind def ! /a6tray {} bind def ! /b4tray {} bind def ! /flsatray {} bind def ! /flsetray {} bind def ! /halflettertray {} bind def ! /legaltray {} bind def ! /lettertray {} bind def % Per-job parameters *************** *** 95,101 **** /paperfamily 0 def % 0 is US, 1 is European /papertray 1 def ! /setpapertray {statusdict exch /papertray exch put} def /trayswitch false def % paperout feeds from another tray ! /papersize {/letter true} def % , /appletalktype (LaserWriter) def --- 95,101 ---- /paperfamily 0 def % 0 is US, 1 is European /papertray 1 def ! /setpapertray {statusdict exch /papertray exch put} bind def /trayswitch false def % paperout feeds from another tray ! /papersize {/letter true} bind def % , /appletalktype (LaserWriter) def *************** *** 103,111 **** %%%%%% Reference Manual, First Edition. ! /checkpassword {statusdict begin .password eq end} def ! /defaulttimeouts {statusdict begin .timeouts aload pop end} def %/dostartpage ! /eescratch {pop 0} def ! /idlefonts {statusdict begin mark .idlefonts aload pop end} def /jobname () def %/jobtimeout --- 103,111 ---- %%%%%% Reference Manual, First Edition. ! /checkpassword {statusdict begin .password eq end} bind def ! /defaulttimeouts {statusdict begin .timeouts aload pop end} bind def %/dostartpage ! /eescratch {pop 0} bind def ! /idlefonts {statusdict begin mark .idlefonts aload pop end} bind def /jobname () def %/jobtimeout *************** *** 112,133 **** /manualfeed false def /manualfeedtimeout 60 def ! /margins {statusdict begin .topmargin .leftmargin end} def ! /pagecount {4711} def ! /pagestackorder {false} def %/pagetype /prefeed false def ! /printererror {pop pop} def ! /printername {statusdict begin .printername exch copy end} def /product (Ghostscript) def /revision revision def % revision is defined in systemdict ! /sccbatch {pop 9600 0} def ! /sccinteractive {pop 9600 0} def ! /setdefaulttimeouts {statusdict begin .timeouts astore pop end} def ! /setdostartpage {statusdict exch /dostartpage exch put} def ! /seteescratch {pop pop} def ! /setidlefonts {] statusdict exch /.idlefonts exch put} def ! /setjobtimeout {statusdict exch /jobtimeout exch put} def /setmargins ! {statusdict begin /.leftmargin exch def /.topmargin exch def end} def /setpagetype { statusdict begin --- 112,133 ---- /manualfeed false def /manualfeedtimeout 60 def ! /margins {statusdict begin .topmargin .leftmargin end} bind def ! /pagecount {4711} bind def ! /pagestackorder {false} bind def %/pagetype /prefeed false def ! /printererror {pop pop} bind def ! /printername {statusdict begin .printername exch copy end} bind def /product (Ghostscript) def /revision revision def % revision is defined in systemdict ! /sccbatch {pop 9600 0} bind def ! /sccinteractive {pop 9600 0} bind def ! /setdefaulttimeouts {statusdict begin .timeouts astore pop end} bind def ! /setdostartpage {statusdict exch /dostartpage exch put} bind def ! /seteescratch {pop pop} bind def ! /setidlefonts {] statusdict exch /.idlefonts exch put} bind def ! /setjobtimeout {statusdict exch /jobtimeout exch put} bind def /setmargins ! {statusdict begin /.leftmargin exch def /.topmargin exch def end} bind def /setpagetype { statusdict begin *************** *** 135,139 **** /pagetype exch def end ! } def /setpassword {exch checkpassword --- 135,139 ---- /pagetype exch def end ! } bind def /setpassword {exch checkpassword *************** *** 140,148 **** {statusdict exch /.password exch put true} {pop false} ! ifelse} def /setprintername ! {dup length string copy statusdict exch /printername exch put} def ! /setsccbatch {pop pop pop} def ! /setsccinteractive {pop pop pop} def /waittimeout 300 def --- 140,148 ---- {statusdict exch /.password exch put true} {pop false} ! ifelse} bind def /setprintername ! {dup length string copy statusdict exch /printername exch put} bind def ! /setsccbatch {pop pop pop} bind def ! /setsccinteractive {pop pop pop} bind def /waittimeout 300 def *************** *** 149,155 **** /.setpagesize { mark /HWSize [ ! currentdevice /HWResolution gsgetdeviceprop aload pop ! 5 index mul 72 div cvi exch ! 6 index mul 72 div cvi exch ] currentdevice putdeviceprops pop pop pop initmatrix initclip erasepage --- 149,154 ---- /.setpagesize { mark /HWSize [ ! 4 index 4 index matrix defaultmatrix dtransform ! abs ceiling cvi exch abs ceiling cvi exch ] currentdevice putdeviceprops pop pop pop initmatrix initclip erasepage *************** *** 171,182 **** serverdict begin ! /execjob { } def % The Red Book implies that something like the following is % an appropriate definition of exitserver. ! /exitserver { clear stop } def % However, this interacts badly with Ghostscript's present error handler, % so we override it with the following less appropriate definition. ! /exitserver { clear cleardictstack } def ! /setrealdevice { } def end % serverdict --- 170,181 ---- serverdict begin ! /execjob { } bind def % The Red Book implies that something like the following is % an appropriate definition of exitserver. ! /exitserver { clear stop } bind def % However, this interacts badly with Ghostscript's present error handler, % so we override it with the following less appropriate definition. ! /exitserver { clear cleardictstack } bind def ! /setrealdevice { } bind def end % serverdict diff -rc2N gs25/gsaddmod gs251/gsaddmod *** gs25/gsaddmod Tue Nov 5 14:31:46 1991 --- gs251/gsaddmod Fri Sep 4 17:37:04 1992 *************** *** 1,3 **** ! export m; m=$1 ! shift ! echo ./gsaddres $* >>${m}.dev --- 1,32 ---- ! export m c; m=$1; c=$2 ! shift; shift ! case ${c} in ! -dev) ! for d in $*; do ! echo device_\(gs_${d}_device\) >>${m}.d_n ! done;; ! -font) ! for d in $*; do ! echo font_\(\"0.font_${d}\",gsf_${d},zf_${d}\) >>${m}.d_f ! done;; ! -include) ! for d in $*; do ! echo /bin/sh '<' ./${d}.dev >>${m}.dev ! done;; ! -lib) ! for l in $*; do ! echo ./echogs -q -l${l} -x 205c '>>' _temp_.dlb >>${m}.dev ! done;; ! -obj) ! for o in $*; do ! ./echogs -q ${o} -x 205c >>${m}.d_o ! done;; ! -oper) ! for o in $*; do ! echo oper_\(${o}_op_defs\) >>${m}.d_v ! done;; ! -ps) ! for f in $*; do ! echo psfile_\(\"${f}.ps\"\) >>${m}.d_v ! done;; ! esac diff -rc2N gs25/gsaddmod.bat gs251/gsaddmod.bat *** gs25/gsaddmod.bat Wed Jun 10 03:28:02 1992 --- gs251/gsaddmod.bat Thu Aug 20 13:36:48 1992 *************** *** 8,12 **** rem ---------------- font ---------------- :-font ! echo font_("0.font_%3",gsf_%3,zf_%3)>>%1.d_v gsaddmod %1 %2 %4 %5 %6 %7 %8 %9 rem ---------------- include ---------------- --- 8,12 ---- rem ---------------- font ---------------- :-font ! echo font_("0.font_%3",gsf_%3,zf_%3)>>%1.d_f gsaddmod %1 %2 %4 %5 %6 %7 %8 %9 rem ---------------- include ---------------- diff -rc2N gs25/gsaddres gs251/gsaddres *** gs25/gsaddres Fri Jun 26 08:10:28 1992 --- gs251/gsaddres *************** *** 1,32 **** - case $1 in - -dev) shift - for d in $*; do - echo device_\(gs_${d}_device\) >>_temp_.dh - done;; - -font) shift - for d in $*; do - echo font_\(\"0.font_${d}\",gsf_${d},zf_${d}\) >>_temp_.dft - done;; - -include) shift - for d in $*; do - /bin/sh < ./${d}.dev - done;; - -lib) shift - for l in $*; do - ./echogs -n -q -l${l} >>_temp_.dlb - ./echogs -x 205c >>_temp_.dlb - done;; - -obj) shift - for o in $*; do - ./echogs -n ${o} >>_temp_.dob - ./echogs -x 205c >>_temp_.dob - done;; - -oper) shift - for o in $*; do - echo oper_\(${o}_op_defs\) >>_temp_.dop - done;; - -ps) shift - for f in $*; do - echo psfile_\(\"${f}.ps\"\) >>_temp_.dps - done;; - esac --- 0 ---- diff -rc2N gs25/gschar0.c gs251/gschar0.c *** gs25/gschar0.c Tue Jan 29 17:10:50 1991 --- gs251/gschar0.c Thu Sep 10 06:17:10 1992 *************** *** 1,3 **** ! /* Copyright (C) 1991 Aladdin Enterprises. All rights reserved. Distributed by Free Software Foundation, Inc. --- 1,3 ---- ! /* Copyright (C) 1991, 1992 Aladdin Enterprises. All rights reserved. Distributed by Free Software Foundation, Inc. *************** *** 20,23 **** --- 20,24 ---- /* gschar0.c */ /* Composite font decoding for Ghostscript library */ + /****** DOESN'T WORK. DON'T TRY TO USE IT. ******/ #include "gx.h" #include "gserrors.h" *************** *** 30,34 **** #include "gxfont.h" ! /* Get the next character and font from a composite string. */ /* If we run off the end of the string in the middle of a */ /* multi-byte sequence, return gs_error_rangecheck. */ --- 31,56 ---- #include "gxfont.h" ! /* Select the appropriate descendant of a font. */ ! /* Free variables: fdepth, index, p. */ ! #define select_descendant(pfont, pdata, n)\ ! if ( (n) >= pdata->encoding_size )\ ! return_error(gs_error_rangecheck);\ ! if ( fdepth >= max_font_depth - 1 )\ ! return_error(gs_error_invalidfont);\ ! pfont = pdata->FDepVector[pdata->Encoding[n]];\ ! penum->fstack[penum->fdepth = ++fdepth] = pfont;\ ! penum->index = index = p - penum->str ! ! /* Define a structure for a (character code, font index) pair. */ ! typedef struct { ! uint fidx; ! char_code chr; ! } mapped_char; ! ! /* Forward declarations */ ! private int map_SubsVector(P4(const byte *, int, gs_type0_data *, mapped_char *)); ! ! /* Get the next character (to penum->chr) and font (to penum->pfont) ! /* from a composite string. */ /* If we run off the end of the string in the middle of a */ /* multi-byte sequence, return gs_error_rangecheck. */ *************** *** 35,51 **** /* If the string is empty, return 1. Otherwise, return 0. */ int ! gs_type0_next(gs_show_enum *penum, ulong *pchar) { uint index = penum->index; ! byte *p = penum->str + index; uint size = penum->size; ! uint left; ! gs_font *pfont = penum->fstack[penum->fdepth]; ! gs_type0_data *pdata = &pfont->data.type0_data; ! uint fidx; ! int modal_mapping; ! top: if ( (left = size - index) == 0 ) return 1; #define need_left(n)\ ! if ( left < n ) return_error(gs_error_rangecheck) ! switch ( pdata->FMapType ) { default: /* can't happen */ --- 57,74 ---- /* If the string is empty, return 1. Otherwise, return 0. */ int ! gs_type0_next(gs_show_enum *penum) { uint index = penum->index; ! const byte *p = penum->str + index; uint size = penum->size; ! int fdepth = 0; ! gs_font *pfont = penum->fstack[0]; ! gs_type0_data *pdata; ! mapped_char mc; ! int code; ! if ( size == index ) return 1; #define need_left(n)\ ! if ( size - index < n ) return_error(gs_error_rangecheck) ! top: pdata = &pfont->data.type0_data; ! top1: switch ( pdata->FMapType ) { default: /* can't happen */ *************** *** 54,152 **** /* ------ Non-modal mappings ------ */ ! case 2: /* 8/8 mapping */ ! modal_mapping = 0; need_left(2); ! fidx = *p++; ! *pchar = *p++; break; ! case 4: /* 1/7 mapping */ ! modal_mapping = 0; ! fidx = *p >> 7; ! *pchar = *p++ & 0x7f; break; ! case 5: /* 9/7 mapping */ ! modal_mapping = 0; need_left(2); ! fidx = ((uint)*p << 1) + (p[1] >> 7); ! *pchar = p[1] & 0x7f; p += 2; break; ! case 6: /* SubsVector mapping */ ! modal_mapping = 0; ! { uint subs_count = pdata->subs_size; ! byte *psv = pdata->SubsVector; ! need_left(pdata->subs_width); ! #define subs_loop(subs_elt, width)\ ! while ( subs_count != 0 && chr >= (schr = subs_elt) )\ ! subs_count--, chr -= schr, psv += width;\ ! *pchar = chr; break ! switch ( pdata->subs_width ) ! { ! default: /* can't happen */ ! return_error(gs_error_invalidfont); ! case 1: ! { byte chr = *p, schr; ! subs_loop(*psv, 1); ! } ! case 2: ! #define w2(p) (((ushort)*p << 8) + p[1]) ! { ushort chr = w2(p), schr; ! subs_loop(w2(psv), 2); ! } ! #undef w2 ! case 3: ! #define w3(p) (((ulong)*p << 16) + ((uint)p[1] << 8) + p[2]) ! { ulong chr = w3(p), schr; ! subs_loop(w3(psv), 3); ! } ! #undef w3 ! case 4: ! #define w4(p)\ ! (((ulong)*p << 24) + ((ulong)p[1] << 16) + ((uint)p[1] << 8) + p[2]) ! { ulong chr = w4(p), schr; ! subs_loop(w4(psv), 4); ! } ! #undef w4 ! #undef subs_loop ! } ! p += pdata->subs_width; break; ! } /* ------ Modal mappings ------ */ ! case 3: /* escape mapping */ ! modal_mapping = 1; ! if ( *p == pdata->EscChar ) ! { need_left(2); ! fidx = p[1]; p += 2; goto remap; ! } ! goto modal; ! case 7: /* double escape mapping */ ! modal_mapping = 1; ! if ( *p == pdata->EscChar ) ! { need_left(2); ! if ( p[1] == pdata->EscChar ) ! { need_left(3); ! fidx = p[2] + 256; p += 3; goto remap; ! } ! fidx = p[1]; p += 2; goto remap; ! } ! goto modal; ! case 8: /* shift mapping */ ! modal_mapping = 1; ! if ( *p == pdata->ShiftIn ) ! { fidx = 0; p++; goto remap; ! } ! else if ( *p == pdata->ShiftOut ) ! { fidx = 1; p++; goto remap; ! } ! modal: *pchar = *p++; ! penum->index = p - penum->str; return 0; --- 77,142 ---- /* ------ Non-modal mappings ------ */ ! case fmap_8_8: need_left(2); ! mc.fidx = *p++; ! mc.chr = *p++; break; ! case fmap_1_7: ! mc.fidx = *p >> 7; ! mc.chr = *p++ & 0x7f; break; ! case fmap_9_7: need_left(2); ! mc.fidx = ((uint)*p << 1) + (p[1] >> 7); ! mc.chr = p[1] & 0x7f; p += 2; break; ! case fmap_SubsVector: ! { int width = pdata->subs_width; ! need_left(width); ! code = map_SubsVector(p, width, pdata, &mc); ! if ( code < 0 ) return code; break; ! } /* ------ Modal mappings ------ */ ! case fmap_escape: ! if ( *p != pdata->EscChar ) goto same_mode; ! need_left(2); ! mc.fidx = p[1]; p += 2; goto cmode; ! case fmap_double_escape: ! if ( *p != pdata->EscChar ) goto same_mode; ! need_left(2); ! if ( p[1] == *p ) ! { need_left(3); ! mc.fidx = p[2] + 256; p += 3; goto cmode; ! } ! mc.fidx = p[1]; p += 2; goto cmode; ! /* Enter a mode. */ ! cmode: penum->fdepth = 1; ! break; ! case fmap_shift: ! if ( *p == pdata->ShiftIn ) mc.fidx = 0; ! else if ( *p == pdata->ShiftOut ) mc.fidx = 1; ! else goto same_mode; ! select_descendant(pfont, pdata, mc.fidx); ! goto top; ! ! /* Stay in the same mode. */ ! same_mode: for ( ; ; ) ! { pfont = penum->fstack[++fdepth]; ! if ( pfont->FontType != ft_composite) break; ! pdata = &pfont->data.type0_data; ! if ( pdata->FMapType != fmap_escape ) ! goto top1; /* must be non-modal */ ! } ! penum->chr = *p++; ! penum->index = index + 1; return 0; *************** *** 153,177 **** } ! /* Control continues here for non-modal mappings, */ ! /* or for modal mappings after a font change. */ ! remap: if ( fidx >= pdata->encoding_size ) ! return_error(gs_error_rangecheck); ! fidx = pdata->Encoding[fidx]; ! penum->index = p - penum->str; /* We pre-checked the encoding vector, so we know that */ /* fidx is now a legal subscript for FDepVector. */ ! pfont = pdata->FDepVector[fidx]; ! if ( modal_mapping ) ! { if ( penum->index == 0 ) return 1; ! if ( pfont->FontType == ft_composite ) ! { penum->fstack[++penum->fdepth] = pfont; ! goto top; ! } ! *pchar = *p++; ! penum->index--; } ! else ! { penum->pfont = pfont; } return 0; } --- 143,233 ---- } ! /* Control continues here for non-modal mappings. */ ! remap: select_descendant(pfont, pdata, mc.fidx); ! /****** WHERE DOES THE FOLLOWING COMMENT BELONG?? ******/ /* We pre-checked the encoding vector, so we know that */ /* fidx is now a legal subscript for FDepVector. */ ! if ( pfont->FontType == ft_composite ) /* must be non-modal */ ! { pdata = &pfont->data.type0_data; ! switch ( pdata->FMapType ) ! { ! ! case fmap_8_8: ! need_left(1); ! mc.fidx = mc.chr; ! mc.chr = *p++; ! break; ! ! case fmap_1_7: ! case fmap_9_7: ! need_left(1); ! mc.fidx = mc.chr; ! mc.chr = *p++ & 0x7f; ! break; ! ! case fmap_SubsVector: ! { int width = pdata->subs_width; ! /* It isn't clear what to use for the input */ ! /* to the mapping algorithm.... */ ! byte c[4]; ! int i = width; ! while ( --i >= 0 ) ! c[i] = (byte)mc.chr, mc.chr >>= 8; ! code = map_SubsVector(c, width, pdata, &mc); ! if ( code < 0 ) return code; ! break; ! } ! ! default: /* can't happen */ ! return_error(gs_error_invalidfont); ! } ! goto remap; ! } ! penum->pfont = pfont; ! penum->chr = mc.chr; ! return 0; ! } ! ! /* ------ Internal routines ------ */ ! ! /* Get the font index for a character from a SubsVector. */ ! private int ! map_SubsVector(const byte *p, int width, gs_type0_data *pdata, mapped_char *pmc) ! { uint subs_count = pdata->subs_size; ! const byte *psv = pdata->SubsVector; ! #define subs_loop(subs_elt, width)\ ! while ( subs_count != 0 && chr >= (schr = subs_elt) )\ ! subs_count--, chr -= schr, psv += width;\ ! pmc->chr = chr; break ! switch ( width ) ! { ! default: /* can't happen */ ! return_error(gs_error_invalidfont); ! case 1: ! { byte chr = *p, schr; ! subs_loop(*psv, 1); ! } ! case 2: ! #define w2(p) (((ushort)*p << 8) + p[1]) ! { ushort chr = w2(p), schr; ! subs_loop(w2(psv), 2); ! } ! #undef w2 ! case 3: ! #define w3(p) (((ulong)*p << 16) + ((uint)p[1] << 8) + p[2]) ! { ulong chr = w3(p), schr; ! subs_loop(w3(psv), 3); } ! #undef w3 ! case 4: ! #define w4(p)\ ! (((ulong)*p << 24) + ((ulong)p[1] << 16) + ((uint)p[2] << 8) + p[3]) ! { ulong chr = w4(p), schr; ! subs_loop(w4(psv), 4); } + #undef w4 + #undef subs_loop + } + pmc->fidx = pdata->subs_size - subs_count; return 0; } diff -rc2N gs25/gsconfig gs251/gsconfig *** gs25/gsconfig Mon Jun 1 03:27:58 1992 --- gs251/gsconfig Fri Sep 4 17:18:46 1992 *************** *** 2,11 **** shift else ! rm -f _temp_.dft _temp_.dob _temp_.dlb _temp_.d ! touch _temp_.dft _temp_.dob _temp_.dlb _temp_.d ! rm -f _temp_.dh _temp_.dop _temp_.dps echo '/* This file was automatically generated by Ghostscript (gsconfig). */' > _temp_.dh echo '/* See gconfig.c for documentation. */' >>_temp_.dh - touch _temp_.dop _temp_.dps fi rm -f _temp_.c --- 2,10 ---- shift else ! rm -f _temp_.dob _temp_.dop _temp_.dlb _temp_.d ! touch _temp_.dob _temp_.dop _temp_.dlb _temp_.d ! rm -f _temp_.dh echo '/* This file was automatically generated by Ghostscript (gsconfig). */' > _temp_.dh echo '/* See gconfig.c for documentation. */' >>_temp_.dh fi rm -f _temp_.c *************** *** 14,22 **** rm -f obj.tr gconfig.h lib.tr sort <_temp_.dob | uniq >obj.tr mv _temp_.dh gconfig.h - sort <_temp_.dft | uniq >>gconfig.h - sort <_temp_.dop | uniq >>gconfig.h mv _temp_.dlb lib.tr - sort <_temp_.dps | uniq >>gconfig.h rm -f _temp_.d* EOF --- 13,19 ---- rm -f obj.tr gconfig.h lib.tr sort <_temp_.dob | uniq >obj.tr + sort <_temp_.dop | uniq >>_temp_.dh mv _temp_.dh gconfig.h mv _temp_.dlb lib.tr rm -f _temp_.d* EOF diff -rc2N gs25/gsdevice.c gs251/gsdevice.c *** gs25/gsdevice.c Wed Aug 19 00:55:56 1992 --- gs251/gsdevice.c Wed Sep 9 13:54:44 1992 *************** *** 71,77 **** }; - /* The null device */ - gx_device *gx_device_null_p = &null_device; - /* Flush buffered output to the device */ int --- 71,74 ---- *************** *** 96,100 **** gs_copyscanlines(gx_device *dev, int start_y, byte *data, uint size, int *plines_copied, uint *pbytes_copied) ! { uint line_size = gx_device_bytes_per_scan_line(dev, 0); int code = (*dev->procs->get_bits)(dev, start_y, data, size, 0); uint count; --- 93,97 ---- gs_copyscanlines(gx_device *dev, int start_y, byte *data, uint size, int *plines_copied, uint *pbytes_copied) ! { uint line_size = gx_device_raster(dev, 0); int code = (*dev->procs->get_bits)(dev, start_y, data, size, 0); uint count; *************** *** 155,162 **** gs_makeimagedevice(gx_device **pnew_dev, const gs_matrix *pmat, uint width, uint height, const byte *colors, int num_colors, ! proc_alloc_t palloc) { const gx_device_memory *old_dev; register gx_device_memory *new_dev; - byte *bits; int palette_size = num_colors; int bpp = 1; --- 152,158 ---- gs_makeimagedevice(gx_device **pnew_dev, const gs_matrix *pmat, uint width, uint height, const byte *colors, int num_colors, ! const gs_memory_procs *mp) { const gx_device_memory *old_dev; register gx_device_memory *new_dev; int palette_size = num_colors; int bpp = 1; *************** *** 164,169 **** int bits_per_pixel; float x_pixels_per_unit, y_pixels_per_unit; - ulong bitmap_size; byte palette[256 * 3]; int has_color; if ( width <= 0 || height <= 0 ) return_error(gs_error_rangecheck); --- 160,165 ---- int bits_per_pixel; float x_pixels_per_unit, y_pixels_per_unit; byte palette[256 * 3]; + byte *dev_palette; int has_color; if ( width <= 0 || height <= 0 ) return_error(gs_error_rangecheck); *************** *** 264,268 **** return_error(gs_error_undefinedresult); /* All checks done, allocate the device. */ ! new_dev = (gx_device_memory *)(*palloc)(1, old_dev->params_size, "gs_makeimagedevice(device)"); if ( new_dev == 0 ) return_error(gs_error_VMerror); *new_dev = *old_dev; --- 260,264 ---- return_error(gs_error_undefinedresult); /* All checks done, allocate the device. */ ! new_dev = (gx_device_memory *)(*mp->alloc)(1, old_dev->params_size, "gs_makeimagedevice(device)"); if ( new_dev == 0 ) return_error(gs_error_VMerror); *new_dev = *old_dev; *************** *** 275,289 **** new_dev->color_info.max_rgb = 0, new_dev->color_info.dither_rgb = 0; ! bitmap_size = gdev_mem_bitmap_size(new_dev); ! if ( bitmap_size > max_uint ) /* can't allocate it! */ ! return_error(gs_error_limitcheck); ! bits = (byte *)(*palloc)(1, (uint)bitmap_size + pcount, ! "gs_makeimagedevice(bits)"); ! if ( bits == 0 ) return_error(gs_error_VMerror); ! new_dev->base = bits; new_dev->invert = (palette[0] | palette[1] | palette[2] ? -1 : 0); /* bogus */ new_dev->palette_size = palette_size; ! new_dev->palette = bits + bitmap_size; ! memcpy(new_dev->palette, palette, pcount); new_dev->is_open = 0; *pnew_dev = (gx_device *)new_dev; --- 271,282 ---- new_dev->color_info.max_rgb = 0, new_dev->color_info.dither_rgb = 0; ! dev_palette = (byte *)(*mp->alloc)(pcount, 1, "gs_makeimagedevice(palette)"); ! if ( dev_palette == 0 ) return_error(gs_error_VMerror); new_dev->invert = (palette[0] | palette[1] | palette[2] ? -1 : 0); /* bogus */ new_dev->palette_size = palette_size; ! new_dev->palette = dev_palette; ! memcpy(dev_palette, palette, pcount); ! /* The bitmap will be allocated when the device is opened. */ ! new_dev->memory_procs = *mp; new_dev->is_open = 0; *pnew_dev = (gx_device *)new_dev; *************** *** 320,324 **** void gs_nulldevice(gs_state *pgs) ! { gs_setdevice(pgs, gx_device_null_p); } --- 313,317 ---- void gs_nulldevice(gs_state *pgs) ! { gs_setdevice(pgs, &null_device); } *************** *** 353,357 **** /* with or without padding to a word boundary. */ uint ! gx_device_bytes_per_scan_line(const gx_device *dev, int pad) { ulong bits = (ulong)dev->width * dev->color_info.depth; return (pad ? --- 346,350 ---- /* with or without padding to a word boundary. */ uint ! gx_device_raster(const gx_device *dev, int pad) { ulong bits = (ulong)dev->width * dev->color_info.depth; return (pad ? *************** *** 362,371 **** /* Adjust the resolution for devices that only have a fixed set of */ /* geometries, so that the apparent size in inches remains constant. */ int gx_device_adjust_resolution(gx_device *dev, ! int actual_width, int actual_height) { double width_ratio = (double)actual_width / dev->width ; double height_ratio = (double)actual_height / dev->height ; ! double ratio = max(width_ratio, height_ratio); dev->x_pixels_per_inch *= ratio; dev->y_pixels_per_inch *= ratio; --- 355,368 ---- /* Adjust the resolution for devices that only have a fixed set of */ /* geometries, so that the apparent size in inches remains constant. */ + /* If fit=1, the resolution is adjusted so that the entire image fits; */ + /* if fit=0, one dimension fits, but the other one is clipped. */ int gx_device_adjust_resolution(gx_device *dev, ! int actual_width, int actual_height, int fit) { double width_ratio = (double)actual_width / dev->width ; double height_ratio = (double)actual_height / dev->height ; ! double ratio = ! (fit ? min(width_ratio, height_ratio) : ! max(width_ratio, height_ratio)); dev->x_pixels_per_inch *= ratio; dev->y_pixels_per_inch *= ratio; *************** *** 481,484 **** --- 478,493 ---- }; + /* Get the size of the device properties. */ + int + gs_getdeviceprops_size(gx_device *dev) + { return (*dev->procs->get_props)(dev, NULL); + } + + /* Get the device properties. */ + int + gs_getdeviceprops(gx_device *dev, gs_prop_item *plist) + { return (*dev->procs->get_props)(dev, plist); + } + /* Get standard properties. */ int *************** *** 518,528 **** } /* Set standard properties. */ ! /* Note that if the device is open, it will be closed and reopened. */ ! /****** DOESN'T FIND ALL GSTATES THAT REFERENCE THE DEVICE. ******/ int gx_default_put_props(gx_device *dev, gs_prop_item *plist, int count) { gs_prop_item *known[2]; - int reopen; int code = 0; gx_device temp_dev; --- 527,545 ---- } + /* Set the device properties. */ + /* If the device was open and the put_props procedure closed it, */ + /* return 1; otherwise, return 0 or an error code as usual. */ + int + gs_putdeviceprops(gx_device *dev, gs_prop_item *plist, int count) + { int was_open = dev->is_open; + int code = (*dev->procs->put_props)(dev, plist, count); + return (code < 0 ? code : was_open && !dev->is_open ? 1 : code); + } + /* Set standard properties. */ ! /* Note that setting the size or resolution closes the device. */ int gx_default_put_props(gx_device *dev, gs_prop_item *plist, int count) { gs_prop_item *known[2]; int code = 0; gx_device temp_dev; *************** *** 544,547 **** --- 561,565 ---- temp_dev.height = ap[1].value.i; } + if ( code == 0 ) code = 1; } } *************** *** 559,562 **** --- 577,581 ---- temp_dev.y_pixels_per_inch = ap[1].value.f; } + if ( code == 0 ) code = 1; } } *************** *** 563,569 **** if ( code < 0 ) return_error(code); ! reopen = dev->is_open && (known[0] != 0 || known[1] != 0); ! if ( reopen ) ! if ( (code = gs_closedevice(dev)) < 0 ) return code; dev->x_pixels_per_inch = temp_dev.x_pixels_per_inch; dev->y_pixels_per_inch = temp_dev.y_pixels_per_inch; --- 582,590 ---- if ( code < 0 ) return_error(code); ! /* Close the device; gs_putdeviceprops will reopen it. */ ! if ( dev->is_open && code ) ! { int ccode = gs_closedevice(dev); ! if ( ccode < 0 ) return ccode; ! } dev->x_pixels_per_inch = temp_dev.x_pixels_per_inch; dev->y_pixels_per_inch = temp_dev.y_pixels_per_inch; *************** *** 570,578 **** dev->width = temp_dev.width; dev->height = temp_dev.height; ! if ( reopen ) ! { if ( (code = (*dev->procs->open_device)(dev)) < 0 ) ! return_error(code); ! dev->is_open = 1; ! } ! return 0; } --- 591,594 ---- dev->width = temp_dev.width; dev->height = temp_dev.height; ! return code; } diff -rc2N gs25/gsdj gs251/gsdj *** gs25/gsdj --- gs251/gsdj Sun Dec 29 03:43:08 1991 *************** *** 0 **** --- 1 ---- + gs -q -sDEVICE=deskjet -r300 -dNOPAUSE -- gslp.ps $* diff -rc2N gs25/gsdj500.bat gs251/gsdj500.bat *** gs25/gsdj500.bat Sun Apr 12 16:48:04 1992 --- gs251/gsdj500.bat Tue Sep 1 01:21:48 1992 *************** *** 1 **** ! @gs -q -sDEVICE=djet500 -r300 -dDISKFONTS -dNOPAUSE -- gslp.ps %1 %2 %3 %4 %5 %6 %7 %8 %9 --- 1 ---- ! @gs -q -sDEVICE=djet500 -r300 -dDISKFONTS -dNOPAUSE -- gslp.ps %1 %2 %3 %4 %5 %6 %7 %8 %9 diff -rc2N gs25/gsfile.c gs251/gsfile.c *** gs25/gsfile.c Thu Apr 9 17:55:32 1992 --- gs251/gsfile.c Sun Sep 6 19:18:30 1992 *************** *** 30,34 **** int gs_writeppmfile(gx_device_memory *md, FILE *file) ! { int raster = gx_device_bytes_per_scan_line((gx_device *)md, 0); int height = md->height; int depth = md->color_info.depth; --- 30,34 ---- int gs_writeppmfile(gx_device_memory *md, FILE *file) ! { int raster = gx_device_raster((gx_device *)md, 0); int height = md->height; int depth = md->color_info.depth; diff -rc2N gs25/gslj gs251/gslj *** gs25/gslj --- gs251/gslj Mon Sep 7 15:18:44 1992 *************** *** 0 **** --- 1 ---- + gs -q -sDEVICE=laserjet -r300 -dNOPAUSE -- gslp.ps $* diff -rc2N gs25/gslj.bat gs251/gslj.bat *** gs25/gslj.bat --- gs251/gslj.bat Tue Sep 8 19:06:44 1992 *************** *** 0 **** --- 1 ---- + @gs -q -sDEVICE=laserjet -r300 -dDISKFONTS -dNOPAUSE -- gslp.ps %1 %2 %3 %4 %5 %6 %7 %8 %9 diff -rc2N gs25/gsmain.c gs251/gsmain.c *** gs25/gsmain.c Mon Jul 27 07:51:20 1992 --- gs251/gsmain.c Sun Sep 6 03:17:56 1992 *************** *** 104,107 **** --- 104,108 ---- if ( !init2_done ) { int code, exit_code; + ref error_object; call_init(gs_init) call_init(zop_init) *************** *** 119,126 **** } /* Execute the standard initialization file. */ ! code = gs_run_file(gs_init_file, gs_user_errors, &exit_code); if ( code < 0 ) { if ( code != gs_error_Fatal ) ! gs_debug_dump_stack(code); gs_exit((exit_code ? exit_code : 2)); } --- 120,127 ---- } /* Execute the standard initialization file. */ ! code = gs_run_file(gs_init_file, gs_user_errors, &exit_code, &error_object); if ( code < 0 ) { if ( code != gs_error_Fatal ) ! gs_debug_dump_stack(code, &error_object); gs_exit((exit_code ? exit_code : 2)); } *************** *** 159,163 **** } int ! gs_run_file(const char *file_name, int user_errors, int *pexit_code) { ref initial_file; set_lib_paths(); --- 160,164 ---- } int ! gs_run_file(const char *file_name, int user_errors, int *pexit_code, ref *perror_object) { ref initial_file; set_lib_paths(); *************** *** 167,175 **** } r_set_attrs(&initial_file, a_execute + a_executable); ! return gs_interpret(&initial_file, user_errors, pexit_code); } int ! gs_run_string(const char *str, int user_errors, int *pexit_code) { ref stref; set_lib_paths(); --- 168,176 ---- } r_set_attrs(&initial_file, a_execute + a_executable); ! return gs_interpret(&initial_file, user_errors, pexit_code, perror_object); } int ! gs_run_string(const char *str, int user_errors, int *pexit_code, ref *perror_object) { ref stref; set_lib_paths(); *************** *** 176,180 **** make_tasv(&stref, t_string, a_executable + a_readonly, strlen(str), const_bytes, (byte *)str); ! return gs_interpret(&stref, gs_user_errors, pexit_code); } --- 177,181 ---- make_tasv(&stref, t_string, a_executable + a_readonly, strlen(str), const_bytes, (byte *)str); ! return gs_interpret(&stref, gs_user_errors, pexit_code, perror_object); } *************** *** 210,222 **** extern void debug_print_ref(P1(const ref *)); extern void debug_dump_refs(P3(const ref *, uint, const char *)); - extern ref error_object; /* Dump the stacks after interpretation */ void ! gs_debug_dump_stack(int code) { zflush(osp); /* force out buffered output */ ! dprintf1("\nUnexpected interpreter error %d!\nError object: ", code); ! debug_print_ref(&error_object); ! dputc('\n'); debug_dump_refs(osbot, osp + 1 - osbot, "Operand stack"); debug_dump_refs(esbot, esp + 1 - esbot, "Execution stack"); --- 211,225 ---- extern void debug_print_ref(P1(const ref *)); extern void debug_dump_refs(P3(const ref *, uint, const char *)); /* Dump the stacks after interpretation */ void ! gs_debug_dump_stack(int code, ref *perror_object) { zflush(osp); /* force out buffered output */ ! dprintf1("\nUnexpected interpreter error %d!\n", code); ! if ( perror_object != 0 ) ! { dputs("Error object: "); ! debug_print_ref(perror_object); ! dputc('\n'); ! } debug_dump_refs(osbot, osp + 1 - osbot, "Operand stack"); debug_dump_refs(esbot, esp + 1 - esbot, "Execution stack"); diff -rc2N gs25/gspath2.c gs251/gspath2.c *** gs25/gspath2.c Sun Aug 2 13:53:10 1992 --- gs251/gspath2.c Thu Sep 10 17:37:00 1992 *************** *** 193,202 **** (dev->height / dev->y_pixels_per_inch - dev->t_margin) * 72, &box.q); - /* Make sure the clipping rectangle falls entirely */ - /* in non-negative coordinates. */ - if ( box.p.x < 0 ) box.p.x = 0; - if ( box.p.y < 0 ) box.p.y = 0; - if ( box.q.x < 0 ) box.q.x = 0; - if ( box.q.y < 0 ) box.p.y = 0; } return gx_clip_to_rectangle(pgs, &box); --- 193,196 ---- diff -rc2N gs25/gsprops.h gs251/gsprops.h *** gs25/gsprops.h Tue Apr 7 15:43:46 1992 --- gs251/gsprops.h Tue Sep 8 03:39:32 1992 *************** *** 58,61 **** --- 58,62 ---- # define gs_prop_item_DEFINED typedef struct gs_prop_item_s gs_prop_item; + extern const uint gs_prop_item_sizeof; #endif diff -rc2N gs25/gssetmod gs251/gssetmod *** gs25/gssetmod Tue Apr 7 15:31:06 1992 --- gs251/gssetmod Wed Sep 9 13:35:28 1992 *************** *** 1,5 **** export m; m=$1 shift ! rm -f ${m}.dev echo '# This file was automatically generated by Ghostscript (gssetmod).' >${m}.dev ! echo ./gsaddres -obj $* >${m}.dev --- 1,9 ---- export m; m=$1 shift ! rm -f ${m}.d_f ${m}.d_n ${m}.d_o ${m}.d_v ! touch ${m}.d_f ${m}.d_n ${m}.d_o ${m}.d_v echo '# This file was automatically generated by Ghostscript (gssetmod).' >${m}.dev ! echo cat ${m}.d_n '>>_temp_.dh' >>${m}.dev ! echo cat ${m}.d_o '>>_temp_.dob' >>${m}.dev ! echo cat ${m}.d_v '>>_temp_.dop' >>${m}.dev ! ./gsaddmod ${m} -obj $* diff -rc2N gs25/gssetmod.bat gs251/gssetmod.bat *** gs25/gssetmod.bat Tue Aug 11 18:32:32 1992 --- gs251/gssetmod.bat Fri Sep 4 17:15:48 1992 *************** *** 2,5 **** --- 2,6 ---- echogs @echo off >%1.dev echo rem This file was automatically generated by Ghostscript (gssetmod). >>%1.dev + if exist %1.d_f erase %1.d_f if exist %1.d_n erase %1.d_n if exist %1.d_o erase %1.d_o diff -rc2N gs25/gsstate.c gs251/gsstate.c *** gs25/gsstate.c Mon Jun 8 17:20:42 1992 --- gs251/gsstate.c Thu Sep 10 04:14:14 1992 *************** *** 163,167 **** copy_gstate_contents(pnew, pgs); pnew->saved = 0; ! return pgs; } --- 163,167 ---- copy_gstate_contents(pnew, pgs); pnew->saved = 0; ! return pnew; } diff -rc2N gs25/gsstate.h gs251/gsstate.h *** gs25/gsstate.h Mon Jun 8 01:44:28 1992 --- gs251/gsstate.h Tue Sep 8 03:59:06 1992 *************** *** 56,59 **** --- 56,64 ---- typedef struct gx_device_s gx_device; #endif + #ifndef gs_prop_item_DEFINED + # define gs_prop_item_DEFINED + typedef struct gs_prop_item_s gs_prop_item; + extern const uint gs_prop_item_sizeof; + #endif int gs_flushpage(P1(gs_state *)); int gs_copypage(P1(gs_state *)); *************** *** 62,66 **** gx_device * gs_getdevice(P1(int)); int gs_copydevice(P3(gx_device **, const gx_device *, proc_alloc_t)); ! int gs_makeimagedevice(P7(gx_device **, const gs_matrix *, uint, uint, const byte *, int, proc_alloc_t)); void gs_nulldevice(P1(gs_state *)); int gs_setdevice(P2(gs_state *, gx_device *)); --- 67,71 ---- gx_device * gs_getdevice(P1(int)); int gs_copydevice(P3(gx_device **, const gx_device *, proc_alloc_t)); ! int gs_makeimagedevice(P7(gx_device **, const gs_matrix *, uint, uint, const byte *, int, const gs_memory_procs *)); void gs_nulldevice(P1(gs_state *)); int gs_setdevice(P2(gs_state *, gx_device *)); *************** *** 68,71 **** --- 73,79 ---- const char * gs_devicename(P1(const gx_device *)); void gs_deviceinitialmatrix(P2(gx_device *, gs_matrix *)); + int gs_getdeviceprops_size(P1(gx_device *)); + int gs_getdeviceprops(P2(gx_device *, gs_prop_item *)); + int gs_putdeviceprops(P3(gx_device *, gs_prop_item *, int)); int gs_closedevice(P1(gx_device *)); diff -rc2N gs25/gst.bat gs251/gst.bat *** gs25/gst.bat Wed May 20 14:28:12 1992 --- gs251/gst.bat Tue Sep 1 01:21:52 1992 *************** *** 1 **** ! @gs %1 %2 %3 %4 %5 %6 %7 %8 %9 >t --- 1 ---- ! @gs %1 %2 %3 %4 %5 %6 %7 %8 %9 >t diff -rc2N gs25/gsuid.h gs251/gsuid.h *** gs25/gsuid.h --- gs251/gsuid.h Mon Sep 7 13:56:26 1992 *************** *** 0 **** --- 1,56 ---- + /* Copyright (C) 1992 Aladdin Enterprises. All rights reserved. + Distributed by Free Software Foundation, Inc. + + This file is part of Ghostscript. + + Ghostscript is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY. No author or distributor accepts responsibility + to anyone for the consequences of using it or for whether it serves any + particular purpose or works at all, unless he says so in writing. Refer + to the Ghostscript General Public License for full details. + + Everyone is granted permission to copy, modify and redistribute + Ghostscript, but only under the conditions described in the Ghostscript + General Public License. A copy of this license is supposed to have been + given to you along with Ghostscript so you can know your rights and + responsibilities. It should be in a file named COPYING. Among other + things, the copyright notice and this notice must be preserved on all + copies. */ + + /* gsuid.h */ + /* Unique id definitions for Ghostscript */ + + /* A unique id (uid) may be either a UniqueID or an XUID. */ + /* (XUIDs are a Level 2 feature.) */ + typedef struct gs_uid_s { + union { + long id; /* UniqueID, size == 0 */ + long *xvalues; /* XUID, size != 0 */ + } u; + ushort size; + } gs_uid; + + /* A UniqueID of -1 is an indication that there is no uid. */ + #define uid_is_valid(puid)\ + !((puid)->size == 0 && (puid)->u.id == -1) + #define uid_set_invalid(puid)\ + ((puid)->size = 0, (puid)->u.id = -1) + + /* Initialize a uid. */ + #define uid_set_UniqueID(puid, idv)\ + ((puid)->size = 0, (puid)->u.id = idv) + #define uid_set_XUID(puid, pvalues, siz)\ + ((puid)->size = siz, (puid)->u.xvalues = pvalues) + + /* Compare two uids for equality. */ + #define uid_equal(puid1, puid2)\ + ((puid1)->size == (puid2)->size &&\ + ((puid1)->size ?\ + !memcmp((const char *)(puid1)->u.xvalues,\ + (const char *)(puid2)->u.xvalues, (puid1)->size) :\ + (puid1)->u.id == (puid2)->u.id)) + + /* Free the XUID array of a uid if necessary. */ + #define uid_free(puid, proc_free, cname)\ + if ( (puid)->size )\ + (proc_free)((char *)(puid)->u.xvalues, (puid)->size, sizeof(long), cname) diff -rc2N gs25/gsutil.c gs251/gsutil.c *** gs25/gsutil.c Tue Apr 7 15:41:00 1992 --- gs251/gsutil.c Tue Sep 8 03:40:02 1992 *************** *** 26,29 **** --- 26,32 ---- #include "gsutil.h" /* for prototype checking */ + /* Export the size of a gs_prop_item for clients. */ + const uint gs_prop_item_sizeof = sizeof(gs_prop_item); + /* ------ String utilities ------ */ diff -rc2N gs25/gsutil.h gs251/gsutil.h *** gs25/gsutil.h Sat Mar 21 02:28:24 1992 --- gs251/gsutil.h Tue Sep 8 03:39:32 1992 *************** *** 43,47 **** */ #ifndef gs_prop_item_s_DEFINED ! struct gs_prop_item_s; #endif extern int props_extract(P6( --- 43,49 ---- */ #ifndef gs_prop_item_s_DEFINED ! # define gs_prop_item_DEFINED ! typedef struct gs_prop_item_s gs_prop_item; ! extern const uint gs_prop_item_sizeof; #endif extern int props_extract(P6( diff -rc2N gs25/gxclist.c gs251/gxclist.c *** gs25/gxclist.c Fri Aug 14 05:49:38 1992 --- gs251/gxclist.c Thu Sep 10 17:20:06 1992 *************** *** 52,56 **** /* The device descriptor */ ! private gx_device_procs clist_procs = { clist_open, clist_get_initial_matrix, --- 52,57 ---- /* The device descriptor */ ! /* The device template itself is never used, only the procs. */ ! gx_device_procs gs_clist_device_procs = { clist_open, clist_get_initial_matrix, *************** *** 69,79 **** clist_put_props }; - gx_device_clist gs_clist_device = - { sizeof(gx_device_clist), - &clist_procs, - "command list", - 0, 0, 1, 1, no_margins, dci_black_and_white, 0, /* generic */ - NULL, NULL, 0 - }; /* ------ Define the command set and syntax ------ */ --- 70,73 ---- *************** *** 510,514 **** clist_fill_rectangle(gx_device *dev, int x, int y, int width, int height, gx_color_index color) ! { BEGIN_RECT if ( color != pcls->color1 ) cmd_set_colors(dev, pcls, pcls->color0, color); --- 504,509 ---- clist_fill_rectangle(gx_device *dev, int x, int y, int width, int height, gx_color_index color) ! { fit_fill(dev, x, y, width, height); ! BEGIN_RECT if ( color != pcls->color1 ) cmd_set_colors(dev, pcls, pcls->color0, color); *************** *** 686,690 **** int width, int height, gx_color_index color0, gx_color_index color1, int px, int py) ! { BEGIN_RECT if ( tile->id != pcls->tile->id ) { if ( clist_change_tile(cdev, pcls, tile) < 0 ) --- 681,686 ---- int width, int height, gx_color_index color0, gx_color_index color1, int px, int py) ! { fit_fill(dev, x, y, width, height); ! BEGIN_RECT if ( tile->id != pcls->tile->id ) { if ( clist_change_tile(cdev, pcls, tile) < 0 ) *************** *** 710,714 **** int x, int y, int width, int height, gx_color_index color0, gx_color_index color1) ! { int y0 = y; BEGIN_RECT gx_cmd_rect rect; --- 706,712 ---- int x, int y, int width, int height, gx_color_index color0, gx_color_index color1) ! { int y0; ! fit_copy(dev, data, data_x, raster, id, x, y, width, height); ! y0 = y; BEGIN_RECT gx_cmd_rect rect; *************** *** 779,783 **** const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height) ! { int y0 = y; BEGIN_RECT gx_cmd_rect rect; --- 777,783 ---- const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height) ! { int y0; ! fit_copy(dev, data, data_x, raster, id, x, y, width, height); ! y0 = y; BEGIN_RECT gx_cmd_rect rect; *************** *** 791,796 **** clist_copy_color(dev, row, data_x, raster, gx_no_bitmap_id, x, y, width, h2); ! clist_copy_color(dev, row + h2 * raster, gx_no_bitmap_id, ! data_x, raster, x, y + h2, width, height - h2); } else --- 791,796 ---- clist_copy_color(dev, row, data_x, raster, gx_no_bitmap_id, x, y, width, h2); ! clist_copy_color(dev, row + h2 * raster, data_x, ! raster, gx_no_bitmap_id, x, y + h2, width, height - h2); } else *************** *** 852,857 **** if ( cdev->ymin < 0 ) clist_render_init(cdev); ! bytes_per_line = gx_device_bytes_per_scan_line((gx_device *)mdev, ! pad_to_word); count = min(size / bytes_per_line, cdev->target->height - start_y); --- 852,856 ---- if ( cdev->ymin < 0 ) clist_render_init(cdev); ! bytes_per_line = gx_device_raster((gx_device *)mdev, pad_to_word); count = min(size / bytes_per_line, cdev->target->height - start_y); diff -rc2N gs25/gxclist.h gs251/gxclist.h *** gs25/gxclist.h Thu Apr 16 17:52:08 1992 --- gs251/gxclist.h Sat Sep 5 12:24:44 1992 *************** *** 85,88 **** gx_device_memory mdev; }; ! extern gx_device_clist ! gs_clist_device; --- 85,88 ---- gx_device_memory mdev; }; ! /* The device template itself is never used, only the procs. */ ! extern gx_device_procs gs_clist_device_procs; diff -rc2N gs25/gxdevice.h gs251/gxdevice.h *** gs25/gxdevice.h Sat Aug 15 08:57:50 1992 --- gs251/gxdevice.h Thu Sep 10 17:12:00 1992 *************** *** 171,181 **** }; ! /* Calculate the number of bytes in a scan line, */ /* with byte or word padding. */ ! extern unsigned int gx_device_bytes_per_scan_line(P2(const gx_device *dev, int pad_to_word)); /* Adjust the resolution for devices that only have a fixed set of */ /* geometries, so that the apparent size in inches remains constant. */ ! extern int gx_device_adjust_resolution(P3(gx_device *dev, int actual_width, int actual_height)); /* Default implementations of optional procedures */ --- 171,209 ---- }; ! /* Calculate the raster (number of bytes in a scan line), */ /* with byte or word padding. */ ! extern unsigned int gx_device_raster(P2(const gx_device *dev, int pad_to_word)); /* Adjust the resolution for devices that only have a fixed set of */ /* geometries, so that the apparent size in inches remains constant. */ ! /* If fit=1, the resolution is adjusted so that the entire image fits; */ ! /* if fit=0, one dimension fits, but the other one is clipped. */ ! extern int gx_device_adjust_resolution(P4(gx_device *dev, int actual_width, int actual_height, int fit)); ! ! /* ! * Macros to help the drawing procedures clip coordinates to ! * fit into the drawing region. Note that these may modify ! * x, y, w, h, data, data_x, and id. ! */ ! ! /* Macro for fill_rectangle and tile_rectangle. */ ! #define fit_fill(dev, x, y, w, h)\ ! if ( (x | y) < 0 )\ ! { if ( x < 0 ) w += x, x = 0;\ ! if ( y < 0 ) h += y, y = 0;\ ! }\ ! if ( x > dev->width - w ) w = dev->width - x;\ ! if ( y > dev->height - h ) h = dev->height - y;\ ! if ( w <= 0 || h <= 0 ) return 0 ! ! /* Macro for copy_mono and copy_color. */ ! #define fit_copy(dev, data, data_x, raster, id, x, y, w, h)\ ! if ( (x | y) < 0 )\ ! { if ( x < 0 ) w += x, data_x -= x, x = 0;\ ! if ( y < 0 ) h += y, data -= y * raster, id = gx_no_bitmap_id, y = 0;\ ! }\ ! if ( x > dev->width - w ) w = dev->width - x;\ ! if ( y > dev->height - h ) h = dev->height - y;\ ! if ( w <= 0 || h <= 0 ) return 0 /* Default implementations of optional procedures */ diff -rc2N gs25/gxdevmem.h gs251/gxdevmem.h *** gs25/gxdevmem.h Thu May 28 11:41:20 1992 --- gs251/gxdevmem.h Sun Sep 6 19:39:08 1992 *************** *** 1,3 **** ! /* Copyright (C) 1989, 1991 Aladdin Enterprises. All rights reserved. Distributed by Free Software Foundation, Inc. --- 1,3 ---- ! /* Copyright (C) 1989, 1991, 1992 Aladdin Enterprises. All rights reserved. Distributed by Free Software Foundation, Inc. *************** *** 49,57 **** /* bytes are stored in */ /* little-endian order, else 0 */ ! /* Following is only needed for monochrome */ int invert; /* 0 if 1=white, -1 if 1=black */ ! /* Following are only needed for mapped color */ int palette_size; /* # of entries */ byte *palette; /* RGB triples */ }; extern const gx_device_memory --- 49,62 ---- /* bytes are stored in */ /* little-endian order, else 0 */ ! /* Following is only needed for monochrome. */ int invert; /* 0 if 1=white, -1 if 1=black */ ! /* Following are only needed for mapped color. */ int palette_size; /* # of entries */ byte *palette; /* RGB triples */ + /* Following are used for all memory devices. */ + /* If the memory_procs are non-zero, they are used for */ + /* allocating the bitmap when the device is opened, */ + /* and freeing it when the device is closed. */ + gs_memory_procs memory_procs; }; extern const gx_device_memory *************** *** 74,78 **** * Compute the raster (bytes per line) similarly. */ ! extern uint gdev_mem_raster(P1(const gx_device_memory *)); /* Determine the appropriate memory device for a given */ --- 79,84 ---- * Compute the raster (bytes per line) similarly. */ ! #define gdev_mem_raster(mdev)\ ! gx_device_raster((const gx_device *)(mdev), 1) /* Determine the appropriate memory device for a given */ diff -rc2N gs25/gxpcopy.c gs251/gxpcopy.c *** gs25/gxpcopy.c Thu Aug 13 19:48:12 1992 --- gs251/gxpcopy.c Sun Sep 6 17:27:02 1992 *************** *** 118,122 **** pseg = pseg->next; } ! ppath->position = old.position; /* restore current point */ #ifdef DEBUG if ( gs_debug['p'] ) --- 118,123 ---- pseg = pseg->next; } ! if ( !old.subpath_open && old.position_valid ) ! gx_path_add_point(ppath, old.position.x, old.position.y); #ifdef DEBUG if ( gs_debug['p'] ) *************** *** 217,221 **** else goto sub; } ! else if ( adx3 > scaled_flat << 1 ) goto sub; reduce_3(ady3, short_max); --- 218,222 ---- else goto sub; } ! else if ( adx3 >> 3 > scaled_flat ) goto sub; reduce_3(ady3, short_max); *************** *** 243,247 **** else goto sub; } ! else if ( ady3 > scaled_flat << 1 ) goto sub; reduce_3(adx3, short_max); --- 244,248 ---- else goto sub; } ! else if ( ady3 >> 3 > scaled_flat ) goto sub; reduce_3(adx3, short_max); diff -rc2N gs25/gxstroke.c gs251/gxstroke.c *** gs25/gxstroke.c Sun Jul 19 17:24:54 1992 --- gs251/gxstroke.c Thu Sep 10 06:37:32 1992 *************** *** 94,98 **** int gx_stroke_add(const gx_path *ppath, gx_path *to_path, gs_state *pgs) ! { return stroke(ppath, to_path, stroke_add, pgs); } --- 94,103 ---- int gx_stroke_add(const gx_path *ppath, gx_path *to_path, gs_state *pgs) ! { int code = stroke(ppath, to_path, stroke_add, pgs); ! if ( code < 0 ) return code; ! if ( !ppath->subpath_open && ppath->position_valid ) ! code = gx_path_add_point(to_path, ppath->position.x, ! ppath->position.y); ! return code; } *************** *** 308,312 **** if ( first++ == 0 ) pl_first = pl; if ( index++ ) ! { code = (*line_proc)(to_path, index - 2, &pl_prev, &pl, pgs); if ( code < 0 ) goto exit; fill_stroke_path(); --- 313,319 ---- if ( first++ == 0 ) pl_first = pl; if ( index++ ) ! { code = (*line_proc)(to_path, ! (psub->closed ? 1 : index - 2), ! &pl_prev, &pl, pgs); if ( code < 0 ) goto exit; fill_stroke_path(); *************** *** 511,514 **** --- 518,539 ---- #define litox plp->e.p.x #define litoy plp->e.p.y + #define trsign(v, c) ((v) >= 0 ? (c) : -(c)) + + /* Set up the width and delta parameters for a thin line. */ + /* We only approximate the width and height. */ + private void near + set_thin_widths(register pl_ptr plp) + { fixed dx = litox - lix, dy = litoy - liy; + if ( any_abs(dx) > any_abs(dy) ) + { plp->width.x = plp->e.cdelta.y = 0; + plp->width.y = -(plp->e.cdelta.x = + trsign(dx, -fixed_half)); + } + else + { plp->width.y = plp->e.cdelta.x = 0; + plp->width.x = -(plp->e.cdelta.y = + trsign(dy, -fixed_half)); + } + } /* Draw a line on the device. */ *************** *** 522,526 **** /* slop at the ends. */ fixed dx = litox - lix, dy = litoy - liy; - #define trsign(v, c) ((v) >= 0 ? (c) : -(c)) #define slop int2fixed(2) fixed xslop = trsign(dx, slop); --- 547,550 ---- *************** *** 534,551 **** } #undef slop /* We didn't set up the endpoint parameters before, */ /* because the line was thin. Do it now. */ ! /* We only approximate the width and height. */ ! if ( any_abs(dx) > any_abs(dy) ) ! { plp->width.x = plp->e.cdelta.y = 0; ! plp->width.y = -(plp->e.cdelta.x = ! trsign(dx, -fixed_half)); ! } ! else ! { plp->width.y = plp->e.cdelta.x = 0; ! plp->width.x = -(plp->e.cdelta.y = ! trsign(dy, -fixed_half)); ! } ! #undef trsign } /* General case: construct a path for the fill algorithm. */ --- 558,565 ---- } #undef slop + #undef trsign /* We didn't set up the endpoint parameters before, */ /* because the line was thin. Do it now. */ ! set_thin_widths(plp); } /* General case: construct a path for the fill algorithm. */ *************** *** 567,570 **** --- 581,585 ---- { /* We didn't set up the endpoint parameters before, */ /* because the line was thin. Do it now. */ + set_thin_widths(plp); adjust_stroke(plp, pgs); compute_caps(plp); diff -rc2N gs25/iccfont.c gs251/iccfont.c *** gs25/iccfont.c Tue Jul 28 13:35:32 1992 --- gs251/iccfont.c Tue Sep 8 18:45:46 1992 *************** *** 36,47 **** /* Forward references */ ! private int cfont_ref_dict_create(P3(ref *, const cfont_dict_keys _ds *, ! const ref _ds * _ds *)); ! private int cfont_string_dict_create(P3(ref *, const cfont_dict_keys _ds *, ! const const_charray _ds *)); ! private int cfont_num_dict_create(P3(ref *, const cfont_dict_keys _ds *, ! const float _ds *)); ! private int cfont_name_array_create(P3(ref *, const char _ds * _ds *, int)); ! private int cfont_dict_put(P3(ref *, const char _ds *, const ref *)); /* Procedure vector passed to font initialization procedures. */ --- 36,49 ---- /* Forward references */ ! private int huge ! cfont_ref_dict_create(P4(ref *, const cfont_dict_keys *, ! cfont_string_array, const ref *)), ! cfont_string_dict_create(P4(ref *, const cfont_dict_keys *, ! cfont_string_array, cfont_string_array)), ! cfont_num_dict_create(P4(ref *, const cfont_dict_keys *, ! cfont_string_array, const float *)), ! cfont_name_array_create(P3(ref *, cfont_string_array, int)), ! cfont_string_array_create(P4(ref *, cfont_string_array, int, uint)), ! cfont_name_create(P2(ref *, const char *)); /* Procedure vector passed to font initialization procedures. */ *************** *** 51,67 **** cfont_num_dict_create, cfont_name_array_create, ! cfont_dict_put }; /* ------ Initialization tables ------ */ - /* See gconfig.c for documentation on how this works. */ - #define device_(dev) - #define oper_(defs) - #define psfile_(fns) /* Generate an operator procedure for each font. */ #define font_(fname, fproc, zfproc)\ ! extern int fproc(P2(const cfont_procs _ds *, ref *));\ ! private int zfproc(os_ptr op)\ { int code = fproc(&ccfont_procs, (ref *)(op + 1));\ if ( code < 0 ) return code;\ --- 53,77 ---- cfont_num_dict_create, cfont_name_array_create, ! cfont_string_array_create, ! cfont_name_create }; /* ------ Initialization tables ------ */ + /* + * The file gconfigf.h contains a line + * font_("0.font_xxx", gsf_xxx, zf_xxx) + * for each compiled font. + */ + /* Generate an operator procedure for each font. */ + #ifdef __PROTOTYPES__ + # define zfproto(proc) proc(os_ptr op) + #else + # define zfproto(proc) proc(op) os_ptr op; + #endif #define font_(fname, fproc, zfproc)\ ! extern int huge fproc(P2(const cfont_procs *, ref *));\ ! private int zfproto(zfproc)\ { int code = fproc(&ccfont_procs, (ref *)(op + 1));\ if ( code < 0 ) return code;\ *************** *** 69,73 **** return 0;\ } ! #include "gconfig.h" /* Generate the operator initialization table. */ --- 79,83 ---- return 0;\ } ! #include "gconfigf.h" /* Generate the operator initialization table. */ *************** *** 76,80 **** {fname, zfproc}, op_def ccfonts_op_defs[] = { ! #include "gconfig.h" op_def_end(0) }; --- 86,90 ---- {fname, zfproc}, op_def ccfonts_op_defs[] = { ! #include "gconfigf.h" op_def_end(0) }; *************** *** 82,97 **** /* ------ Procedural code ------ */ /* Check for reaching the end of the keys. */ ! #define more_keys(kp) ((kp)->num_enc_keys | (kp)->num_str_keys) /* Put the next entry into a dictionary. */ /* We know that more_keys(kp) is true. */ ! private int ! cfont_put_next(ref *pdict, cfont_dict_keys _ss *kp, const ref *pvalue, ref * _ss *pencodings) { ref kname; int code; if ( *pencodings == 0 ) ! { /* Create the dictionary and look up the encodings. */ code = dict_create(kp->num_enc_keys + kp->num_str_keys + kp->extra_slots, pdict); if ( code < 0 ) return code; --- 92,139 ---- /* ------ Procedural code ------ */ + typedef struct { + const char *str_array; + const byte *str; + uint len; + } str_enum; + #define init_str_enum(sep, ksa)\ + (sep)->str_array = ksa + typedef struct { + cfont_dict_keys keys; + str_enum strings; + } key_enum; + #define init_key_enum(kep, kp, ksa)\ + (kep)->keys = *kp, init_str_enum(&(kep)->strings, ksa) + /* Check for reaching the end of the keys. */ ! #define more_keys(kep) ((kep)->keys.num_enc_keys | (kep)->keys.num_str_keys) ! ! /* Get the next string from a string array. */ ! /* Return true if it was a string, false if it was a null. */ ! private int near ! cfont_next_string(str_enum _ss *pse) ! { const char *str = pse->str_array; ! uint len = (((const byte *)str)[0] << 8) + ((const byte *)str)[1]; ! int was_string = 1; ! if ( len == 0xffff ) ! { len = 0; ! was_string = 0; ! } ! pse->str = (const byte *)str + 2; ! pse->len = len; ! pse->str_array = str + 2 + len; ! return was_string; ! } /* Put the next entry into a dictionary. */ /* We know that more_keys(kp) is true. */ ! private int near ! cfont_put_next(ref *pdict, key_enum _ss *kep, const ref *pvalue, ref * _ss *pencodings) { ref kname; int code; + #define kp (&kep->keys) if ( *pencodings == 0 ) ! { /* Create the dictionary and look up the encodings. */ code = dict_create(kp->num_enc_keys + kp->num_str_keys + kp->extra_slots, pdict); if ( code < 0 ) return code; *************** *** 102,117 **** ) return e_undefined; ! } if ( kp->num_enc_keys ) ! { const charindex _ds *skp = kp->enc_keys++; code = array_get(pencodings[skp->encx], (long)(skp->charx), &kname); kp->num_enc_keys--; ! } else /* must have kp->num_str_keys != 0 */ ! { const char *skp = *(kp->str_keys++); ! code = name_ref((const byte *)skp, strlen(skp), &kname, 0); kp->num_str_keys--; ! } return dict_put(pdict, &kname, pvalue); } --- 144,160 ---- ) return e_undefined; ! } if ( kp->num_enc_keys ) ! { const charindex *skp = kp->enc_keys++; code = array_get(pencodings[skp->encx], (long)(skp->charx), &kname); kp->num_enc_keys--; ! } else /* must have kp->num_str_keys != 0 */ ! { cfont_next_string(&kep->strings); ! code = name_ref(kep->strings.str, kep->strings.len, &kname, 0); kp->num_str_keys--; ! } return dict_put(pdict, &kname, pvalue); + #undef kp } *************** *** 119,167 **** /* Create a dictionary with general ref values. */ ! private int ! cfont_ref_dict_create(ref *pdict, const cfont_dict_keys _ds *kp, ! const ref _ds * _ds *values) ! { cfont_dict_keys keys; ! const ref _ds * _ds *vp = values; ref *pencodings[2]; ! keys = *kp; pencodings[0] = 0; ! while ( more_keys(&keys) ) ! { const ref *pvalue = *vp++; ! ref nref; ! int code; ! if ( r_has_type(pvalue, t_name) ) ! { /* The "name" is really a string. */ ! /* Convert it to a real name now. */ ! code = name_ref(pvalue->value.bytes, r_size(pvalue), ! &nref, 0); ! if ( code < 0 ) return code; ! pvalue = &nref; ! } ! code = cfont_put_next(pdict, &keys, pvalue, pencodings); if ( code < 0 ) return code; ! } return 0; } ! /* Create a dictionary with string values. */ ! private int ! cfont_string_dict_create(ref *pdict, const cfont_dict_keys _ds *kp, ! const const_charray _ds *values) ! { cfont_dict_keys keys; ! const const_charray _ds *vp = values; uint attrs = kp->value_attrs; ref *pencodings[2]; ! ref vstring; ! keys = *kp; pencodings[0] = 0; ! while ( more_keys(&keys) ) ! { int code; ! make_tasv(&vstring, t_string, attrs, ! vp->len, bytes, (byte *)vp->str); ! vp++; ! code = cfont_put_next(pdict, &keys, &vstring, pencodings); if ( code < 0 ) return code; ! } return 0; } --- 162,204 ---- /* Create a dictionary with general ref values. */ ! private int huge ! cfont_ref_dict_create(ref *pdict, const cfont_dict_keys *kp, ! cfont_string_array ksa, const ref *values) ! { key_enum kenum; ! const ref *vp = values; ref *pencodings[2]; ! init_key_enum(&kenum, kp, ksa); pencodings[0] = 0; ! while ( more_keys(&kenum) ) ! { const ref *pvalue = vp++; ! int code = cfont_put_next(pdict, &kenum, pvalue, pencodings); if ( code < 0 ) return code; ! } return 0; } ! /* Create a dictionary with string/null values. */ ! private int huge ! cfont_string_dict_create(ref *pdict, const cfont_dict_keys *kp, ! cfont_string_array ksa, cfont_string_array kva) ! { key_enum kenum; ! str_enum senum; uint attrs = kp->value_attrs; ref *pencodings[2]; ! init_key_enum(&kenum, kp, ksa); ! init_str_enum(&senum, kva); pencodings[0] = 0; ! while ( more_keys(&kenum) ) ! { ref vstring; ! int code; ! if ( cfont_next_string(&senum) ) ! { make_tasv(&vstring, t_string, attrs, senum.len, ! const_bytes, (const byte *)senum.str); ! } ! else ! make_null(&vstring); ! code = cfont_put_next(pdict, &kenum, &vstring, pencodings); if ( code < 0 ) return code; ! } return 0; } *************** *** 168,182 **** /* Create a dictionary with number values. */ ! private int ! cfont_num_dict_create(ref *pdict, const cfont_dict_keys _ds *kp, ! const float _ds *values) ! { cfont_dict_keys keys; ! const float _ds *vp = values; ref *pencodings[2]; ref vnum; ! keys = *kp; pencodings[0] = 0; ! while ( more_keys(&keys) ) ! { float val = *vp++; int code; if ( val == (int)val ) --- 205,219 ---- /* Create a dictionary with number values. */ ! private int huge ! cfont_num_dict_create(ref *pdict, const cfont_dict_keys *kp, ! cfont_string_array ksa, const float *values) ! { key_enum kenum; ! const float *vp = values; ref *pencodings[2]; ref vnum; ! init_key_enum(&kenum, kp, ksa); pencodings[0] = 0; ! while ( more_keys(&kenum) ) ! { float val = *vp++; int code; if ( val == (int)val ) *************** *** 184,190 **** else make_real(&vnum, val); ! code = cfont_put_next(pdict, &keys, &vnum, pencodings); if ( code < 0 ) return code; ! } return 0; } --- 221,227 ---- else make_real(&vnum, val); ! code = cfont_put_next(pdict, &kenum, &vnum, pencodings); if ( code < 0 ) return code; ! } return 0; } *************** *** 191,216 **** /* Create an array with name values. */ ! private int ! cfont_name_array_create(ref *parray, const char _ds * _ds *str_list, ! int size) { ref *aptr = alloc_refs(size, "cfont_name_array_create"); int i; ! const char _ds * _ds *pstr = str_list; if ( aptr == 0 ) return e_VMerror; make_tasv(parray, t_array, a_readonly, size, refs, aptr); ! for ( i = 0; i < size; i++, aptr++, pstr++ ) ! { ref nref; ! int code = name_ref((byte *)*pstr, strlen(*pstr), &nref, 0); if ( code < 0 ) return code; ref_assign_new(aptr, &nref); ! } return 0; } ! /* Enter a name in a dictionary. */ ! private int ! cfont_dict_put(ref *pdref, const char _ds *nstr, const ref *pvalue) ! { ref nref; ! name_enter(nstr, &nref); ! return dict_put(pdref, &nref, pvalue); } --- 228,274 ---- /* Create an array with name values. */ ! private int huge ! cfont_name_array_create(ref *parray, cfont_string_array ksa, int size) { ref *aptr = alloc_refs(size, "cfont_name_array_create"); int i; ! str_enum senum; if ( aptr == 0 ) return e_VMerror; + init_str_enum(&senum, ksa); make_tasv(parray, t_array, a_readonly, size, refs, aptr); ! for ( i = 0; i < size; i++, aptr++ ) ! { ref nref; ! int code; ! cfont_next_string(&senum); ! code = name_ref((const byte *)senum.str, senum.len, &nref, 0); if ( code < 0 ) return code; ref_assign_new(aptr, &nref); ! } ! return 0; ! } ! ! /* Create an array with string/null values. */ ! private int huge ! cfont_string_array_create(ref *parray, cfont_string_array ksa, ! int size, uint attrs) ! { ref *aptr = alloc_refs(size, "cfont_string_array_create"); ! int i; ! str_enum senum; ! if ( aptr == 0 ) return e_VMerror; ! init_str_enum(&senum, ksa); ! make_tasv(parray, t_array, a_readonly, size, refs, aptr); ! for ( i = 0; i < size; i++, aptr++ ) ! { if ( cfont_next_string(&senum) ) ! { make_tasv_new(aptr, t_string, attrs, senum.len, ! const_bytes, (const byte *)senum.str); ! } ! else ! make_null_new(aptr); ! } return 0; } ! /* Create a name. */ ! private int huge ! cfont_name_create(ref *pnref, const char *str) ! { return name_ref((const byte *)str, strlen(str), pnref, 0); } diff -rc2N gs25/iinit.c gs251/iinit.c *** gs25/iinit.c Fri Jun 12 18:26:28 1992 --- gs251/iinit.c Thu Sep 10 17:37:22 1992 *************** *** 32,35 **** --- 32,40 ---- #include "store.h" + /* Define the revision and revision date of this interpreter. */ + /* The revision is the Ghostscript release number x 100 + the sub-release. */ + const int gs_revision = 251; + const char *gs_revisiondate = "9/11/92"; + /* Implementation parameters. */ /* The size of systemdict can be set in the makefile. */ *************** *** 72,79 **** obj_init() { - /* Initialize the standard objects */ - ref vnull; - make_tv(&vnull, t_null, intval, 0); - /* Create the system dictionary */ dict_create(SYSTEMDICT_SIZE, &systemdict); --- 77,80 ---- *************** *** 85,89 **** /* Initialize the predefined names other than operators */ ! initial_enter_name("null", &vnull); /* Create other system-known names */ --- 86,99 ---- /* Initialize the predefined names other than operators */ ! { ref vtemp; ! make_tv(&vtemp, t_null, intval, 0); ! initial_enter_name("null", &vtemp); ! make_int(&vtemp, gs_revision); ! initial_enter_name("revision", &vtemp); ! make_tasv(&vtemp, t_string, a_readonly, ! strlen(gs_revisiondate), ! const_bytes, (const byte *)gs_revisiondate); ! initial_enter_name("revisiondate", &vtemp); ! } /* Create other system-known names */ diff -rc2N gs25/impath.ps gs251/impath.ps *** gs25/impath.ps Sat Jul 25 17:45:36 1992 --- gs251/impath.ps Thu Aug 20 03:21:50 1992 *************** *** 86,92 **** ifelse } bind def ! /pathtotype1 % -> cs_array { 3 dict begin /x 0 def /y 0 def ! [ { moving putxy } --- 86,92 ---- ifelse } bind def ! /pathtotype1 % -> charstack { 3 dict begin /x 0 def /y 0 def ! mark { moving putxy } *************** *** 115,119 **** } pathforall end - ] } bind def --- 115,118 ---- *************** *** 151,155 **** % Compute and encode the origin, width, and side bearing. ! ofilter [ ox oy dtransform rc /opty exch def rc /optx exch def --- 150,154 ---- % Compute and encode the origin, width, and side bearing. ! mark ox oy dtransform rc /opty exch def rc /optx exch def *************** *** 163,167 **** { iwx /hsbw } ifelse ! ] charstring_write % Flip over the Y axis, because the image is stored top-to-bottom. --- 162,166 ---- { iwx /hsbw } ifelse ! ofilter charstack_write % Flip over the Y axis, because the image is stored top-to-bottom. *************** *** 173,180 **** width height data .imagepath gsave matrix setmatrix pathtotype1 grestore ! ofilter exch charstring_write % Terminate the output ! ofilter [/endchar] charstring_write ostring 0 ofilter fileposition getinterval --- 172,179 ---- width height data .imagepath gsave matrix setmatrix pathtotype1 grestore ! ofilter charstack_write % Terminate the output ! ofilter mark /endchar charstack_write ostring 0 ofilter fileposition getinterval diff -rc2N gs25/interp.c gs251/interp.c *** gs25/interp.c Thu Aug 6 19:32:30 1992 --- gs251/interp.c Sun Sep 6 03:36:04 1992 *************** *** 39,48 **** extern int zop_sub(P1(os_ptr)); ! /* The procedure to call if an operator requests rescheduling. */ ! /* This causes an error unless the context machinery has been installed. */ private int no_reschedule() { return e_invalidcontext; } int (*gs_interp_reschedule_proc)(P0()) = no_reschedule; ! /* The procedure to call for time-slicing. */ ! /* This is a no-op unless the context machinery has been installed. */ private int no_time_slice() { return 0; } int (*gs_interp_time_slice_proc)(P0()) = no_time_slice; --- 39,52 ---- extern int zop_sub(P1(os_ptr)); ! /* ! * The procedure to call if an operator requests rescheduling. ! * This causes an error unless the context machinery has been installed. ! */ private int no_reschedule() { return e_invalidcontext; } int (*gs_interp_reschedule_proc)(P0()) = no_reschedule; ! /* ! * The procedure to call for time-slicing. ! * This is a no-op unless the context machinery has been installed. ! */ private int no_time_slice() { return 0; } int (*gs_interp_time_slice_proc)(P0()) = no_time_slice; *************** *** 49,53 **** /* Forward references */ ! private int interp(P1(ref *pref)); private int interp_exit(P1(os_ptr)); private int i_interp_exit; --- 53,57 ---- /* Forward references */ ! private int interp(P2(ref *pref, ref *perror_object)); private int interp_exit(P1(os_ptr)); private int i_interp_exit; *************** *** 80,86 **** ds_ptr dsp, dstop; - /* The object that caused an error */ - ref error_object; - /* Object related to error handling */ extern ref name_errordict; --- 84,87 ---- *************** *** 169,173 **** /* In case of a quit or a fatal error, also store the exit code. */ int ! gs_interpret(ref *pref, int user_errors, int *pexit_code) { ref *epref = pref; ref erref; --- 170,174 ---- /* In case of a quit or a fatal error, also store the exit code. */ int ! gs_interpret(ref *pref, int user_errors, int *pexit_code, ref *perror_object) { ref *epref = pref; ref erref; *************** *** 179,183 **** make_oper(esp0, i_interp_exit, (dummy_op_proc_p)interp_exit); *pexit_code = 0; ! retry: code = interp(epref); switch ( code ) { --- 180,184 ---- make_oper(esp0, i_interp_exit, (dummy_op_proc_p)interp_exit); *pexit_code = 0; ! retry: code = interp(epref, perror_object); switch ( code ) { *************** *** 230,234 **** epref = &erref; /* Push the error object on the operand stack */ ! *++osp = error_object; goto retry; } --- 231,235 ---- epref = &erref; /* Push the error object on the operand stack */ ! *++osp = *perror_object; goto retry; } *************** *** 250,259 **** /* Main interpreter. */ /* If execution terminates normally, return e_InterpreterExit. */ ! /* If an error occurs, leave the current object in error_object */ /* and return a (negative) error code. */ #define return_with_error(code, objp)\ ! { esp = iesp; osp = iosp; error_object = *(objp); return_error(code); } private int ! interp(ref *pref /* object to interpret */) { register ref *iref = pref; register int icount = 0; /* # of consecutive tokens at iref */ --- 251,268 ---- /* Main interpreter. */ /* If execution terminates normally, return e_InterpreterExit. */ ! /* If an error occurs, leave the current object in *perror_object */ /* and return a (negative) error code. */ #define return_with_error(code, objp)\ ! { store_state(iesp);\ ! esp = iesp; osp = iosp; *perror_object = *(objp);\ ! return_error(code);\ ! } ! #define return_with_error_short(code, objp)\ ! { store_state_short(iesp);\ ! esp = iesp; osp = iosp; *perror_object = *(objp);\ ! return_error(code);\ ! } private int ! interp(ref *pref /* object to interpret */, ref *perror_object) { register ref *iref = pref; register int icount = 0; /* # of consecutive tokens at iref */ *************** *** 266,276 **** os_ptr whichp; esfile = 0; /* clear cache */ ! /* We want to recognize executable arrays here, */ ! /* so we push the argument on the estack and enter */ ! /* the loop at the bottom. */ ! if ( iesp >= estop ) return_with_error (e_execstackoverflow, pref); ! *++iesp = *pref; ! goto bot; ! /* At this point, if icount > 0, iref and icount correspond */ /* to the top entry on the execution stack: icount is the */ /* count of sequential entries remaining AFTER the current one. */ --- 275,279 ---- os_ptr whichp; esfile = 0; /* clear cache */ ! /* From here on, if icount > 0, iref and icount correspond */ /* to the top entry on the execution stack: icount is the */ /* count of sequential entries remaining AFTER the current one. */ *************** *** 285,288 **** --- 288,297 ---- if ( --icount <= 0 ) { if ( icount < 0 ) goto up; iesp--; }\ iref = add1_short(iref); goto top; + /* We want to recognize executable arrays here, */ + /* so we push the argument on the estack and enter */ + /* the loop at the bottom. */ + if ( iesp >= estop ) return_with_error (e_execstackoverflow, pref); + *++iesp = *pref; + goto bot; top: /* * This is the top of the interpreter loop. *************** *** 707,711 **** case pt_full_ref+1: if ( iosp >= ostop ) ! return_with_error (e_stackoverflow, iref); ++iosp; /* We know that refs are properly aligned: */ --- 716,720 ---- case pt_full_ref+1: if ( iosp >= ostop ) ! return_with_error_short(e_stackoverflow, iref); ++iosp; /* We know that refs are properly aligned: */ *************** *** 722,726 **** case pt_integer: if ( iosp >= ostop ) ! return_with_error (e_stackoverflow, iref); ++iosp; make_int(iosp, (*(short *)iref & packed_int_mask) + --- 731,735 ---- case pt_integer: if ( iosp >= ostop ) ! return_with_error_short(e_stackoverflow, iref); ++iosp; make_int(iosp, (*(short *)iref & packed_int_mask) + *************** *** 730,734 **** case pt_literal_name+1: if ( iosp >= ostop ) ! return_with_error (e_stackoverflow, iref); ++iosp; name_index_ref((uint)*(ushort *)iref & --- 739,743 ---- case pt_literal_name+1: if ( iosp >= ostop ) ! return_with_error_short(e_stackoverflow, iref); ++iosp; name_index_ref((uint)*(ushort *)iref & *************** *** 745,749 **** { ref *pdvalue; if ( (pdvalue = dict_find_name_by_index(nidx)) == 0 ) ! return_with_error (e_undefined, &nref); pvalue = pdvalue; } --- 754,758 ---- { ref *pdvalue; if ( (pdvalue = dict_find_name_by_index(nidx)) == 0 ) ! return_with_error_short(e_undefined, &nref); pvalue = pdvalue; } diff -rc2N gs25/iscan.c gs251/iscan.c *** gs25/iscan.c Mon Aug 10 14:41:48 1992 --- gs251/iscan.c Thu Sep 3 11:33:00 1992 *************** *** 427,434 **** ptr = dynamic_grow(&da, da.limit); if ( !ptr ) sreturn(e_VMerror); - /* Force a buffer refill */ - spgetc(s); s_begin_inline(s, sptr, endptr); - sputback_inline(s, sptr, endptr); goto dyn_name; } --- 427,431 ---- diff -rc2N gs25/language.doc gs251/language.doc *** gs25/language.doc Sat Aug 15 10:24:54 1992 --- gs251/language.doc Thu Sep 10 15:26:46 1992 *************** *** 317,339 **** Gets all the properties of a device. Currently defined names and values for all devices are: - Name - device name HWResolution [ ] ! X and Y resolution in pixels/inch HWSize [ ] ! X and Y size in pixels InitialMatrix [<6 floats>] ! initial transformation matrix For printers, the following are also defined: - MaxBitmap - maximum space for a full bitmap in RAM BufferSpace ! buffer space for band lists, if the bitmap ! is too big to fit in RAM OutputFile () means send to printer directly, otherwise specifies the file name for ! output; a * is replaced by the page #; on Unix systems, (|command) writes to a pipe ... --- 317,342 ---- Gets all the properties of a device. Currently defined names and values for all devices are: HWResolution [ ] ! X and Y resolution in pixels/inch. HWSize [ ] ! X and Y size in pixels. InitialMatrix [<6 floats>] ! Initial transformation matrix. ! Name ! Read-only. The device name. For printers, the following are also defined: BufferSpace ! Buffer space for band lists, if the bitmap ! is too big to fit in RAM. ! MaxBitmap ! Maximum space for a full bitmap in RAM. OutputFile () means send to printer directly, otherwise specifies the file name for ! output; a %d is replaced by the page #; on Unix systems, (|command) writes to a pipe + PageCount + Read-only. Counts the number of pages + printed on the device. ... diff -rc2N gs25/lines.ps gs251/lines.ps *** gs25/lines.ps Wed Jun 24 17:27:28 1992 --- gs251/lines.ps Tue Sep 1 15:27:32 1992 *************** *** 1,4 **** %! ! % ** Copyright (C) 1989, 1990 by Aladdin Enterprises. All rights reserved. ** % Test line rendering (stroke). --- 1,5 ---- %! ! % ** Copyright (C) 1989, 1990, 1992 by Aladdin Enterprises. ** ! % ** All rights reserved. ** % Test line rendering (stroke). *************** *** 34,39 **** grestore ! % Exercise the miter limit. The lower row of lines should bevel at ! % 90 degrees, the upper at 60 degrees. gsave --- 35,40 ---- grestore ! % Exercise the miter limit. The left column of lines should bevel at ! % 90 degrees, the right column at 60 degrees. gsave *************** *** 41,50 **** 0 setgray 10 10 scale ! 5 20 translate [1.415 2.0] ! { setmiterlimit 0 10 translate 0 0 moveto 5 30 360 ! { gsave 2.5 0 rlineto rotate 2.5 0 rlineto stroke grestore ! 6.5 0 rmoveto } for } forall --- 42,53 ---- 0 setgray 10 10 scale ! 5 5 translate [1.415 2.0] ! { setmiterlimit 10 0 translate 0 0 moveto 5 30 360 ! { gsave 2.5 0 rlineto rotate 2.5 0 rlineto ! strokepath 0 setlinewidth stroke ! grestore ! 0 4 rmoveto } for } forall diff -rc2N gs25/main.h gs251/main.h *** gs25/main.h Tue Jun 16 03:21:50 1992 --- gs251/main.h Sun Sep 6 03:19:08 1992 *************** *** 35,41 **** /* e_Fatal for a non-zero quit or a fatal error. */ /* e_Fatal stores the exit code in the third argument. */ ! extern int gs_run_file(P3(const char *, int, int *)), ! gs_run_string(P3(const char *, int, int *)); ! extern void gs_debug_dump_stack(P1(int code)); extern void gs_finit(P0()), gs_exit(P1(int)); --- 35,44 ---- /* e_Fatal for a non-zero quit or a fatal error. */ /* e_Fatal stores the exit code in the third argument. */ ! extern int gs_run_file(P4(const char *fname, int user_errors, int *pexit_code, ref *perror_object)), ! gs_run_string(P4(const char *str, int user_errors, int *pexit_code, ref *perror_object)); ! extern void gs_debug_dump_stack(P2(int code, ref *perror_object)); extern void gs_finit(P0()), gs_exit(P1(int)); + /* Direct interface to the interpreter. */ + /* Clients do not normally use this. */ + extern int gs_interpret(P4(ref *pref, int user_errors, int *pexit_code, ref *perror_object)); diff -rc2N gs25/maint.mak gs251/maint.mak *** gs25/maint.mak Sat Aug 1 03:04:14 1992 --- gs251/maint.mak Thu Sep 10 18:28:58 1992 *************** *** 24,28 **** DRIVE=a: ! LABEL=GS_072792 VERIFY= --- 24,28 ---- DRIVE=a: ! LABEL=GS_090892 VERIFY= *************** *** 78,85 **** rename _temp_.txz tar0.z ! tar1.z: \cp.bat \rm.bat bdftops.bat font2c.bat pfbtogs.bat ! copy \cp.bat ! copy \rm.bat ! tar -b1 -cf _temp_.t -ubat g*.asm i*.asm gs*.bat cp.bat bdftops.bat font2c.bat pfbtogs.bat showpbm.bat rm.bat compress -i _temp_.t if exist tar1.z erase tar1.z --- 78,84 ---- rename _temp_.txz tar0.z ! tar1.z: bdftops.bat font2c.bat ! tar -b1 -cf _temp_.t -ubat g*.asm i*.asm gs*.bat bdftops.bat font2c.bat ! compress -i _temp_.t if exist tar1.z erase tar1.z *************** *** 86,91 **** rename _temp_.txz tar1.z ! tar2.z: ansi2knr.c echogs.c ega.c uniq.c ! tar -b1 -cf _temp_.t ansi2knr.c echogs.c ega.c uniq.c compress -i _temp_.t if exist tar2.z erase tar2.z --- 85,93 ---- rename _temp_.txz tar1.z ! tar2.z: \cp.bat \mv.bat \rm.bat ansi2knr.c echogs.c ega.c uniq.c ! copy \cp.bat ! copy \mv.bat ! copy \rm.bat ! tar -b1 -cf _temp_.t -ubat cp.bat mv.bat rm.bat ansi2knr.c echogs.c ega.c uniq.c compress -i _temp_.t if exist tar2.z erase tar2.z *************** *** 134,139 **** rename _temp_.txz tar6.z ! tar7.z: fontmap copying news readme bdftops font2c pfbtogs ccgs ! tar -b1 -cf _temp_.t fontmap copying news readme bdftops font2c pfbtogs showpbm gs*. ccgs compress -i _temp_.t if exist tar7.z erase tar7.z --- 136,141 ---- rename _temp_.txz tar6.z ! tar7.z: fontmap copying news readme bdftops font2c ccgs ! tar -b1 -cf _temp_.t fontmap copying news readme bdftops font2c gs*. ccgs compress -i _temp_.t if exist tar7.z erase tar7.z *************** *** 150,153 **** --- 152,156 ---- allzips: gsexe.zip gsfiles.zip gssrc1.zip gssrc2.zip \ gsfonts1.zip gsfonts2.zip gsfonts3.zip gsfonts4.zip + @echo ---------------- Done. ---------------- zips: gsexe.zip gsfiles.zip gssrc1.zip gssrc2.zip *************** *** 173,178 **** gsfiles.zip: bdftops.bat if exist _temp_.zip erase _temp_.zip ! pkzip _temp_.zip gs*.bat bdftops.bat font2c.bat pfbtogs.bat showpbm.bat *.doc ! pkzip -a _temp_.zip *.ps fontmap copying news readme bdftops font2c pfbtogs showpbm pkzip -d _temp_.zip q* q*.* t.* comp1.* if exist gsfiles.zip erase gsfiles.zip --- 176,181 ---- gsfiles.zip: bdftops.bat if exist _temp_.zip erase _temp_.zip ! pkzip _temp_.zip gs*.bat bdftops.bat font2c.bat *.doc ! pkzip -a _temp_.zip *.ps fontmap copying news readme bdftops font2c pkzip -d _temp_.zip q* q*.* t.* comp1.* if exist gsfiles.zip erase gsfiles.zip *************** *** 181,185 **** gssrc1.zip: ansi2knr.c if exist _temp_.zip erase _temp_.zip ! pkzip _temp_.zip \rm.bat \cp.bat pkzip -a _temp_.zip g*.asm i*.asm pkzip -a _temp_.zip ansi2knr.c echogs.c ega.c uniq.c turboc.cfg gs.def *.icx gs.rc --- 184,188 ---- gssrc1.zip: ansi2knr.c if exist _temp_.zip erase _temp_.zip ! pkzip _temp_.zip \rm.bat \cp.bat \mv.bat pkzip -a _temp_.zip g*.asm i*.asm pkzip -a _temp_.zip ansi2knr.c echogs.c ega.c uniq.c turboc.cfg gs.def *.icx gs.rc *************** *** 186,190 **** pkzip -a _temp_.zip *.h *.mak *.man *.sh *.tr tar_*. ugly*.* pkzip -a _temp_.zip gs*. ccgs ! pkzip -d _temp_.zip arch.h gconfig.h obj*.tr lib*.tr _temp*.* pkzip -d _temp_.zip ugly*.bdf libc*.tr q* q*.* t.* comp1.* if exist gssrc1.zip erase gssrc1.zip --- 189,193 ---- pkzip -a _temp_.zip *.h *.mak *.man *.sh *.tr tar_*. ugly*.* pkzip -a _temp_.zip gs*. ccgs ! pkzip -d _temp_.zip arch.h gconfig*.h obj*.tr lib*.tr _temp*.* pkzip -d _temp_.zip ugly*.bdf libc*.tr q* q*.* t.* comp1.* if exist gssrc1.zip erase gssrc1.zip diff -rc2N gs25/make.doc gs251/make.doc *** gs25/make.doc Wed Aug 19 00:56:03 1992 --- gs251/make.doc Sat Sep 5 17:05:02 1992 *************** *** 88,92 **** - TDEBUG: no debugging code included in the build. ! - DEVICE_DEVS: platform-specific, see below. - FEATURE_DEVS: platform-specific. --- 88,92 ---- - TDEBUG: no debugging code included in the build. ! - DEVICE_DEVS*: platform-specific, see below. - FEATURE_DEVS: platform-specific. *************** *** 112,140 **** ******** ! The makefiles distributed with Ghostscript select the following ! devices for inclusion in the executable: - Turbo C: - VGA and EGA displays - Epson-compatible dot matrix printers - (default resolution 180 x 180 DPI) - Canon BJ-10e (BubbleJet) printer - (default resolution 360 x 360 DPI) - Borland C++: all of the above, plus: - H-P DeskJet and LaserJet family printers - (default resolution 300 DPI) - GIF file format - Watcom C/386: all of the above, plus: - (partial) Display PostScript and PostScript Level 2 features - Tseng ET3000/ET4000 SuperVGA displays - H-P PaintJet printer - PBM/PGM/PPM file formats - PCX file format - - These options were chosen to strike a balance between RAM consumption and - likely usefulness. (Turbo C is limited to 640K and does not support code - overlaying; Borland C++ is limited to 640K, but supports code overlaying; - Watcom C/386 is not limited to 640K.) - To build Ghostscript, you need MS-DOS version 3.3 or later, and a Borland C/C++ development system or the Watcom C/386 development system. Details --- 112,132 ---- ******** ! To find out what devices the makefiles distributed with Ghostscript ! select for inclusion in the executable, find the lines in the ! appropriate makefiles of the form ! FEATURE_DEVS= ! and ! DEVICE_DEVS= ! (similarly DEVICE_DEVS2... up to DEVICE_DEVS5) ! The relevant makefiles are: ! Turbo C: turboc.mak ! Borland C++, MS-DOS: tbcplus.mak ! Borland C++, MS Windows: bcwin.mak ! Watcom C/386, MS-DOS: watc.mak ! The options were chosen to strike a balance between RAM consumption ! and likely usefulness. (Turbo C is limited to 640K and does not ! support code overlaying; Borland C++ is limited to 640K, but supports ! code overlaying under MS-DOS; Watcom C/386 is not limited to 640K.) To build Ghostscript, you need MS-DOS version 3.3 or later, and a Borland C/C++ development system or the Watcom C/386 development system. Details *************** *** 315,321 **** 80386 system using a version of gcc older than version 1.38, you must not use the -O option. ! X11R5 may need #include in x_.h. If you are using ! a stock System V platform that lacks rename and gettimeofday, change ! PLATFORM=unix_ in the makefile to PLATFORM=sysv_. Apollo: --- 307,312 ---- 80386 system using a version of gcc older than version 1.38, you must not use the -O option. ! X11R5 may need #include in x_.h. ! Also see below regarding System V platforms. Apollo: *************** *** 334,339 **** H-P 700 series: ! You may need to use +O1 rather than -O to get the compiler to ! produce correct code. ISC Unix: --- 325,329 ---- H-P 700 series: ! Use the compiler flags -Aa +O3 (*not* -O). ISC Unix: *************** *** 390,393 **** --- 380,388 ---- give a syntax error. This has been observed on a SPARCstation running SunOS 4.1.1. If this happens, use -g for this file, or use gcc. + + System V Unix platforms: + If you are using a stock System V platform that lacks rename + and gettimeofday, change PLATFORM=unix_ in the makefile to + PLATFORM=sysv_. ******** diff -rc2N gs25/man.doc gs251/man.doc *** gs25/man.doc Wed Aug 19 00:56:09 1992 --- gs251/man.doc Tue Sep 8 14:31:04 1992 *************** *** 1,5 **** .\"- -*- nroff -*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\" ! .\"This file describes version 2.5 of Ghostscript. .\" .\"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --- 1,5 ---- .\"- -*- nroff -*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\" ! .\"This file describes version 2.5.1 of Ghostscript. .\" .\"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *************** *** 10,14 **** .. .TH GS 1 "August 16, 1992" "" "CAEN - The University of Michigan" ! .SH NAME gs \- PostScript previewer .SH SYNOPSIS --- 10,14 ---- .. .TH GS 1 "August 16, 1992" "" "CAEN - The University of Michigan" ! .SH NAME gs \- PostScript previewer .SH SYNOPSIS *************** *** 25,45 **** Ghostscript is an interpreter for Adobe Systems' PostScript (tm) language. .I Gs ! reads each given .I file in sequence and displays or prints it as a Ghostscript file. It then interprets commands from the primary input stream (normally the keyboard) ! until an end of file character (^D or CTRL\-D) is typed. Typing `quit' at the Ghostscript prompt also terminates Ghostscript execution. Typing the interrupt character, e.g., .B control-C, ! also terminates Ghostscript execution. You can get a help message by invoking Ghostscript with .nf ! gs -h .fi or .nf ! gs -? .fi --- 25,45 ---- Ghostscript is an interpreter for Adobe Systems' PostScript (tm) language. .I Gs ! reads each given .I file in sequence and displays or prints it as a Ghostscript file. It then interprets commands from the primary input stream (normally the keyboard) ! until an end of file character (^D or CTRL\-D) is typed. Typing `quit' at the Ghostscript prompt also terminates Ghostscript execution. Typing the interrupt character, e.g., .B control-C, ! also terminates Ghostscript execution. You can get a help message by invoking Ghostscript with .nf ! gs \-h .fi or .nf ! gs \-? .fi *************** *** 46,51 **** .SS "Choosing the output device" ! Ghostscript may be built with multiple output devices. Ghostscript ! normally opens the first one and directs output to it. To use device xyz as the initial output device, include the switch --- 46,51 ---- .SS "Choosing the output device" ! Ghostscript may be built with multiple output devices. Ghostscript ! normally opens the first one and directs output to it. To use device xyz as the initial output device, include the switch *************** *** 91,95 **** To select the density on a printer, use ! gs -sDEVICE= -rx For example, on a 9-pin Epson-compatible printer, you can get the --- 91,95 ---- To select the density on a printer, use ! gs \-sDEVICE= \-rx For example, on a 9-pin Epson-compatible printer, you can get the *************** *** 96,112 **** lowest-density (fastest) mode with ! gs -sDEVICE=epson -r60x72 and the highest-density mode with ! gs -sDEVICE=epson -r240x72. On a 24-pin printer, the lowest density is ! gs -sDEVICE=epson -r60x60 and the highest-density 24-pin mode is ! gs -sDEVICE=epson -r360x180 If you select a printer as the output device, Ghostscript also allows you --- 96,112 ---- lowest-density (fastest) mode with ! gs \-sDEVICE=epson \-r60x72 and the highest-density mode with ! gs \-sDEVICE=epson \-r240x72. On a 24-pin printer, the lowest density is ! gs \-sDEVICE=epson \-r60x60 and the highest-density 24-pin mode is ! gs \-sDEVICE=epson \-r360x180 If you select a printer as the output device, Ghostscript also allows you *************** *** 138,142 **** devicenames == ! after starting up Ghostscript. Alternatively you can use the -h or -? switch in the command line, as described above. --- 138,142 ---- devicenames == ! after starting up Ghostscript. Alternatively you can use the \-h or -? switch in the command line, as described above. *************** *** 174,178 **** standard buffer size wasn't large enough. Likewise, if Ghostscript gives you a 'VMerror in setdevice' error, it means the buffer size ! was too large. You can use the -dBufferSpace= switch to set the buffer size to a different value, e.g., --- 174,178 ---- standard buffer size wasn't large enough. Likewise, if Ghostscript gives you a 'VMerror in setdevice' error, it means the buffer size ! was too large. You can use the \-dBufferSpace= switch to set the buffer size to a different value, e.g., *************** *** 194,199 **** .TP ! - ! The directory/ies specified by the -I switch(es) in the command line (see below), if any; .TP --- 194,199 ---- .TP ! - ! The directory/ies specified by the \-I switch(es) in the command line (see below), if any; .TP *************** *** 202,206 **** if any; .TP ! - The directories specified by the GS_LIB_DEFAULT macro, which is typically set to "/usr/lib/ghostscript:/usr/lib/ghostscript/fonts" --- 202,206 ---- if any; .TP ! - The directories specified by the GS_LIB_DEFAULT macro, which is typically set to "/usr/lib/ghostscript:/usr/lib/ghostscript/fonts" *************** *** 208,212 **** .PP ! Each of these (GS_LIB_DEFAULT, GS_LIB, and -I parameter) may be either a single directory, or a list of directories separated by a character appropriate for the operating system (':' on Unix systems, ';' on VMS --- 208,212 ---- .PP ! Each of these (GS_LIB_DEFAULT, GS_LIB, and \-I parameter) may be either a single directory, or a list of directories separated by a character appropriate for the operating system (':' on Unix systems, ';' on VMS *************** *** 297,304 **** the name of the border color (default = black) .TP ! .B geometry the window size and placement, WxH+X+Y (default = ???) .TP ! .B xResolution the number of x pixels per inch default is computed from WidthOfScreen and WidthMMOfScreen --- 297,304 ---- the name of the border color (default = black) .TP ! .B geometry the window size and placement, WxH+X+Y (default = ???) .TP ! .B xResolution the number of x pixels per inch default is computed from WidthOfScreen and WidthMMOfScreen *************** *** 319,323 **** Then load the defaults into the X server: ! % xrdb -merge ~/.Xresources .SH OPTIONS --- 319,323 ---- Then load the defaults into the X server: ! % xrdb \-merge ~/.Xresources .SH OPTIONS *************** *** 327,331 **** .SS "Normal switches" ! .IP \fI\@filename\fR --- 327,331 ---- .SS "Normal switches" ! .IP \fI@filename\fR *************** *** 376,380 **** .RE .IP \fI\-q\fR ! Quiet startup -- suppress normal startup messages, and also do the equivalent of \fI-dQUIET\fR. --- 376,380 ---- .RE .IP \fI\-q\fR ! Quiet startup \-- suppress normal startup messages, and also do the equivalent of \fI-dQUIET\fR. *************** *** 381,385 **** .IP "\fI\-gnumber1xnumber2\fR" Equivalent to \fI\-dDEVICEWIDTH=number1\fR and ! \fI\-dDEVICEHEIGHT=number2\fR. This is for the benefit of devices (such as X11 windows and VESA displays) that require (or allow) width and height to be specified. --- 381,385 ---- .IP "\fI\-gnumber1xnumber2\fR" Equivalent to \fI\-dDEVICEWIDTH=number1\fR and ! \fI\-dDEVICEHEIGHT=number2\fR. This is for the benefit of devices (such as X11 windows and VESA displays) that require (or allow) width and height to be specified. *************** *** 407,419 **** .LP Note that gs_init.ps makes systemdict read-only, so the values of names ! defined with -D/d/S/s cannot be changed (although, of course, they can be superseded by definitions in userdict or other dictionaries.) .SS "Special names" - .IP \fI\-dASCIIOUT\fr - disables Ghostscript's normal behavior; instead, writes strings to - stdout that would have been displayed or printed. For more information, - see the file gs_2asc.ps. - .IP \fI\-dDISKFONTS\fR causes individual character outlines to be loaded from the disk --- 407,414 ---- .LP Note that gs_init.ps makes systemdict read-only, so the values of names ! defined with \-D/d/S/s cannot be changed (although, of course, they can be superseded by definitions in userdict or other dictionaries.) .SS "Special names" .IP \fI\-dDISKFONTS\fR causes individual character outlines to be loaded from the disk *************** *** 425,436 **** disables the `bind' operator. Only useful for debugging. ! .IP \fI\-dNOCACHE\fR disables character caching. Only useful for debugging. .IP \fI\-dNODISPLAY\fR ! suppress the normal initialization of the output device. This may be useful when debugging. ! .IP \fI\-dNOPAUSE\fR disables the prompt and pause at the end of each page. This may be desirable for applications where another program is 'driving' --- 420,431 ---- disables the `bind' operator. Only useful for debugging. ! .IP \fI\-dNOCACHE\fR disables character caching. Only useful for debugging. .IP \fI\-dNODISPLAY\fR ! suppress the normal initialization of the output device. This may be useful when debugging. ! .IP \fI\-dNOPAUSE\fR disables the prompt and pause at the end of each page. This may be desirable for applications where another program is 'driving' *************** *** 522,526 **** spam% gs Initializing... done. ! Ghostscript 2.5 (8/16/92) Copyright (C) 1990, 1992 Aladdin Enterprises, Menlo Park, CA. All rights reserved. --- 517,521 ---- spam% gs Initializing... done. ! Ghostscript 2.5.1 (9/8/92) Copyright (C) 1990, 1992 Aladdin Enterprises, Menlo Park, CA. All rights reserved. *************** *** 538,563 **** At most installations, the only available display device is x11, so you must be running X11 windows to use ghostscript unless you use the ! command line option \fI\-dNODISPLAY\fR. There is also a script called ! 'gsnd' which is just 'gs -DNODISPLAY -q $*'. At most installations, Ghostscript was not built for a debugging configuration therefore the command line option \fI\-Zxxx\fR is not ! available. This speeds up the interpreter. ! Ghostscript works with color postscript files, postscript files created by ! Tom Rokicki's dvips, M-PLOT, Mathematica, Tell-a-Graf, etc. You can, for example, preview multiple pages of a postscript file created by Latex/dvips/psfig ! and you will be able to see any included postscript figure. If the postscript file adheres to Adobe's Document Structuring Convention, like the ones generated by Latex/dvips, then you are advised to use .B ghostview ! to preview your postscript document for it provides a far more friendly and graphical user interface. ! Ghostscript also has the ability to convert a postscript file to a PPM file. ! Once you have a file in PPM format you can display or manipulate it in many ! ways. You can, for example, use 'xv' or other tools to convert the PPM file ! to a variety of formats, like GIF, TIFF, PICT, RLE, XPM, GPR (only available ! on the apollos, through the program /progs/bit2bit/bin/ppm2gpr) etc. .nf --- 533,558 ---- At most installations, the only available display device is x11, so you must be running X11 windows to use ghostscript unless you use the ! command line option \fI\-dNODISPLAY\fR. There is also a script ! called 'gsnd' which is just 'gs \-DNODISPLAY \-q $*'. At most installations, Ghostscript was not built for a debugging configuration therefore the command line option \fI\-Zxxx\fR is not ! available. This speeds up the interpreter. ! Ghostscript works with color postscript files, postscript files created by ! Tom Rokicki's dvips, M-PLOT, Mathematica, Tell-a-Graf, etc. You can, for example, preview multiple pages of a postscript file created by Latex/dvips/psfig ! and you will be able to see any included postscript figure. If the postscript file adheres to Adobe's Document Structuring Convention, like the ones generated by Latex/dvips, then you are advised to use .B ghostview ! to preview your postscript document for it provides a far more friendly and graphical user interface. ! Ghostscript also has the ability to convert a postscript file to a PPM file. ! Once you have a file in PPM format you can display or manipulate it in many ! ways. You can, for example, use 'xv' or other tools to convert the PPM file ! to a variety of formats, like GIF, TIFF, PICT, RLE, XPM, GPR (only available ! on the apollos, through the program /progs/bit2bit/bin/ppm2gpr) etc. .nf *************** *** 565,569 **** spam% gs Initializing... done. ! Ghostscript 2.5 (8/16/92) Copyright (C) 1990, 1992 Aladdin Enterprises, Menlo Park, CA. All rights reserved. --- 560,564 ---- spam% gs Initializing... done. ! Ghostscript 2.5.1 (9/8/92) Copyright (C) 1990, 1992 Aladdin Enterprises, Menlo Park, CA. All rights reserved. *************** *** 590,597 **** ppmtogif: 39 colors found ! spam% ls -l tiger.ps /tmp/tiger.ppm /tmp/tiger.gif ! -rw-r--r-- 1 oliveria 41796 Apr 21 18:44 /tmp/tiger.gif ! -rw-r--r-- 1 oliveria 3366054 Apr 21 18:36 /tmp/tiger.ppm ! -rw-r--r-- 1 oliveria 78519 Apr 21 17:39 tiger.ps .fi --- 585,592 ---- ppmtogif: 39 colors found ! spam% ls \-l tiger.ps /tmp/tiger.ppm /tmp/tiger.gif ! \-rw-r--r-- 1 oliveria 41796 Apr 21 18:44 /tmp/tiger.gif ! \-rw-r--r-- 1 oliveria 3366054 Apr 21 18:36 /tmp/tiger.ppm ! \-rw-r--r-- 1 oliveria 78519 Apr 21 17:39 tiger.ps .fi *************** *** 600,604 **** IslandDraw version 3.0 or greater is also able to read (select 'Convert...' under the 'File' menu) single\-page postscript ! files. It can also save the postscript file in a variety of formats. .SH SYSTEM FILES --- 595,599 ---- IslandDraw version 3.0 or greater is also able to read (select 'Convert...' under the 'File' menu) single\-page postscript ! files. It can also save the postscript file in a variety of formats. .SH SYSTEM FILES *************** *** 610,614 **** .TP 15 .B gs_fonts.ps ! Font initialization. gs_init.ps reads this in. It initializes Ghostscript's font machinery and provides some utility procedures that work with fonts. .TP 15 --- 605,609 ---- .TP 15 .B gs_fonts.ps ! Font initialization. gs_init.ps reads this in. It initializes Ghostscript's font machinery and provides some utility procedures that work with fonts. .TP 15 *************** *** 619,623 **** .TP 15 .B gs_2asc.ps ! gs_init.ps reads this in if the ASCIIOUT option is selected. It redefines many operators. For more information, see the comments in the file. --- 614,618 ---- .TP 15 .B gs_2asc.ps ! This utility file helps extract the ASCII text from PostScript source files. It redefines many operators. For more information, see the comments in the file. *************** *** 648,652 **** .TP 15 .B snowflak.ps ! a rectangular grid of intricate colored snowflakes. (Renders very slowly.) .TP 15 .B colorcir.ps --- 643,647 ---- .TP 15 .B snowflak.ps ! a rectangular grid of intricate colored snowflakes. (Renders very slowly.) .TP 15 .B colorcir.ps *************** *** 675,684 **** them rendered in landscape mode. .TP 15 - .B pfbtogs.ps - a utility for converting PFB fonts to plain text form, which - Ghostscript can use. - .TP 15 .B pstoppm.ps ! a utility for rendering PostScript files onto PPM (bitmap) files. .TP 15 .B ps2image.ps --- 670,675 ---- them rendered in landscape mode. .TP 15 .B pstoppm.ps ! a utility for rendering PostScript files onto PPM (bitmap) files. .TP 15 .B ps2image.ps *************** *** 686,692 **** PostScript file consisting of just bitmaps, one per page. .TP 15 - .B showpbm.ps - a utility for displaying PBM/PGM/PPM files. - .TP 15 .B wrfont.ps a utility for writing out an unprotected Type 1 font, such as --- 677,680 ---- *************** *** 705,711 **** font. .TP 15 - .B phonbook.ps - an address/phone book template. - .TP 15 .B ppath.ps a couple of utilities for printing out the current path, for debugging. --- 693,696 ---- *************** *** 723,727 **** the Type 1 font format opcodes. .TP 15 ! .B unprot.ps a program to disable access checking. --- 708,712 ---- the Type 1 font format opcodes. .TP 15 ! .B unprot.ps a program to disable access checking. *************** *** 738,742 **** .B /usr/um/lib/ghostscript Initialization files, utilities, sample postscript files ! .TP 15 .B /usr/um/lib/ghostscript/fonts Ghostscript and Hershey fonts (*.gsf files) --- 723,727 ---- .B /usr/um/lib/ghostscript Initialization files, utilities, sample postscript files ! .TP 15 .B /usr/um/lib/ghostscript/fonts Ghostscript and Hershey fonts (*.gsf files) *************** *** 785,789 **** synchronizes the X connection in the Unix implementation. showpage is a procedure that does a copypage and then beeps the bell and waits for the ! user to hit a key. (copypage does do the right thing for printers.) strokepath produces incorrect output for dashed lines. --- 770,774 ---- synchronizes the X connection in the Unix implementation. showpage is a procedure that does a copypage and then beeps the bell and waits for the ! user to hit a key. (copypage does do the right thing for printers.) strokepath produces incorrect output for dashed lines. *************** *** 818,823 **** .SH "SEE ALSO" .br ! The PostScript Language Reference Manual, Adobe Systems Incorporated, Second Edition, Addison\-Wesley Publishing Company, ISBN 0\-201\-18127\-4, 1990 .br X(1), ghostview(1), lpr(1), dvips(1), ppm(5), xv(1) --- 803,809 ---- .SH "SEE ALSO" .br ! The PostScript Language Reference Manual, Adobe Systems Incorporated, Second Edition, Addison\-Wesley Publishing Company, ISBN 0\-201\-18127\-4, 1990 .br X(1), ghostview(1), lpr(1), dvips(1), ppm(5), xv(1) + .br diff -rc2N gs25/mv.bat gs251/mv.bat *** gs25/mv.bat --- gs251/mv.bat Tue Sep 8 19:06:48 1992 *************** *** 0 **** --- 1 ---- + @rename %1 %2 diff -rc2N gs25/nalloc.h gs251/nalloc.h *** gs25/nalloc.h --- gs251/nalloc.h Tue Mar 3 15:55:38 1992 *************** *** 0 **** --- 1,146 ---- + /* Copyright (C) 1991, 1992 Aladdin Enterprises. All rights reserved. + Distributed by Free Software Foundation, Inc. + + This file is part of Ghostscript. + + Ghostscript is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY. No author or distributor accepts responsibility + to anyone for the consequences of using it or for whether it serves any + particular purpose or works at all, unless he says so in writing. Refer + to the Ghostscript General Public License for full details. + + Everyone is granted permission to copy, modify and redistribute + Ghostscript, but only under the conditions described in the Ghostscript + General Public License. A copy of this license is supposed to have been + given to you along with Ghostscript so you can know your rights and + responsibilities. It should be in a file named COPYING. Among other + things, the copyright notice and this notice must be preserved on all + copies. */ + + /* nalloc.h */ + /* Library client interface for new Ghostscript allocator */ + + /* Define the type for the size of an object. */ + typedef uint usize_t; + + /* Define the type for identifying an allocator client. */ + typedef char _ds *client_name_t; + + /* Define the type for an allocator instance. */ + struct alloc_state_s; + typedef struct alloc_state_s _ds *as_ptr_t; + + /* Define the type for a structure descriptor. */ + struct struct_type_s; + typedef struct struct_type_s _ds *at_ptr_t; + + /* Define the type for allocator statistics. */ + typedef struct alloc_status_s { + ulong allocated; + ulong used; + } alloc_status_t; + + /* Define the allocator client procedures */ + typedef struct alloc_procs_s alloc_procs_t; + struct alloc_procs_s { + + /* Allocate a structure */ + #define alloc_proc_alloc_struct(proc)\ + void *proc(P3(as_ptr_t, at_ptr_t, client_name_t)) + alloc_proc_alloc_struct((*alloc_struct)); + #define gs_alloc_struct(ap,tp,cn) (*(ap)->procs.alloc_struct)(ap,tp,cn) + + /* Allocate (aligned) bytes */ + #define alloc_proc_alloc_bytes(proc)\ + byte *proc(P4(as_ptr_t, uint, uint, client_name_t)) + alloc_proc_alloc_bytes((*alloc_bytes)); + #define gs_alloc_bytes(ap,es,n,cn) (*(ap)->procs.alloc_bytes)(ap,es,n,cn) + + /* Change the size of a byte object */ + #define alloc_proc_resize(proc)\ + byte *proc(P5(as_ptr_t, byte *, uint, uint, client_name_t)) + alloc_proc_resize((*resize)); + #define gs_resize(ap,p,es,n,cn) (*(ap)->procs.resize)(ap,p,es,n,cn) + + /* Free an object (structure or bytes) */ + #define alloc_proc_free(proc)\ + void proc(P3(as_ptr_t, void *, client_name_t)) + alloc_proc_free((*free)); + #define gs_free(ap,p,cn) (*(ap)->procs.free)(ap,p,cn) + + /* Report status (assigned, used) */ + #define alloc_proc_status(proc)\ + void proc(P2(as_ptr_t, alloc_status_t *)) + alloc_proc_status((*status)); + #define gs_alloc_status(ap,s) (*(ap)->procs.status)(ap,s) + + }; + + /* Define the generic allocator state. */ + /* "Subclasses" will extend this. */ + #define alloc_state_common\ + alloc_procs_t procs + struct alloc_state_s { + alloc_state_common; + }; + + /* Define the standard Ghostscript allocator implementation. */ + extern alloc_procs_t gs_alloc_std_procs; + + /* ====== Root-registering clients ====== */ + union struct_header_s; + struct ref_s; + + /* Define the type for a pointer descriptor. */ + typedef struct ptr_procs_s { + + /* Mark the referent of a pointer. */ + #define ptr_proc_mark(proc)\ + bool proc(P1(void *)) + ptr_proc_mark((*mark)); + + /* Relocate a pointer. */ + #define ptr_proc_reloc(proc)\ + void *proc(P1(void *)) + ptr_proc_reloc((*reloc)); + + } ptr_procs_t; + typedef ptr_procs_t _ds *ptr_type_t; + + /* Define the pointer type for ordinary structure pointers. */ + extern ptr_procs_t ptr_struct_procs; + #define ptr_struct_type (&ptr_struct_procs) + + /* Define the type for a GC root. */ + typedef struct gc_root_s gc_root_t; + struct gc_root_s { + gc_root_t *next; + ptr_type_t ptype; + void **p; + }; + + /* Register/unregister a root. */ + void gs_struct_root_register(P3(as_ptr_t, gc_root_t *, union struct_header_s **)); + void gs_root_unregister(P2(as_ptr_t, gc_root_t *)); + + /* ====== Structure-defining clients ====== */ + /* These are clients who define new types of structure. */ + + /* Object contents enumerator type */ + #define mark_enum_proc(proc)\ + ptr_type_t proc(P3(void *ptr, uint index, void ***pep)) + + /* Object type */ + typedef struct struct_type_s { + usize_t size; + char _ds *sname; + mark_enum_proc((*gc_mark_proc)); + void (*pre_gc_proc)(P1(void *)); + void (*post_gc_proc)(P1(void *)); + void (*finalize_proc)(P1(void *)); + } struct_type_t; + /* Default object procedures */ + extern mark_enum_proc(no_gc_mark_proc); + extern void no_pre_gc_proc(P1(void *)), + no_post_gc_proc(P1(void *)), + no_finalize_proc(P1(void *)); diff -rc2N gs25/newalloc.mak gs251/newalloc.mak *** gs25/newalloc.mak --- gs251/newalloc.mak Tue Mar 3 11:45:58 1992 *************** *** 0 **** --- 1,11 ---- + ntest.$(OBJ): ntest.c + + nalloc.$(OBJ): nalloc.c std.h nstd.h nalloc.h nmman.h + + nsave.$(OBJ): nsave.c ghost.h nstd.h npacked.h nalloc.h nsave.h nmman.h + + ngc.$(OBJ): ngc.c ghost.h nstd.h dict.h estack.h ostack.h npacked.h store.h nalloc.h nsave.h nmman.h + + NALL=ntest.$(OBJ) nalloc.$(OBJ) # nsave.$(OBJ) ngc.$(OBJ) + ntest.exe: $(NALL) + tlink /m /l c:\bc\lib\c0l $(NALL),ntest,ntest,@libcl.tr diff -rc2N gs25/nmman.h gs251/nmman.h *** gs25/nmman.h --- gs251/nmman.h Tue Mar 3 15:58:36 1992 *************** *** 0 **** --- 1,162 ---- + /* Copyright (C) 1992 Aladdin Enterprises. All rights reserved. + Distributed by Free Software Foundation, Inc. + + This file is part of Ghostscript. + + Ghostscript is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY. No author or distributor accepts responsibility + to anyone for the consequences of using it or for whether it serves any + particular purpose or works at all, unless he says so in writing. Refer + to the Ghostscript General Public License for full details. + + Everyone is granted permission to copy, modify and redistribute + Ghostscript, but only under the conditions described in the Ghostscript + General Public License. A copy of this license is supposed to have been + given to you along with Ghostscript so you can know your rights and + responsibilities. It should be in a file named COPYING. Among other + things, the copyright notice and this notice must be preserved on all + copies. */ + + /* nmman.h */ + /* New memory manager internal definitions for Ghostscript */ + + /* ====== Allocator ====== */ + + /* Define the alignment modulus for aligned objects. */ + #define log2_align_mod 3 /* big enough for a double */ + /* and for a struct_header */ + #define align_mod (1 << log2_align_mod) + #define align_mask (align_mod-1) + #define align_round(siz) (uint)(((siz) + align_mask) & -align_mod) + + /* Structure header. */ + /* There are 3 different formats, as indicated below. */ + /* Note that we force the size of a structure header to be align_mod. */ + typedef union struct_header_s struct_header_t; + union struct_header_s { + struct { + unsigned mark : 1, large : 1, bytes : 1; + } h; /* all formats */ + /* Ordinary typed structure */ + struct { + unsigned _ : 3, reloc8 : 13; + at_ptr_t type; + } s; /* large = 0, bytes = 0 */ + /* Plain (but aligned) bytes */ + struct { + unsigned _ : 3, reloc8 : 13; + ushort size; + } b; /* large = 0, bytes = 1 */ + /* Large bytes (in a chunk by themselves) */ + struct { + unsigned _ : 3, lsize : 13; + ushort size; + } l; /* large = 1, bytes = 1 */ + /* Force size up to align_mod */ + byte _[align_mod]; + }; + #define struct_size(shp)\ + ((shp)->h.bytes ? (shp)->b.size : (shp)->s.type->size) + #define struct_large_size(shp)\ + (((ulong)(shp)->l.lsize << 16) + (shp)->l.size) + #define struct_next(shp)\ + ((struct_header_t *)((byte *)(shp) + struct_size(shp))) + + /* ====== Chunks ====== */ + + /* Chunks are "objects", i.e. they have a header that identifies */ + /* which implementation is being used. */ + typedef struct chunk_s chunk_t; + typedef struct chunk_locator_s chunk_locator_t; + typedef chunk_locator_t _ss *cl_ptr_t; + + #define declare_chunk_procs(dscope, ctype, init, status, gc_init, gc_trace_from_marked, gc_set_reloc, gc_do_reloc, gc_compact)\ + \ + /* Initialize the chunk. */\ + dscope void init(P3(ctype *, byte *, usize_t));\ + \ + /* Return the space allocated and used. */\ + dscope void status(P2(ctype *, alloc_status_t *));\ + \ + /**** The rest of the procedures are only for the GC. ****/\ + \ + /* Initialize for a GC by clearing marks. */\ + dscope void gc_init(P1(ctype *));\ + \ + /* Trace from all marked pointers. */\ + /* Return true if any new marks. */\ + dscope bool gc_trace_from_marked(P1(ctype *));\ + \ + /* Compute and store relocation amounts. */\ + dscope void gc_set_reloc(P2(ctype *, cl_ptr_t));\ + \ + /* Relocate pointers. */\ + dscope void gc_do_reloc(P2(ctype *, cl_ptr_t));\ + \ + /* Compact to remove unmarked components. */\ + dscope void gc_compact(P1(ctype *)) + + #define chunk_procs_struct(ctype)\ + struct {\ + declare_chunk_procs(, ctype, (*init), (*status), (*gc_init), (*gc_trace_from_marked), (*gc_set_reloc), (*gc_do_reloc), (*gc_compact));\ + } + typedef chunk_procs_struct(chunk_t) chunk_procs_t; + #define chunk_common\ + chunk_procs_t _ds *procs;\ + byte *cbot, *ctop;\ + chunk_t *cprev, *cnext /* sorted by address */ + struct chunk_s { + chunk_common; + }; + + /* Find the chunk for a pointer. */ + #define ptr_is_in_chunk(ptr, cp)\ + ptr_between((byte *)ptr, (cp)->cbot, (cp)->ctop) + struct chunk_locator_s { + chunk_t *cp; /* one-element cache */ + }; + extern bool chunk_locate_ptr(P2(byte *, cl_ptr_t)); + #define chunk_locate(ptr, clp)\ + (ptr_is_in_chunk((byte *)(ptr), (clp)->cp) ||\ + chunk_locate_ptr((byte *)(ptr), clp)) + + /* ------ Concrete chunks ------ */ + + /* Many small structures. */ + typedef struct { + chunk_common; + struct_header_t *top; + } chunk_structs_t; + + /* One large structure. */ + typedef struct { + chunk_common; + } chunk_large_struct_t; + + /* Refs and strings. */ + typedef struct { + chunk_common; + struct ref_s *rtop; + byte *ibot, *itop; + /* Rest is for GC */ + byte *ibits; + byte *ibase; + usize_t ibitsize; + ushort *ireloc; + uint imove; + } chunk_refs_t; + + /* ====== Definition of allocator state ====== */ + + typedef struct std_alloc_state_s std_alloc_state_t; + struct std_alloc_state_s { + alloc_state_common; + chunk_structs_t ccs; /* current structs chunk */ + chunk_structs_t *pccs; /* where to put ccs */ + chunk_refs_t ccrs; /* current refs chunk */ + chunk_refs_t *pccrs; /* where to put ccrs */ + uint chunk_size; + uint large_size; /* min size for large chunk */ + gc_root_t *roots; + chunk_t chunk_min, chunk_max; /* head and tail of chunk list */ + }; diff -rc2N gs25/npacked.h gs251/npacked.h *** gs25/npacked.h --- gs251/npacked.h Sat Apr 25 06:39:36 1992 *************** *** 0 **** --- 1,109 ---- + /* Copyright (C) 1991, 1992 Aladdin Enterprises. All rights reserved. + Distributed by Free Software Foundation, Inc. + + This file is part of Ghostscript. + + Ghostscript is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY. No author or distributor accepts responsibility + to anyone for the consequences of using it or for whether it serves any + particular purpose or works at all, unless he says so in writing. Refer + to the Ghostscript General Public License for full details. + + Everyone is granted permission to copy, modify and redistribute + Ghostscript, but only under the conditions described in the Ghostscript + General Public License. A copy of this license is supposed to have been + given to you along with Ghostscript so you can know your rights and + responsibilities. It should be in a file named COPYING. Among other + things, the copyright notice and this notice must be preserved on all + copies. */ + + /* packed.h */ + /* Packed array format for Ghostscript */ + + /* + + Packed elements come in 2 different sizes, 2 bytes or 8 bytes. The + top bits of the first 16-bit subelement distinguish the 2 forms. The + 'size' of a packed array is the number of elements, not the number of + bytes it occupies. The encoding: + + 00-ttttt texrwsnm full 8-byte object + 01m0jjjj jjjjjjjj executable operator (for bind) + 01m1vvvv vvvvvvvv integer (biased by packed_min_intval) + 10miiiii iiiiiiii literal name + 11miiiii iiiiiiii executable name + + The m bit is the mark bit for the garbage collector. Note its + slightly unusual placement. + + The jjj index of executable operators is either the index of the + operator in the op_def_table, if the index is less than op_def_count, + or the index of the definition in the op_array_table (subtracting + op_def_count first). + + The iii index of names is the one that the name machinery already + maintains. A name whose index is larger than will fit in the packed + representation must be represented as a full 8-byte element. + + There are actually two packed array types, t_mixedarray and + t_shortarray. A t_mixedarray can have a mix of 2- and 8-bit + elements; a t_shortarray has all 2-byte elements. In both cases, the + `size' is the number of elements. + + Packed array elements can be distinguished from full-size elements, + so we allow the interpreter to simply execute all the different kinds + of arrays directly. In theory, this could lead to unaligned accesses + to full-size (8-byte) refs. Some machines can't handle unaligned + accesses of this kind. Rather than try to tailor the algorithms to + the machine's capabilities, we guarantee that full-size elements in + mixed arrays are always properly aligned. We do this by converting + up to 3 preceding 2-byte elements into 8-byte elements so that the + alignment is preserved. The only code this actually affects is in + make_packed_array. However, the save/restore machinery in isave.c is + sometimes used to save changes to packed arrays, and it currently + only knows how to save full-size, aligned refs. + + Note that code in zpacked.c and interp.c knows more about the + representation of packed elements than the definitions in this file + would imply. Read the code carefully if you change the + representation. + + */ + + typedef ushort ref_packed; + + #define packed_type_shift 12 + typedef enum { + pt_full_ref = 0, + #define pt_min_packed 4 + pt_executable_operator = 4, + pt_integer = 5, + pt_literal_name = 8, + pt_executable_name = 12 + } packed_type; + #define pt_tag(pt) ((ref_packed)(pt) << packed_type_shift) + #define r_is_packed(rp) (*(ref_packed *)(rp) >= pt_tag(pt_min_packed)) + #define packed_ref_is_name(prp) (*(prp) >= pt_tag(pt_literal_name)) + #define packed_max_full_ref (pt_tag(pt_min_packed) - 1) + #define packed_min_intval (-(1 << (packed_type_shift - 1))) + #define packed_max_intval ((1 << (packed_type_shift - 1)) - 1) + #define packed_int_mask ((1 << packed_type_shift) - 1) + #define packed_max_name_index ((1 << (packed_type_shift + 1)) - 1) + #define packed_per_ref (sizeof(ref) / sizeof(ref_packed)) + + /* Packed ref marking */ + #define lp_mark 0x2000 + #define r_has_pmark(rp) (*(rp) & lp_mark) + #define r_set_pmark(rp) (*(rp) |= lp_mark) + #define r_clear_pmark(rp) (*(rp) &= ~lp_mark) + + /* Procedures implemented in zpacked.c */ + + /* Make a packed array */ + extern int make_packed_array(P4(const ref *, uint, ref *, const char *)); + + /* Get an element from a packed array. */ + extern void packed_get(P2(const ref_packed *, ref *)); + /* Advance to the next element in a packed array. */ + #define packed_next(packed)\ + (*packed <= packed_max_full_ref ? packed + packed_per_ref : packed + 1) diff -rc2N gs25/nsave.h gs251/nsave.h *** gs25/nsave.h --- gs251/nsave.h Sun Mar 1 06:54:36 1992 *************** *** 0 **** --- 1,41 ---- + /* Copyright (C) 1991, 1992 Aladdin Enterprises. All rights reserved. + Distributed by Free Software Foundation, Inc. + + This file is part of Ghostscript. + + Ghostscript is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY. No author or distributor accepts responsibility + to anyone for the consequences of using it or for whether it serves any + particular purpose or works at all, unless he says so in writing. Refer + to the Ghostscript General Public License for full details. + + Everyone is granted permission to copy, modify and redistribute + Ghostscript, but only under the conditions described in the Ghostscript + General Public License. A copy of this license is supposed to have been + given to you along with Ghostscript so you can know your rights and + responsibilities. It should be in a file named COPYING. Among other + things, the copyright notice and this notice must be preserved on all + copies. */ + + /* nsave.h */ + /* Interpreter client interface for new Ghostscript allocator */ + /* Requires nalloc.h and ghost.h */ + + /* The routines here parallel those in nalloc.h, but deal with */ + /* refs and (unaligned) strings. */ + + /* ====== Ordinary clients ====== */ + /* These are clients who just allocate and deallocate objects. */ + + /* Allocate/free a string. */ + extern byte *gs_alloc_string(P3(as_ptr_t, uint, client_name_t)); + extern void gs_free_string(P4(as_ptr_t, byte *, uint, client_name_t)); + + /* Allocate/free refs. */ + extern ref *gs_alloc_refs(P3(as_ptr_t, uint, client_name_t)); + extern void gs_free_refs(P4(as_ptr_t, ref *, uint, client_name_t)); + + /* ====== Root-registering clients ====== */ + + /* Register a ref root. */ + void gs_alloc_ref_root_register(P3(as_ptr_t, gc_root_t *, ref **)); diff -rc2N gs25/nstd.h gs251/nstd.h *** gs25/nstd.h --- gs251/nstd.h Tue Mar 3 17:38:52 1992 *************** *** 0 **** --- 1,5 ---- + /* Additions to std.h */ + + typedef byte bool; + #define false 0 + #define true 1 diff -rc2N gs25/pcharstr.ps gs251/pcharstr.ps *** gs25/pcharstr.ps Wed Aug 19 00:56:11 1992 --- gs251/pcharstr.ps Thu Aug 20 03:19:48 1992 *************** *** 35,39 **** dup length lenIV sub lenIV exch getinterval save exch 0 () /SubFileDecode filter ! mark exch charstring_read counttomark 1 sub -1 0 { index ( ) print =only --- 35,39 ---- dup length lenIV sub lenIV exch getinterval save exch 0 () /SubFileDecode filter ! mark exch charstack_read counttomark 1 sub -1 0 { index ( ) print =only diff -rc2N gs25/pfbtogs gs251/pfbtogs *** gs25/pfbtogs Sun Jun 30 21:39:10 1991 --- gs251/pfbtogs *************** *** 1 **** - gs -q -dNODISPLAY -- pfbtogs.ps $1 $2 --- 0 ---- diff -rc2N gs25/pfbtogs.bat gs251/pfbtogs.bat *** gs25/pfbtogs.bat Thu Feb 27 02:30:30 1992 --- gs251/pfbtogs.bat *************** *** 1 **** - @gs -q -dNODISPLAY -- pfbtogs.ps %1 %2 %3 %4 %5 %6 %7 %8 %9 --- 0 ---- diff -rc2N gs25/pfbtogs.ps gs251/pfbtogs.ps *** gs25/pfbtogs.ps Mon Aug 10 04:13:24 1992 --- gs251/pfbtogs.ps *************** *** 1,114 **** - % Copyright (C) 1991, 1992 Aladdin Enterprises. All rights reserved. - % Distributed by Free Software Foundation, Inc. - % - % This file is part of Ghostscript. - % - % Ghostscript is distributed in the hope that it will be useful, but - % WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - % to anyone for the consequences of using it or for whether it serves any - % particular purpose or works at all, unless he says so in writing. Refer - % to the Ghostscript General Public License for full details. - % - % Everyone is granted permission to copy, modify and redistribute - % Ghostscript, but only under the conditions described in the Ghostscript - % General Public License. A copy of this license is supposed to have been - % given to you along with Ghostscript so you can know your rights and - % responsibilities. It should be in a file named COPYING. Among other - % things, the copyright notice and this notice must be preserved on all - % copies. - - % pfbtogs.ps - % Convert a PFB file to a Ghostscript font. - - % A .pfb file is a sequence of packets. Each packet starts with byte - % 0x80. The second byte in the packet gives the type of packet: 1 - % means it's a packet of ascii data which should be sent out as is - % (except for translating \r to the appropriate end-of-line - % character(s)); 2 means it's a packet of binary data (which may be - % translated into hex); 3 means EOF. For types 1 and 2, the type byte - % is followed by four bytes giving the length of the packet, least - % significant first. - - /envPFB 20 dict def - envPFB begin - - % ------ Packet writing routines ------ % - - /pfbtext % str -> - { { (\r) search - { ofile exch writestring pop - ofile (\n) writestring - } - { ofile exch writestring exit - } - ifelse - } loop - } def - - /pfbbinary % str -> - { { dup length 30 gt - { dup 0 30 getinterval ofile exch writehexstring - ofile (\n) writestring - dup length 30 sub 30 exch getinterval - } - { ofile exch writehexstring exit - } - ifelse - } loop ofile (\n) writestring - } def - - /pfbcopy % count proc -> - { exch % proc count - { dup bufsize min - buf 0 3 -1 roll getinterval - 2 index exec - bufsize sub dup 0 le { exit } if - } loop pop pop - } def - - % ------ The main program ------ % - - /bufsize 30000 def - /buf bufsize string def - - /pfbtogs % infilename outfilename pfbtogs -> - { /psname exch def - /pfbname exch def - - pfbname (r) file /ifile exch def - /packet 6 string def - ifile packet readstring - { dup length 6 eq { 0 get 128 eq } { pop false } ifelse } - { pop false } - ifelse - not { (Not a valid .PFB file.\n) print flush stop } if - - ifile 0 setfileposition - psname (w) file /ofile exch def - - { ifile packet readstring - not { exit } if - (packet: ) print packet { ( ) print =only } forall (\n) print flush - packet 5 get 256 mul packet 4 get add - 256 mul packet 3 get add 256 mul packet 2 get add - packet 1 get 1 sub - { { { ifile exch readstring pop pfbtext } pfbcopy } - { { ifile exch readstring pop pfbbinary } pfbcopy } - { exit } - } exch get exec - } loop - - ofile closefile - ifile closefile - - } bind def - - end - - % Enter the main program in the current dictionary. - /pfbtogs - { envPFB begin pfbtogs end - } bind def - - % If the program was invoked from the command line, run it now. - shellarguments { pfbtogs } if --- 0 ---- diff -rc2N gs25/phonbook.ps gs251/phonbook.ps *** gs25/phonbook.ps Sun Apr 19 14:33:54 1992 --- gs251/phonbook.ps *************** *** 1,123 **** - % Copyright (C) 1992 Aladdin Enterprises. All rights reserved. - % Distributed by Free Software Foundation, Inc. - % - % This file is part of Ghostscript. - % - % Ghostscript is distributed in the hope that it will be useful, but - % WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - % to anyone for the consequences of using it or for whether it serves any - % particular purpose or works at all, unless he says so in writing. Refer - % to the Ghostscript General Public License for full details. - % - % Everyone is granted permission to copy, modify and redistribute - % Ghostscript, but only under the conditions described in the Ghostscript - % General Public License. A copy of this license is supposed to have been - % given to you along with Ghostscript so you can know your rights and - % responsibilities. It should be in a file named COPYING. Among other - % things, the copyright notice and this notice must be preserved on all - % copies. - - % Print a template for a name / address / phone book. - - /HeadingFont { (Helvetica) findfont 12 scalefont setfont } def - /HeadingHeight 40 def - /NameHeading (Name and Address) def - /NumberHeading (Telephone) def - - /AreaCodeFont { (Helvetica) findfont 6 scalefont setfont } def - - /SpacerLineWidth 0.3 def - /SpacerGap 3 def - - /InterLineWidth 0.3 def - /EntryLineWidth 0.8 def - - /EntriesPerPage 10 def - /LinesPerEntry 3 def - /NameFraction 0.65 def - - /InnerMargin 18 def % We aren't going to bind the sheets after all - - % Determine the page height and width. - clippath pathbbox /SheetHeight exch def /SheetWidth exch def pop pop - newpath - % Flip the page sideways - 90 rotate - % Adjust the sheet dimensions for peculiarities of the BubbleJet.... - /SheetHeight SheetHeight 48 sub def - 8 0 translate - /PageHeight SheetWidth def - /PageWidth SheetHeight 2 div def - /BodyHeight PageHeight HeadingHeight sub SpacerGap sub 9 sub def - - % Compute the width and height of the name/address and phone number lines. - /EntryHeight BodyHeight EntriesPerPage div def - /LineHeight EntryHeight LinesPerEntry div def - /BodyWidth PageWidth InnerMargin sub def - /InfoWidth BodyWidth SpacerGap sub def - /NameAddressWidth InfoWidth NameFraction mul def - /PhoneNumberX NameAddressWidth SpacerGap add def - /PhoneNumberWidth InfoWidth NameAddressWidth sub def - - % Print one entry at the current origin. - /PrintEntry - { % Print the area code label - AreaCodeFont - PhoneNumberX 6 add LineHeight -0.4 mul moveto - currentpoint (AREA) show - LineHeight -0.4 mul add moveto (CODE) show - EntryLineWidth setlinewidth - LinesPerEntry -1 1 - { neg LineHeight mul 0 exch moveto - NameAddressWidth 0 rlineto - SpacerGap 0 rmoveto - PhoneNumberWidth 0 rlineto - stroke - InterLineWidth setlinewidth - } for - } def - - % Print the heading. (0,0) is upper left corner of page. - /PrintHeading - { HeadingFont - NameHeading stringwidth pop - NameAddressWidth exch sub 2 div HeadingHeight -0.75 mul moveto - NameHeading show - NumberHeading stringwidth pop - PhoneNumberWidth exch sub 2 div PhoneNumberX add - currentpoint exch pop moveto - NumberHeading show - } def - - % Draw a spacer. Relative X and Y are on the stack. - /PrintSpacer - { SpacerLineWidth setlinewidth - 2 copy rlineto - dup 0 eq - { exch neg exch 0 SpacerGap neg } - { neg SpacerGap 0 } - ifelse rmoveto rlineto stroke - } def - - % Print an entire page. - /PrintPage - { PrintHeading - 0 HeadingHeight neg moveto - BodyWidth 0 PrintSpacer - NameAddressWidth HeadingHeight SpacerGap add neg moveto - 0 BodyHeight neg PrintSpacer - % Print the entries. - gsave - 0 HeadingHeight SpacerGap add neg translate - EntriesPerPage - { PrintEntry - 0 EntryHeight neg translate - } repeat - grestore - } def - - % Print a full sheet. - PrintPage - PageWidth InnerMargin 2 mul add 0 translate - PrintPage - showpage --- 0 ---- diff -rc2N gs25/ppath.ps gs251/ppath.ps *** gs25/ppath.ps Sat Jul 18 07:26:16 1992 --- gs251/ppath.ps Sat Sep 5 19:02:16 1992 *************** *** 19,24 **** 2 copy -tp2 (\n)print flush -dict /-line get exec} ! {5 index 4 index -p2 3 index 2 index -p2 2 copy -p2 ( curveto\t%)print ! 5 index 4 index -tp2 3 index 2 index -tp2 2 copy -tp2 (\n)print flush -dict /-curve get exec} {(closepath\n)print flush -dict /-close get exec} --- 19,24 ---- 2 copy -tp2 (\n)print flush -dict /-line get exec} ! {5 index 5 index -p2 3 index 3 index -p2 2 copy -p2 ( curveto\t%)print ! 5 index 5 index -tp2 3 index 3 index -tp2 2 copy -tp2 (\n)print flush -dict /-curve get exec} {(closepath\n)print flush -dict /-close get exec} diff -rc2N gs25/prfont.ps gs251/prfont.ps *** gs25/prfont.ps Thu Mar 5 03:03:34 1992 --- gs251/prfont.ps Wed Aug 19 12:08:18 1992 *************** *** 3,6 **** --- 3,9 ---- %%Title: Print font catalog % Copyright (c) 1986 Eric Gisin + % Copyright (C) 1992 Aladdin Enterprises, Menlo Park, CA (ghost@aladdin.com) + % Modified to print all 256 encoded characters, + % plus any unencoded characters. % Example usages at bottom of file *************** *** 39,77 **** } def ! % print font sample page ! /DoFont { ! /FName exch def % font name ! /F FName findfont def ! /F24 F 24 scalefont def ! /Line0 96 string def ! /Line1 96 string def ! /Times-Roman findfont 18 scalefont setfont 18 10.5 Inch moveto FName Temp cvs show ( ) show ((24 point)) show ! 0 1 95 { /I exch def ! /Xn I 16 mod def /Yn I 16 idiv def ! ! % chars 20-7F ! gsave ! Xn 36 mul 18 add Yn -48 mul 9.5 Inch add translate ! Line0 I I 16#20 add put ! I 16#20 add DoChar ! grestore ! ! % chars A0-FF gsave ! Xn 36 mul 18 add Yn -48 mul 4.5 Inch add translate ! Line1 I I 16#A0 add put ! I 16#A0 add DoChar grestore } for F 10 scalefont setfont ! 18 5.5 Inch moveto Line0 show ! 18 0.5 Inch moveto Line1 show showpage } def --- 42,91 ---- } def ! % print page title ! /DoTitle { /Times-Roman findfont 18 scalefont setfont 18 10.5 Inch moveto FName Temp cvs show ( ) show ((24 point)) show + } def ! % print one block of characters ! /DoBlock { % firstcode lastcode ! /FirstCode 2 index def ! 1 exch { /I exch def ! /Xn I FirstCode sub 16 mod def /Yn I FirstCode sub 16 idiv def gsave ! Xn 36 mul 9 add Yn -56 mul 9.5 Inch add translate ! I DoChar grestore } for + } def + % print a line of character + /DoLine { % firstcode lastcode + 1 exch { (_) dup 0 3 index put show pop } for + } def + + % print font sample page + /DoFont { + /FName exch def % font name + /F FName findfont def + /F24 F 24 scalefont def + /Line0 96 string def + /Line1 96 string def + + DoTitle (, characters 0-127) show + 0 127 DoBlock F 10 scalefont setfont ! 18 2.0 Inch moveto 0 63 DoLine ! 18 1.5 Inch moveto 64 127 DoLine ! showpage + DoTitle (, character 128-255) show + 128 255 DoBlock + F 10 scalefont setfont + 18 2.0 Inch moveto 128 191 DoLine + 18 1.5 Inch moveto 192 255 DoLine showpage + } def diff -rc2N gs25/psfiles.doc gs251/psfiles.doc *** gs25/psfiles.doc Thu Apr 23 18:31:50 1992 --- gs251/psfiles.doc Mon Sep 7 15:25:32 1992 *************** *** 40,46 **** that really want to be printed on a LaserWriter. ! gs_2asc.ps - gs_init.ps reads this in if the ASCIIOUT option is selected. ! It redefines many operators. For more information, see the comments in ! the file. gs_dps1.ps - gs_init.ps reads this in if the dps feature is included in --- 40,46 ---- that really want to be printed on a LaserWriter. ! gs_2asc.ps - This utility file helps extract the ASCII text from ! PostScript source files. It redefines many operators. For more ! information, see the comments in the file. gs_dps1.ps - gs_init.ps reads this in if the dps feature is included in *************** *** 91,98 **** them rendered in landscape mode. - pfbtogs.ps - a utility for converting PFB fonts to plain text form. - No longer needed (as of release 2.4). See fonts.doc for more - information. - pstoppm.ps - a utility for rendering PostScript files onto PPM (bitmap) files. --- 91,94 ---- *************** *** 101,106 **** .ps file consisting of just PostScript bitmaps, one per page. - showpbm.ps - a utility for displaying PBM/PGM/PPM files. - wrfont.ps - a utility for writing out an unprotected Type 1 font, such as the standard Ghostscript fonts. --- 97,100 ---- *************** *** 115,120 **** pcharstr.ps - a program to print out the CharStrings and Subrs in a Type 1 font. - - phonbook.ps - an address/phone book template. ppath.ps - a couple of utilities for printing out the current path, for --- 109,112 ---- diff -rc2N gs25/pstoppm.ps gs251/pstoppm.ps *** gs25/pstoppm.ps Mon Apr 6 13:46:02 1992 --- gs251/pstoppm.ps Thu Sep 10 12:49:32 1992 *************** *** 1,6 **** %! PS-Adobe-2.0 %% Program for reading a .ps file and writing out a PPM file. ! %% For Ghostscript 2.4. %% %% Modified by L. Peter Deutsch 4/6/92: %% Ghostscript 2.4 requires all 8 primary colors to be in the palette. --- 1,9 ---- %! PS-Adobe-2.0 %% Program for reading a .ps file and writing out a PPM file. ! %% For Ghostscript 2.5.1. %% + %% Modified by L. Peter Deutsch 9/10/92: + %% internal procedures didn't use `bind'; + %% grestoreall undid selection of PPM device. %% Modified by L. Peter Deutsch 4/6/92: %% Ghostscript 2.4 requires all 8 primary colors to be in the palette. *************** *** 86,90 **** { pop } ifelse (ppm) concatstrings ! } def % Redefine copypage and showpage appropriately. --- 89,93 ---- { pop } ifelse (ppm) concatstrings ! } bind def % Redefine copypage and showpage appropriately. *************** *** 122,130 **** end ! } userdict begin def end /showpage { copypage erasepage initgraphics ! } userdict begin def end /Convert % the main procedure % Convert - --- 125,139 ---- end ! } bind userdict begin odef end /showpage { copypage erasepage initgraphics ! } bind userdict begin odef end + % Redefine grestoreall so it doesn't undo the device selection + /grestoreall /grestoreall load def + /grestoreall + { ppmdict begin grestoreall Device setdevice end + } bind userdict begin odef end + /Convert % the main procedure % Convert - *************** *** 160,164 **** end % ppmdict ! } def end % ppmdict --- 169,173 ---- end % ppmdict ! } bind def end % ppmdict *************** *** 171,175 **** /Horz_dpi exch def end ! } def /ppmsetprefix --- 180,184 ---- /Horz_dpi exch def end ! } bind def /ppmsetprefix *************** *** 177,181 **** /OutFilePrefix exch def end ! } def /ppmsetfirstpagenumber --- 186,190 ---- /OutFilePrefix exch def end ! } bind def /ppmsetfirstpagenumber *************** *** 183,199 **** ppmdict begin /FirstPageNumber exch def ! } def /ppm1run { ppmdict begin Palette1 Convert ! } def /ppm8run { ppmdict begin Palette8 Convert ! } def /ppm24run { ppmdict begin null Convert ! } def %%%%%% Display instructions for the user. --- 192,208 ---- ppmdict begin /FirstPageNumber exch def ! } bind def /ppm1run { ppmdict begin Palette1 Convert ! } bind def /ppm8run { ppmdict begin Palette8 Convert ! } bind def /ppm24run { ppmdict begin null Convert ! } bind def %%%%%% Display instructions for the user. diff -rc2N gs25/readme.doc gs251/readme.doc *** gs25/readme.doc Sat Aug 1 03:00:58 1992 --- gs251/readme.doc Tue Sep 1 14:30:54 1992 *************** *** 21,25 **** This file, readme.doc, describes problems and new features in the ! current release of Ghostscript. This file describes version 2.5 of Ghostscript. --- 21,25 ---- This file, readme.doc, describes problems and new features in the ! current release of Ghostscript. This file describes version 2.5.1 of Ghostscript. *************** *** 33,65 **** section of NEWS for full details. ! Rotated halftone screens work now. ! Fontmap can include font aliases, so that one font can be used in ! place of another. ! ! Ghostscript now properly interprets the "hints" in Type 1 outline ! fonts. Because of this, the Courier, Charter, and Utopia fonts ! supplied with Ghostscript, and most commercial Type 1 fonts, produce ! better output at small sizes. ! ! On MS-DOS platforms, the TEMP environment variable can be used to ! designate the directory for Ghostscript's temporary files. ! ! Ghostscript's halftoning algorithms have changed. Both color and ! gray-scale may look slightly different than in previous versions. ! ! The Distillery works with Ghostscript now. ! ! The default search path for Ghostscript on Unix systems has been ! changed. See the definition of GS_LIB_DEFAULT in your makefile. ! ! You can make A4 paper the default for the DeskJet and LaserJet ! printers (currently, only for black-and-white printers). See ! devs.mak. ! ! Ghostscript now can be built to run under Microsoft Windows. ! ! You can use @filename to get around DOS' 128-character limit on the ! length of a command line. See use.doc. Known problems --- 33,41 ---- section of NEWS for full details. ! A serious performance bug in curve drawing (introduced in release ! 2.5) has been fixed. ! The standard MS-DOS executables now include a driver for the H-P ! DeskJet 500C. Known problems diff -rc2N gs25/scfe.c gs251/scfe.c *** gs25/scfe.c Mon Aug 10 14:35:08 1992 --- gs251/scfe.c Thu Aug 20 03:10:32 1992 *************** *** 281,285 **** s_CFE_close(register stream *s) { int code = s_CFE_write_buf(s); ! if ( code < 0 ) return code; if ( s->cfs.EndOfBlock ) { int i = (s->cfs.K < 0 ? 2 : 6); --- 281,285 ---- s_CFE_close(register stream *s) { int code = s_CFE_write_buf(s); ! if ( code == ERRC ) return code; if ( s->cfs.EndOfBlock ) { int i = (s->cfs.K < 0 ? 2 : 6); diff -rc2N gs25/sfilter.c gs251/sfilter.c *** gs25/sfilter.c Sat Aug 15 20:00:25 1992 --- gs251/sfilter.c Thu Sep 10 04:55:40 1992 *************** *** 45,49 **** { if ( s_is_writing(s) ) { int code = sflush(s); ! if ( code < 0 ) return code; } return s_std_close(s); --- 45,49 ---- { if ( s_is_writing(s) ) { int code = sflush(s); ! if ( code == ERRC ) return code; } return s_std_close(s); diff -rc2N gs25/showpbm gs251/showpbm *** gs25/showpbm Wed Apr 15 18:13:58 1992 --- gs251/showpbm *************** *** 1 **** - gs -q -dNODISPLAY -- showpbm.ps $* --- 0 ---- diff -rc2N gs25/showpbm.bat gs251/showpbm.bat *** gs25/showpbm.bat Sat Apr 11 04:00:50 1992 --- gs251/showpbm.bat *************** *** 1 **** - @gs -q -- showpbm.ps %1 %2 %3 %4 %5 %6 %7 %8 %9 >t --- 0 ---- diff -rc2N gs25/showpbm.ps gs251/showpbm.ps *** gs25/showpbm.ps Fri Aug 14 03:50:10 1992 --- gs251/showpbm.ps *************** *** 1,80 **** - % Copyright (C) 1992 Aladdin Enterprises. All rights reserved. - % Distributed by Free Software Foundation, Inc. - % - % This file is part of Ghostscript. - % - % Ghostscript is distributed in the hope that it will be useful, but - % WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - % to anyone for the consequences of using it or for whether it serves any - % particular purpose or works at all, unless he says so in writing. Refer - % to the Ghostscript General Public License for full details. - % - % Everyone is granted permission to copy, modify and redistribute - % Ghostscript, but only under the conditions described in the Ghostscript - % General Public License. A copy of this license is supposed to have been - % given to you along with Ghostscript so you can know your rights and - % responsibilities. It should be in a file named COPYING. Among other - % things, the copyright notice and this notice must be preserved on all - % copies. - - % showpbm.ps - % Display a PBM/PGM/PPM file. Currently only handles "raw" formats (P4-P6). - - /s 100 string def - /readmaxv - { f s readline pop cvx exec /maxv exch def - } def - /pdict 6 dict def - pdict begin - /P1 [ { /rsize w 7 add 8 idiv def } - { } - ] def - /P2 [ { readmaxv /rsize w def } - { } - ] def - /P3 [ { readmaxv /rsize w 3 mul def } - { } - ] def - /P4 [ { /rsize w 7 add 8 idiv def } - { true exch { f row readstring pop } imagemask } - ] def - /P5 [ { readmaxv /rsize w def } - { 8 exch { f row readstring pop } image } - ] def - /P6 [ { readmaxv /rsize w 3 mul def } - { 8 exch { f row readstring pop } false 3 colorimage } - ] def - end - /showpbm % filename -> - { (r) file /f exch def - f s readline pop cvn /pn exch def % Pn - f s readline pop % check for comment - (#) anchorsearch - { pop pop f s readline pop } - if - cvx exec /h exch def /w exch def - pdict pn get dup /rprocs exch def - 0 get exec - /row rsize string def - % Scale the image (uniformly) to fit the page. - clippath pathbbox - dtransform exch abs exch abs min dup scale pop pop - erasepage - 0 setgray - w h [w 0 0 h neg 0 h] rprocs 1 get exec - showpage - } def - - % If the program was invoked from the command line, run it now. - [ shellarguments - { counttomark 1 eq - { showpbm - } - { cleartomark - (Usage: showpbm filename.p*m\n) print - ( e.g.: showpbm my.ppm\n) print flush - mark - } - ifelse - } - if pop --- 0 ---- diff -rc2N gs25/tbcplus.mak gs251/tbcplus.mak *** gs25/tbcplus.mak Sat Aug 15 10:58:22 1992 --- gs251/tbcplus.mak Thu Sep 10 17:44:24 1992 *************** *** 198,205 **** !endif ! CCFLAGS=$(GENOPT) $(PLATOPT) $(FPFLAGS) -m$(MM) ! CC=$(COMPDIR)\$(COMP) @ccf.tr CCC=$(CC) $(CYO) $(CO) -c CCD=$(CC) $(CYO) -O -c CC0=$(CC) $(CYO) -c CCINT=$(CC) $(CYO) -c --- 198,207 ---- !endif ! CCFLAGS0=$(GENOPT) $(PLATOPT) $(FPFLAGS) ! CCFLAGS=$(CCFLAGS0) -m$(MM) ! CC=$(COMPDIR)\$(COMP) -m$(MM) @ccf.tr CCC=$(CC) $(CYO) $(CO) -c CCD=$(CC) $(CYO) -O -c + CCCF=$(COMPDIR)\$(COMP) -mh @ccf.tr $(CYO) -O -c CC0=$(CC) $(CYO) -c CCINT=$(CC) $(CYO) -c *************** *** 222,226 **** DEVICE_DEVS=vga.dev ega.dev epson.dev bj10e.dev DEVICE_DEVS2=deskjet.dev djet500.dev laserjet.dev ljetplus.dev ljet2p.dev ljet3.dev ! DEVICE_DEVS3=gifmono.dev gif8.dev !include "gs.mak" !include "devs.mak" --- 224,229 ---- DEVICE_DEVS=vga.dev ega.dev epson.dev bj10e.dev DEVICE_DEVS2=deskjet.dev djet500.dev laserjet.dev ljetplus.dev ljet2p.dev ljet3.dev ! DEVICE_DEVS3=cdeskjet.dev cdjcolor.dev cdjmono.dev paintjet.dev pjetxl.dev ! DEVICE_DEVS5=gifmono.dev gif8.dev !include "gs.mak" !include "devs.mak" *************** *** 230,238 **** ccf.tr: $(MAKEFILE) makefile !if $(CPU_TYPE) < 286 ! echo -a -d -r -G -X -I$(INCDIR) $(CCFLAGS) >ccf.tr !else ! echo -2 -a -d -r -G -X -I$(INCDIR) $(CCFLAGS) >ccf.tr ! if $(CPU_TYPE) > 286 ! echo -3 -a -d -r -G -X -I$(INCDIR) $(CCFLAGS) >_temp_ if $(EXIST_BC3_1) copy _temp_ ccf.tr ! endif --- 233,241 ---- ccf.tr: $(MAKEFILE) makefile !if $(CPU_TYPE) < 286 ! echo -a -d -r -G -X -I$(INCDIR) $(CCFLAGS0) >ccf.tr !else ! echo -2 -a -d -r -G -X -I$(INCDIR) $(CCFLAGS0) >ccf.tr ! if $(CPU_TYPE) > 286 ! echo -3 -a -d -r -G -X -I$(INCDIR) $(CCFLAGS0) >_temp_ if $(EXIST_BC3_1) copy _temp_ ccf.tr ! endif *************** *** 260,263 **** --- 263,267 ---- BEGINFILES=ccf.tr + CCBEGIN=$(CCC) *.c iutilasm.$(OBJ): iutilasm.asm diff -rc2N gs25/tccommon.mak gs251/tccommon.mak *** gs25/tccommon.mak Sun Aug 2 12:16:06 1992 --- gs251/tccommon.mak Mon Sep 7 13:40:58 1992 *************** *** 103,107 **** # -------------------------- Auxiliary programs --------------------------- # ! CCAUX=$(COMPDIR)\$(COMP) -I$(INCDIR) -L$(LIBDIR) -O echogs$(XE): echogs.c --- 103,107 ---- # -------------------------- Auxiliary programs --------------------------- # ! CCAUX=$(COMPDIR)\$(COMP) -m$(MM) -I$(INCDIR) -L$(LIBDIR) -O echogs$(XE): echogs.c diff -rc2N gs25/time_.h gs251/time_.h *** gs25/time_.h Tue Mar 24 02:16:20 1992 --- gs251/time_.h Sat Sep 5 17:07:20 1992 *************** *** 21,25 **** /* Generic substitute for Unix sys/time.h */ ! #include #if defined(_IBMR2) || defined(SYSV) || defined(SVR4) /* IBM RS/6000, AIX 3.n, System V.4 */ # include --- 21,38 ---- /* Generic substitute for Unix sys/time.h */ ! /* Some System V environments don't include sys/time.h. */ ! /* We detect this in the makefile rules for gp_sysv.c and gp_unix.c, */ ! /* and compile with the NOSYSTIME macro defined. What a kludge! */ ! #ifdef NOSYSTIME ! struct timeval { ! long tv_sec, tv_usec; ! }; ! struct timezone { ! int tz_minuteswest, tz_dsttime; ! }; ! #else ! # include ! #endif ! #if defined(_IBMR2) || defined(SYSV) || defined(SVR4) /* IBM RS/6000, AIX 3.n, System V.4 */ # include diff -rc2N gs25/turboc.mak gs251/turboc.mak *** gs25/turboc.mak Sun Aug 2 12:15:10 1992 --- gs251/turboc.mak Mon Sep 7 13:40:36 1992 *************** *** 138,145 **** GENOPT=$(CP) $(CS) $(CD) ! CCFLAGS=$(GENOPT) $(PLATOPT) $(FPFLAGS) -m$(MM) CC=$(COMPDIR)\$(COMP) -d -r -y -G -I$(INCDIR) CCC=$(CC) -a $(CCFLAGS) -O -c CCD=$(CCC) CC0=$(COMPDIR)\$(COMP) -m$(MM) -I$(INCDIR) -c CCINT=$(CC) -a $(CCFLAGS) -c --- 138,147 ---- GENOPT=$(CP) $(CS) $(CD) ! CCFLAGS0=$(GENOPT) $(PLATOPT) $(FPFLAGS) ! CCFLAGS=$(CCFLAGS0) -m$(MM) CC=$(COMPDIR)\$(COMP) -d -r -y -G -I$(INCDIR) CCC=$(CC) -a $(CCFLAGS) -O -c CCD=$(CCC) + CCCF=$(CC) -a $(CCFLAGS0) -mh -O -c CC0=$(COMPDIR)\$(COMP) -m$(MM) -I$(INCDIR) -c CCINT=$(CC) -a $(CCFLAGS) -c *************** *** 187,190 **** --- 189,193 ---- BEGINFILES= + CCBEGIN=$(CCC) *.c iutilasm.$(OBJ): iutilasm.asm diff -rc2N gs25/type1ops.ps gs251/type1ops.ps *** gs25/type1ops.ps Wed Jun 10 16:54:12 1992 --- gs251/type1ops.ps Thu Aug 20 03:19:02 1992 *************** *** 72,121 **** % ------ CharString encoding ------ % ! % For these utilities, a CharString is represented by an array. ! % Elements of the array are either integers or names. % Integers represent themselves; names are CharString operator names. % Compute the length of a CharString. ! /charstring_length % cs_array -> length ! { 0 exch ! { dup type /nametype eq ! { Type1encode exch get length } ! { dup dup -107 ge exch 107 le and ! { pop 1 } ! { dup -1131 ge exch 1131 le and { 2 } { 5 } ifelse } ifelse } ! ifelse add ! } forall } bind def ! % Write a CharString to a file. Normally this will be a NullEncode filter ! % writing on a string of the correct length. ! /charstring_write % file cs_array -> ! { { dup type /nametype eq ! { Type1encode exch get 1 index exch writestring ! } ! { dup dup -107 ge exch 107 le and ! { 139 add ! } ! { dup dup -1131 lt exch 1131 gt or ! { 1 index 255 write ! 2 copy -24 bitshift 255 and write ! 2 copy -16 bitshift 255 and write ! 2 copy -8 bitshift 255 and write ! 255 and ! } ! { dup 0 ge { 16#f694 } { neg 16#fa94 } ifelse add ! 2 copy -8 bitshift write 255 and ! } ! ifelse ! } ! ifelse 1 index exch write ! } ! ifelse ! } forall pop } bind def --- 72,147 ---- % ------ CharString encoding ------ % ! % For these utilities, a CharString is represented by a sequence of ! % integers or names, either in an array or on the stack. % Integers represent themselves; names are CharString operator names. + % A CharString in an array is called a "charproc"; a CharString on + % the stack is called a "charstack", and is delimited by a mark. + % Individual elements are called "chartokens". % Compute the length of a CharString. ! /chartoken_length % chartoken -> length ! { dup type /nametype eq ! { Type1encode exch get length ! } ! { dup dup -107 ge exch 107 le and ! { pop 1 } ! { dup -1131 ge exch 1131 le and { 2 } { 5 } ifelse ! } ! ifelse ! } ! ifelse ! } bind def ! /charproc_length % charproc -> length ! { 0 exch { chartoken_length add } forall ! } bind def ! /charstack_length % charstack -> charstack length ! { counttomark 0 exch -1 1 { index chartoken_length add } for ! } bind def ! ! % Write a CharString to a file. Normally this will be a NullEncode filter ! % writing on a string of the correct length. ! /chartoken_write % file chartoken -> ! { dup type /nametype eq ! { Type1encode exch get writestring ! } ! { dup dup -107 ge exch 107 le and ! { 139 add ! } ! { dup dup -1131 lt exch 1131 gt or ! { 1 index 255 write ! 2 copy -24 bitshift 255 and write ! 2 copy -16 bitshift 255 and write ! 2 copy -8 bitshift 255 and write ! 255 and } ! { dup 0 ge { 16#f694 } { neg 16#fa94 } ifelse add ! 2 copy -8 bitshift write 255 and } ifelse } ! ifelse write ! } ! ifelse ! } bind def ! /charproc_write % file charproc -> ! { { 1 index exch chartoken_write } forall pop ! } bind def ! /charstack_write % charstack file -> ! { counttomark 1 sub -1 1 { index 1 index exch chartoken_write } for ! cleartomark } bind def ! % Convert a charproc or charstack to a proper encrypted CharString. ! /charproc_string % charproc -> string ! { mark exch aload pop charstack_string ! } bind def ! /charstack_string % charstack -> string ! { charstack_length lenIV add string ! dup dup length lenIV sub lenIV exch getinterval % skip lenIV ! /NullEncode filter ! exch 1 index counttomark 1 add 2 roll ! charstack_write closefile ! % 4330 exch dup type1encrypt exch pop readonly } bind def *************** *** 158,163 **** def ! % Decode a CharString (unencrypted) and push its elements on the stack. ! /charstring_read % file -> {integer|name}* { { dup read not { pop exit } if Type1decode exch get --- 184,189 ---- def ! % Decode a CharString (unencrypted). ! /charstack_read % file -> (NO MARK) charstack { { dup read not { pop exit } if Type1decode exch get diff -rc2N gs25/unix-ansi.mak gs251/unix-ansi.mak *** gs25/unix-ansi.mak Wed Aug 19 01:02:14 1992 --- gs251/unix-ansi.mak Fri Sep 11 17:50:43 1992 *************** *** 188,191 **** --- 188,192 ---- CC0=$(CCC) + CCCF=$(CCC) CCD=$(CCC) CCINT=$(CCC) *************** *** 223,230 **** # FEATURE_DEVS - the optional features to include in the # executable. Current features are: ! # dps - support for Display PostScript extensions. ! # *** PARTIALLY IMPLEMENTED, SEE language.doc. *** ! # level2 - support for PostScript Level 2 extensions. ! # *** PARTIALLY IMPLEMENTED, SEE language.doc. *** # compfont - support for composite (type 0) fonts. # *** NOT IMPLEMENTED YET. *** --- 224,231 ---- # FEATURE_DEVS - the optional features to include in the # executable. Current features are: ! # dps - (partial) support for Display PostScript extensions: ! # see language.doc for details. ! # level2 - (partial) support for PostScript Level 2 ! # extensions: see language.doc for details. # compfont - support for composite (type 0) fonts. # *** NOT IMPLEMENTED YET. *** *************** *** 245,248 **** --- 246,252 ---- # XE - the extension for executable files (e.g., null or .exe). # OBJ - the extension for relocatable object files (e.g., o or obj). + # BEGINFILES - the list of files that `make begin' should delete. + # CCBEGIN - the compilation command for `make begin', normally + # $(CCC) *.c. # CCC - the C invocation for normal compilation. # CCD - the C invocation for files that store into frame buffers or *************** *** 251,254 **** --- 255,260 ---- # CC0 - a C invocation with the fewest possible flags. Needed because # MS-DOS limits the length of command lines to 128 characters. + # CCCF - the C invocation for compiled fonts. Needed because MS-DOS + # requires using the 'huge' memory model for these. # CCINT - the C invocation for compiling the main interpreter module, # normally the same as CCC: this is needed because the *************** *** 280,284 **** mostlyclean realclean distclean clean: rm -f *.$(OBJ) *.a core gmon.out ! rm -f *.dev *.d_* arch.h gconfig.h obj*.tr lib*.tr rm -f t _temp_* _temp_*.* *.map *.sym rm -f ansi2knr$(XE) echogs$(XE) genarch$(XE) uniq$(XE) --- 286,290 ---- mostlyclean realclean distclean clean: rm -f *.$(OBJ) *.a core gmon.out ! rm -f *.dev *.d_* arch.h gconfig*.h obj*.tr lib*.tr rm -f t _temp_* _temp_*.* *.map *.sym rm -f ansi2knr$(XE) echogs$(XE) genarch$(XE) uniq$(XE) *************** *** 291,295 **** rm -f arch.h genarch$(XE) $(BEGINFILES) make arch.h ! - $(CCC) *.c rm -f gconfig.$(OBJ) gdev*.$(OBJ) gp_*.$(OBJ) gsmisc.$(OBJ) rm -f iccfont.$(OBJ) iinit.$(OBJ) interp.$(OBJ) --- 297,301 ---- rm -f arch.h genarch$(XE) $(BEGINFILES) make arch.h ! - $(CCBEGIN) rm -f gconfig.$(OBJ) gdev*.$(OBJ) gp_*.$(OBJ) gsmisc.$(OBJ) rm -f iccfont.$(OBJ) iinit.$(OBJ) interp.$(OBJ) *************** *** 359,362 **** --- 365,369 ---- gsstate_h=gsstate.h $(gscolor_h) gstype1_h=gstype1.h + gsuid_h=gsuid.h gsutil_h=gsutil.h *************** *** 388,392 **** ### Executable code ! gsutil.$(OBJ): gsutil.c \ $(std_h) $(gsprops_h) $(gsutil_h) --- 395,399 ---- ### Executable code ! gsutil.$(OBJ): gsutil.c $(AK) \ $(std_h) $(gsprops_h) $(gsutil_h) *************** *** 503,513 **** gdevmem1.$(OBJ): gdevmem1.c $(AK) \ ! $(gs_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem2.$(OBJ): gdevmem2.c $(AK) \ ! $(gs_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem3.$(OBJ): gdevmem3.c $(AK) \ ! $(gs_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) ###### Files dependent on the installed devices, features, and platform. --- 510,520 ---- gdevmem1.$(OBJ): gdevmem1.c $(AK) \ ! $(gx_h) $(gserrors_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem2.$(OBJ): gdevmem2.c $(AK) \ ! $(gx_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem3.$(OBJ): gdevmem3.c $(AK) \ ! $(gx_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) ###### Files dependent on the installed devices, features, and platform. *************** *** 514,518 **** # Generating gconfig.h also generates obj*.tr and lib.tr. ! gconfig.h obj.tr objw.tr lib.tr: devs.mak $(MAKEFILE) echogs$(XE) $(UNIQ) \ $(DEVICE_DEVS) $(DEVICE_DEVS2) $(DEVICE_DEVS3) $(DEVICE_DEVS4) $(DEVICE_DEVS5)\ $(FEATURE_DEVS) $(PLATFORM).dev --- 521,526 ---- # Generating gconfig.h also generates obj*.tr and lib.tr. ! gconfig.h obj.tr objw.tr lib.tr: \ ! devs.mak $(MAKEFILE) echogs$(XE) $(UNIQ) \ $(DEVICE_DEVS) $(DEVICE_DEVS2) $(DEVICE_DEVS3) $(DEVICE_DEVS4) $(DEVICE_DEVS5)\ $(FEATURE_DEVS) $(PLATFORM).dev *************** *** 588,592 **** ialloc.$(OBJ): ialloc.c $(AK) $(gs_h) $(gdebug_h) $(alloc_h) $(astate_h) ! iccfont.$(OBJ): iccfont.c $(GH) gconfig.h \ $(ghost_h) $(alloc_h) $(ccfont_h) $(dict_h) $(dstack_h) $(errors_h) $(iutil_h) $(name_h) $(oper_h) $(save_h) $(store_h) --- 596,600 ---- ialloc.$(OBJ): ialloc.c $(AK) $(gs_h) $(gdebug_h) $(alloc_h) $(astate_h) ! iccfont.$(OBJ): iccfont.c $(GH) gconfigf.h \ $(ghost_h) $(alloc_h) $(ccfont_h) $(dict_h) $(dstack_h) $(errors_h) $(iutil_h) $(name_h) $(oper_h) $(save_h) $(store_h) *************** *** 654,659 **** zprops.$(OBJ): zprops.c $(OP) \ ! $(alloc_h) $(dict_h) $(name_h) $(store_h) \ ! $(gsprops_h) $(gsmatrix_h) $(gxdevice_h) zrelbit.$(OBJ): zrelbit.c $(OP) $(store_h) $(dict_h) --- 662,667 ---- zprops.$(OBJ): zprops.c $(OP) \ ! $(alloc_h) $(dict_h) $(name_h) $(state_h) $(store_h) \ ! $(gsprops_h) $(gsmatrix_h) $(gxdevice_h) $(gsstate_h) zrelbit.$(OBJ): zrelbit.c $(OP) $(store_h) $(dict_h) *************** *** 832,846 **** $(SHP)gssetmod ccfonts $(ccfonts_) iccfont.$(OBJ) $(SHP)gsaddmod ccfonts -oper ccfonts - $(SHP)gsaddmod ccfonts -font Ugly ugly.$(OBJ): ugly.c $(CCFONT) ncrr.$(OBJ): ncrr.c $(CCFONT) psyr.$(OBJ): psyr.c $(CCFONT) ptmr.$(OBJ): ptmr.c $(CCFONT) pzdr.$(OBJ): pzdr.c $(CCFONT) # ----------------------------- Main program ------------------------------ # --- 840,864 ---- $(SHP)gssetmod ccfonts $(ccfonts_) iccfont.$(OBJ) $(SHP)gsaddmod ccfonts -oper ccfonts + gconfigf.h: $(MAKEFILE) + $(SHP)gssetmod ccfonts_ + $(SHP)gsaddmod ccfonts_ -font Ugly + rm -f gconfigf.h + mv ccfonts_.d_f gconfigf.h + ugly.$(OBJ): ugly.c $(CCFONT) + $(CCCF) ugly.c ncrr.$(OBJ): ncrr.c $(CCFONT) + $(CCCF) ncrr.c psyr.$(OBJ): psyr.c $(CCFONT) + $(CCCF) psyr.c ptmr.$(OBJ): ptmr.c $(CCFONT) + $(CCCF) ptmr.c pzdr.$(OBJ): pzdr.c $(CCFONT) + $(CCCF) pzdr.c # ----------------------------- Main program ------------------------------ # *************** *** 905,908 **** --- 923,927 ---- # * pe Private Eye # Unix and VMS: + # * att3b1 AT&T 3b1/Unixpc monochrome display [3b1 only] # * sonyfb Sony Microsystems monochrome display [Sony only] # * sunview SunView window system [SunOS only] *************** *** 931,935 **** # + ljet2p H-P LaserJet IId/IIp/III* with TIFF compression # + ljet3 H-P LaserJet III* with Delta Row compression ! # * ljetplus H-P LaserJet Plus # * nwp533 Sony Microsystems NWP533 laser printer [Sony only] # paintjet H-P PaintJet color printer --- 950,955 ---- # + ljet2p H-P LaserJet IId/IIp/III* with TIFF compression # + ljet3 H-P LaserJet III* with Delta Row compression ! # + ljetplus H-P LaserJet Plus ! # * necp6 NEC P6/P6+/P60 printers at 360 x 360 DPI resolution # * nwp533 Sony Microsystems NWP533 laser printer [Sony only] # paintjet H-P PaintJet color printer *************** *** 1107,1110 **** --- 1127,1138 ---- gdevmswn.$(OBJ): gdevmswn.c $(GDEV) $(gp_h) $(gpcheck_h) + ###### ----------- The AT&T 3b1 Unixpc monochrome display ------------ ###### + + att3b1_=gdev3b1.$(OBJ) + att3b1.dev: $(att3b1_) + $(SHP)gssetdev att3b1 $(att3b1_) + + gdev3b1.$(OBJ): gdev3b1.c + ###### --------------- Memory-buffered printer devices --------------- ###### *************** *** 1278,1281 **** --- 1306,1317 ---- gdevln03.$(OBJ): gdevln03.c $(PDEVH) + ### --------------------- The NEC P6 family devices -------------------- ### + + necp6_=gdevnp6.$(OBJ) gdevprn.$(OBJ) + necp6.dev: $(necp6_) + $(SHP)gssetdev necp6 $(necp6_) + + gdevnp6.$(OBJ): gdevnp6.c $(PDEVH) + ### ------------- The Ricoh 4081 laser printer device ------------------ ### ### Note: this driver was contributed by users: ### *************** *** 1353,1357 **** # See the main makefile for the definition of XINCLUDE. GDEVX=$(GDEV) x_.h gdevx.h $(MAKEFILE) ! gdevx.$(OBJ): gdevx.c $(GDEVX) $(CCC) $(XINCLUDE) gdevx.c --- 1389,1393 ---- # See the main makefile for the definition of XINCLUDE. GDEVX=$(GDEV) x_.h gdevx.h $(MAKEFILE) ! gdevx.$(OBJ): gdevx.c $(GDEVX) $(gserrors_h) $(gsprops_h) $(gsutil_h) $(CCC) $(XINCLUDE) gdevx.c *************** *** 1369,1373 **** ###### ----------------------- PC file formats ---------------------- ###### ! gdevpccm.$(OBJ): gdevpccm.c $(gs_h) $(gsmatrix_h) $(gxdevice_h) $(gdevpccm_h) ### ------------------------- GIF file formats ------------------------- ### --- 1405,1410 ---- ###### ----------------------- PC file formats ---------------------- ###### ! gdevpccm.$(OBJ): gdevpccm.c $(AK) \ ! $(gs_h) $(gsmatrix_h) $(gxdevice_h) $(gdevpccm_h) ### ------------------------- GIF file formats ------------------------- ### *************** *** 1463,1466 **** --- 1500,1506 ---- ## The Unix platforms + # We have to include a test for the existence of sys/time.h, + # because some System V platforms don't have it. + # All reasonable Unix platforms. unix__=gp_unix.$(OBJ) *************** *** 1468,1473 **** $(SHP)gssetmod unix_ $(unix__) ! gp_unix.$(OBJ): gp_unix.c $(memory__h) $(string__h) $(gx_h) $(gp_h) \ $(stat__h) $(time__h) # Brain-damaged System V platforms. --- 1508,1515 ---- $(SHP)gssetmod unix_ $(unix__) ! gp_unix.$(OBJ): gp_unix.c $(AK) $(memory__h) $(string__h) $(gx_h) $(gp_h) \ $(stat__h) $(time__h) + if ( test -f /usr/include/sys/time.h ) then $(CCC) gp_unix.c;\ + else $(CCC) -DNOSYSTIME gp_unix.c; fi # Brain-damaged System V platforms. *************** *** 1476,1480 **** $(SHP)gssetmod sysv_ $(sysv__) ! gp_sysv.$(OBJ): gp_sysv.c # -------------------------- Auxiliary programs --------------------------- # --- 1518,1524 ---- $(SHP)gssetmod sysv_ $(sysv__) ! gp_sysv.$(OBJ): gp_sysv.c $(time__h) $(AK) ! if ( test -f /usr/include/sys/time.h ) then $(CCC) gp_sysv.c;\ ! else $(CCC) -DNOSYSTIME gp_sysv.c; fi # -------------------------- Auxiliary programs --------------------------- # *************** *** 1493,1496 **** --- 1537,1543 ---- # ----------------------------- Main program ------------------------------ # + BEGINFILES= + CCBEGIN=$(CCC) *.c + # Main program *************** *** 1526,1531 **** $(INSTALL_PROGRAM) bdftops $(bindir) $(INSTALL_PROGRAM) font2c $(bindir) - $(INSTALL_PROGRAM) pfbtogs $(bindir) - $(INSTALL_PROGRAM) showpbm $(bindir) -mkdir $(gsdatadir) $(INSTALL_DATA) README $(gsdatadir) --- 1573,1576 ---- *************** *** 1545,1552 **** $(INSTALL_DATA) impath.ps $(gsdatadir) $(INSTALL_DATA) landscap.ps $(gsdatadir) - $(INSTALL_DATA) pfbtogs.ps $(gsdatadir) $(INSTALL_DATA) prfont.ps $(gsdatadir) $(INSTALL_DATA) pstoppm.ps $(gsdatadir) - $(INSTALL_DATA) showpbm.ps $(gsdatadir) $(INSTALL_DATA) type1ops.ps $(gsdatadir) $(INSTALL_DATA) wrfont.ps $(gsdatadir) --- 1590,1595 ---- diff -rc2N gs25/unix-cc.mak gs251/unix-cc.mak *** gs25/unix-cc.mak Wed Aug 19 01:02:15 1992 --- gs251/unix-cc.mak Fri Sep 11 17:50:44 1992 *************** *** 184,187 **** --- 184,188 ---- CC0=$(CCC) + CCCF=$(CCC) CCD=$(CCC) CCINT=$(CCC) *************** *** 219,226 **** # FEATURE_DEVS - the optional features to include in the # executable. Current features are: ! # dps - support for Display PostScript extensions. ! # *** PARTIALLY IMPLEMENTED, SEE language.doc. *** ! # level2 - support for PostScript Level 2 extensions. ! # *** PARTIALLY IMPLEMENTED, SEE language.doc. *** # compfont - support for composite (type 0) fonts. # *** NOT IMPLEMENTED YET. *** --- 220,227 ---- # FEATURE_DEVS - the optional features to include in the # executable. Current features are: ! # dps - (partial) support for Display PostScript extensions: ! # see language.doc for details. ! # level2 - (partial) support for PostScript Level 2 ! # extensions: see language.doc for details. # compfont - support for composite (type 0) fonts. # *** NOT IMPLEMENTED YET. *** *************** *** 241,244 **** --- 242,248 ---- # XE - the extension for executable files (e.g., null or .exe). # OBJ - the extension for relocatable object files (e.g., o or obj). + # BEGINFILES - the list of files that `make begin' should delete. + # CCBEGIN - the compilation command for `make begin', normally + # $(CCC) *.c. # CCC - the C invocation for normal compilation. # CCD - the C invocation for files that store into frame buffers or *************** *** 247,250 **** --- 251,256 ---- # CC0 - a C invocation with the fewest possible flags. Needed because # MS-DOS limits the length of command lines to 128 characters. + # CCCF - the C invocation for compiled fonts. Needed because MS-DOS + # requires using the 'huge' memory model for these. # CCINT - the C invocation for compiling the main interpreter module, # normally the same as CCC: this is needed because the *************** *** 276,280 **** mostlyclean realclean distclean clean: rm -f *.$(OBJ) *.a core gmon.out ! rm -f *.dev *.d_* arch.h gconfig.h obj*.tr lib*.tr rm -f t _temp_* _temp_*.* *.map *.sym rm -f ansi2knr$(XE) echogs$(XE) genarch$(XE) uniq$(XE) --- 282,286 ---- mostlyclean realclean distclean clean: rm -f *.$(OBJ) *.a core gmon.out ! rm -f *.dev *.d_* arch.h gconfig*.h obj*.tr lib*.tr rm -f t _temp_* _temp_*.* *.map *.sym rm -f ansi2knr$(XE) echogs$(XE) genarch$(XE) uniq$(XE) *************** *** 287,291 **** rm -f arch.h genarch$(XE) $(BEGINFILES) make arch.h ! - $(CCC) *.c rm -f gconfig.$(OBJ) gdev*.$(OBJ) gp_*.$(OBJ) gsmisc.$(OBJ) rm -f iccfont.$(OBJ) iinit.$(OBJ) interp.$(OBJ) --- 293,297 ---- rm -f arch.h genarch$(XE) $(BEGINFILES) make arch.h ! - $(CCBEGIN) rm -f gconfig.$(OBJ) gdev*.$(OBJ) gp_*.$(OBJ) gsmisc.$(OBJ) rm -f iccfont.$(OBJ) iinit.$(OBJ) interp.$(OBJ) *************** *** 355,358 **** --- 361,365 ---- gsstate_h=gsstate.h $(gscolor_h) gstype1_h=gstype1.h + gsuid_h=gsuid.h gsutil_h=gsutil.h *************** *** 384,388 **** ### Executable code ! gsutil.$(OBJ): gsutil.c \ $(std_h) $(gsprops_h) $(gsutil_h) --- 391,395 ---- ### Executable code ! gsutil.$(OBJ): gsutil.c $(AK) \ $(std_h) $(gsprops_h) $(gsutil_h) *************** *** 499,509 **** gdevmem1.$(OBJ): gdevmem1.c $(AK) \ ! $(gs_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem2.$(OBJ): gdevmem2.c $(AK) \ ! $(gs_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem3.$(OBJ): gdevmem3.c $(AK) \ ! $(gs_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) ###### Files dependent on the installed devices, features, and platform. --- 506,516 ---- gdevmem1.$(OBJ): gdevmem1.c $(AK) \ ! $(gx_h) $(gserrors_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem2.$(OBJ): gdevmem2.c $(AK) \ ! $(gx_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem3.$(OBJ): gdevmem3.c $(AK) \ ! $(gx_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) ###### Files dependent on the installed devices, features, and platform. *************** *** 510,514 **** # Generating gconfig.h also generates obj*.tr and lib.tr. ! gconfig.h obj.tr objw.tr lib.tr: devs.mak $(MAKEFILE) echogs$(XE) $(UNIQ) \ $(DEVICE_DEVS) $(DEVICE_DEVS2) $(DEVICE_DEVS3) $(DEVICE_DEVS4) $(DEVICE_DEVS5)\ $(FEATURE_DEVS) $(PLATFORM).dev --- 517,522 ---- # Generating gconfig.h also generates obj*.tr and lib.tr. ! gconfig.h obj.tr objw.tr lib.tr: \ ! devs.mak $(MAKEFILE) echogs$(XE) $(UNIQ) \ $(DEVICE_DEVS) $(DEVICE_DEVS2) $(DEVICE_DEVS3) $(DEVICE_DEVS4) $(DEVICE_DEVS5)\ $(FEATURE_DEVS) $(PLATFORM).dev *************** *** 584,588 **** ialloc.$(OBJ): ialloc.c $(AK) $(gs_h) $(gdebug_h) $(alloc_h) $(astate_h) ! iccfont.$(OBJ): iccfont.c $(GH) gconfig.h \ $(ghost_h) $(alloc_h) $(ccfont_h) $(dict_h) $(dstack_h) $(errors_h) $(iutil_h) $(name_h) $(oper_h) $(save_h) $(store_h) --- 592,596 ---- ialloc.$(OBJ): ialloc.c $(AK) $(gs_h) $(gdebug_h) $(alloc_h) $(astate_h) ! iccfont.$(OBJ): iccfont.c $(GH) gconfigf.h \ $(ghost_h) $(alloc_h) $(ccfont_h) $(dict_h) $(dstack_h) $(errors_h) $(iutil_h) $(name_h) $(oper_h) $(save_h) $(store_h) *************** *** 650,655 **** zprops.$(OBJ): zprops.c $(OP) \ ! $(alloc_h) $(dict_h) $(name_h) $(store_h) \ ! $(gsprops_h) $(gsmatrix_h) $(gxdevice_h) zrelbit.$(OBJ): zrelbit.c $(OP) $(store_h) $(dict_h) --- 658,663 ---- zprops.$(OBJ): zprops.c $(OP) \ ! $(alloc_h) $(dict_h) $(name_h) $(state_h) $(store_h) \ ! $(gsprops_h) $(gsmatrix_h) $(gxdevice_h) $(gsstate_h) zrelbit.$(OBJ): zrelbit.c $(OP) $(store_h) $(dict_h) *************** *** 828,842 **** $(SHP)gssetmod ccfonts $(ccfonts_) iccfont.$(OBJ) $(SHP)gsaddmod ccfonts -oper ccfonts - $(SHP)gsaddmod ccfonts -font Ugly ugly.$(OBJ): ugly.c $(CCFONT) ncrr.$(OBJ): ncrr.c $(CCFONT) psyr.$(OBJ): psyr.c $(CCFONT) ptmr.$(OBJ): ptmr.c $(CCFONT) pzdr.$(OBJ): pzdr.c $(CCFONT) # ----------------------------- Main program ------------------------------ # --- 836,860 ---- $(SHP)gssetmod ccfonts $(ccfonts_) iccfont.$(OBJ) $(SHP)gsaddmod ccfonts -oper ccfonts + gconfigf.h: $(MAKEFILE) + $(SHP)gssetmod ccfonts_ + $(SHP)gsaddmod ccfonts_ -font Ugly + rm -f gconfigf.h + mv ccfonts_.d_f gconfigf.h + ugly.$(OBJ): ugly.c $(CCFONT) + $(CCCF) ugly.c ncrr.$(OBJ): ncrr.c $(CCFONT) + $(CCCF) ncrr.c psyr.$(OBJ): psyr.c $(CCFONT) + $(CCCF) psyr.c ptmr.$(OBJ): ptmr.c $(CCFONT) + $(CCCF) ptmr.c pzdr.$(OBJ): pzdr.c $(CCFONT) + $(CCCF) pzdr.c # ----------------------------- Main program ------------------------------ # *************** *** 901,904 **** --- 919,923 ---- # * pe Private Eye # Unix and VMS: + # * att3b1 AT&T 3b1/Unixpc monochrome display [3b1 only] # * sonyfb Sony Microsystems monochrome display [Sony only] # * sunview SunView window system [SunOS only] *************** *** 927,931 **** # + ljet2p H-P LaserJet IId/IIp/III* with TIFF compression # + ljet3 H-P LaserJet III* with Delta Row compression ! # * ljetplus H-P LaserJet Plus # * nwp533 Sony Microsystems NWP533 laser printer [Sony only] # paintjet H-P PaintJet color printer --- 946,951 ---- # + ljet2p H-P LaserJet IId/IIp/III* with TIFF compression # + ljet3 H-P LaserJet III* with Delta Row compression ! # + ljetplus H-P LaserJet Plus ! # * necp6 NEC P6/P6+/P60 printers at 360 x 360 DPI resolution # * nwp533 Sony Microsystems NWP533 laser printer [Sony only] # paintjet H-P PaintJet color printer *************** *** 1103,1106 **** --- 1123,1134 ---- gdevmswn.$(OBJ): gdevmswn.c $(GDEV) $(gp_h) $(gpcheck_h) + ###### ----------- The AT&T 3b1 Unixpc monochrome display ------------ ###### + + att3b1_=gdev3b1.$(OBJ) + att3b1.dev: $(att3b1_) + $(SHP)gssetdev att3b1 $(att3b1_) + + gdev3b1.$(OBJ): gdev3b1.c + ###### --------------- Memory-buffered printer devices --------------- ###### *************** *** 1274,1277 **** --- 1302,1313 ---- gdevln03.$(OBJ): gdevln03.c $(PDEVH) + ### --------------------- The NEC P6 family devices -------------------- ### + + necp6_=gdevnp6.$(OBJ) gdevprn.$(OBJ) + necp6.dev: $(necp6_) + $(SHP)gssetdev necp6 $(necp6_) + + gdevnp6.$(OBJ): gdevnp6.c $(PDEVH) + ### ------------- The Ricoh 4081 laser printer device ------------------ ### ### Note: this driver was contributed by users: ### *************** *** 1349,1353 **** # See the main makefile for the definition of XINCLUDE. GDEVX=$(GDEV) x_.h gdevx.h $(MAKEFILE) ! gdevx.$(OBJ): gdevx.c $(GDEVX) $(CCC) $(XINCLUDE) gdevx.c --- 1385,1389 ---- # See the main makefile for the definition of XINCLUDE. GDEVX=$(GDEV) x_.h gdevx.h $(MAKEFILE) ! gdevx.$(OBJ): gdevx.c $(GDEVX) $(gserrors_h) $(gsprops_h) $(gsutil_h) $(CCC) $(XINCLUDE) gdevx.c *************** *** 1365,1369 **** ###### ----------------------- PC file formats ---------------------- ###### ! gdevpccm.$(OBJ): gdevpccm.c $(gs_h) $(gsmatrix_h) $(gxdevice_h) $(gdevpccm_h) ### ------------------------- GIF file formats ------------------------- ### --- 1401,1406 ---- ###### ----------------------- PC file formats ---------------------- ###### ! gdevpccm.$(OBJ): gdevpccm.c $(AK) \ ! $(gs_h) $(gsmatrix_h) $(gxdevice_h) $(gdevpccm_h) ### ------------------------- GIF file formats ------------------------- ### *************** *** 1459,1462 **** --- 1496,1502 ---- ## The Unix platforms + # We have to include a test for the existence of sys/time.h, + # because some System V platforms don't have it. + # All reasonable Unix platforms. unix__=gp_unix.$(OBJ) *************** *** 1464,1469 **** $(SHP)gssetmod unix_ $(unix__) ! gp_unix.$(OBJ): gp_unix.c $(memory__h) $(string__h) $(gx_h) $(gp_h) \ $(stat__h) $(time__h) # Brain-damaged System V platforms. --- 1504,1511 ---- $(SHP)gssetmod unix_ $(unix__) ! gp_unix.$(OBJ): gp_unix.c $(AK) $(memory__h) $(string__h) $(gx_h) $(gp_h) \ $(stat__h) $(time__h) + if ( test -f /usr/include/sys/time.h ) then $(CCC) gp_unix.c;\ + else $(CCC) -DNOSYSTIME gp_unix.c; fi # Brain-damaged System V platforms. *************** *** 1472,1476 **** $(SHP)gssetmod sysv_ $(sysv__) ! gp_sysv.$(OBJ): gp_sysv.c # -------------------------- Auxiliary programs --------------------------- # --- 1514,1520 ---- $(SHP)gssetmod sysv_ $(sysv__) ! gp_sysv.$(OBJ): gp_sysv.c $(time__h) $(AK) ! if ( test -f /usr/include/sys/time.h ) then $(CCC) gp_sysv.c;\ ! else $(CCC) -DNOSYSTIME gp_sysv.c; fi # -------------------------- Auxiliary programs --------------------------- # *************** *** 1489,1492 **** --- 1533,1539 ---- # ----------------------------- Main program ------------------------------ # + BEGINFILES= + CCBEGIN=$(CCC) *.c + # Main program *************** *** 1522,1527 **** $(INSTALL_PROGRAM) bdftops $(bindir) $(INSTALL_PROGRAM) font2c $(bindir) - $(INSTALL_PROGRAM) pfbtogs $(bindir) - $(INSTALL_PROGRAM) showpbm $(bindir) -mkdir $(gsdatadir) $(INSTALL_DATA) README $(gsdatadir) --- 1569,1572 ---- *************** *** 1541,1548 **** $(INSTALL_DATA) impath.ps $(gsdatadir) $(INSTALL_DATA) landscap.ps $(gsdatadir) - $(INSTALL_DATA) pfbtogs.ps $(gsdatadir) $(INSTALL_DATA) prfont.ps $(gsdatadir) $(INSTALL_DATA) pstoppm.ps $(gsdatadir) - $(INSTALL_DATA) showpbm.ps $(gsdatadir) $(INSTALL_DATA) type1ops.ps $(gsdatadir) $(INSTALL_DATA) wrfont.ps $(gsdatadir) --- 1586,1591 ---- diff -rc2N gs25/unix-gcc.mak gs251/unix-gcc.mak *** gs25/unix-gcc.mak Wed Aug 19 01:02:16 1992 --- gs251/unix-gcc.mak Fri Sep 11 17:50:44 1992 *************** *** 192,195 **** --- 192,196 ---- CC0=$(CCC) + CCCF=$(CCC) CCD=$(CCC) CCINT=$(CCC) *************** *** 227,234 **** # FEATURE_DEVS - the optional features to include in the # executable. Current features are: ! # dps - support for Display PostScript extensions. ! # *** PARTIALLY IMPLEMENTED, SEE language.doc. *** ! # level2 - support for PostScript Level 2 extensions. ! # *** PARTIALLY IMPLEMENTED, SEE language.doc. *** # compfont - support for composite (type 0) fonts. # *** NOT IMPLEMENTED YET. *** --- 228,235 ---- # FEATURE_DEVS - the optional features to include in the # executable. Current features are: ! # dps - (partial) support for Display PostScript extensions: ! # see language.doc for details. ! # level2 - (partial) support for PostScript Level 2 ! # extensions: see language.doc for details. # compfont - support for composite (type 0) fonts. # *** NOT IMPLEMENTED YET. *** *************** *** 249,252 **** --- 250,256 ---- # XE - the extension for executable files (e.g., null or .exe). # OBJ - the extension for relocatable object files (e.g., o or obj). + # BEGINFILES - the list of files that `make begin' should delete. + # CCBEGIN - the compilation command for `make begin', normally + # $(CCC) *.c. # CCC - the C invocation for normal compilation. # CCD - the C invocation for files that store into frame buffers or *************** *** 255,258 **** --- 259,264 ---- # CC0 - a C invocation with the fewest possible flags. Needed because # MS-DOS limits the length of command lines to 128 characters. + # CCCF - the C invocation for compiled fonts. Needed because MS-DOS + # requires using the 'huge' memory model for these. # CCINT - the C invocation for compiling the main interpreter module, # normally the same as CCC: this is needed because the *************** *** 284,288 **** mostlyclean realclean distclean clean: rm -f *.$(OBJ) *.a core gmon.out ! rm -f *.dev *.d_* arch.h gconfig.h obj*.tr lib*.tr rm -f t _temp_* _temp_*.* *.map *.sym rm -f ansi2knr$(XE) echogs$(XE) genarch$(XE) uniq$(XE) --- 290,294 ---- mostlyclean realclean distclean clean: rm -f *.$(OBJ) *.a core gmon.out ! rm -f *.dev *.d_* arch.h gconfig*.h obj*.tr lib*.tr rm -f t _temp_* _temp_*.* *.map *.sym rm -f ansi2knr$(XE) echogs$(XE) genarch$(XE) uniq$(XE) *************** *** 295,299 **** rm -f arch.h genarch$(XE) $(BEGINFILES) make arch.h ! - $(CCC) *.c rm -f gconfig.$(OBJ) gdev*.$(OBJ) gp_*.$(OBJ) gsmisc.$(OBJ) rm -f iccfont.$(OBJ) iinit.$(OBJ) interp.$(OBJ) --- 301,305 ---- rm -f arch.h genarch$(XE) $(BEGINFILES) make arch.h ! - $(CCBEGIN) rm -f gconfig.$(OBJ) gdev*.$(OBJ) gp_*.$(OBJ) gsmisc.$(OBJ) rm -f iccfont.$(OBJ) iinit.$(OBJ) interp.$(OBJ) *************** *** 363,366 **** --- 369,373 ---- gsstate_h=gsstate.h $(gscolor_h) gstype1_h=gstype1.h + gsuid_h=gsuid.h gsutil_h=gsutil.h *************** *** 392,396 **** ### Executable code ! gsutil.$(OBJ): gsutil.c \ $(std_h) $(gsprops_h) $(gsutil_h) --- 399,403 ---- ### Executable code ! gsutil.$(OBJ): gsutil.c $(AK) \ $(std_h) $(gsprops_h) $(gsutil_h) *************** *** 507,517 **** gdevmem1.$(OBJ): gdevmem1.c $(AK) \ ! $(gs_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem2.$(OBJ): gdevmem2.c $(AK) \ ! $(gs_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem3.$(OBJ): gdevmem3.c $(AK) \ ! $(gs_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) ###### Files dependent on the installed devices, features, and platform. --- 514,524 ---- gdevmem1.$(OBJ): gdevmem1.c $(AK) \ ! $(gx_h) $(gserrors_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem2.$(OBJ): gdevmem2.c $(AK) \ ! $(gx_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) gdevmem3.$(OBJ): gdevmem3.c $(AK) \ ! $(gx_h) $(gxdevice_h) $(gxdevmem_h) $(gdevmem_h) ###### Files dependent on the installed devices, features, and platform. *************** *** 518,522 **** # Generating gconfig.h also generates obj*.tr and lib.tr. ! gconfig.h obj.tr objw.tr lib.tr: devs.mak $(MAKEFILE) echogs$(XE) $(UNIQ) \ $(DEVICE_DEVS) $(DEVICE_DEVS2) $(DEVICE_DEVS3) $(DEVICE_DEVS4) $(DEVICE_DEVS5)\ $(FEATURE_DEVS) $(PLATFORM).dev --- 525,530 ---- # Generating gconfig.h also generates obj*.tr and lib.tr. ! gconfig.h obj.tr objw.tr lib.tr: \ ! devs.mak $(MAKEFILE) echogs$(XE) $(UNIQ) \ $(DEVICE_DEVS) $(DEVICE_DEVS2) $(DEVICE_DEVS3) $(DEVICE_DEVS4) $(DEVICE_DEVS5)\ $(FEATURE_DEVS) $(PLATFORM).dev *************** *** 592,596 **** ialloc.$(OBJ): ialloc.c $(AK) $(gs_h) $(gdebug_h) $(alloc_h) $(astate_h) ! iccfont.$(OBJ): iccfont.c $(GH) gconfig.h \ $(ghost_h) $(alloc_h) $(ccfont_h) $(dict_h) $(dstack_h) $(errors_h) $(iutil_h) $(name_h) $(oper_h) $(save_h) $(store_h) --- 600,604 ---- ialloc.$(OBJ): ialloc.c $(AK) $(gs_h) $(gdebug_h) $(alloc_h) $(astate_h) ! iccfont.$(OBJ): iccfont.c $(GH) gconfigf.h \ $(ghost_h) $(alloc_h) $(ccfont_h) $(dict_h) $(dstack_h) $(errors_h) $(iutil_h) $(name_h) $(oper_h) $(save_h) $(store_h) *************** *** 658,663 **** zprops.$(OBJ): zprops.c $(OP) \ ! $(alloc_h) $(dict_h) $(name_h) $(store_h) \ ! $(gsprops_h) $(gsmatrix_h) $(gxdevice_h) zrelbit.$(OBJ): zrelbit.c $(OP) $(store_h) $(dict_h) --- 666,671 ---- zprops.$(OBJ): zprops.c $(OP) \ ! $(alloc_h) $(dict_h) $(name_h) $(state_h) $(store_h) \ ! $(gsprops_h) $(gsmatrix_h) $(gxdevice_h) $(gsstate_h) zrelbit.$(OBJ): zrelbit.c $(OP) $(store_h) $(dict_h) *************** *** 836,850 **** $(SHP)gssetmod ccfonts $(ccfonts_) iccfont.$(OBJ) $(SHP)gsaddmod ccfonts -oper ccfonts - $(SHP)gsaddmod ccfonts -font Ugly ugly.$(OBJ): ugly.c $(CCFONT) ncrr.$(OBJ): ncrr.c $(CCFONT) psyr.$(OBJ): psyr.c $(CCFONT) ptmr.$(OBJ): ptmr.c $(CCFONT) pzdr.$(OBJ): pzdr.c $(CCFONT) # ----------------------------- Main program ------------------------------ # --- 844,868 ---- $(SHP)gssetmod ccfonts $(ccfonts_) iccfont.$(OBJ) $(SHP)gsaddmod ccfonts -oper ccfonts + gconfigf.h: $(MAKEFILE) + $(SHP)gssetmod ccfonts_ + $(SHP)gsaddmod ccfonts_ -font Ugly + rm -f gconfigf.h + mv ccfonts_.d_f gconfigf.h + ugly.$(OBJ): ugly.c $(CCFONT) + $(CCCF) ugly.c ncrr.$(OBJ): ncrr.c $(CCFONT) + $(CCCF) ncrr.c psyr.$(OBJ): psyr.c $(CCFONT) + $(CCCF) psyr.c ptmr.$(OBJ): ptmr.c $(CCFONT) + $(CCCF) ptmr.c pzdr.$(OBJ): pzdr.c $(CCFONT) + $(CCCF) pzdr.c # ----------------------------- Main program ------------------------------ # *************** *** 909,912 **** --- 927,931 ---- # * pe Private Eye # Unix and VMS: + # * att3b1 AT&T 3b1/Unixpc monochrome display [3b1 only] # * sonyfb Sony Microsystems monochrome display [Sony only] # * sunview SunView window system [SunOS only] *************** *** 935,939 **** # + ljet2p H-P LaserJet IId/IIp/III* with TIFF compression # + ljet3 H-P LaserJet III* with Delta Row compression ! # * ljetplus H-P LaserJet Plus # * nwp533 Sony Microsystems NWP533 laser printer [Sony only] # paintjet H-P PaintJet color printer --- 954,959 ---- # + ljet2p H-P LaserJet IId/IIp/III* with TIFF compression # + ljet3 H-P LaserJet III* with Delta Row compression ! # + ljetplus H-P LaserJet Plus ! # * necp6 NEC P6/P6+/P60 printers at 360 x 360 DPI resolution # * nwp533 Sony Microsystems NWP533 laser printer [Sony only] # paintjet H-P PaintJet color printer *************** *** 1111,1114 **** --- 1131,1142 ---- gdevmswn.$(OBJ): gdevmswn.c $(GDEV) $(gp_h) $(gpcheck_h) + ###### ----------- The AT&T 3b1 Unixpc monochrome display ------------ ###### + + att3b1_=gdev3b1.$(OBJ) + att3b1.dev: $(att3b1_) + $(SHP)gssetdev att3b1 $(att3b1_) + + gdev3b1.$(OBJ): gdev3b1.c + ###### --------------- Memory-buffered printer devices --------------- ###### *************** *** 1282,1285 **** --- 1310,1321 ---- gdevln03.$(OBJ): gdevln03.c $(PDEVH) + ### --------------------- The NEC P6 family devices -------------------- ### + + necp6_=gdevnp6.$(OBJ) gdevprn.$(OBJ) + necp6.dev: $(necp6_) + $(SHP)gssetdev necp6 $(necp6_) + + gdevnp6.$(OBJ): gdevnp6.c $(PDEVH) + ### ------------- The Ricoh 4081 laser printer device ------------------ ### ### Note: this driver was contributed by users: ### *************** *** 1357,1361 **** # See the main makefile for the definition of XINCLUDE. GDEVX=$(GDEV) x_.h gdevx.h $(MAKEFILE) ! gdevx.$(OBJ): gdevx.c $(GDEVX) $(CCC) $(XINCLUDE) gdevx.c --- 1393,1397 ---- # See the main makefile for the definition of XINCLUDE. GDEVX=$(GDEV) x_.h gdevx.h $(MAKEFILE) ! gdevx.$(OBJ): gdevx.c $(GDEVX) $(gserrors_h) $(gsprops_h) $(gsutil_h) $(CCC) $(XINCLUDE) gdevx.c *************** *** 1373,1377 **** ###### ----------------------- PC file formats ---------------------- ###### ! gdevpccm.$(OBJ): gdevpccm.c $(gs_h) $(gsmatrix_h) $(gxdevice_h) $(gdevpccm_h) ### ------------------------- GIF file formats ------------------------- ### --- 1409,1414 ---- ###### ----------------------- PC file formats ---------------------- ###### ! gdevpccm.$(OBJ): gdevpccm.c $(AK) \ ! $(gs_h) $(gsmatrix_h) $(gxdevice_h) $(gdevpccm_h) ### ------------------------- GIF file formats ------------------------- ### *************** *** 1467,1470 **** --- 1504,1510 ---- ## The Unix platforms + # We have to include a test for the existence of sys/time.h, + # because some System V platforms don't have it. + # All reasonable Unix platforms. unix__=gp_unix.$(OBJ) *************** *** 1472,1477 **** $(SHP)gssetmod unix_ $(unix__) ! gp_unix.$(OBJ): gp_unix.c $(memory__h) $(string__h) $(gx_h) $(gp_h) \ $(stat__h) $(time__h) # Brain-damaged System V platforms. --- 1512,1519 ---- $(SHP)gssetmod unix_ $(unix__) ! gp_unix.$(OBJ): gp_unix.c $(AK) $(memory__h) $(string__h) $(gx_h) $(gp_h) \ $(stat__h) $(time__h) + if ( test -f /usr/include/sys/time.h ) then $(CCC) gp_unix.c;\ + else $(CCC) -DNOSYSTIME gp_unix.c; fi # Brain-damaged System V platforms. *************** *** 1480,1484 **** $(SHP)gssetmod sysv_ $(sysv__) ! gp_sysv.$(OBJ): gp_sysv.c # -------------------------- Auxiliary programs --------------------------- # --- 1522,1528 ---- $(SHP)gssetmod sysv_ $(sysv__) ! gp_sysv.$(OBJ): gp_sysv.c $(time__h) $(AK) ! if ( test -f /usr/include/sys/time.h ) then $(CCC) gp_sysv.c;\ ! else $(CCC) -DNOSYSTIME gp_sysv.c; fi # -------------------------- Auxiliary programs --------------------------- # *************** *** 1497,1500 **** --- 1541,1547 ---- # ----------------------------- Main program ------------------------------ # + BEGINFILES= + CCBEGIN=$(CCC) *.c + # Main program *************** *** 1530,1535 **** $(INSTALL_PROGRAM) bdftops $(bindir) $(INSTALL_PROGRAM) font2c $(bindir) - $(INSTALL_PROGRAM) pfbtogs $(bindir) - $(INSTALL_PROGRAM) showpbm $(bindir) -mkdir $(gsdatadir) $(INSTALL_DATA) README $(gsdatadir) --- 1577,1580 ---- *************** *** 1549,1556 **** $(INSTALL_DATA) impath.ps $(gsdatadir) $(INSTALL_DATA) landscap.ps $(gsdatadir) - $(INSTALL_DATA) pfbtogs.ps $(gsdatadir) $(INSTALL_DATA) prfont.ps $(gsdatadir) $(INSTALL_DATA) pstoppm.ps $(gsdatadir) - $(INSTALL_DATA) showpbm.ps $(gsdatadir) $(INSTALL_DATA) type1ops.ps $(gsdatadir) $(INSTALL_DATA) wrfont.ps $(gsdatadir) --- 1594,1599 ---- diff -rc2N gs25/unixhead.mak gs251/unixhead.mak *** gs25/unixhead.mak Sun May 31 04:24:16 1992 --- gs251/unixhead.mak Thu Aug 20 13:56:52 1992 *************** *** 55,58 **** --- 55,59 ---- CC0=$(CCC) + CCCF=$(CCC) CCD=$(CCC) CCINT=$(CCC) diff -rc2N gs25/unixtail.mak gs251/unixtail.mak *** gs25/unixtail.mak Sat Aug 1 03:08:16 1992 --- gs251/unixtail.mak Mon Sep 7 15:26:46 1992 *************** *** 34,37 **** --- 34,40 ---- ## The Unix platforms + # We have to include a test for the existence of sys/time.h, + # because some System V platforms don't have it. + # All reasonable Unix platforms. unix__=gp_unix.$(OBJ) *************** *** 39,44 **** $(SHP)gssetmod unix_ $(unix__) ! gp_unix.$(OBJ): gp_unix.c $(memory__h) $(string__h) $(gx_h) $(gp_h) \ $(stat__h) $(time__h) # Brain-damaged System V platforms. --- 42,49 ---- $(SHP)gssetmod unix_ $(unix__) ! gp_unix.$(OBJ): gp_unix.c $(AK) $(memory__h) $(string__h) $(gx_h) $(gp_h) \ $(stat__h) $(time__h) + if ( test -f /usr/include/sys/time.h ) then $(CCC) gp_unix.c;\ + else $(CCC) -DNOSYSTIME gp_unix.c; fi # Brain-damaged System V platforms. *************** *** 47,51 **** $(SHP)gssetmod sysv_ $(sysv__) ! gp_sysv.$(OBJ): gp_sysv.c # -------------------------- Auxiliary programs --------------------------- # --- 52,58 ---- $(SHP)gssetmod sysv_ $(sysv__) ! gp_sysv.$(OBJ): gp_sysv.c $(time__h) $(AK) ! if ( test -f /usr/include/sys/time.h ) then $(CCC) gp_sysv.c;\ ! else $(CCC) -DNOSYSTIME gp_sysv.c; fi # -------------------------- Auxiliary programs --------------------------- # *************** *** 64,67 **** --- 71,77 ---- # ----------------------------- Main program ------------------------------ # + BEGINFILES= + CCBEGIN=$(CCC) *.c + # Main program *************** *** 97,102 **** $(INSTALL_PROGRAM) bdftops $(bindir) $(INSTALL_PROGRAM) font2c $(bindir) - $(INSTALL_PROGRAM) pfbtogs $(bindir) - $(INSTALL_PROGRAM) showpbm $(bindir) -mkdir $(gsdatadir) $(INSTALL_DATA) README $(gsdatadir) --- 107,110 ---- *************** *** 116,123 **** $(INSTALL_DATA) impath.ps $(gsdatadir) $(INSTALL_DATA) landscap.ps $(gsdatadir) - $(INSTALL_DATA) pfbtogs.ps $(gsdatadir) $(INSTALL_DATA) prfont.ps $(gsdatadir) $(INSTALL_DATA) pstoppm.ps $(gsdatadir) - $(INSTALL_DATA) showpbm.ps $(gsdatadir) $(INSTALL_DATA) type1ops.ps $(gsdatadir) $(INSTALL_DATA) wrfont.ps $(gsdatadir) --- 124,129 ---- diff -rc2N gs25/use.doc gs251/use.doc *** gs25/use.doc Wed Aug 19 00:56:16 1992 --- gs251/use.doc Sun Sep 6 09:25:04 1992 *************** *** 224,227 **** --- 224,235 ---- ------------ + There are three MS-DOS executables in the standard Ghostscript + distribution: + - GS.EXE runs on any MS-DOS machine, but is limited to 640K. + - GS386.EXE runs on any 386 or 486 machine, and will use all + available extended (not expanded) memory. + - GSWIN.EXE runs under Microsoft Windows 3.n in enhanced + mode, and will use all available memory. + If you are running Ghostscript on a MS-DOS machine with a display that is not EGA/VGA compatible, you must use the Borland compiler. *************** *** 359,367 **** Special names ------------- - - -dASCIIOUT - disables Ghostscript's normal behavior; instead, writes strings to - stdout that would have been displayed or printed. For more information, - see the file gs_2asc.ps. -dDISKFONTS --- 367,370 ---- diff -rc2N gs25/watc.mak gs251/watc.mak *** gs25/watc.mak Sat Aug 15 10:56:44 1992 --- gs251/watc.mak Tue Sep 8 14:25:46 1992 *************** *** 220,225 **** CCC=$(CC) CCD=$(CC) CC0=$(CC) ! CCINT=$(CC) .c.obj: --- 220,226 ---- CCC=$(CC) CCD=$(CC) + CCCF=$(CC) CC0=$(CC) ! CCINT=$(COMP) -oit -i=$(INCDIR) $(CCFLAGS) .c.obj: *************** *** 235,242 **** # Choose the device(s) to include. See devs.mak for details. ! DEVICE_DEVS=vga.dev ega.dev tseng.dev epson.dev bj10e.dev paintjet.dev DEVICE_DEVS2=deskjet.dev djet500.dev laserjet.dev ljetplus.dev ljet2p.dev ljet3.dev ! DEVICE_DEVS3=pbm.dev pbmraw.dev pgm.dev pgmraw.dev ppm.dev ppmraw.dev ! DEVICE_DEVS4=gifmono.dev gif8.dev pcxmono.dev pcx16.dev pcx256.dev bit.dev !include gs.mak !include devs.mak --- 236,244 ---- # Choose the device(s) to include. See devs.mak for details. ! DEVICE_DEVS=vga.dev ega.dev tseng.dev epson.dev bj10e.dev DEVICE_DEVS2=deskjet.dev djet500.dev laserjet.dev ljetplus.dev ljet2p.dev ljet3.dev ! DEVICE_DEVS3=cdeskjet.dev cdjcolor.dev cdjmono.dev paintjet.dev pjetxl.dev ! DEVICE_DEVS4=pbm.dev pbmraw.dev pgm.dev pgmraw.dev ppm.dev ppmraw.dev ! DEVICE_DEVS5=gifmono.dev gif8.dev pcxmono.dev pcx16.dev pcx256.dev bit.dev !include gs.mak !include devs.mak *************** *** 259,262 **** --- 261,267 ---- BEGINFILES=ccf.tr + # The Watcom compiler doesn't recognize wildcards; + # we don't want any compilation to fail. + CCBEGIN=for %%f in (gs*.c gx*.c z*.c) do $(CCC) %%f LIBDOS=$(LIB) gp_iwatc.$(OBJ) gp_dosfb.$(OBJ) gp_msdos.$(OBJ) objw.tr lib.tr diff -rc2N gs25/x_.h gs251/x_.h *** gs25/x_.h Thu May 21 02:44:52 1992 --- gs251/x_.h Tue Sep 8 18:45:52 1992 *************** *** 68,71 **** --- 68,72 ---- # define XOpenDisplay xopendisplay # define XPutImage xputimage + # define XResizeWindow xresizewindow # define XSendEvent xsendevent # define XSetBackground xsetbackground *************** *** 79,82 **** --- 80,84 ---- # define XSetTile xsettile # define XSetWindowBackgroundPixmap xsetwindowbackgroundpixmap + # define XSetWMHints xsetwmhints # define XSync xsync # define XVisualIDFromVisual xvisualidfromvisual diff -rc2N gs25/zcontext.c gs251/zcontext.c *** gs25/zcontext.c Tue Jun 16 02:39:24 1992 --- gs251/zcontext.c Thu Sep 3 19:41:24 1992 *************** *** 151,155 **** { /* Punt. */ lprintf("Can't allocate stacks!"); ! return_error(gs_error_Fatal); } pctx->stacksize = stackneed; --- 151,155 ---- { /* Punt. */ lprintf("Can't allocate stacks!"); ! return_error(e_Fatal); } pctx->stacksize = stackneed; *************** *** 171,175 **** if ( active.head == 0 ) { lprintf("No context to run!"); ! return_error(gs_error_Fatal); } ctx_current = active.head; --- 171,175 ---- if ( active.head == 0 ) { lprintf("No context to run!"); ! return_error(e_Fatal); } ctx_current = active.head; diff -rc2N gs25/zdevice.c gs251/zdevice.c *** gs25/zdevice.c Sat Aug 15 10:23:34 1992 --- gs251/zdevice.c Mon Sep 7 19:45:10 1992 *************** *** 125,128 **** --- 125,129 ---- int num_colors; int code; + static const gs_memory_procs mprocs = { alloc, alloc_free }; check_type(op[-2], t_integer); /* width */ check_type(op[-1], t_integer); /* height */ *************** *** 145,149 **** (int)op[-2].value.intval, (int)op[-1].value.intval, ! colors, num_colors, alloc); if ( code == 0 ) { make_tv(op - 3, t_device, pdevice, new_dev); --- 146,150 ---- (int)op[-2].value.intval, (int)op[-1].value.intval, ! colors, num_colors, &mprocs); if ( code == 0 ) { make_tv(op - 3, t_device, pdevice, new_dev); diff -rc2N gs25/zfont2.c gs251/zfont2.c *** gs25/zfont2.c Wed May 27 13:12:44 1992 --- gs251/zfont2.c Mon Sep 7 14:01:58 1992 *************** *** 19,23 **** /* zfont2.c */ ! /* Font creation operator for Ghostscript */ #include "ghost.h" #include "errors.h" --- 19,23 ---- /* zfont2.c */ ! /* Font creation utilities for Ghostscript */ #include "ghost.h" #include "errors.h" *************** *** 43,46 **** --- 43,47 ---- static ref name_Encoding; ref name_UniqueID; /* used by zfont1 */ + static ref name_XUID; static ref name_BuildChar; *************** *** 60,63 **** --- 61,65 ---- { "Encoding", &name_Encoding }, { "UniqueID", &name_UniqueID }, + { "XUID", &name_XUID }, { "BuildChar", &name_BuildChar }, diff -rc2N gs25/zprops.c gs251/zprops.c *** gs25/zprops.c Sat Apr 25 12:26:10 1992 --- gs251/zprops.c Wed Sep 9 13:58:54 1992 *************** *** 27,30 **** --- 27,31 ---- #include "oper.h" #include "name.h" + #include "state.h" #include "store.h" #include "gsprops.h" *************** *** 31,34 **** --- 32,36 ---- #include "gsmatrix.h" /* for gxdevice.h */ #include "gxdevice.h" + #include "gsstate.h" /* Forward references */ *************** *** 45,53 **** check_type(*op, t_device); dev = op->value.pdevice; ! count = (*dev->procs->get_props)(dev, NULL); plist = (gs_prop_item *)alloc(count, sizeof(gs_prop_item), "getdeviceprops"); if ( plist == 0 ) return_error(e_VMerror); ! (*dev->procs->get_props)(dev, plist); ! code = props_to_stack(plist, op + 1, count); alloc_free((char *)plist, count, sizeof(gs_prop_item), "getdeviceprops"); if ( code >= 0 ) --- 47,55 ---- check_type(*op, t_device); dev = op->value.pdevice; ! count = gs_getdeviceprops_size(dev); plist = (gs_prop_item *)alloc(count, sizeof(gs_prop_item), "getdeviceprops"); if ( plist == 0 ) return_error(e_VMerror); ! code = gs_getdeviceprops(dev, plist); ! if ( code >= 0 ) code = props_to_stack(plist, op + 1, count); alloc_free((char *)plist, count, sizeof(gs_prop_item), "getdeviceprops"); if ( code >= 0 ) *************** *** 67,72 **** --- 69,77 ---- int count, acount = 0; int code; + int old_width, old_height; check_type(*op, t_device); dev = op->value.pdevice; + old_width = dev->width; + old_height = dev->height; for ( mp = op - 1; !r_has_type(mp, t_mark); mp-- ) { if ( mp <= osbot ) return e_unmatchedmark; *************** *** 86,94 **** code = props_from_stack(plist, mp + 1, count); if ( code >= 0 ) ! code = (*dev->procs->put_props)(dev, plist, count + acount); alloc_free((char *)plist, count + acount, sizeof(gs_prop_item), "putdeviceprops"); if ( code >= 0 ) { *mp = *op; osp = op = mp; } return code; --- 91,109 ---- code = props_from_stack(plist, mp + 1, count); if ( code >= 0 ) ! code = gs_putdeviceprops(dev, plist, count + acount); alloc_free((char *)plist, count + acount, sizeof(gs_prop_item), "putdeviceprops"); + if ( code > 0 || dev->width != old_width || dev->height != old_height ) + { /* The device was open and is now closed, */ + /* or its dimensions have changed. */ + /* If it was the current device, */ + /* call setdevice to reinstall it and erase the page. */ + /****** DOESN'T FIND ALL THE GSTATES THAT REFERENCE THE DEVICE. ******/ + if ( gs_currentdevice(igs) == dev ) + code = gs_setdevice(igs, dev); + } if ( code >= 0 ) { *mp = *op; osp = op = mp; + code = 0; } return code;