#endif
#include "sysdep.h"
+#include <stdlib.h>
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
}
+/*
+ * Citadelian replacement for tmpnam()
+ */
+char *CtdlTempFileName(char *prefix1, int prefix2) {
+ static int seq = 0;
+ static char buf[SIZ];
+
+ sprintf(buf, "/tmp/Citadel-%s-%d-%04x-%04x",
+ prefix1,
+ prefix2,
+ (int)getpid(),
+ ++seq
+ );
+
+ return(buf);
+}
+
+
+/*
+ * Citadelian replacement for tmpfile()
+ */
+FILE *CtdlTempFile(void) {
+ char filename[SIZ];
+ FILE *fp;
+
+ strcpy(filename, tmpnam(NULL));
+ fp = fopen(filename, "w+b");
+ unlink(filename);
+ return(fp);
+}