/*)BUILD
	$(TKBOPTIONS) = {
		STACK = 1500
		TASK = ...ROT
	}
*/
/*
 * rip everything out of an archive
 */
#include <stdio.h>

main (argc, argv)
int argc;
char **argv; {
	char inline [1000];
	char *inlp;
	FILE *inf;
	if (argc > 1) {
		printf ("Useage: %s <archive.arc\n\trips all files out\n");
		exit (0);
	}
	inf = NULL;
	while (gets (inline)) {
		if (strncmp (inline, "-h- ", 4)) {
			fputss (inline, inf);
		} else {
			if (inf)
				fclose (inf);
			inlp = index (inline, '\t');
			if (inlp)
				*inlp = EOS;
			inf = fopen (&inline [4], "w");
			if (!inf)
				printf ("%%Can't open %s, ignoring it\n",
					&inline [4]);
			else
				printf ("[Found %s]\n", &inline[4]);
		}
	}
	if (inf)
		fclose (inf);
}
