		if( !strcmp(graphtype,"tek4010") )
			return(TEK4010);
		else if( !strcmp(graphtype,"tek4012") )
			return(TEK4012);
		else if( !strcmp(graphtype,"tek4013") )
			return(TEK4013);
		else if( !strcmp(graphtype,"tek4014") )
			return(TEK4014);
		else if( !strcmp(graphtype,"graphon") )
			return(GRAPHON);
		else if( !strcmp(graphtype,"retrographics") )
			return(RETROGRAPHICS);
		else if( !strcmp(graphtype,"tek4105") )
			return(TEK4105);
		else if( !strcmp(graphtype,"tek4106") )
			return(TEK4106);
		else if( !strcmp(graphtype,"tek4107") )
			return(TEK4107);
		else if( !strcmp(graphtype,"tek4109") )
			return(TEK4109);
		else
			return(0);
	}
	return(VPLOT);
}
	

char *
gtypeof(ttyid)
	char *ttyid;
{
	static char typebuf[16];
	char buf[50];
	register FILE *f;
	register char *p, *t, *q;

	if (ttyid == NULL)
		return (UNKNOWN);
	f = fopen("/etc/ttygraphics", "r");
	if (f == NULL)
		return (UNKNOWN);
	/* split off end of name */
	for (p = q = ttyid; *p != 0; p++)
		if (*p == '/')
			q = p + 1;

	/* scan the file */
	while (fgets(buf, sizeof buf, f) != NULL)
	{
		for (t = buf; *t != ' ' && *t != '\t'; t++)
			;
		*t++ = 0;
		while (*t == ' ' || *t == '\t')
			t++;
		for (p = t; *p > ' '; p++)
			;
		*p = 0;
		if (strcmp(q,t) == 0)
		{
			strcpy(typebuf, buf);
			fclose(f);
			return (typebuf);
		}
	}
	fclose (f);
	return (UNKNOWN);
}
