This is tmpnam.c in view mode; [Download] [Up]
#include <stdio.h>
char *msql_tmpnam(baseName)
char *baseName;
{
char *buf;
static int nr = 0;
nr++;
if (nr == 9999999)
nr == 1;
if (baseName) {
buf = (char *)malloc(21+ strlen(baseName));
} else {
baseName = (char *)malloc(4);
sprintf(baseName,"msql");
buf = (char *)malloc(25);
free(baseName);
}
sprintf(buf, "/tmp/%s.%07d.%07d", baseName, nr, getpid());
return buf;
}
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.