Article View: comp.lang.postscript
Article #1171ps2eexec BUG fixed (sorry)
From: Carsten Wiethoff
Date: Tue, 10 Oct 1989 14:01
Date: Tue, 10 Oct 1989 14:01
54 lines
1838 bytes
1838 bytes
I posted a quickie program to convert postscript to eexec format two weeks
ago. Unfortunately I mixed up the versions and included an old and
incorrect version. Sorry for that.
(I always say programs are either trivial or incorrect, but mine was both..)
So here is the (hopefully) correct version:
----------------------- cut here -------------------------------------------
/* Quickie to convert postscript from stdin to eexec format on stdout */
/* Written by Carsten Wiethoff 1989 */
/* You may do with it what you want as long as this notice stays in it */
#include <stdio.h>
static unsigned short buffer = 0xd971;
static unsigned long startup = 0x00000000; /* or whatever you want */
main()
{
unsigned char input;
unsigned char output;
int init = 4;
int i;
printf("%08x",startup);
for (i=0;i<init;++i)
{
input = (startup >> ((3-i)*8));
buffer = (input + buffer) * 0xce6d + 0x58bf;
}
for(;;)
{
for (i=0;i<(32-init);++i)
{
input = getchar();
if (input == EOF)
break;
output = (input ^ (buffer>>8));
buffer = (output + buffer) * 0xce6d + 0x58bf;
printf("%02x",output);
}
init = 0;
printf("\n");
if (input == EOF)
break;
}
}
Carsten Wiethoff
Voice: +49/(0)9131/85-7908
E-mail: cnwietho@immd4.informatik.uni-erlangen.de
Technical Details
Message-ID:
<538@medusa.informatik.uni-erlangen.de>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!unido!fauern!immd4.informatik.uni-erlangen.de!cnwiethoShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!unido!fauern!immd4.informatik.uni-erlangen.de!cnwietho From: cnwietho@immd4.informatik.uni-erlangen.de (Carsten Wiethoff) Newsgroups: comp.lang.postscript Subject: ps2eexec BUG fixed (sorry) Keywords: eexec ps2eexec Message-ID: <538@medusa.informatik.uni-erlangen.de> Date: 10 Oct 89 14:01:11 GMT Organization: IMMD IV, University of Erlangen, W-Germany Lines: 54