#include "uucp.h"
#include "uudefs.h"
#include "uuconf.h"
#include "system.h"
#include "sysdep.h"
#define ZDIGS \
"0123456789abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-"
#define CDIGS (sizeof ZDIGS - 1)
char *
zstemp_file (qsys)
const struct uuconf_system *qsys ATTRIBUTE_UNUSED;
{
static unsigned int icount;
const char *const zdigs = ZDIGS;
char ab[14];
pid_t ime;
int iset;
ab[0] = 'T';
ab[1] = 'M';
ab[2] = '.';
ime = getpid ();
iset = 3;
while (ime > 0 && iset < 10)
{
ab[iset] = zdigs[ime % CDIGS];
ime /= CDIGS;
++iset;
}
ab[iset] = '.';
++iset;
ab[iset] = zdigs[icount / CDIGS];
++iset;
ab[iset] = zdigs[icount % CDIGS];
++iset;
ab[iset] = '\0';
++icount;
if (icount >= CDIGS * CDIGS)
icount = 0;
#if SPOOLDIR_V2 || SPOOLDIR_BSD42
return zbufcpy (ab);
#endif
#if SPOOLDIR_BSD43 || SPOOLDIR_ULTRIX || SPOOLDIR_TAYLOR
return zsysdep_in_dir (".Temp", ab);
#endif
#if SPOOLDIR_HDB || SPOOLDIR_SVR4
return zsysdep_in_dir (qsys->uuconf_zname, ab);
#endif
}