Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/goo/gfile.h
diff options
context:
space:
mode:
Diffstat (limited to 'pdf/goo/gfile.h')
-rw-r--r--pdf/goo/gfile.h29
1 files changed, 23 insertions, 6 deletions
diff --git a/pdf/goo/gfile.h b/pdf/goo/gfile.h
index bb4dbe0..38b9998 100644
--- a/pdf/goo/gfile.h
+++ b/pdf/goo/gfile.h
@@ -11,16 +11,20 @@
#ifndef GFILE_H
#define GFILE_H
-extern "C" {
+#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
+extern "C" {
#if defined(WIN32)
-# ifdef _MSC_VER
-# include <windows.h>
+# include <sys/stat.h>
+# ifdef FPTEX
+# include <win32lib.h>
# else
-# include <kpathsea/win32lib.h>
+# include <windows.h>
# endif
#elif defined(ACORN)
+#elif defined(MACOS)
+# include <ctime.h>
#else
# include <unistd.h>
# include <sys/types.h>
@@ -28,10 +32,10 @@ extern "C" {
# include "vms_dirent.h"
# elif HAVE_DIRENT_H
# include <dirent.h>
-# define NAMLEN(dirent) strlen((dirent)->d_name)
+# define NAMLEN(d) strlen((d)->d_name)
# else
# define dirent direct
-# define NAMLEN(dirent) (dirent)->d_namlen
+# define NAMLEN(d) (d)->d_namlen
# if HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif
@@ -71,6 +75,18 @@ extern GBool isAbsolutePath(char *path);
// relative) or prepending user's directory (if path starts with '~').
GString *makePathAbsolute(GString *path);
+// Get the modification time for <fileName>. Returns 0 if there is an
+// error.
+time_t getModTime(char *fileName);
+
+// Create a temporary file and open it for writing. If <ext> is not
+// NULL, it will be used as the file name extension. Returns both the
+// name and the file pointer. For security reasons, all writing
+// should be done to the returned file pointer; the file may be
+// reopened later for reading, but not for writing. The <mode> string
+// should be "w" or "wb". Returns true on success.
+GBool openTempFile(GString **name, FILE **f, char *mode, char *ext);
+
//------------------------------------------------------------------------
// GDir and GDirEntry
//------------------------------------------------------------------------
@@ -105,6 +121,7 @@ private:
WIN32_FIND_DATA ffd;
HANDLE hnd;
#elif defined(ACORN)
+#elif defined(MACOS)
#else
DIR *dir; // the DIR structure from opendir()
#ifdef VMS