echo shar: extracting "'init.c'" '(1259 characters)'
sed 's/^X//' << \SHAR_EOF > 'init.c'
X/* Copyright (c) 1986, Greg McGary */
Xstatic char sccsid[] = "@(#)init.c	1.1 86/10/09";
X
X#include	<id.h>
X#include	<string.h>
X#include	<stdio.h>
X#include	<extern.h>
X
XFILE *
XinitID(idFile, idhp, idArgs)
X	char		*idFile;
X	struct idhead	*idhp;
X	struct idarg	**idArgs;
X{
X	FILE		*idFILE;
X	register int	i;
X	register char	*strings;
X	register struct idarg	*idArg;
X
X	if ((idFILE = fopen(idFile, "r")) == NULL)
X		return NULL;
X
X	fseek(idFILE, 0L, 0);
X	fread(idhp, sizeof(struct idhead), 1, idFILE);
X	if (!strnequ(idhp->idh_magic, IDH_MAGIC, sizeof(idhp->idh_magic))) {
X		fprintf(stderr, "%s: Not an id file: `%s'\n", MyName, idFile);
X		exit(1);
X	}
X	if (idhp->idh_vers != IDH_VERS) {
X		fprintf(stderr, "%s: ID version mismatch (want: %d, got: %d)\n", MyName, IDH_VERS, idhp->idh_vers);
X		exit(1);
X	}
X
X	fseek(idFILE, idhp->idh_argo, 0);
X	strings = malloc(i = idhp->idh_namo - idhp->idh_argo);
X	fread(strings, i, 1, idFILE);
X	idArg = *idArgs = (struct idarg *)calloc(idhp->idh_pthc, sizeof(struct idarg));
X	for (i = 0; i < idhp->idh_argc; i++) {
X		if (*strings == '+' || *strings == '-')
X			goto skip;
X		idArg->ida_flags = (*strings) ? 0 : IDA_BLANK;
X		idArg->ida_arg = strings;
X		idArg->ida_next = idArg + 1;
X		idArg++;
X	skip:
X		while (*strings++)
X			;
X	}
X	return idFILE;
X}
SHAR_EOF
if test 1259 -ne "`wc -c < 'init.c'`"
then
	echo shar: error transmitting "'init.c'" '(should have been 1259 characters)'
fi
