#include "../sccshead/sfile.h"
#include "../sccshead/sint.h"

char auxf__[] "~|^`auxf.c:	3.3";
/*
	Figures out names for g-file, l-file, x-file, etc.

	File	Module	g-file	l-file	x-file & rest

	a/s.m	m	m	l.m	a/x.m

	`File' in above chart is `pkt->Pfile'.  Second argument
	is letter; 0 means module name is wanted.
*/

auxf(pkt,ch)
register struct Packet *pkt;
register char ch;
{
	static char auxfile[50];
	register char *snp;

	snp = sname(pkt->Pfile);
	if (!same(snp,"s.",2))
		fatal("not an SCCS file (301)");

	switch(ch) {

	case 0:
	case 'g':	copy(&snp[2],auxfile);
			break;

	case 'l':	copy(snp,auxfile);
			auxfile[0] = 'l';
			break;

	default:
			copy(pkt->Pfile,auxfile);
			auxfile[snp-pkt->Pfile] = ch;
	}
	return(auxfile);
}
