Metropoli BBS
VIEWER: quadname.c MODE: TEXT (ASCII)
/*Copyright (C) 1992, 1994 by Thomas Glen Smith.  All Rights Reserved.*/
/* quadname APL2 V1.0.1 ************************************************
* Called from aplgrpsb to check a name for Q-type, e.g. Lio, Lct, etc. *
* and transform it from its internal format to printable.  If the name *
* isn't Q-type, it is returned as is.                                  *
*                                                                      *
* !!!! NOTE !!!!! This must be compiled without ASCII compatibility.   *
***********************************************************************/
#define INCLUDES APLCHDEF+STRING
#include "includes.h"
#define MAXNAME 6
char *quadname(name)
char *name;	/* Name to be checked. */
{
#include "quadext.h"
	Codechar;
	static char mybuf[MAXNAME];
	static int	av[]={APL_A, APL_V},
				ct[]={APL_C, APL_T},
				fc[]={APL_F, APL_C},
				io[]={APL_I, APL_O},
				lx[]={APL_L, APL_X},
				pp[]={APL_P, APL_P},
				rl[]={APL_R, APL_L},
				ts[]={APL_T, APL_S},
				tt[]={APL_T, APL_T},
				tz[]={APL_T, APL_Z};
	int *ip=NULL;

	if (1 == strlen(name))
		if		(0 == strcmp(name,quadav)) ip = av;
		else if	(0 == strcmp(name,quadct)) ip = ct;
		else if	(0 == strcmp(name,quadfc)) ip = fc;
		else if	(0 == strcmp(name,quadio)) ip = io;
		else if	(0 == strcmp(name,quadlx)) ip = lx;
		else if	(0 == strcmp(name,quadrl)) ip = rl;
		else if	(0 == strcmp(name,quadts)) ip = ts;
		else if	(0 == strcmp(name,quadtt)) ip = tt;
		else if	(0 == strcmp(name,quadtz)) ip = tz;
	if (ip == NULL)
		return(name); /* No change in name. */
	strcpy(mybuf,codechar(QUAD));
	strcpy(mybuf+strlen(mybuf),codechar(*ip));
	strcpy(mybuf+strlen(mybuf),codechar(*ip+1));
	return(mybuf);
}
[ RETURN TO DIRECTORY ]