home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
usenet
/
altsrcs
/
3
/
3246
< prev
next >
Wrap
Internet Message Format
|
1991-04-28
|
50KB
From: mcastle@mcs213d.cs.umr.edu (Mike Castle {Nexus})
Newsgroups: alt.sources
Subject: PBMPlus on MSDOS patches (01/03)
Message-ID: <2692@umriscc.isc.umr.edu>
Date: 29 Apr 91 03:45:56 GMT
These are my patches to get most of PBMPlus to work under MSDOS. When I
created the diffs, my readme.dos got put at the very end, so look at the
end of the last part if you want to look at that before down loading.
Btw, the original diffs were 160k+, as one file (using gnu diff with
-c -B -H +recursive +new-file or something like that). I just broke the
file up on file boundaries. I don't know if patch will work with that or
not, but it's simple enough to cut out this header and cat or copy them
together. -mrc
-------------------------------------------------------
diff -c -B -H +new-file +recursive pbmplus.old/makeall.bat pbmplus.new/makeall.bat
*** pbmplus.old/makeall.bat
--- pbmplus.new/makeall.bat Sun Apr 28 08:39:22 1991
***************
*** 0 ****
--- 1,27 ----
+ rem MAKEALL.BAT for use with GNUMAKE.
+
+ cd pbm
+ del *.a
+ make -f makefile.pc
+
+ cd ..\pgm
+ del *.a
+ make -f makefile.pc
+
+ cd ..\ppm
+ del *.a
+ make -f makefile.pc
+
+ cd ..\pnm
+ del *.a
+ copy ..\pbm\*.a
+ copy ..\pbm\*.h
+ copy ..\pgm\*.a
+ copy ..\pgm\*.h
+ copy ..\ppm\*.a
+ copy ..\ppm\*.h
+ make -f makefile.pc
+ cd ..
+
+ ECHO Made all 32-bit files.
+ ECHO Edit MAKEEXE.BAT to use go32.exe or stub.exe as appropriate.
diff -c -B -H +new-file +recursive pbmplus.old/makeexe.bat pbmplus.new/makeexe.bat
*** pbmplus.old/makeexe.bat
--- pbmplus.new/makeexe.bat Sun Apr 28 08:27:38 1991
***************
*** 0 ****
--- 1,22 ----
+ rem Edit the following line to point to the correct path to use go32.exe or
+ rem stub.exe
+ set MAKEEXE=c:\gcc\bin\stub.exe
+
+ rem Change the following lines to make only the packages you want.
+ cd pbm
+ call exepbm
+ cd ..
+
+ cd pgm
+ call exepgm
+ cd ..
+
+ cd ppm
+ call exeppm
+ cd ..
+
+ cd pnm
+ call exepnm
+ cd ..
+
+ set MAKEEXE=
diff -c -B -H +new-file +recursive pbmplus.old/pbm/brushtop.c pbmplus.new/pbm/brushtop.c
*** pbmplus.old/pbm/brushtop.c Fri Apr 12 00:30:32 1991
--- pbmplus.new/pbm/brushtop.c Fri Apr 19 16:31:18 1991
***************
*** 29,35 ****
--- 29,39 ----
pm_usage( "[brushfile]" );
if ( argc == 2 )
+ #ifdef GNUDOS
+ ifp = pm_openrb( argv[1] );
+ #else /* GNUDOS */
ifp = pm_openr( argv[1] );
+ #endif /* GNUDOS */
else
ifp = stdin;
diff -c -B -H +new-file +recursive pbmplus.old/pbm/cmuwmtop.c pbmplus.new/pbm/cmuwmtop.c
*** pbmplus.old/pbm/cmuwmtop.c Fri Apr 12 00:30:34 1991
--- pbmplus.new/pbm/cmuwmtop.c Fri Apr 19 12:48:08 1991
***************
*** 31,37 ****
--- 31,41 ----
pm_usage( "[cmuwmfile]" );
if ( argc == 2 )
+ #ifdef GNUDOS
+ ifp = pm_openrb( argv[1] );
+ #else /* GNUDOS */
ifp = pm_openr( argv[1] );
+ #endif /* GNUDOS */
else
ifp = stdin;
diff -c -B -H +new-file +recursive pbmplus.old/pbm/delpbm.bat pbmplus.new/pbm/delpbm.bat
*** pbmplus.old/pbm/delpbm.bat
--- pbmplus.new/pbm/delpbm.bat Fri Apr 12 22:46:42 1991
***************
*** 0 ****
--- 1,36 ----
+ del BRUSHTOP
+ del CMUWMTOP
+ del G3TOPBM
+ del GEMTOPBM
+ del ICONTOPB
+ del MACPTOPB
+ del MGRTOPBM
+ del PBMLIFE
+ del PBMMAKE
+ del PBMMASK
+ del PBMPASTE
+ del PBMREDUC
+ del PBMTEXT
+ del PBMTO10X
+ del PBMTOASC
+ del PBMTOBBN
+ del PBMTOCMU
+ del PBMTOEPS
+ del PBMTOG3
+ del PBMTOGEM
+ del PBMTOGO
+ del PBMTOICO
+ del PBMTOLJ
+ del PBMTOMAC
+ del PBMTOMGR
+ del PBMTOPI3
+ del PBMTOPLO
+ del PBMTOPTX
+ del PBMTOX10
+ del PBMTOXBM
+ del PBMTOYBM
+ del PBMTOZIN
+ del PBMUPC
+ del PI3TOPBM
+ del XBMTOPBM
+ del YBMTOPBM
diff -c -B -H +new-file +recursive pbmplus.old/pbm/exepbm.bat pbmplus.new/pbm/exepbm.bat
*** pbmplus.old/pbm/exepbm.bat
--- pbmplus.new/pbm/exepbm.bat Fri Apr 12 22:46:26 1991
***************
*** 0 ****
--- 1,36 ----
+ copy /b c:\gcc\bin\stub.exe+BRUSHTOP BRUSHTOP.exe
+ copy /b c:\gcc\bin\stub.exe+CMUWMTOP CMUWMTOP.exe
+ copy /b c:\gcc\bin\stub.exe+G3TOPBM G3TOPBM.exe
+ copy /b c:\gcc\bin\stub.exe+GEMTOPBM GEMTOPBM.exe
+ copy /b c:\gcc\bin\stub.exe+ICONTOPB ICONTOPB.exe
+ copy /b c:\gcc\bin\stub.exe+MACPTOPB MACPTOPB.exe
+ copy /b c:\gcc\bin\stub.exe+MGRTOPBM MGRTOPBM.exe
+ copy /b c:\gcc\bin\stub.exe+PBMLIFE PBMLIFE.exe
+ copy /b c:\gcc\bin\stub.exe+PBMMAKE PBMMAKE.exe
+ copy /b c:\gcc\bin\stub.exe+PBMMASK PBMMASK.exe
+ copy /b c:\gcc\bin\stub.exe+PBMPASTE PBMPASTE.exe
+ copy /b c:\gcc\bin\stub.exe+PBMREDUC PBMREDUC.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTEXT PBMTEXT.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTO10X PBMTO10X.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOASC PBMTOASC.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOBBN PBMTOBBN.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOCMU PBMTOCMU.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOEPS PBMTOEPS.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOG3 PBMTOG3.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOGEM PBMTOGEM.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOGO PBMTOGO.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOICO PBMTOICO.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOLJ PBMTOLJ.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOMAC PBMTOMAC.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOMGR PBMTOMGR.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOPI3 PBMTOPI3.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOPLO PBMTOPLO.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOPTX PBMTOPTX.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOX10 PBMTOX10.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOXBM PBMTOXBM.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOYBM PBMTOYBM.exe
+ copy /b c:\gcc\bin\stub.exe+PBMTOZIN PBMTOZIN.exe
+ copy /b c:\gcc\bin\stub.exe+PBMUPC PBMUPC.exe
+ copy /b c:\gcc\bin\stub.exe+PI3TOPBM PI3TOPBM.exe
+ copy /b c:\gcc\bin\stub.exe+XBMTOPBM XBMTOPBM.exe
+ copy /b c:\gcc\bin\stub.exe+YBMTOPBM YBMTOPBM.exe
diff -c -B -H +new-file +recursive pbmplus.old/pbm/g3topbm.c pbmplus.new/pbm/g3topbm.c
*** pbmplus.old/pbm/g3topbm.c Fri Apr 12 00:30:30 1991
--- pbmplus.new/pbm/g3topbm.c Fri Apr 19 12:48:28 1991
***************
*** 67,73 ****
--- 67,77 ----
if ( argn < argc )
{
+ #ifdef GNUDOS
+ ifp = pm_openrb( argv[argn] );
+ #else /* GNUDOS */
ifp = pm_openr( argv[argn] );
+ #endif /* GNUDOS */
argn++;
}
else
diff -c -B -H +new-file +recursive pbmplus.old/pbm/gemtopbm.c pbmplus.new/pbm/gemtopbm.c
*** pbmplus.old/pbm/gemtopbm.c Fri Apr 12 00:30:32 1991
--- pbmplus.new/pbm/gemtopbm.c Fri Apr 19 21:33:30 1991
***************
*** 32,37 ****
--- 32,43 ----
* Handle systems that do CR-LF translation on reading / writing and
* little endians (some guesswork is involved).
*/
+
+ #ifdef GNUDOS
+ #ifndef MSDOS
+ #define MSDOS
+ #endif /* MSDOS */
+ #endif /* GNUDOS */
#ifdef MSDOS
#define LITTLE_ENDIAN
#endif /*MSDOS*/
***************
*** 110,117 ****
if (argc != 2)
pm_usage("[-d] <gemfile>");
f = pm_openr( argv[1] );
!
if (fread(&hd, sizeof hd, 1, f) != 1)
pm_perror( "read" );
--- 116,126 ----
if (argc != 2)
pm_usage("[-d] <gemfile>");
+ #ifdef GNUDOS
+ f = pm_openrb( argv[1] );
+ #else /* GNUDOS */
f = pm_openr( argv[1] );
! #endif /* GNUDOS */
if (fread(&hd, sizeof hd, 1, f) != 1)
pm_perror( "read" );
***************
*** 120,126 ****
#endif /*LITTLE_ENDIAN*/
for ( i = sizeof(struct header); i < hd.hlen; ++i )
! (void) getc(f);
if (debug) {
pm_message(
--- 129,135 ----
#endif /*LITTLE_ENDIAN*/
for ( i = sizeof(struct header); i < hd.hlen; ++i )
! (void) fgetc(f);
if (debug) {
pm_message(
***************
*** 140,154 ****
x = 0;
linerep = 0;
while (x < hd.linewid) {
! switch (c = getc(f)) {
case 0x80: /* Bit String */
! c = getc(f); /* Byte count */
if (debug)
pm_message(
"bit string of %d bytes",
c, 0,0,0,0);
for (j = 0; j < c; ++j) {
! cc = getc(f);
for (k = 0x80; k; k >>= 1) {
bitrow[x] = (k & cc) ? PBM_BLACK : PBM_WHITE;
++x;
--- 149,163 ----
x = 0;
linerep = 0;
while (x < hd.linewid) {
! switch (c = fgetc(f)) {
case 0x80: /* Bit String */
! c = fgetc(f); /* Byte count */
if (debug)
pm_message(
"bit string of %d bytes",
c, 0,0,0,0);
for (j = 0; j < c; ++j) {
! cc = fgetc(f);
for (k = 0x80; k; k >>= 1) {
bitrow[x] = (k & cc) ? PBM_BLACK : PBM_WHITE;
++x;
***************
*** 156,162 ****
}
break;
case 0: /* Pattern run */
! c = getc(f); /* Repeat count */
if (debug)
pm_message(
"pattern run of %d repetitions",
--- 165,171 ----
}
break;
case 0: /* Pattern run */
! c = fgetc(f); /* Repeat count */
if (debug)
pm_message(
"pattern run of %d repetitions",
***************
*** 163,172 ****
c, 0,0,0,0);
/* line repeat */
if (c == 0) {
! c = getc(f);
if (c != 0x00ff)
pm_error( "badly formed line repeat", 0,0,0,0,0 );
! linerep = getc(f);
break;
}
fread(pattern, 1, hd.patlen, f);
--- 172,181 ----
c, 0,0,0,0);
/* line repeat */
if (c == 0) {
! c = fgetc(f);
if (c != 0x00ff)
pm_error( "badly formed line repeat", 0,0,0,0,0 );
! linerep = fgetc(f);
break;
}
fread(pattern, 1, hd.patlen, f);
diff -c -B -H +new-file +recursive pbmplus.old/pbm/icontopb.c pbmplus.new/pbm/icontopb.c
*** pbmplus.old/pbm/icontopb.c Fri Apr 12 00:30:28 1991
--- pbmplus.new/pbm/icontopb.c Fri Apr 19 12:48:42 1991
***************
*** 27,33 ****
--- 27,37 ----
pm_usage( "[iconfile]" );
if ( argc == 2 )
+ #ifdef GNUDOS
+ ifp = pm_openrb( argv[1] );
+ #else /* GNUDOS */
ifp = pm_openr( argv[1] );
+ #endif /* GNUDOS */
else
ifp = stdin;
diff -c -B -H +new-file +recursive pbmplus.old/pbm/libpbm1.c pbmplus.new/pbm/libpbm1.c
*** pbmplus.old/pbm/libpbm1.c Fri Apr 12 00:30:34 1991
--- pbmplus.new/pbm/libpbm1.c Fri Apr 19 16:27:22 1991
***************
*** 251,256 ****
--- 251,291 ----
}
return f;
}
+ #ifdef GNUDOS
+ FILE*
+ pm_openrb( name )
+ char* name;
+ {
+ FILE* f;
+
+ if ( strcmp( name, "-" ) == 0 )
+ f = stdin;
+ else
+ {
+ f = fopen( name, "rb" );
+ if ( f == NULL )
+ {
+ pm_perror( name );
+ exit( 1 );
+ }
+ }
+ return f;
+ }
+ FILE*
+ pm_openwb( name )
+ char* name;
+ {
+ FILE* f;
+
+ f = fopen( name, "wb" );
+ if ( f == NULL )
+ {
+ pm_perror( name );
+ exit( 1 );
+ }
+ return f;
+ }
+ #endif /* GNUDOS */
FILE*
pm_openw( name )
***************
*** 275,281 ****
pm_close( f )
FILE* f;
{
! if ( f != stdin )
if ( fclose( f ) != 0 )
pm_perror( "fclose" );
}
--- 310,316 ----
pm_close( f )
FILE* f;
{
! if ( f != stdin && f != stdout )
if ( fclose( f ) != 0 )
pm_perror( "fclose" );
}
diff -c -B -H +new-file +recursive pbmplus.old/pbm/macptopb.c pbmplus.new/pbm/macptopb.c
*** pbmplus.old/pbm/macptopb.c Fri Apr 12 00:30:28 1991
--- pbmplus.new/pbm/macptopb.c Fri Apr 19 12:43:54 1991
***************
*** 44,50 ****
--- 44,54 ----
if ( argn < argc )
{
+ #ifdef GNUDOS
+ ifp = pm_openrb( argv[argn] );
+ #else /* GNUDOS */
ifp = pm_openr( argv[argn] );
+ #endif /* GNUDOS */
argn++;
}
else
diff -c -B -H +new-file +recursive pbmplus.old/pbm/makefile.pc pbmplus.new/pbm/makefile.pc
*** pbmplus.old/pbm/makefile.pc
--- pbmplus.new/pbm/makefile.pc Fri Apr 19 16:15:02 1991
***************
*** 0 ****
--- 1,145 ----
+ # Makefile for pbm tools.
+ #
+ # Copyright (C) 1989, 1991 by Jef Poskanzer.
+ #
+ # Permission to use, copy, modify, and distribute this software and its
+ # documentation for any purpose and without fee is hereby granted, provided
+ # that the above copyright notice appear in all copies and that both that
+ # copyright notice and this permission notice appear in supporting
+ # documentation. This software is provided "as is" without express or
+ # implied warranty.
+
+ # Default values, usually overridden by top-level Makefile.
+ #CC = cc
+ CC = gcc -fcombine-regs
+ #CFLAGS = -O
+ CFLAGS = -g
+ #CFLAGS = -g -O
+ #LDFLAGS = -s
+ LDFLAGS =
+ INSTALLBINARIES = /usr/new/pbm
+ INSTALLMANUALS1 = /usr/man/man1
+ SUFFIXMANUALS1 = 1
+ INSTALLMANUALS3 = /usr/man/man3
+ SUFFIXMANUALS3 = 3
+ INSTALLMANUALS5 = /usr/man/man5
+ SUFFIXMANUALS5 = 5
+ MANCP = cp
+
+ SHELL = /bin/sh
+ ALLCFLAGS = $(CFLAGS)
+ LIBPBM = libpbm.a
+
+ BINARIES = brushtopbm cmuwmtopbm g3topbm icontopbm gemtopbm \
+ macptopbm mgrtopbm pbmlife pbmmake pbmmask \
+ pbmpaste pbmreduce pbmtext pbmto10x pbmtoascii \
+ pbmtobbnbg pbmtocmuwm pbmtoepson pbmtog3 \
+ pbmtogem pbmtogo pbmtoicon pbmtolj pbmtomacp \
+ pbmtomgr pbmtopi3 pbmtoplot pbmtoptx \
+ pbmtox10bm pbmtoxbm pbmtoybm pbmtozinc \
+ pbmupc pi3topbm xbmtopbm \
+ ybmtopbm
+
+ OBJECTS = brushtopbm.o cmuwmtopbm.o g3topbm.o icontopbm.o gemtopbm.o \
+ macptopbm.o mgrtopbm.o pbmlife.o pbmmake.o pbmmask.o \
+ pbmpaste.o pbmreduce.o pbmtext.o pbmto10x.o pbmtoascii.o \
+ pbmtobbnbg.o pbmtocmuwm.o pbmtoepson.o pbmtog3.o \
+ pbmtogem.o pbmtogo.o pbmtoicon.o pbmtolj.o pbmtomacp.o \
+ pbmtomgr.o pbmtopi3.o pbmtoplot.o pbmtoptx.o \
+ pbmtox10bm.o pbmtoxbm.o pbmtoybm.o pbmtozinc.o \
+ pbmupc.o pi3topbm.o xbmtopbm.o \
+ ybmtopbm.o
+
+ MANUALS1 = $(BINARIES)
+ MANUALS3 = libpbm
+ MANUALS5 = pbm
+
+
+ all: binaries
+
+
+ binaries: $(BINARIES)
+
+ installbinaries: binaries
+ cd $(INSTALLBINARIES)
+ cp $(BINARIES) $(INSTALLBINARIES)
+
+
+ merge: pbmmerge
+ pbmmerge: pbmmerge.c $(OBJECTS) $(LIBPBM)
+ $(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c $(OBJECTS) $(LIBPBM)
+
+ installmerge: installpbmmerge
+ installpbmmerge: pbmmerge
+ cd $(INSTALLBINARIES)
+ cp pbmmerge $(INSTALLBINARIES)
+ cd $(INSTALLBINARIES) ; for i in $(BINARIES) ; do ln pbmmerge $$i ; done
+
+
+
+ installmanuals:
+ for i in $(MANUALS1) ; do $(MANCP) $$i.1 $(INSTALLMANUALS1)/$$i.$(SUFFIXMANUALS1) ; done
+ for i in $(MANUALS3) ; do $(MANCP) $$i.3 $(INSTALLMANUALS3)/$$i.$(SUFFIXMANUALS3) ; done
+ for i in $(MANUALS5) ; do $(MANCP) $$i.5 $(INSTALLMANUALS5)/$$i.$(SUFFIXMANUALS5) ; done
+
+
+ # Rules for plain programs.
+ $(BINARIES): pbm.h ../pbmplus.h $(LIBPBM)
+ $(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c $(LIBPBM)
+ $(OBJECTS): pbm.h ../pbmplus.h
+ $(CC) $(ALLCFLAGS) "-Dmain=$*_main" -c $*.c
+
+ # And library.
+ lib: $(LIBPBM)
+ $(LIBPBM): libpbm1.o libpbm2.o libpbm3.o libpbm4.o libpbm5.o
+
+ ar rc $(LIBPBM) libpbm1.o libpbm2.o libpbm3.o libpbm4.o libpbm5.o
+
+ libpbm1.o: pbm.h ../pbmplus.h libpbm.h libpbm1.c
+ $(CC) $(ALLCFLAGS) -c libpbm1.c
+ libpbm2.o: pbm.h ../pbmplus.h libpbm.h libpbm2.c
+ $(CC) $(ALLCFLAGS) -c libpbm2.c
+ libpbm3.o: pbm.h ../pbmplus.h libpbm.h libpbm3.c
+ $(CC) $(ALLCFLAGS) -c libpbm3.c
+ libpbm4.o: pbm.h ../pbmplus.h libpbm.h libpbm4.c
+ $(CC) $(ALLCFLAGS) -c libpbm4.c
+ libpbm5.o: pbm.h ../pbmplus.h pbmfont.h libpbm5.c
+ $(CC) $(ALLCFLAGS) -c libpbm5.c
+
+ # Other dependencies.
+ brushtopbm brushtopbm.o: brushtopbm.c
+ cmuwmtopbm cmuwmtopbm.o: cmuwmtopbm.c cmuwm.h
+ g3topbm g3topbm.o: g3topbm.c g3.h
+ icontopbm icontopbm.o: icontopbm.c
+ gemtopbm gemtopbm.o: gemtopbm.c
+ macptopbm macptopbm.o: macptopbm.c macp.h
+ mgrtopbm mgrtopbm.o: mgrtopbm.c mgr.h
+ pbmlife pbmlife.o: pbmlife.c
+ pbmmake pbmmake.o: pbmmake.c
+ pbmmask pbmmask.o: pbmmask.c
+ pbmpaste pbmpaste.o: pbmpaste.c
+ pbmreduce pbmreduce.o: pbmreduce.c
+ pbmtext pbmtext.o: pbmtext.c pbmfont.h
+ pbmto10x pbmto10x.o: pbmto10x.c
+ pbmtoascii pbmtoascii.o: pbmtoascii.c
+ pbmtobbnbg pbmtobbnbg.o: pbmtobbnbg.c
+ pbmtocmuwm pbmtocmuwm.o: pbmtocmuwm.c cmuwm.h
+ pbmtoepson pbmtoepson.o: pbmtoepson.c
+ pbmtog3 pbmtog3.o: pbmtog3.c g3.h
+ pbmtogem pbmtogem.o: pbmtogem.c
+ pbmtogo pbmtogo.o: pbmtogo.c
+ pbmtoicon pbmtoicon.o: pbmtoicon.c
+ pbmtolj pbmtolj.o: pbmtolj.c
+ pbmtomacp pbmtomacp.o: pbmtomacp.c macp.h
+ pbmtomgr pbmtomgr.o: pbmtomgr.c mgr.h
+ pbmtopi3 pbmtopi3.o: pbmtopi3.c
+ pbmtoplot pbmtoplot.o: pbmtoplot.c
+ pbmtoptx pbmtoptx.o: pbmtoptx.c
+ pbmtox10bm pbmtox10bm.o: pbmtox10bm.c
+ pbmtoxbm pbmtoxbm.o: pbmtoxbm.c
+ pbmtoybm pbmtoybm.o: pbmtoybm.c
+ pbmtozinc pbmtozinc.o: pbmtozinc.c
+ pbmupc pbmupc.o: pbmupc.c
+ pi3topbm pi3topbm.o: pi3topbm.c
+ xbmtopbm xbmtopbm.o: xbmtopbm.c
+ ybmtopbm ybmtopbm.o: ybmtopbm.c
diff -c -B -H +new-file +recursive pbmplus.old/pbm/mgrtopbm.c pbmplus.new/pbm/mgrtopbm.c
*** pbmplus.old/pbm/mgrtopbm.c Fri Apr 12 00:30:32 1991
--- pbmplus.new/pbm/mgrtopbm.c Fri Apr 19 12:47:34 1991
***************
*** 30,36 ****
--- 30,40 ----
pm_usage( "[mgrfile]" );
if ( argc == 2 )
+ #ifdef GNUDOS
+ ifp = pm_openrb( argv[1] );
+ #else /* GNUDOS */
ifp = pm_openr( argv[1] );
+ #endif /* GNUDOS */
else
ifp = stdin;
diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmto10x.c pbmplus.new/pbm/pbmto10x.c
*** pbmplus.old/pbm/pbmto10x.c Fri Apr 12 00:30:36 1991
--- pbmplus.new/pbm/pbmto10x.c Fri Apr 19 19:53:08 1991
***************
*** 19,28 ****
--- 19,35 ----
FILE *ifp;
int rows, cols, format;
+ #ifdef GNUDOS
+ FILE* ofp;
+ char fname[100], *fcp;
+ #endif /* GNUDOS */
+
void main(argc, argv)
int argc;
char *argv[];
{
+ fprintf(stderr,"%ld", argc);
+ fflush(stderr);
pbm_init( &argc, argv );
if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'h')
{
***************
*** 37,42 ****
--- 44,61 ----
else
ifp = stdin;
+ #ifdef GNUDOS
+ if ( ifp == stdin )
+ strcpy( fname, "noname" );
+ else {
+ strcpy( fname, argv[1] );
+ if ( ( fcp = index( fname, '.' ) ) != 0 )
+ *fcp = '\0';
+ }
+ strcat( fname, ".10x" );
+ ofp = pm_openwb( fname );
+ #endif /* GNUDOS */
+
pbm_readpbminit(ifp, &cols, &rows, &format);
if (highres)
res_120x144();
***************
*** 44,49 ****
--- 63,73 ----
res_60x72();
pm_close(ifp);
+
+ #ifdef GNUDOS
+ pm_close( ofp );
+ #endif /* GNUDOS */
+
exit(0);
}
***************
*** 54,60 ****
for (i = 0; i < LOW_RES_ROWS; ++i)
bitrows[i] = pbm_allocrow(cols);
! printf("\033A\010"); /* '\n' = 8/72 */
for (row = 0; row < rows; row += LOW_RES_ROWS)
{
if (row + LOW_RES_ROWS <= rows)
--- 78,89 ----
for (i = 0; i < LOW_RES_ROWS; ++i)
bitrows[i] = pbm_allocrow(cols);
! #ifdef GNUDOS
! fprintf( ofp, "\033A\010"); /* '\n' = 8/72 */
! #else /* GNUDOS */
! printf("\033A\010"); /* '\n' = 8/72 */
! #endif /* GNUDOS */
!
for (row = 0; row < rows; row += LOW_RES_ROWS)
{
if (row + LOW_RES_ROWS <= rows)
***************
*** 63,69 ****
--- 92,102 ----
npins = rows - row;
for (i = 0; i < npins; ++i)
pbm_readpbmrow(ifp, bP[i] = bitrows[i], cols, format);
+ #ifdef GNUDOS
+ fprintf( ofp, "\033K%c%c", cols % 256, cols / 256);
+ #else /* GNUDOS */
printf("\033K%c%c", cols % 256, cols / 256);
+ #endif /* GNUDOS */
for (col = 0; col < cols; ++col)
{
item = 0;
***************
*** 70,78 ****
--- 103,117 ----
for (i = 0; i < npins; ++i)
if (*(bP[i]++) == PBM_BLACK)
item |= 1 << (7 - i);
+ #ifdef GNUDOS
+ fputc(item, ofp );
+ }
+ fputc('\n', ofp );
+ #else /* GNUDOS */
putchar(item);
}
putchar('\n');
+ #endif /* GNUDOS */
}
}
***************
*** 83,89 ****
--- 122,133 ----
for (i = 0; i < HIGH_RES_ROWS; ++i)
bitrows[i] = pbm_allocrow(cols);
+ #ifdef GNUDOS
+ fputc('\033', ofp); fputc('3', ofp ); fputc('\0', ofp );
+ #else /* GNUDOS */
putchar('\033'); putchar('3'); putchar('\0');
+ #endif /* GNUDOS */
+
for (row = 0; row < rows; row += HIGH_RES_ROWS)
{
if (row + HIGH_RES_ROWS <= rows)
***************
*** 92,98 ****
--- 136,146 ----
npins = rows - row;
for (i = 0; i < npins; ++i)
pbm_readpbmrow(ifp, bP[i] = bitrows[i], cols, format);
+ #ifdef GNUDOS
+ fprintf( ofp, "\033L%c%c", cols % 256, cols / 256);
+ #else /* GNUDOS */
printf("\033L%c%c", cols % 256, cols / 256);
+ #endif /* GNUDOS */
for (col = 0; col < cols; ++col)
{
item = 0;
***************
*** 100,110 ****
--- 148,169 ----
for (pin = i = 0; i < npins; i += 2, ++pin)
if (*(bP[i]++) == PBM_BLACK)
item |= 1 << (7 - pin);
+ #ifdef GNUDOS
+ fputc(item, ofp );
+ #else /* GNUDOS */
putchar(item);
+ #endif /* GNUDOS */
}
+ #ifdef GNUDOS
+ fputc('\n', ofp ); /* flush buffer */
+ fprintf( ofp, "\033J\001"); /* 1/144 down */
+ fprintf( ofp, "\033L%c%c", cols % 256, cols / 256);
+ #else /* GNUDOS */
putchar('\n'); /* flush buffer */
printf("\033J\001"); /* 1/144 down */
printf("\033L%c%c", cols % 256, cols / 256);
+ #endif /* GNUDOS */
+
for (col = 0; col < cols; ++col)
{
item = 0;
***************
*** 112,120 ****
--- 171,188 ----
for (i = 1, pin = 0; i < npins; i += 2, ++pin)
if (*(bP[i]++) == PBM_BLACK)
item |= 1 << (7 - pin);
+ #ifdef GNUDOS
+ fputc( item, ofp );
+ #else /* GNUDOS */
putchar(item);
+ #endif /* GNUDOS */
}
+ #ifdef GNUDOS
+ fputc('\n', ofp ); /* flush buffer */
+ fprintf( ofp, "\033J\017"); /* 15/144 down */
+ #else /* GNUDOS */
putchar('\n'); /* flush buffer */
printf("\033J\017"); /* 15/144 down */
+ #endif /* GNUDOS */
}
}
diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtoasc.c pbmplus.new/pbm/pbmtoasc.c
*** pbmplus.old/pbm/pbmtoasc.c Fri Apr 12 00:30:30 1991
--- pbmplus.new/pbm/pbmtoasc.c Fri Apr 19 19:57:32 1991
***************
*** 12,17 ****
--- 12,22 ----
#include "pbm.h"
+ #ifdef GNUDOS
+ FILE* ofp;
+ char fname[100], *fcp;
+ #endif /* GNUDOS */
+
void main( argc, argv )
int argc;
char *argv[];
***************
*** 30,35 ****
--- 35,52 ----
else
ifp = stdin;
+ #ifdef GNUDOS
+ if ( ifp == stdin )
+ strcpy( fname, "noname" );
+ else {
+ strcpy( fname, argv[1] );
+ if ( ( fcp = index( fname, '.' ) ) != 0 )
+ *fcp = '\0';
+ }
+ strcat( fname, ".asc" );
+ ofp = pm_openwb( fname );
+ #endif /* GNUDOS */
+
bits = pbm_readpbm( ifp, &cols, &rows );
pm_close( ifp );
***************
*** 50,69 ****
--- 67,106 ----
if ( *bP == PBM_WHITE )
{
if ( row+1 >= rows || *b1P == PBM_WHITE )
+ #ifdef GNUDOS
+ fputc( ' ', ofp );
+ else
+ fputc( 'o', ofp );
+ #else /* GNUDOS */
putchar( ' ' );
else
putchar( 'o' );
+ #endif /* GNUDOS */
}
else
{
if ( row+1 >= rows || *b1P == PBM_WHITE )
+ #ifdef GNUDOS
+ fputc( '"', ofp );
+ else
+ fputc( '$', ofp );
+ #else /* GNUDOS */
putchar( '"' );
else
putchar( '$' );
+ #endif /* GNUDOS */
}
}
+ #ifdef GNUDOS
+ fputc( '\n', ofp );
+ #else /* GNUDOS */
putchar( '\n' );
+ #endif /* GNUDOS */
}
+
+ #ifdef GNUDOS
+ pm_close( ofp );
+ #endif /* GNUDOS */
exit( 0 );
}
diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtobbn.c pbmplus.new/pbm/pbmtobbn.c
*** pbmplus.old/pbm/pbmtobbn.c Fri Apr 12 00:30:36 1991
--- pbmplus.new/pbm/pbmtobbn.c Fri Apr 19 18:16:46 1991
***************
*** 19,24 ****
--- 19,29 ----
int nco;
+ #ifdef GNUDOS
+ FILE* ofp;
+ char fname[100], *fcp;
+ #endif /* GNUDOS */
+
void main(argc,argv)
int argc;
char **argv;
***************
*** 37,42 ****
--- 42,52 ----
pbm_init( &argc, argv );
+ #ifdef GNUDOS
+ strcpy( fname, "noname.bbn" );
+ ofp = pm_openwb( fname );
+ #endif /* GNUDOS */
+
op = 3;
switch (argc)
{ case 1:
***************
*** 47,64 ****
case 3:
x = atoi(argv[1]);
y = atoi(argv[2]);
! printf("\33:%d;%dm",x,y);
break;
case 4:
op = atoi(argv[1]);
x = atoi(argv[2]);
y = atoi(argv[3]);
! printf("\33:%d;%dm",x,y);
break;
}
nco = 0;
pbm_readpbminit(stdin,&cols,&rows,&format);
printf("\33P:%d;%d;%ds\n",op,cols,rows);
bitrow = pbm_allocrow(cols);
for (row=0;row<rows;row++)
{ pbm_readpbmrow(stdin,bitrow,cols,format);
--- 57,88 ----
case 3:
x = atoi(argv[1]);
y = atoi(argv[2]);
! #ifdef GNUDOS
! fprintf( ofp, "\33:%d;%dm",x,y);
! #else /* GNUDOS */
! printf("\33:%d;%dm",x,y);
! #endif /* GNUDOS */
break;
case 4:
op = atoi(argv[1]);
x = atoi(argv[2]);
y = atoi(argv[3]);
! #ifdef GNUDOS
! fprintf( ofp, "\33:%d;%dm",x,y);
! #else /* GNUDOS */
! printf("\33:%d;%dm",x,y);
! #endif /* GNUDOS */
break;
}
nco = 0;
pbm_readpbminit(stdin,&cols,&rows,&format);
+
+ #ifdef GNUDOS
+ fprintf( ofp, "\33P:%d;%d;%ds\n",op,cols,rows);
+ #else /* GNUDOS */
printf("\33P:%d;%d;%ds\n",op,cols,rows);
+ #endif /* GNUDOS */
+
bitrow = pbm_allocrow(cols);
for (row=0;row<rows;row++)
{ pbm_readpbmrow(stdin,bitrow,cols,format);
***************
*** 76,83 ****
if (mask != 0x8000)
{ write16(sixteen);
}
! }
! puts("\033\\");
exit(0);
}
--- 100,112 ----
if (mask != 0x8000)
{ write16(sixteen);
}
! }
! #ifdef GNUDOS
! fputs( "\033\\\n", ofp );
! pm_close( ofp );
! #else /* GNUDOS */
! puts("\033\\");
! #endif /* GNUDOS */
exit(0);
}
***************
*** 85,90 ****
--- 114,135 ----
write16(sixteen)
unsigned int sixteen;
{
+ #ifdef GNUDOS
+ if (nco > 75)
+ { fputc('\n', ofp );
+ nco = 0;
+ }
+ if (sixteen & 0xfc00)
+ { fputc(0100+(sixteen>>10), ofp );
+ nco ++;
+ }
+ if (sixteen & 0xfff0)
+ { fputc(0100+((sixteen>>4)&0x3f), ofp );
+ nco ++;
+ }
+ fputc(060+(sixteen&0xf), ofp );
+ nco ++;
+ #else /* GNUDOS */
if (nco > 75)
{ putchar('\n');
nco = 0;
***************
*** 99,104 ****
--- 144,150 ----
}
putchar(060+(sixteen&0xf));
nco ++;
+ #endif /* GNUDOS */
}
#else
/*
***************
*** 115,121 ****
--- 161,171 ----
int signChar;
if (nco > 75) {
+ #ifdef GNUDOS
+ fputc( '\n', ofp );
+ #else /* GNUDOS */
putchar ('\n');
+ #endif /* GNUDOS */
nco = 0;
}
***************
*** 130,135 ****
--- 180,199 ----
mid = ((word & 0x3f0) >> 4) + '@';
low = (word & 0xf) + signChar;
+ #ifdef GNUDOS
+ if (high != '@') {
+ fprintf ( ofp, "%c%c%c", high, mid, low);
+ nco += 3;
+ }
+ else if (mid != '@') {
+ fprintf ( ofp, "%c%c", mid, low);
+ nco += 2;
+ }
+ else {
+ fputc( low, ofp );
+ nco++;
+ }
+ #else /* GNUDOS */
if (high != '@') {
printf ("%c%c%c", high, mid, low);
nco += 3;
***************
*** 142,146 ****
--- 206,211 ----
putchar (low);
nco++;
}
+ #endif /* GNUDOS */
}
#endif
diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtocmu.c pbmplus.new/pbm/pbmtocmu.c
*** pbmplus.old/pbm/pbmtocmu.c Fri Apr 12 00:30:34 1991
--- pbmplus.new/pbm/pbmtocmu.c Fri Apr 19 19:57:22 1991
***************
*** 15,20 ****
--- 15,25 ----
static void putinit(), putbit(), putrest(), putitem();
+ #ifdef GNUDOS
+ FILE* ofp;
+ char fname[100], *fcp;
+ #endif /* GNUDOS */
+
void main( argc, argv )
int argc;
char *argv[];
***************
*** 33,38 ****
--- 38,55 ----
else
ifp = stdin;
+ #ifdef GNUDOS
+ if ( ifp == stdin )
+ strcpy( fname, "noname" );
+ else {
+ strcpy( fname, argv[1] );
+ if ( ( fcp = index( fname, '.' ) ) != 0 )
+ *fcp = '\0';
+ }
+ strcat( fname, ".cmu" );
+ ofp = pm_openwb( fname );
+ #endif /* GNUDOS */
+
pbm_readpbminit( ifp, &cols, &rows, &format );
bitrow = pbm_allocrow( cols );
***************
*** 53,58 ****
--- 70,79 ----
putrest( );
+ #ifdef GNUDOS
+ pm_close( ofp );
+ #endif /* GNUDOS */
+
exit( 0 );
}
***************
*** 64,70 ****
putinit( rows, cols )
int rows, cols;
{
! if ( pm_writebiglong( stdout, CMUWM_MAGIC ) == -1 )
pm_error( "write error", 0,0,0,0,0 );
if ( pm_writebiglong( stdout, cols ) == -1 )
pm_error( "write error", 0,0,0,0,0 );
--- 85,101 ----
putinit( rows, cols )
int rows, cols;
{
! #ifdef GNUDOS
! if ( pm_writebiglong( ofp, CMUWM_MAGIC ) == -1 )
! pm_error( "write error", 0,0,0,0,0 );
! if ( pm_writebiglong( ofp, cols ) == -1 )
! pm_error( "write error", 0,0,0,0,0 );
! if ( pm_writebiglong( ofp, rows ) == -1 )
! pm_error( "write error", 0,0,0,0,0 );
! if ( pm_writebigshort( ofp, (short) 1 ) == -1 )
! pm_error( "write error", 0,0,0,0,0 );
! #else /* GNUDOS */
! if ( pm_writebiglong( stdout, CMUWM_MAGIC ) == -1 )
pm_error( "write error", 0,0,0,0,0 );
if ( pm_writebiglong( stdout, cols ) == -1 )
pm_error( "write error", 0,0,0,0,0 );
***************
*** 72,77 ****
--- 103,109 ----
pm_error( "write error", 0,0,0,0,0 );
if ( pm_writebigshort( stdout, (short) 1 ) == -1 )
pm_error( "write error", 0,0,0,0,0 );
+ #endif /* GNUDOS */
item = 0;
bitsperitem = 0;
***************
*** 100,106 ****
--- 132,142 ----
static void
putitem( )
{
+ #ifdef GNUDOS
+ if ( putc( item, ofp ) == EOF )
+ #else /* GNUDOS */
if ( putc( item, stdout ) == EOF )
+ #endif /* GNUDOS */
pm_error( "write error", 0,0,0,0,0 );
item = 0;
bitsperitem = 0;
diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtoeps.c pbmplus.new/pbm/pbmtoeps.c
*** pbmplus.old/pbm/pbmtoeps.c Fri Apr 12 00:30:36 1991
--- pbmplus.new/pbm/pbmtoeps.c Fri Apr 19 19:57:18 1991
***************
*** 16,21 ****
--- 16,26 ----
static int mask[] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
+ #ifdef GNUDOS
+ FILE* ofp;
+ char fname[100], *fcp;
+ #endif /* GNUDOS */
+
void main( argc, argv )
int argc;
char* argv[];
***************
*** 37,48 ****
--- 42,71 ----
else
ifp = stdin;
+ #ifdef GNUDOS
+ if ( ifp == stdin )
+ strcpy( fname, "noname" );
+ else {
+ strcpy( fname, argv[1] );
+ if ( ( fcp = index( fname, '.' ) ) != 0 )
+ *fcp = '\0';
+ }
+ strcat( fname, ".epn" );
+ ofp = pm_openwb( fname );
+ #endif /* GNUDOS */
+
bits = pbm_readpbm( ifp, &cols, &rows );
pm_close( ifp );
/* Change line spacing to 8/72 inches. */
+
+ #ifdef GNUDOS
+ fprintf( ofp, "\033A\010");
+ #else /* GNUDOS */
printf("\033A\010");
+ #endif /* GNUDOS */
+
/* Write out rows by eights. */
for ( row = 0; row < rows; row += 8 )
{
***************
*** 59,65 ****
bP[idx] = bits[row+idx];
/* Put in plotter (1:1) graphics. */
if ( lastcol >= 0 )
! printf("\033*\005%c%c", (lastcol+1)%256, (lastcol+1)/256);
for ( col = 0; col <= lastcol; ++col )
{
val = 0;
--- 82,94 ----
bP[idx] = bits[row+idx];
/* Put in plotter (1:1) graphics. */
if ( lastcol >= 0 )
!
! #ifdef GNUDOS
! fprintf( ofp, "\033*\005%c%c", (lastcol+1)%256, (lastcol+1)/256);
! #else /* GNUDOS */
! printf("\033*\005%c%c", (lastcol+1)%256, (lastcol+1)/256);
! #endif /* GNUDOS */
!
for ( col = 0; col <= lastcol; ++col )
{
val = 0;
***************
*** 66,79 ****
for ( idx = 0; idx < 8 && row+idx < rows; ++idx )
if ( *bP[idx] == PBM_BLACK )
val |= mask[idx];
! putchar( val );
for ( idx = 0; idx < 8 && row+idx < rows; ++idx )
++bP[idx];
}
putchar( '\n' );
}
putchar( '\f' );
/* Restore normal line spacing. */
printf("\033@");
exit( 0 );
! }
--- 95,127 ----
for ( idx = 0; idx < 8 && row+idx < rows; ++idx )
if ( *bP[idx] == PBM_BLACK )
val |= mask[idx];
!
! #ifdef GNUDOS
! fputc( val, ofp );
for ( idx = 0; idx < 8 && row+idx < rows; ++idx )
++bP[idx];
}
+ fputc( '\n', ofp );
+ }
+ fputc( '\f', ofp );
+ #else /* GNUDOS */
+ putchar( val );
+ for ( idx = 0; idx < 8 && row+idx < rows; ++idx )
+ ++bP[idx];
+ }
putchar( '\n' );
}
putchar( '\f' );
+ #endif /* GNUDOS */
+
/* Restore normal line spacing. */
+
+ #ifdef GNUDOS
+ fprintf( ofp, "\033@");
+ pm_close( ofp );
+ #else /* GNUDOS */
printf("\033@");
+ #endif /* GNUDOS */
+
exit( 0 );
! }
diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtog3.c pbmplus.new/pbm/pbmtog3.c
*** pbmplus.old/pbm/pbmtog3.c Fri Apr 12 00:30:32 1991
--- pbmplus.new/pbm/pbmtog3.c Fri Apr 19 19:57:16 1991
***************
*** 18,23 ****
--- 18,28 ----
static int reversebits;
+ #ifdef GNUDOS
+ FILE* ofp;
+ char fname[100], *fcp;
+ #endif /* GNUDOS */
+
void main( argc, argv )
int argc;
char *argv[];
***************
*** 52,57 ****
--- 57,74 ----
if ( argn != argc )
pm_usage( usage );
+ #ifdef GNUDOS
+ if ( ifp == stdin )
+ strcpy( fname, "noname" );
+ else {
+ strcpy( fname, argv[argc-1] );
+ if ( ( fcp = index( fname, '.' ) ) != 0 )
+ *fcp = '\0';
+ }
+ strcat( fname, ".g3" );
+ ofp = pm_openwb( fname );
+ #endif /* GNUDOS */
+
pbm_readpbminit( ifp, &cols, &rows, &format );
bigcols = max( 1728, cols );
bitrow = pbm_allocrow( bigcols );
***************
*** 81,86 ****
--- 98,107 ----
pm_close( ifp );
+ #ifdef GNUDOS
+ pm_close( ofp );
+ #endif /* GNUDOS */
+
exit( 0 );
}
***************
*** 198,204 ****
--- 219,229 ----
else
shbit = shbit>>1;
if((shbit&0xff) == 0) {
+ #ifdef GNUDOS
+ fputc( shdata, ofp );
+ #else /* GNUDOS */
putchar(shdata);
+ #endif /* GNUDOS */
shdata = 0;
shbit = reversebits ? 0x01 : 0x80;
}
***************
*** 209,215 ****
--- 234,244 ----
{
if ( ( reversebits && shbit != 0x01 ) ||
( ! reversebits && shbit != 0x80 ) ) {
+ #ifdef GNUDOS
+ fputc( shdata, ofp );
+ #else /* GNUDOS */
putchar(shdata);
+ #endif /* GNUDOS */
shdata = 0;
shbit = reversebits ? 0x01 : 0x80;
}
diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtogem.c pbmplus.new/pbm/pbmtogem.c
*** pbmplus.old/pbm/pbmtogem.c Fri Apr 12 00:30:36 1991
--- pbmplus.new/pbm/pbmtogem.c Fri Apr 19 22:12:16 1991
***************
*** 40,45 ****
--- 40,50 ----
static void putinit(), putbit(), putrest(), putitem(), putrow();
+ #ifdef GNUDOS
+ FILE* ofp;
+ char fname[100], *fcp;
+ #endif /* GNUDOS */
+
void main( argc, argv )
int argc;
char* argv[];
***************
*** 58,64 ****
if ( argc == 2 )
ifp = pm_openr( argv[1] );
else
! ifp = stdin;
pbm_readpbminit( ifp, &cols, &rows, &format );
--- 63,81 ----
if ( argc == 2 )
ifp = pm_openr( argv[1] );
else
! ifp = stdin;
!
! #ifdef GNUDOS
! if ( ifp == stdin )
! strcpy( fname, "noname");
! else {
! strcpy( fname, argv[1] );
! if ( ( fcp = index( fname, '.' ) ) != 0 )
! *fcp = '\0';
! }
! strcat( fname, ".img" );
! ofp = pm_openwb( fname );
! #endif /* GNUDOS */
pbm_readpbminit( ifp, &cols, &rows, &format );
***************
*** 92,97 ****
--- 109,118 ----
putrest( );
+ #ifdef GNUDOS
+ pm_close( ofp );
+ #endif /* GNUDOS */
+
exit( 0 );
}
***************
*** 101,108 ****
static void
putinit( hdr )
struct header* hdr;
! {
fwrite( hdr, 32, 1, stdout );
item = 0;
bitsperitem = 0;
bitshift = 15;
--- 122,133 ----
static void
putinit( hdr )
struct header* hdr;
! {
! #ifdef GNUDOS
! fwrite( hdr, 32, 1, ofp );
! #else /* GNUDOS */
fwrite( hdr, 32, 1, stdout );
+ #endif /* GNUDOS */
item = 0;
bitsperitem = 0;
bitshift = 15;
***************
*** 145,152 ****
static void
putrow( )
{
! putc(0x80, stdout); /* a Bit string */
! putc(outcol*2, stdout); /* count */
fwrite( outrow, outcol*2, 1, stdout );
outcol = 0;
}
--- 170,183 ----
static void
putrow( )
{
! #ifdef GNUDOS
! fputc(0x80, ofp ); /* a Bit string */
! fputc(outcol*2, ofp ); /* count */
! fwrite( outrow, outcol*2, 1, ofp );
! #else /* GNUDOS */
! fputc(0x80, stdout); /* a Bit string */
! fputc(outcol*2, stdout); /* count */
fwrite( outrow, outcol*2, 1, stdout );
+ #endif /* GNUDOS */
outcol = 0;
}
diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtogo.c pbmplus.new/pbm/pbmtogo.c
*** pbmplus.old/pbm/pbmtogo.c Fri Apr 12 00:30:32 1991
--- pbmplus.new/pbm/pbmtogo.c Fri Apr 19 19:57:08 1991
***************
*** 48,53 ****
--- 48,58 ----
unsigned char *scanlineptr; /* Pointer to current scan line byte */
+ #ifdef GNUDOS
+ FILE *ofp;
+ char fname[100], *fcp;
+ #endif /* GNUDOS */
+
void main( argc, argv )
int argc;
char *argv[];
***************
*** 77,82 ****
--- 82,99 ----
else
ifd = stdin;
+ #ifdef GNUDOS
+ if ( ifd == stdin )
+ strcpy( fname, "noname" );
+ else {
+ strcpy( fname, argv[argn-1] );
+ if ( ( fcp = index( fname, '.' ) ) != 0 )
+ *fcp = '\0';
+ }
+ strcat( fname, ".go" );
+ ofp = pm_openwb( fname );
+ #endif /* GNUDOS */
+
pbm_readpbminit(ifd, &cols, &rows, &format);
bitrow = pbm_allocrow(cols);
***************
*** 91,97 ****
putinit();
/* Start donwloading screen raster */
! printf("\033P0;1;0;4;1;%d;%d;1!R1/", rows, rucols);
linerepeat = 63; /* 63 means "Start new picture" */
for (row = 0; row < rows; row++)
--- 108,118 ----
putinit();
/* Start donwloading screen raster */
! #ifdef GNUDOS
! fprintf( ofp, "\033P0;1;0;4;1;%d;%d;1!R1/", rows, rucols);
! #else /* GNUDOS */
! printf("\033P0;1;0;4;1;%d;%d;1!R1/", rows, rucols);
! #endif /* GNUDOS */
linerepeat = 63; /* 63 means "Start new picture" */
for (row = 0; row < rows; row++)
***************
*** 122,128 ****
--- 143,153 ----
** repeat count to cause the old line(s) to be plotted on the screen,
** copy the new data into the internal buffer, and reset the counters.
*/
+ #ifdef GNUDOS
+ fputc(linerepeat, ofp );
+ #else /* GNUDOS */
putchar(linerepeat);
+ #endif /* GNUDOS */
for (i = 0; i < bytesperrow; ++i)
buffer[i] = diff[i];
nbyte = 0; /* Internal buffer byte counter */
***************
*** 196,206 ****
--- 221,240 ----
goto nextrow;
} /* while (TRUE) */
+ #ifdef GNUDOS
+ nextrow: fprintf( ofp, "%d/", nout+1); /* Total bytes to transfer = nout+1 */
+ fflush( ofp );
+ #else /* GNUDOS */
nextrow: printf("%d/", nout+1); /* Total bytes to transfer = nout+1 */
fflush(stdout);
+ #endif /* GNUDOS */
/* Output the plot data */
+ #ifdef GNUDOS
+ fwrite( outbuffer, 1, nout, ofp );
+ #else /* GNUDOS */
write(1, outbuffer, nout);
+ #endif /* GNUDOS */
/* Reset the counters */
linerepeat = 0;
***************
*** 210,219 ****
--- 244,260 ----
linerepeat++;
if (linerepeat == 62) /* 62 lines max, then restart */
{
+ #ifdef GNUDOS
+ fputc( linerepeat, ofp );
+ fprintf( ofp, "%d/", nout+1);
+ fflush( ofp );
+ fwrite( outbuffer, 1, nout, ofp );
+ #else /* GNUDOS */
putchar(linerepeat);
printf("%d/", nout+1);
fflush(stdout);
write(1, outbuffer, nout);
+ #endif /* GNUDOS */
linerepeat = 0;
}
}
***************
*** 222,230 ****
--- 263,279 ----
for (i = 0; i < bytesperrow; ++i)
oldscanline[i] = newscanline[i];
}
+ #ifdef GNUDOS
+ fputc( linerepeat, ofp );
+ #else /* GNUDOS */
putchar(linerepeat); /* For the last line(s) to be plotted */
+ #endif /* GNUDOS */
pm_close(ifd);
putrest();
+ #ifdef GNUDOS
+ pm_close( ofp );
+ #endif /* GNUDOS */
+
exit(0);
}
***************
*** 232,237 ****
--- 281,299 ----
putinit()
{
+ #ifdef GNUDOS
+ /* Enter graphics window */
+ fprintf( ofp, "\0331");
+
+ /* Erase graphics window */
+ fprintf( ofp, "\033\014");
+
+ /* Set graphics window in raster mode */
+ fprintf( ofp, "\033r");
+
+ /* Select standard Tek coding **/
+ fprintf( ofp, "\033[=11l");
+ #else /* GNUDOS */
/* Enter graphics window */
printf("\0331");
***************
*** 243,248 ****
--- 305,311 ----
/* Select standard Tek coding **/
printf("\033[=11l");
+ #endif /* GNUDOS */
bitsperitem = 1;
item = 0;
***************
*** 268,273 ****
--- 331,346 ----
if (bitsperitem > 1)
putitem();
+ #ifdef GNUDOS
+ /* end raster downloading */
+ fprintf( ofp, "\033\134");
+
+ /* Exit raster mode */
+ fprintf( ofp, "\033t");
+
+ /* Exit graphics window
+ fprintf( ofp, "\0332"); */
+ #else /* GNUDOS */
/* end raster downloading */
printf("\033\134");
***************
*** 276,281 ****
--- 349,355 ----
/* Exit graphics window
printf("\0332"); */
+ #endif /* GNUDOS */
}
putitem()
diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtoico.c pbmplus.new/pbm/pbmtoico.c
*** pbmplus.old/pbm/pbmtoico.c Fri Apr 12 00:30:30 1991
--- pbmplus.new/pbm/pbmtoico.c Fri Apr 19 20:23:44 1991
***************
*** 14,19 ****
--- 14,25 ----
static void putinit(), putbit(), putrest(), putitem();
+ #ifdef GNUDOS
+ FILE *ofp;
+ char fname[100], *fcp;
+ #endif GNUDOS;
+
+
void main( argc, argv )
int argc;
char *argv[];
***************
*** 32,37 ****
--- 38,55 ----
else
ifp = stdin;
+ #ifdef GNUDOS
+ if ( ifp == stdin )
+ strcpy( fname, "noname" );
+ else {
+ strcpy( fname, argv[1] );
+ if ( ( fcp = index( fname, '.' ) ) != 0 )
+ *fcp = '\0';
+ }
+ strcat( fname, ".ico" );
+ ofp = pm_openwb( fname );
+ #endif /* GNUDOS */
+
pbm_readpbminit( ifp, &cols, &rows, &format );
bitrow = pbm_allocrow( cols );
***************
*** 40,48 ****
padleft = pad / 2;
padright = pad - padleft;
! printf( "/* Format_version=1, Width=%d, Height=%d", cols + pad, rows );
printf( ", Depth=1, Valid_bits_per_item=16\n */\n" );
putinit( );
for ( row = 0; row < rows; row++ )
{
--- 58,72 ----
padleft = pad / 2;
padright = pad - padleft;
! #ifdef GNUDOS
! fprintf( ofp, "/* Format_version=1, Width=%d, Height=%d", cols + pad, rows );
! fprintf( ofp, ", Depth=1, Valid_bits_per_item=16\n */\n" );
! #else /* GNUDOS */
! printf( "/* Format_version=1, Width=%d, Height=%d", cols + pad, rows );
printf( ", Depth=1, Valid_bits_per_item=16\n */\n" );
+ #endif /* GNUDOS */
+
putinit( );
for ( row = 0; row < rows; row++ )
{
***************
*** 59,64 ****
--- 83,92 ----
putrest( );
+ #ifdef GNUDOS
+ pm_close( ofp );
+ #endif /* GNUDOS */
+
exit( 0 );
}
***************
*** 92,98 ****
--- 120,130 ----
{
if ( bitsperitem > 0 )
putitem( );
+ #ifdef GNUDOS
+ fputc( '\n', ofp );
+ #else /* GNUDOS */
putchar( '\n' );
+ #endif /* GNUDOS */
}
static void
***************
*** 103,108 ****
--- 135,156 ----
if ( firstitem )
firstitem = 0;
else
+ #ifdef GNUDOS
+ fputc( ',', ofp );
+ if ( itemsperline == 8 )
+ {
+ fputc( '\n', ofp );
+ itemsperline = 0;
+ }
+ if ( itemsperline == 0 )
+ fputc( '\t', ofp );
+ fputc( '0', ofp );
+ fputc( 'x', ofp );
+ fputc( hexits[item >> 12], ofp );
+ fputc( hexits[( item >> 8 ) & 15], ofp );
+ fputc( hexits[( item >> 4 ) & 15], ofp );
+ fputc( hexits[item & 15], ofp );
+ #else /* GNUDOS */
putchar( ',' );
if ( itemsperline == 8 )
{
***************
*** 117,122 ****
--- 165,171 ----
putchar( hexits[( item >> 8 ) & 15] );
putchar( hexits[( item >> 4 ) & 15] );
putchar( hexits[item & 15] );
+ #endif /* GNUDOS */
itemsperline++;
bitsperitem = 0;
item = 0;
diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtolj.c pbmplus.new/pbm/pbmtolj.c
*** pbmplus.old/pbm/pbmtolj.c Fri Apr 12 00:30:30 1991
--- pbmplus.new/pbm/pbmtolj.c Fri Apr 19 20:31:38 1991
***************
*** 28,33 ****
--- 28,38 ----
static void putinit(), putbit(), putrest(), putitem();
+ #ifdef GNUDOS
+ FILE* ofp;
+ char fname[100], *fcp;
+ #endif /* GNUDOS */
+
void main( argc, argv )
int argc;
char* argv[];
***************
*** 68,73 ****
--- 73,90 ----
if ( argn != argc )
pm_usage( usage );
+ #ifdef GNUDOS
+ if ( ifp == stdin )
+ strcpy( fname, "noname" );
+ else {
+ strcpy( fname, argv[argc-1] );
+ if ( ( fcp = index( fname, '.' ) ) != 0 )
+ *fcp = '\0';
+ }
+ strcat( fname, ".lj" );
+ ofp = pm_openwb( fname );
+ #endif /* GNUDOS */
+
pbm_readpbminit( ifp, &cols, &rows, &format );
bitrow = pbm_allocrow( cols );
***************
*** 86,92 ****
padright = rucols - (nzcol + 1);
/* Transfer raster graphics */
! printf("\033*b%dW",rucols/8);
for ( col = 0, bP = bitrow; col <= nzcol; ++col, ++bP )
putbit( *bP );
for ( col = 0; col < padright; ++col )
--- 103,113 ----
padright = rucols - (nzcol + 1);
/* Transfer raster graphics */
! #ifdef GNUDOS
! fprintf( ofp, "\033*b%dW",rucols/8);
! #else /* GNUDOS */
! printf("\033*b%dW",rucols/8);
! #endif /* GNUDOS */
for ( col = 0, bP = bitrow; col <= nzcol; ++col, ++bP )
putbit( *bP );
for ( col = 0; col < padright; ++col )
***************
*** 97,102 ****
--- 118,127 ----
putrest( );
+ #ifdef GNUDOS
+ pm_close( ofp );
+ #endif /* GNUDOS */
+
exit( 0 );
}
***************
*** 106,111 ****
--- 131,149 ----
static void
putinit( )
{
+ #ifdef GNUDOS
+ /* Printer reset. */
+ fprintf( ofp, "\033E");
+
+ /* Ensure top margin is zero */
+ fprintf( ofp, "\033&l0E");
+
+ /* Set raster graphics resolution */
+ fprintf( ofp, "\033*t%dR",dpi);
+
+ /* Start raster graphics, relative adressing */
+ fprintf( ofp, "\033*r1A");
+ #else /* GNUDOS */
/* Printer reset. */
printf("\033E");
***************
*** 117,122 ****
--- 155,161 ----
/* Start raster graphics, relative adressing */
printf("\033*r1A");
+ #endif /* GNUDOS */
itemsperline = 0;
bitsperitem = 1;
***************
*** 145,161 ****
--- 184,212 ----
if ( bitsperitem > 1 )
putitem( );
+ #ifdef GNUDOS
+ /* end raster graphics */
+ fprintf( ofp, "\033*rB" );
+
+ /* Printer reset. */
+ fprintf( ofp, "\033E");
+ #else /* GNUDOS */
/* end raster graphics */
printf( "\033*rB" );
/* Printer reset. */
printf("\033E");
+ #endif /* GNUDOS */
}
static void
putitem( )
{
+ #ifdef GNUDOS
+ fputc( item, ofp );
+ #else /* GNUDOS */
putchar( item );
+ #endif /* GNUDOS */
bitsperitem = 0;
item = 0;
}
diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtomac.c pbmplus.new/pbm/pbmtomac.c
*** pbmplus.old/pbm/pbmtomac.c Fri Apr 12 00:30:32 1991
--- pbmplus.new/pbm/pbmtomac.c Fri Apr 19 20:33:10 1991
***************
*** 21,26 ****
--- 21,31 ----
FILE *fdout;
char *usage = "[-l left] [-r right] [-b bottom] [-t top] [pbmfile]";
+ #ifdef GNUDOS
+ FILE* ofp;
+ char fname[100], *fcp;
+ #endif /* GNUDOS */
+
void main(argc, argv)
int argc;
char *argv[];
***************
*** 83,88 ****
--- 88,105 ----
if ( argn != argc )
pm_usage( usage );
+ #ifdef GNUDOS
+ if ( ifp == stdin )
+ strcpy( fname, "noname" );
+ else {
+ strcpy( fname, argv[argc-1] );
+ if ( ( fcp = index( fname, '.' ) ) != 0 )
+ *fcp = '\0';
+ }
+ strcat( fname, ".mac");
+ fdout = pm_openwb( fname );
+ #endif /* GNUDOS */
+
bitsr = pbm_readpbm( ifp, &cols, &rows );
pm_close( ifp );
***************
*** 119,124 ****
--- 136,144 ----
writemacp( bits );
+ #ifdef GNUDOS
+ pm_close( fdout );
+ #endif /* GNUDOS */
exit( 0 );
}
diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtomgr.c pbmplus.new/pbm/pbmtomgr.c
*** pbmplus.old/pbm/pbmtomgr.c Fri Apr 12 00:30:36 1991
--- pbmplus.new/pbm/pbmtomgr.c Fri Apr 19 19:56:50 1991
***************
*** 15,20 ****
--- 15,25 ----
static void putinit(), putbit(), putrest(), putitem();
+ #ifdef GNUDOS
+ FILE* ofp;
+ char fname[100], *fcp;
+ #endif /* GNUDOS */
+
void main( argc, argv )
int argc;
char *argv[];
***************
*** 33,38 ****
--- 38,55 ----
else
ifp = stdin;
+ #ifdef GNUDOS
+ if ( ifp == stdin )
+ strcpy( fname, "noname" );
+ else {
+ strcpy( fname, argv[1] );
+ if ( ( fcp = index( fname, '.' ) ) != 0 )
+ *fcp = '\0';
+ }
+ strcat( fname, ".mgr" );
+ ofp = pm_openwb( fname );
+ #endif /* GNUDOS */
+
pbm_readpbminit( ifp, &cols, &rows, &format );
bitrow = pbm_allocrow( cols );
***************
*** 53,58 ****
--- 70,79 ----
putrest( );
+ #ifdef GNUDOS
+ pm_close( ofp );
+ #endif /* GNUDOS */
+
exit( 0 );
}
***************
*** 74,80 ****
--- 95,105 ----
head.l_high = ( rows & 0x3f ) + ' ';
head.depth = ( 1 & 0x3f ) + ' ';
head._reserved = ' ';
+ #ifdef GNUDOS
+ fwrite( &head, sizeof(head), 1, ofp );
+ #else /* GNUDOS */
fwrite( &head, sizeof(head), 1, stdout );
+ #endif /* GNUDOS */
item = 0;
bitsperitem = 0;
***************
*** 103,109 ****
--- 128,139 ----
static void
putitem( )
{
+ #ifdef GNUDOS
+ fwrite( &item, sizeof(item), 1, ofp );
+ #else /* GNUDOS */
fwrite( &item, sizeof(item), 1, stdout );
+ #endif /* GNUDOS */
+
item = 0;
bitsperitem = 0;
bitshift = 7;