* Boston, MA 02111-1307, USA.
*/
+#include "config.h"
+
#include "glib.h"
#include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
+#ifdef G_OS_WIN32
+#include <io.h>
+#ifndef F_OK
+#define F_OK 0
+#define X_OK 1
+#define W_OK 2
+#define R_OK 4
+#endif /* !F_OK */
+
+#ifndef S_ISREG
+#define S_ISREG(mode) ((mode)&_S_IFREG)
+#endif
+
+#ifndef S_ISDIR
+#define S_ISDIR(mode) ((mode)&_S_IFDIR)
+#endif
+
+#endif /* G_OS_WIN32 */
+
+#ifndef S_ISLNK
+#define S_ISLNK(x) 0
+#endif
#define _(x) x
return TRUE;
}
+#ifndef G_OS_WIN32
+
static gboolean
get_contents_regfile (const gchar *filename,
struct stat *stat_buf,
}
}
-#ifdef G_OS_WIN32
+#else /* G_OS_WIN32 */
+
static gboolean
get_contents_win32 (const gchar *filename,
gchar **contents,
return get_contents_stdio (filename, f, contents, length, error);
}
+
#endif
/**
return get_contents_posix (filename, contents, length, error);
#endif
}
-