macunpack now compiles, most warnings fixed.

This commit is contained in:
Will Nayes 2018-03-22 20:02:26 -05:00
parent 72ea2b578a
commit acb021e864
47 changed files with 37 additions and 53 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.o
macunpack/macunpack

0
macunpack/arc.h Executable file → Normal file
View File

1
macunpack/bin.c Executable file → Normal file
View File

@ -1,5 +1,6 @@
#include "macunpack.h"
#ifdef BIN
#include <string.h>
#include "globals.h"
#include "../fileio/machdr.h"
#include "../fileio/wrfile.h"

0
macunpack/bits_be.c Executable file → Normal file
View File

0
macunpack/bits_be.h Executable file → Normal file
View File

5
macunpack/cpt.c Executable file → Normal file
View File

@ -5,6 +5,7 @@
#endif /* CPT */
#endif /* DD */
#ifdef CPT
#include <stdlib.h>
#include "globals.h"
#include "cpt.h"
#include "crc.h"
@ -21,10 +22,6 @@
#define ESC1SEEN 1
#define ESC2SEEN 2
extern char *malloc();
extern char *realloc();
extern int free();
static void cpt_uncompact();
static unsigned char *cpt_data;
static unsigned long cpt_datamax;

4
macunpack/cpt.h Executable file → Normal file
View File

@ -40,7 +40,7 @@ typedef struct cptHdr { /* 8 bytes */
unsigned long hdrcrc; /* header crc */
unsigned short entries; /* number of index entries */
unsigned char commentsize; /* number of bytes comment that follow*/
};
} cptHdr;
typedef struct fileHdr { /* 78 bytes */
unsigned char fName[32]; /* a STR32 */
@ -61,7 +61,7 @@ typedef struct fileHdr { /* 78 bytes */
unsigned long dataLength;
unsigned long compRLength; /* compressed lengths */
unsigned long compDLength;
};
} fileHdr;
/* file format is:

Binary file not shown.

0
macunpack/crc.c Executable file → Normal file
View File

0
macunpack/crc.h Executable file → Normal file
View File

8
macunpack/dd.c Executable file → Normal file
View File

@ -1,5 +1,7 @@
#include "macunpack.h"
#ifdef DD
#include <stdlib.h>
#include <string.h>
#include "globals.h"
#include "dd.h"
#include "crc.h"
@ -9,10 +11,6 @@
#include "../util/masks.h"
#include "../util/util.h"
extern char *malloc();
extern char *realloc();
extern char *strcpy();
extern char *strncpy();
extern void cpt_wrfile1();
extern void core_compress();
extern void de_compress();
@ -48,7 +46,7 @@ static void dd_cpt_compat();
typedef struct methodinfo {
char *name;
int number;
};
} methodinfo;
static struct methodinfo methods[] = {
{"NoComp", nocomp},

4
macunpack/dd.h Executable file → Normal file
View File

@ -71,7 +71,7 @@ typedef struct fileHdr { /* 124 bytes */
unsigned short datacrc; /* checksum */
unsigned short rsrccrc;
unsigned short hdrcrc; /* true crc */
};
} fileHdr;
typedef struct fileCHdr { /* 84 bytes */
unsigned char magic[4]; /* "\253\315\000\124" */
@ -101,7 +101,7 @@ typedef struct fileCHdr { /* 84 bytes */
unsigned short datacrc2; /* other checksum */
unsigned short rsrccrc2;
unsigned short hdrcrc; /* true crc */
};
} fileCHdr;
#define DD_FILE 0
#define DD_COPY 1

0
macunpack/de_compress.c Executable file → Normal file
View File

0
macunpack/de_huffman.c Executable file → Normal file
View File

0
macunpack/de_lzah.c Executable file → Normal file
View File

0
macunpack/de_lzh.c Executable file → Normal file
View File

5
macunpack/dia.c Executable file → Normal file
View File

@ -1,5 +1,7 @@
#include "macunpack.h"
#ifdef DIA
#include <stdlib.h>
#include <string.h>
#include "globals.h"
#include "dia.h"
#include "../util/curtime.h"
@ -9,9 +11,6 @@
#include "../fileio/kind.h"
#include "../util/util.h"
extern char *malloc();
extern char *realloc();
static unsigned char *dia_archive;
static int dia_archive_size;
static int dia_max_archive_size;

0
macunpack/dia.h Executable file → Normal file
View File

Binary file not shown.

4
macunpack/dir.c Executable file → Normal file
View File

@ -1,12 +1,10 @@
#include <stdlib.h>
#include "globals.h"
#include "../fileio/machdr.h"
#include "../fileio/wrfile.h"
#include "../util/util.h"
#include "../util/masks.h"
extern char *malloc();
extern char *realloc();
static char *dir_stack;
static int dir_ptr = -64;
static int dir_max;

Binary file not shown.

0
macunpack/globals.c Executable file → Normal file
View File

0
macunpack/globals.h Executable file → Normal file
View File

0
macunpack/huffman.h Executable file → Normal file
View File

0
macunpack/jdw.c Executable file → Normal file
View File

2
macunpack/jdw.h Executable file → Normal file
View File

@ -19,5 +19,5 @@ typedef struct fileHdr {
unsigned long mtime;
char flength;
char fname[32]; /* actually flength */
};
} fileHdr;

1
macunpack/lzc.c Executable file → Normal file
View File

@ -1,5 +1,6 @@
#include "macunpack.h"
#ifdef LZC
#include <string.h>
#include "globals.h"
#include "lzc.h"
#include "../util/util.h"

3
macunpack/lzc.h Executable file → Normal file
View File

@ -25,5 +25,4 @@ typedef struct fileHdr {
unsigned long fileauth;
unsigned long flag1;
unsigned long flag2;
};
} fileHdr;

11
macunpack/lzh.c Executable file → Normal file
View File

@ -1,5 +1,6 @@
#include "macunpack.h"
#ifdef LZH
#include <stdlib.h>
#include <string.h>
#include "globals.h"
#include "lzh.h"
#include "crc.h"
@ -17,8 +18,6 @@
#define LZSMASK 4095
#define LZBUFFSIZE 8192 /* Max of above buffsizes */
extern char *malloc();
extern char *realloc();
extern void de_lzah();
extern unsigned char (*lzah_getbyte)();
extern void de_lzh();
@ -26,7 +25,7 @@ extern void de_lzh();
typedef struct methodinfo {
char *name;
int number;
};
} methodinfo;
static struct methodinfo methods[] = {
{"-lh0-", lh0},
@ -770,7 +769,3 @@ unsigned long obytes;
de_lzh((long)(-1), (long)obytes, &lzh_current, 13);
out_ptr = tmp_out_ptr;
}
#else /* LZH */
int lzh; /* keep lint and some compilers happy */
#endif /* LZH */

10
macunpack/lzh.h Executable file → Normal file
View File

@ -45,7 +45,7 @@ typedef struct fileHdr { /* 58 bytes */
unsigned char extendsize;
char *extend;
char *data;
};
} fileHdr;
/* Currently known methods: */
#define lh0 0
@ -57,11 +57,3 @@ typedef struct fileHdr { /* 58 bytes */
#define lz4 6
#define lz5 7
#define lzs 8
extern char *lzh_pointer;
extern char *lzh_data;
extern char *lzh_finfo;
extern int lzh_fsize;
extern int lzh_kind;
extern char *lzh_file;

1
macunpack/macbinary.c Executable file → Normal file
View File

@ -1,4 +1,5 @@
#include "macunpack.h"
#include <string.h>
#include "globals.h"
#include "../fileio/machdr.h"
#include "../fileio/wrfile.h"

1
macunpack/macunpack.c Executable file → Normal file
View File

@ -1,4 +1,5 @@
#include "macunpack.h"
#include <unistd.h>
#include "globals.h"
#include "../util/patchlevel.h"
#include "../fileio/wrfile.h"

0
macunpack/macunpack.h Executable file → Normal file
View File

Binary file not shown.

4
macunpack/makefile Executable file → Normal file
View File

@ -77,10 +77,10 @@ lint:
lint $(CF) $(LFLAGS) $(SRCS) $(XSRCS) $(CRCS)
clean:
-rm -f *.o
rm -f *.o
clobber:clean
-rm -f macunpack
rm -f macunpack
macunpack.o: macunpack.h
macunpack.o: globals.h

0
macunpack/mcb.c Executable file → Normal file
View File

1
macunpack/pit.c Executable file → Normal file
View File

@ -1,5 +1,6 @@
#include "macunpack.h"
#ifdef PIT
#include <string.h>
#include "../fileio/wrfile.h"
#include "../fileio/fileglob.h"
#include "../fileio/kind.h"

0
macunpack/pit.h Executable file → Normal file
View File

3
macunpack/sit.c Executable file → Normal file
View File

@ -1,5 +1,6 @@
#include "macunpack.h"
#ifdef SIT
#include <string.h>
#include "globals.h"
#include "sit.h"
#include "crc.h"
@ -22,7 +23,7 @@ extern unsigned char (*lzah_getbyte)();
typedef struct methodinfo {
char *name;
int number;
};
} methodinfo;
static struct methodinfo methods[] = {
{"NoComp", nocomp},

6
macunpack/sit.h Executable file → Normal file
View File

@ -32,7 +32,7 @@ typedef struct sitHdr { /* 22 bytes */
OSType signature2; /* = 'rLau' -- for verification */
unsigned char version; /* version number */
char reserved[7];
};
} sitHdr;
typedef struct fileHdr { /* 112 bytes */
unsigned char compRMethod; /* rsrc fork compression method */
@ -53,8 +53,7 @@ typedef struct fileHdr { /* 112 bytes */
unsigned short dataCRC; /* crc of data fork */
char reserved[6];
unsigned short hdrCRC; /* crc of file header */
};
} fileHdr;
/* file format is:
sitArchiveHdr
@ -92,4 +91,3 @@ typedef struct fileHdr { /* 112 bytes */
/* all other numbers are reserved */
#define ESC 0x90 /* repeat packing escape */

1
macunpack/stf.c Executable file → Normal file
View File

@ -1,5 +1,6 @@
#include "macunpack.h"
#ifdef STF
#include <string.h>
#include "stf.h"
#include "globals.h"
#include "huffman.h"

3
macunpack/stf.h Executable file → Normal file
View File

@ -11,5 +11,4 @@ typedef struct fileHdr {
char fname[32]; /* actually flength */
unsigned long rsrcLength;
unsigned long dataLength;
};
} fileHdr;

4
macunpack/zma.c Executable file → Normal file
View File

@ -1,5 +1,7 @@
#include "macunpack.h"
#ifdef ZMA
#include <stdlib.h>
#include <string.h>
#include "globals.h"
#include "zma.h"
#include "crc.h"
@ -9,8 +11,6 @@
#include "../util/masks.h"
#include "../util/util.h"
extern char *malloc();
extern char *realloc();
extern void de_lzh();
/* We do allow for possible backpointing, so we allocate the archive in core */

2
macunpack/zma.h Executable file → Normal file
View File

@ -42,7 +42,7 @@ typedef struct fileHdr { /* 78 bytes */
unsigned char fName[32]; /* a STR32 */
/* The following are overlayed in the original structure */
unsigned long conts; /* Pointer to directory contents */
};
} fileHdr;
/* zma types (see what) */
#define z_noth 0 /* ??? */

Binary file not shown.

0
macunpack/zmahdr.h Executable file → Normal file
View File

View File

@ -1,5 +1,4 @@
SHELL = /bin/sh
BINDIR = /ufs/dik/tmpbin
BINDIR = bin
# Use the following flags on the CF macro definition as needed.
#
# -DBSD if you are on a BSD system