AC_CHECK_HEADER(zlib.h,, AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
AC_CHECK_HEADER(jpeglib.h,, AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
+AC_CHECK_HEADERS(netinet/in.h)
+
dnl These are needed for fmemopen/open_memstream
AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
AC_DEFINE(__USE_GNU, , [Enable GNU extensions])
-AC_CHECK_FUNCS(fmemopen)
-AC_CHECK_FUNCS(open_memstream)
+AC_CHECK_FUNCS(fmemopen open_memstream realpath)
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
void pak_dir(Eet_File *ef, char *dir, char **noz, int noz_num);
void pack(char *pak_file, char **files, int count, char **noz, int noz_num);
-static mode_t default_mode =
-S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
-
int
eet_mkdir(char *dir)
{
+#ifdef __MINGW32__
+ if (mkdir(dir) < 0) return 0;
+#else
+ mode_t default_mode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP
+ | S_IROTH | S_IXOTH;
+
if (mkdir(dir, default_mode) < 0) return 0;
+#endif
+
return 1;
}
#ifndef _EET_PRIVATE_H
#define _EET_PRIVATE_H
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <fcntl.h>
+
+#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
+#elif __MINGW32__
+#include <winsock.h>
+#endif
+
#include <zlib.h>
#include <string.h>
#include <fnmatch.h>
char buf[PATH_MAX];
if (!file) return NULL;
+
+#ifdef HAVE_REALPATH
/* in case this is a symlink... find out where it REALLY points */
if (!realpath(file, buf))
{
if (mode == EET_FILE_MODE_READ) return NULL;
}
+#else
+ strncpy(buf, file, sizeof(buf));
+ buf[sizeof(buf) - 1] = 0;
+#endif
/* find the current file handle in cache*/
ef = NULL;