home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Otherware
/
Otherware_1_SB_Development.iso
/
amiga
/
video
/
utils
/
gifmach.lzh
/
GIFM13.diff
< prev
next >
Wrap
Text File
|
1991-07-01
|
12KB
|
524 lines
TO TRANSFORM sources/doimage.c INTO rlpsrc/doimage.c ...
*** APPEND AFTER 36 IN sources/doimage.c ***
>#ifdef RLP
>BOOL DoImage(FILE *fh)
>#else
*** APPEND AFTER 37 IN sources/doimage.c ***
>#endif
*** CHANGE 69 IN sources/doimage.c TO 73 IN rlpsrc/doimage.c ***
< if (FRead(fh, &LocalColourTable[index], 1, 3) != 3) {
---------------
> if (FRead(fh, (char *)&LocalColourTable[index], 1, 3) != 3) {
*** APPEND AFTER 184 IN sources/doimage.c ***
>#ifdef RLP
>int ReadCode(FILE *fh)
>#else
*** APPEND AFTER 185 IN sources/doimage.c ***
>#endif
TO TRANSFORM sources/extensions.c INTO rlpsrc/extensions.c ...
*** APPEND AFTER 9 IN sources/extensions.c ***
>#ifdef RLP
>BOOL DoExtension(FILE *fh)
>#else
*** APPEND AFTER 10 IN sources/extensions.c ***
>#endif
TO TRANSFORM sources/GIFMachine.h INTO rlpsrc/GIFMachine.h ...
*** APPEND AFTER 11 IN sources/GIFMachine.h ***
>#ifdef RLP
>#include <stdio.h>
>#include <arp/ArpBase.h>
>#include <arp/proto.h>
>extern struct ArpBase *ArpBase;
>#endif
*** APPEND AFTER 33 IN sources/GIFMachine.h ***
>#ifdef RLP
> UBYTE rgb_pad;
>#endif
*** APPEND AFTER 61 IN sources/GIFMachine.h ***
>#ifndef RLP
*** APPEND AFTER 62 IN sources/GIFMachine.h ***
>#endif
*** APPEND AFTER 67 IN sources/GIFMachine.h ***
>#ifdef RLP
>extern BOOL DoImage(FILE *);
>extern BOOL DoExtension(FILE *);
>#else
*** APPEND AFTER 69 IN sources/GIFMachine.h ***
>#endif
*** APPEND AFTER 72 IN sources/GIFMachine.h ***
>#ifdef RLP
>extern int ReadCode(FILE *);
>#else
*** APPEND AFTER 73 IN sources/GIFMachine.h ***
>#endif
*** APPEND AFTER 92 IN sources/GIFMachine.h ***
>#ifdef RLP
>#define PutStr Printf /* use ARP function */
>#define MyPrintf Printf /* use ARP function */
>#define MySPrintf SPrintf /* use ARP function */
>#define FGetC(fh) fgetc(fh)
>#define UnGetC(fh,c) ungetc(c,fh)
>#define FRead(fh,buf,size,count) fread(buf,size,count,fh)
>#else
*** APPEND AFTER 94 IN sources/GIFMachine.h ***
>#endif
TO TRANSFORM sources/lmkfile INTO rlpsrc/lmkfile ...
*** CHANGE 6 IN sources/lmkfile TO 6 IN rlpsrc/lmkfile ***
<CFLAGS = $(DEBUG) $(CPU) -v -cs -rr -fid -O
---------------
>CFLAGS = $(DEBUG) $(CPU) -v -cfist -rr -fid -O -DRLP
*** CHANGE [13,14] IN sources/lmkfile TO [13,17] IN rlpsrc/lmkfile ***
<OBJS = startup.o main.o mymem.o warncli.o doimage.o extensions.o writeiff.o 24to12.o stripborder.o xcomp.o doflip.o rgbdiff.o giftosham.o myprintf.o
<LIBS = LIB:LCR.lib LIB:amiga2.0.lib
---------------
>OBJS = main.o mymem.o doimage.o extensions.o 24to12.o \
> stripborder.o xcomp.o doflip.o rgbdiff.o giftosham.o \
> writeiff.o iffw.o
>
>LIBS = ARPsvR.lib LIB:LCR.lib LIB:amiga.lib
*** CHANGE [22,23] IN sources/lmkfile TO 25 IN rlpsrc/lmkfile ***
<GIFMachine: $(OBJS)
< UpCVersion version.o
---------------
>GIFM13: $(OBJS)
*** CHANGE [25,29] IN sources/lmkfile TO [27,31] IN rlpsrc/lmkfile ***
<FROM $(OBJS) version.o
<TO GIFMachine
<LIB $(LIBS)
<$(LFLAGS)
<<
---------------
> FROM LIB:c.o $(OBJS) version.o
> TO GIFM13
> LIB $(LIBS)
> $(LFLAGS)
> <
*** APPEND AFTER 49 IN sources/lmkfile ***
>
>iffw.o: iffw.c
TO TRANSFORM sources/main.c INTO rlpsrc/main.c ...
*** APPEND AFTER 5 IN sources/main.c ***
>#ifdef RLP
>#include <setjmp.h>
>#include <arp/ArpBase.h>
>#include <arp/proto.h>
>#else
*** APPEND AFTER 8 IN sources/main.c ***
>#endif
*** APPEND AFTER 10 IN sources/main.c ***
>#ifdef RLP /*------------------------------------------------------*/
>#define ap_Strlen ap_StrLen
>#define APF_DOWILD APB_DoWild
>#define APF_DODIR APB_DoDir
>#define APF_DIDDIR APB_DidDir
>#define MatchFirst(pat,apath) FindFirst(pat,apath)
>#define MatchNext(apath) FindNext(apath)
>#define MatchEnd(apath) FreeAnchorChain(apath)
>#define FilePart(name) BaseName(name)
>#define AddPart(ptr,basename,size) TackOn(ptr,basename)
>#endif /*------------------------------------------------------*/
>
*** CHANGE 35 IN sources/main.c TO 53 IN rlpsrc/main.c ***
<BPTR GIFfh = NULL;
---------------
>FILE * GIFfh = NULL;
*** APPEND AFTER 37 IN sources/main.c ***
>#ifdef RLP
>#define GIFMACH "GIFMachine"
>#define SPACES " "
>#define VERSION "version X (Dos 1.3)"
>#define WICHURA "Copyright \xA9 1990 by Christopher A. Wichura " \
> "(caw@miroc.chi.il.us)\n\n"
>#define PYRON "Adapted for use under 1.3 by Robert L. Pyron (BIX:rpyron)\n\n"
>#define ARG_HELP GIFMACH VERSION "\n" WICHURA PYRON \
> "Usage: " GIFMACH " <GIFfile(s)> " \
> "[TO Directory | File] [ALL]\n" \
> SPACES "[NOBORDER <Line Thresh>] [XCOMP] [DITHER]\n" \
> SPACES "[XFLIP] [YFLIP] [DEEP] [BUFSIZE <Size in Kbytes>]\n"
>
>#define ARG_TEMPLATE "GIFfiles/A/...,TO/K,ALL/S,NOBORDER/K,XCOMP/S,DITHER/S,XFLIP/s,YFLIP/s,DEEP/S,BUFSIZE/K"
>
>#else
>
*** APPEND AFTER 52 IN sources/main.c ***
>
>#endif
>
*** APPEND AFTER 66 IN sources/main.c ***
>#ifdef RLP
>char *CLI_Template = ARG_TEMPLATE;
>char *CLI_Help = ARG_HELP;
>#else
*** APPEND AFTER 67 IN sources/main.c ***
>#endif
*** APPEND AFTER 96 IN sources/main.c ***
>#ifdef RLP
>int main (int argc, char **argv)
>#else
*** APPEND AFTER 97 IN sources/main.c ***
>#endif
*** APPEND AFTER 99 IN sources/main.c ***
>#ifndef RLP
*** APPEND AFTER 100 IN sources/main.c ***
>#endif
*** APPEND AFTER 103 IN sources/main.c ***
>#ifndef RLP
*** CHANGE 108 IN sources/main.c TO [158,160] IN rlpsrc/main.c ***
<
---------------
>#endif
>
>#ifndef RLP
*** CHANGE 113 IN sources/main.c TO [165,167] IN rlpsrc/main.c ***
<
---------------
>#endif
>
>#ifndef RLP
*** CHANGE 118 IN sources/main.c TO [172,180] IN rlpsrc/main.c ***
<
---------------
>#endif
>
>#ifdef RLP
> {
> int i;
> for (i = 0; i < ARG_sizeof; i++)
> ArgArray[i] = argv[i+1];
> }
>#else
*** APPEND AFTER 133 IN sources/main.c ***
>#endif
*** APPEND AFTER 137 IN sources/main.c ***
>#ifdef RLP
> if (ArgArray[ARG_NOBORD]) {
> NoBorderLineThresh = Atol(ArgArray[ARG_NOBORD]);
> if (Errno || NoBorderLineThresh < 0 || NoBorderLineThresh > 100) {
> PutStr("Invalid NOBORDER line threshhold specified.\n");
> MyExit(3);
> }
> }
>#else
*** CHANGE 145 IN sources/main.c TO [217,226] IN rlpsrc/main.c ***
<
---------------
>#endif
>
>#ifdef RLP
> if (ArgArray[ARG_BUFSIZ])
> {
> BufSize = Atol(ArgArray[ARG_BUFSIZ]);
> if (Errno)
> BufSize = 1;
> }
>#else
*** APPEND AFTER 147 IN sources/main.c ***
>#endif
*** APPEND AFTER 163 IN sources/main.c ***
> if (anchor)
> MatchEnd(&anchor->APath);
>
>#ifdef RLP
> if (GIFfh)
> fclose(GIFfh);
>
> if (ArpBase)
> CloseLibrary((void *)ArpBase);
>#else
*** CHANGE [172,177] IN sources/main.c TO 264 IN rlpsrc/main.c ***
<
< if (anchor)
< MatchEnd(&anchor->APath);
<
< if (ArgsPtr)
< FreeArgs(ArgsPtr);
---------------
>#endif
*** APPEND AFTER 215 IN sources/main.c ***
>
*** APPEND AFTER 257 IN sources/main.c ***
>#ifdef RLP
> if (!(GIFfh = fopen(name, "r"))) {
>#else
*** APPEND AFTER 258 IN sources/main.c ***
>#endif
*** APPEND AFTER 262 IN sources/main.c ***
>#ifdef RLP
> setvbuf(GIFfh, NULL, _IOFBF, BufSize);
>#else
*** CHANGE 264 IN sources/main.c TO 359 IN rlpsrc/main.c ***
<
---------------
>#endif
*** APPEND AFTER 307 IN sources/main.c ***
>#ifdef RLP
> DateStamp(&StartTime);
>#else
*** APPEND AFTER 308 IN sources/main.c ***
>#endif
*** CHANGE 338 IN sources/main.c TO 437 IN rlpsrc/main.c ***
< if (FRead(GIFfh, &GlobalColourTable[index], 1, 3) != 3) {
---------------
> if (FRead(GIFfh, (char *)&GlobalColourTable[index], 1, 3) != 3) {
*** APPEND AFTER 440 IN sources/main.c ***
>#ifdef RLP
> DateStamp(&EndTime);
>#else
*** APPEND AFTER 441 IN sources/main.c ***
>#endif
*** CHANGE 470 IN sources/main.c TO [573,577] IN rlpsrc/main.c ***
< Close(GIFfh);
---------------
>#ifdef RLP
> fclose(GIFfh);
>#else
> Close(GIFfh);
>#endif
*** APPEND AFTER 480 IN sources/main.c ***
>#ifdef RLP
> static struct FileInfoBlock fib; /* static for alignment */
>#else
*** APPEND AFTER 481 IN sources/main.c ***
>#endif
TO TRANSFORM sources/rgbdiff.c INTO rlpsrc/rgbdiff.c ...
*** CHANGE 29 IN sources/rgbdiff.c TO [29,35] IN rlpsrc/rgbdiff.c ***
< Intensity[r][g][b] = (int)(.299 * r + .587 * g + .114 * b);
---------------
>#ifdef RLP
> Intensity[r][g][b] = (UBYTE)
> ((19595 * r + 38470 * g + 7471 * b) >> 16);
>#else
> Intensity[r][g][b] = (int)
> (.299 * r + .587 * g + .114 * b);
>#endif
TO TRANSFORM sources/writeiff.c INTO rlpsrc/writeiff.c ...
*** DELETE [6,7] FROM sources/writeiff.c ***
<#include <iff/ILBM.h>
<#include <libraries/iffparse.h>
*** APPEND AFTER 8 IN sources/writeiff.c ***
>#ifdef RLP
>#include "iff/iff.h"
>#include "iff/ILBM.h"
>#else
>#include <iff/ILBM.h>
>#include <libraries/iffparse.h>
*** APPEND AFTER 10 IN sources/writeiff.c ***
>#endif
>
>#ifdef RLP /********************* IFF KLUDGE **************************/
> /* */
> /* I don't have IFFPARSE (I assume it is part of DOS 2.0). */
> /* I hacked these functions together so I would not have */
> /* to rewrite any of Wichura's code. */
> /* */
> /* I call routines in Electronic Arts' IFFW.C to simulate */
> /* the IFFPARSE calls. */
> /* */
> /* THIS IS ONLY A HACK! My routines should not be used as */
> /* the basis of any implementation of IFFPARSE. */
> /* */
> /***********************************************************/
>
>
>#define IFFF_WRITE 1
>#define IFFSIZE_UNKNOWN szNotYetKnown
>
>struct IFFHandle { /* WARNING! THIS IS ONLY A HACK!!! */
> BPTR iff_Stream;
> SHORT level;
> GroupContext Group;
> GroupContext Chunk;
> };
>
>struct IFFHandle *
>AllocIFF (void)
>{
> return (struct IFFHandle *) MyAlloc(sizeof(struct IFFHandle));
>}
>
>void FreeIFF (struct IFFHandle *iff)
>{
> MyFree ((BYTE *)iff);
>}
>
>void InitIFFasDOS (struct IFFHandle *iff)
>{
> /* I don't know what the heck this should do. */
>}
>
>LONG OpenIFF (struct IFFHandle *iff, LONG mode)
>{
> LONG iffp = IFF_OKAY;
> switch (mode)
> {
> case IFFF_WRITE:
> iffp = OpenWIFF (iff->iff_Stream, &iff->Group, IFFSIZE_UNKNOWN);
> CheckIFFP();
> break;
> default:
> break;
> }
> return iffp;
>}
>
>LONG CloseIFF (struct IFFHandle *iff)
>{
> return CloseWGroup (&iff->Group);
>}
>
>LONG WriteChunkBytes (struct IFFHandle *iff, APTR buf, LONG size)
>{
> LONG iffp = IFFWriteBytes (&iff->Chunk, (BYTE *) buf, size);
> return (iffp == IFF_OKAY) ? size : iffp;
>}
>
>LONG PushChunk (struct IFFHandle *iff, LONG GroupID, LONG ChunkID, LONG size)
>{
> LONG iffp;
> if (iff->level == 0)
> {
> iff->level++;
> iffp = PutCkHdr (&iff->Group, ChunkID, size);
> CheckIFFP();
> iffp = IFFWriteBytes (&iff->Group, (BYTE *) &GroupID, sizeof (ID));
> CheckIFFP();
> iffp = OpenWGroup (&iff->Group, &iff->Chunk);
> CheckIFFP();
> }
> else
> {
> iff->level++;
> iffp = PutCkHdr (&iff->Chunk, ChunkID, size);
> CheckIFFP();
> }
> return iffp;
>}
>
>LONG PopChunk (struct IFFHandle *iff)
>{
> LONG iffp;
> iff->level--;
> if (iff->level == 0)
> {
> iffp = CloseWGroup (&iff->Chunk);
> CheckIFFP();
> iffp = PutCkEnd (&iff->Group);
> CheckIFFP();
> }
> else
> {
> iffp = PutCkEnd (&iff->Chunk);
> CheckIFFP();
> }
> return iffp;
>}
>
>#endif /****************** END OF IFF KLUDGE ****************************/
>
*** APPEND AFTER 83 IN sources/writeiff.c ***
>#ifdef RLP
> DateStamp(&dat.dat_Stamp);
>#else
*** APPEND AFTER 84 IN sources/writeiff.c ***
>#endif
*** APPEND AFTER 91 IN sources/writeiff.c ***
>#ifdef RLP
> StamptoStr(&dat); /* use ARP function */
>#else
*** APPEND AFTER 92 IN sources/writeiff.c ***
>#endif