/*
 * OmniPlay v0.98
 * by David Champion
 *
 * temp-file name generator
 * modified from my Amiga port of SOX, the Sound Exchange
 * 01 Sep 92
 */

#include <exec/types.h>
#include <stdio.h>
#include "oplay.h"

/*
 * I used to use myname as the base for the temp file name,
 * but then I realized that it doesn't work if, e.g., you
 * call OmniPlay as "dh0:audio/c/oplay chuckachucka.pp" --
 * it tries to make a file called "t:dh0:o.XXXXXXXX" or
 * something.  Obviously, this is unfair.
 */
//extern char *myname;	/* myname MUST exist! */


char *tmpnam(char *s)
{
char *tmp1[B_tmpnam+1], *tmp2[64];
int i;

strncpy(tmp1, /*myname*/PROGNAME, B_tmpnam);
//sprintf(tmp2, "%s%s.%08x.%08x", P_tmpdir, tmp1, (ULONG)FindTask(NULL), (ULONG)time());
sprintf(tmp2, "%s%s.%08x", P_tmpdir, tmp1, (ULONG)FindTask(NULL));

strncpy(s, tmp2, L_tmpnam);

return(s);
}
