home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
545b.lha
/
T3E
/
t3e.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-06
|
2KB
|
61 lines
struct FileHandle *fi,*fo,*Open();
LONG l,hl,Read(),Seek();
UBYTE *buf,*AllocMem();
UWORD hunkdat[]={
/* 0 1 2 3 4 5 6 7 */
0x0000,0x03F3,0x0000,0x0000,0x0000,0x0001,0x0000,0x0000,/* 0 */
0x0000,0x0000,0x0000,0x0010,0x0000,0x03E9,0x0000,0x0010,/* 1 */
0x43FA,0x002c,0x2C78,0x0004,0x4EAE,0xFDD8,0x2C40,0x4EAE,/* 2 */
0xFFC4,0x2200,0x41FA,0x0024,0x2618,0x2408,0x4EAE,0xFFD0,/* 3 */
0x224E,0x2C78,0x0004,0x4EAE,0xFE62,0x7000,0x4E75,0x646F,/* 4 */
0x732E,0x6C69,0x6272,0x6172,0x7900, /* 5 */
0x0000,0x03F2}; /* 5 */
main(argc,argv)
char *argv[];
{
int t;
if (argc!=3) PrintF("Usage: %s <IN> <OUT>\n",argv[0]);
else {
if (!(fi=Open(argv[1],MODE_OLDFILE))) {
PrintF("Couldn't open input-file\n");
exit(0L);
}
Seek(fi,0L,OFFSET_END);
l=Seek(fi,0L,OFFSET_BEGINNING);
if (l<1L) {
PrintF("Input-file empty !?\n");
Close(fi);
Close(fo);
exit(0L);
}
if (!(fo=Open(argv[2],MODE_NEWFILE))) {
PrintF("Couldn't open output-file\n");
Close(fi);
exit(0L);
}
Write(fo,hunkdat,20L);
hl=16L+((l+1)>>2);
Write(fo,&hl,4L);
Write(fo,&(hunkdat[014]),4L);
Write(fo,&hl,4L);
Write(fo,&(hunkdat[020]),58L);
Write(fo,&l,4L);
hl=((l+1)&0xFFFFFFFCL)+2L;
if (!(buf=AllocMem(hl,MEMF_CLEAR))) {
PrintF("Not enough memory to read file!\n");
Close(fi);
Close(fo);
exit(0L);
}
Read(fi,buf,l);
Write(fo,buf,hl);
Write(fo,&(hunkdat[055]),4L);
Close(fi);
Close(fo);
}
exit(0L);
}