#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <alloc.h>

#define true (!false)
#define false 0
extern unsigned _stklen=2000;
extern unsigned _heaplen=4000;

main(int argc, char **argv)
{
	char fname[80],*s;
	char buff[80];
	int i;
	if (argc!=2) {
		printf("Usage:  WPGLE myfile\n");
		exit(1);
	}
	strcpy(fname,argv[1]);
	s = strchr(fname,'.');
	if (s!=NULL) *s = 0;
	sprintf(buff,"psgle %s /eps",fname); doit(buff);
	sprintf(buff,"dvigle %s ",fname); doit(buff);
	sprintf(buff,"dviprint -dwp -out %s ",fname); doit(buff);
}
doit(char *s)
{
	printf("> %s \n",s);
	system(s);
}
