AM_PROG_LIBTOOL
AC_FUNC_ALLOCA
+AC_CHECK_FUNCS(realpath)
+
AC_CHECK_HEADERS(fnmatch.h,, AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file]))
AC_CHECK_FUNCS(fnmatch, res=yes, res=no)
}
/* check whether file_in exists */
+#ifdef HAVE_REALPATH
if (!realpath(file_in, rpath) || stat(rpath, &st) || !S_ISREG(st.st_mode))
+#else
+ if (stat(file_in, &st) || !S_ISREG(st.st_mode))
+#endif
{
fprintf(stderr, "%s: Error: file not found: %s.\n", progname, file_in);
main_help();
exit(-1);
}
+#ifdef HAVE_REALPATH
if (realpath(file_out, rpath2) && !strcmp (rpath, rpath2))
+#else
+ if (!strcmp (file_in, file_out))
+#endif
{
fprintf(stderr, "%s: Error: input file equals output file.\n", progname);
main_help();
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
-#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdarg.h>
size = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET);
- data = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
- if (data)
- {
+ data = malloc(size);
+ if (data && read(fd, data, size) == size)
parse(data, size);
- munmap(data, size);
- }
else
{
- fprintf(stderr, "%s: Error. cannot mmap file \"%s\" for input. %s\n",
+ fprintf(stderr, "%s: Error. cannot read file \"%s\". %s\n",
progname, file_in, strerror(errno));
exit(-1);
}
+ free(data);
close(fd);
}
#include "edje_main.h"
+#ifndef WIN32
typedef struct _Demo_Edje Demo_Edje;
struct _Demo_Edje
return 0;
}
+#else
+int main ()
+{
+ fprintf(stderr, "no workie on win32 yet\n");
+ return 0;
+}
+#endif