qform(width,fp,pagin,height,myfp)
int width;
FILE *fp;
char pagin;
FILE *myfp
	{
	int a,b,c,real,old;
	char aaa[140];
	int lines_printed = 0;
	
	strcpy(aaa,""); old=255;
	c=1; /* c is the current pos */
QTA:	old=real; a=getc(fp); real=a;
	if (a<=0) goto QTEND;
	
	if ( ((a==13)||(a==10)) && (old!=13) && (old!=10) ) a=32;
	if ( ((old==13)||(old==10)) && (isspace(real)) ) {
		fprintf(myfp,"\n");
		++lines_printed;
		lines_printed = checkpagin(lines_printed,pagin,height);
		c=1;
		}
	if (a>126) goto QTA;

	if (a>32) {
	if ( ((strlen(aaa)+c)>(width-5)) && (strlen(aaa)>(width-5)) )
		{ fprintf(myfp,"\n%s",aaa); c=strlen(aaa); aaa[0]=0;
		++lines_printed;
		lines_printed = checkpagin(lines_printed,pagin,height);
		}
	 b=strlen(aaa); aaa[b]=a; aaa[b+1]=0; }
	if (a==32) {
		if ((strlen(aaa)+c)>(width-5)) { 
			fprintf(myfp,"\n");
			c=1;
			++lines_printed;
			lines_printed = checkpagin(lines_printed,pagin,height);
			}
		fprintf(myfp,"%s ",aaa); ++c; c=c+strlen(aaa);
		strcpy(aaa,"");
		goto QTA;
		}
	if ((a==13)||(a==10)) {
		fprintf(myfp,"%s\n",aaa);
		c=1;
		++lines_printed;
		lines_printed = checkpagin(lines_printed,pagin,height);
		strcpy(aaa,"");
		goto QTA;
		}
	goto QTA;

QTEND:	fprintf(myfp,"\n");
	return(0);
}

