git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1958003
)
implement maketmpname().
author
kramm
<kramm>
Mon, 27 May 2002 16:26:43 +0000
(16:26 +0000)
committer
kramm
<kramm>
Mon, 27 May 2002 16:26:43 +0000
(16:26 +0000)
pdf2swf/xpdf/gfile.cc
patch
|
blob
|
history
pdf2swf/xpdf/gfile.h
patch
|
blob
|
history
diff --git
a/pdf2swf/xpdf/gfile.cc
b/pdf2swf/xpdf/gfile.cc
index
d6d2363
..
1848908
100644
(file)
--- a/
pdf2swf/xpdf/gfile.cc
+++ b/
pdf2swf/xpdf/gfile.cc
@@
-9,6
+9,7
@@
//========================================================================
#include <aconf.h>
//========================================================================
#include <aconf.h>
+#include "../../config.h"
#ifdef WIN32
extern "C" {
#ifdef WIN32
extern "C" {
@@
-442,6
+443,23
@@
time_t getModTime(char *fileName) {
return statBuf.st_mtime;
#endif
}
return statBuf.st_mtime;
#endif
}
+
+static char tmpbuf[128];
+
+char* mktmpname(char*ptr) {
+ // used to be mktemp. This does remove the warnings, but
+ // It's not exactly an improvement.
+#ifdef HAVE_LRAND48
+ sprintf(tmpbuf, "/tmp/%08x%08x",lrand48(),lrand48());
+#else
+# ifdef HAVE_RAND
+ sprintf(tmpbuf, "/tmp/%08x%08x",rand(),rand());
+# else
+ sprintf(tmpbuf, "/tmp/%08x%08x",time(0),(unsigned int)tmpbuf);
+# endif
+#endif
+ return tmpbuf;
+}
GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
#if defined(WIN32)
GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
#if defined(WIN32)
diff --git
a/pdf2swf/xpdf/gfile.h
b/pdf2swf/xpdf/gfile.h
index
bb6131d
..
49b0b7a
100644
(file)
--- a/
pdf2swf/xpdf/gfile.h
+++ b/
pdf2swf/xpdf/gfile.h
@@
-135,4
+135,7
@@
private:
#endif
};
#endif
};
+/* create a temporary filename */
+char* mktmpname(char*ptr);
+
#endif
#endif