Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# On Mac OSX gcc is required as clang complains bitterly about the old style
# C delarations used.

# FIXME: parallel build doesn't work due to doc.inl

CC=gcc
Expand All @@ -12,10 +9,16 @@ HOSTCC ?= $(CC)
YACC=bison -y
# Is there a YACCFLAGS?

.PHONY: all clean
INSTALL_PREFIX = /usr/local

.PHONY: all clean install

all: zmac zmac.1.gz

install: zmac zmac.1
install -m 755 zmac $(INSTALL_PREFIX)/bin/zmac
install -m 644 zmac.1 $(INSTALL_PREFIX)/man/man1/zmac.1

zmac: doc.inl $(DEP)
$(CC) -Wall $(CFLAGS) -o zmac $(DEP)

Expand Down
28 changes: 7 additions & 21 deletions src/mio.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ static unsigned char *mptr; /* pointer to current position */
static unsigned int msize; /* size of chunk mhead points to */

FILE *
mfopen(filename,mode)
char *filename,*mode;
mfopen(char *filename, char *mode)
{
if ((mhead = malloc(MALLOC_SIZE)) == 0) {
msize = 0;
Expand All @@ -30,8 +29,7 @@ char *filename,*mode;
}

int
mfclose(f)
FILE *f;
mfclose(FILE *f)
{
if (mhead) {
free(mhead);
Expand All @@ -42,9 +40,7 @@ FILE *f;
}

unsigned int
mfputc(c,f)
unsigned int c;
FILE *f;
mfputc(unsigned int c,FILE *f)
{
register unsigned char *p;
while (mptr >= mhead + msize) {
Expand All @@ -64,8 +60,7 @@ register unsigned char *p;
}

unsigned int
mfgetc(f)
FILE *f;
mfgetc(FILE *f)
{
if (mptr >= mend) /* no characters left */
return (-1);
Expand All @@ -74,10 +69,7 @@ FILE *f;
}

int
mfseek(f,loc,origin)
FILE *f;
long loc;
int origin;
mfseek(FILE *f, long loc, int origin)
{
if (origin != 0) {
fputs("mseek() only implemented with 0 origin",stderr);
Expand All @@ -88,10 +80,7 @@ int origin;
}

int
mfread(ptr, size, nitems,f)
char *ptr;
unsigned int size, nitems;
FILE *f;
mfread(char *ptr, unsigned int size, unsigned int nitems, FILE *f)
{
register unsigned int i = 0;
while (i < nitems) {
Expand All @@ -106,10 +95,7 @@ register unsigned int i = 0;
}

int
mfwrite(ptr, size, nitems, f)
char *ptr;
int size, nitems;
FILE *f;
mfwrite(char *ptr, int size, int nitems, FILE *f)
{
register int i = 0;
register unsigned char *p;
Expand Down
4 changes: 2 additions & 2 deletions src/zmac.y
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ void putout(int value);
int outrec;
int outlen;
unsigned char outbuf[1024 * 1024];
void bookmark();
void bookmark(int);
void listfrombookmark();


Expand Down Expand Up @@ -5925,7 +5925,7 @@ int nextchar()
{
int c, ch;
unsigned char *p;
char *getlocal();
char *getlocal(int, int);

if (peekc != NOPEEK) {
c = peekc;
Expand Down