* fix compilation on Windows XP (not sure that Windows CE port is needed...)
note that, as ecore_exe is not available on Windows, some code have
been disables for that platform in src/lib/efreet_desktop.c. Also, a new Evil
version should be used (not in svn yet)
The compilation on Windows is needed for Ewl (icon and mime)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/efreet@40257
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
24 files changed:
AC_SUBST(efreet_mime_release_info)
AC_SUBST(efreet_trash_release_info)
AC_SUBST(efreet_mime_release_info)
AC_SUBST(efreet_trash_release_info)
+PKG_PROG_PKG_CONFIG
+
+EFL_EFREET_BUILD=""
+EFL_EFREET_MIME_BUILD=""
+EFL_EFREET_TRASH_BUILD=""
+win32_libs=""
+case "$host_os" in
+ mingw* | cegcc*)
+ PKG_CHECK_MODULES([EVIL], [evil])
+ AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
+ EFL_EFREET_BUILD="-DEFL_EFREET_BUILD"
+ EFL_EFREET_MIME_BUILD="-DEFL_EFREET_MIME_BUILD"
+ EFL_EFREET_TRASH_BUILD="-DEFL_EFREET_TRASH_BUILD"
+ win32_libs="-lws2_32"
+ ;;
+esac
+AC_SUBST(EFL_EFREET_BUILD)
+AC_SUBST(EFL_EFREET_MIME_BUILD)
+AC_SUBST(EFL_EFREET_TRASH_BUILD)
+AC_SUBST(win32_libs)
+
+AC_CHECK_HEADERS([arpa/inet.h])
+
PKG_CHECK_MODULES(EFREET, [eina-0 ecore >= 0.9.9 ecore-file >= 0.9.9])
PKG_CHECK_MODULES(EINA, [eina-0])
PKG_CHECK_MODULES(EFREET, [eina-0 ecore >= 0.9.9 ecore-file >= 0.9.9])
PKG_CHECK_MODULES(EINA, [eina-0])
* @li Trash Specification
*/
* @li Trash Specification
*/
-#ifdef _MSC_VER
-# ifdef BUILDING_DLL
-# define EAPI __declspec(dllexport)
+
+#ifdef _WIN32
+# ifdef EFL_EFREET_BUILD
+# ifdef DLL_EXPORT
+# define EAPI __declspec(dllexport)
+# else
+# define EAPI
+# endif /* ! DLL_EXPORT */
# else
# define EAPI __declspec(dllimport)
# else
# define EAPI __declspec(dllimport)
+# endif /* ! EFL_EFREET_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
-#ifdef _MSC_VER
-# ifdef BUILDING_DLL
-# define EAPI __declspec(dllexport)
+
+#ifdef _WIN32
+# ifdef EFL_EFREET_MIME_BUILD
+# ifdef DLL_EXPORT
+# define EAPI __declspec(dllexport)
+# else
+# define EAPI
+# endif /* ! DLL_EXPORT */
# else
# define EAPI __declspec(dllimport)
# else
# define EAPI __declspec(dllimport)
+# endif /* ! EFL_EFREET_MIME_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
#define EFREET_TRASH_H
#ifdef EAPI
#define EFREET_TRASH_H
#ifdef EAPI
-#ifdef _MSC_VER
-# ifdef BUILDING_DLL
-# define EAPI __declspec(dllexport)
+
+#ifdef _WIN32
+# ifdef EFL_EFREET_TRASH_BUILD
+# ifdef DLL_EXPORT
+# define EAPI __declspec(dllexport)
+# else
+# define EAPI
+# endif /* ! DLL_EXPORT */
# else
# define EAPI __declspec(dllimport)
# else
# define EAPI __declspec(dllimport)
+# endif /* ! EFL_EFREET_TRASH_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
MAINTAINERCLEANFILES = Makefile.in
MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = \
--I$(top_builddir) \
--I$(top_srcdir) \
-@EFREET_CFLAGS@
-
lib_LTLIBRARIES = libefreet.la libefreet_mime.la libefreet_trash.la
EFREETHEADERS = \
lib_LTLIBRARIES = libefreet.la libefreet_mime.la libefreet_trash.la
EFREETHEADERS = \
libefreet_la_SOURCES = \
$(EFREETSOURCES)
libefreet_la_SOURCES = \
$(EFREETSOURCES)
+libefreet_la_CPPFLAGS = \
+-I$(top_builddir) \
+-I$(top_srcdir) \
+@EFL_EFREET_BUILD@ \
+@EFREET_CFLAGS@
+libefreet_la_LIBADD = @EFREET_LIBS@ @win32_libs@
+libefreet_la_LDFLAGS = -no-undefined -version-info @version_info@ @efreet_release_info@
EFREETMIMEHEADERS = \
Efreet_Mime.h
EFREETMIMEHEADERS = \
Efreet_Mime.h
libefreet_mime_la_SOURCES = \
$(EFREETMIMESOURCES)
libefreet_mime_la_SOURCES = \
$(EFREETMIMESOURCES)
+libefreet_mime_la_CPPFLAGS = \
+-I$(top_builddir) \
+-I$(top_srcdir) \
+@EFL_EFREET_MIME_BUILD@ \
+@EFREET_CFLAGS@
libefreet_trash_la_SOURCES = \
$(EFREETTRASHSOURCES)
libefreet_trash_la_SOURCES = \
$(EFREETTRASHSOURCES)
+libefreet_trash_la_CPPFLAGS = \
+-I$(top_builddir) \
+-I$(top_srcdir) \
+@EFL_EFREET_TRASH_BUILD@ \
+@EFREET_CFLAGS@
installed_headersdir = $(prefix)/include/efreet
installed_headers_DATA = $(EFREETHEADERS) $(EFREETMIMEHEADERS) $(EFREETTRASHHEADERS)
installed_headersdir = $(prefix)/include/efreet
installed_headers_DATA = $(EFREETHEADERS) $(EFREETMIMEHEADERS) $(EFREETTRASHHEADERS)
-libefreet_la_LIBADD = @EFREET_LIBS@
-libefreet_la_LDFLAGS = -version-info @version_info@ @efreet_release_info@
-
-libefreet_mime_la_LDFLAGS = -version-info @version_info@ @efreet_mime_release_info@
-libefreet_trash_la_LDFLAGS = -version-info @version_info@ @efreet_trash_release_info@
+libefreet_mime_la_LDFLAGS = -no-undefined -version-info @version_info@ @efreet_mime_release_info@
+libefreet_trash_la_LDFLAGS = -no-undefined -version-info @version_info@ @efreet_trash_release_info@
-libefreet_mime_la_LIBADD = @EFREET_LIBS@ libefreet.la
+libefreet_mime_la_LIBADD = @EFREET_LIBS@ libefreet.la @win32_libs@
libefreet_trash_la_LIBADD = @EFREET_LIBS@ libefreet.la
libefreet_trash_la_LIBADD = @EFREET_LIBS@ libefreet.la
/* vim: set sw=4 ts=4 sts=4 et: */
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <string.h>
+
+#include <Ecore_Str.h>
+
#include "Efreet.h"
#include "efreet_private.h"
#include "Efreet.h"
#include "efreet_private.h"
static int init = 0;
static int efreet_parsed_locale = 0;
static int init = 0;
static int efreet_parsed_locale = 0;
/* vim: set sw=4 ts=4 sts=4 et: */
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+
#include "Efreet.h"
#include "efreet_private.h"
#include "Efreet.h"
#include "efreet_private.h"
EAPI const char *efreet_data_home_get(void);
EAPI Eina_List *efreet_data_dirs_get(void);
EAPI const char *efreet_data_home_get(void);
EAPI Eina_List *efreet_data_dirs_get(void);
/* vim: set sw=4 ts=4 sts=4 et: */
/* vim: set sw=4 ts=4 sts=4 et: */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+
#include "Efreet.h"
#include "efreet_private.h"
#include "Efreet.h"
#include "efreet_private.h"
/* vim: set sw=4 ts=4 sts=4 et: */
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#ifdef _WIN32
+# include <winsock2.h>
+#endif
+
+#include <Ecore_Str.h>
+#include <Ecore_File.h>
+
#include "Efreet.h"
#include "efreet_private.h"
#include "Efreet.h"
#include "efreet_private.h"
efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop __UNUSED__,
char *exec, int remaining __UNUSED__)
{
efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop __UNUSED__,
char *exec, int remaining __UNUSED__)
{
ecore_exe_run(exec, data);
free(exec);
ecore_exe_run(exec, data);
free(exec);
EAPI extern int EFREET_DESKTOP_TYPE_APPLICATION;
EAPI extern int EFREET_DESKTOP_TYPE_LINK;
EAPI extern int EFREET_DESKTOP_TYPE_DIRECTORY;
EAPI extern int EFREET_DESKTOP_TYPE_APPLICATION;
EAPI extern int EFREET_DESKTOP_TYPE_LINK;
EAPI extern int EFREET_DESKTOP_TYPE_DIRECTORY;
/* vim: set sw=4 ts=4 sts=4 et: */
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <limits.h>
+
+#include <Ecore.h>
+#include <Ecore_Str.h>
+#include <Ecore_File.h>
+
#include "Efreet.h"
#include "efreet_private.h"
#include "Efreet.h"
#include "efreet_private.h"
/**
* The possible contexts for an icon directory
*/
/**
* The possible contexts for an icon directory
*/
/* vim: set sw=4 ts=4 sts=4 et: */
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <sys/mman.h>
+
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#elif defined __GNUC__
+# define alloca __builtin_alloca
+#elif defined _AIX
+# define alloca __alloca
+#elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+#else
+# include <stddef.h>
+# ifdef __cplusplus
+extern "C"
+# endif
+void *alloca (size_t);
+#endif
+
#include "Efreet.h"
#include "efreet_private.h"
#include "Efreet.h"
#include "efreet_private.h"
/* vim: set sw=4 ts=4 sts=4 et: */
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <dirent.h>
+
+#include <Ecore_Str.h>
+#include <Ecore_File.h>
+
#include "Efreet.h"
#include "efreet_private.h"
#include "Efreet.h"
#include "efreet_private.h"
/**
* The type of entry
*/
/**
* The type of entry
*/
/* vim: set sw=4 ts=4 sts=4 et: */
/* vim: set sw=4 ts=4 sts=4 et: */
-#include <Efreet.h>
-#include <Efreet_Mime.h>
-#include "efreet_private.h"
-#include <arpa/inet.h>
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <fnmatch.h>
+
+#ifdef _WIN32
+# include <winsock2.h>
+#endif
+
+#ifdef HAVE_ARPA_INET
+# include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#elif defined __GNUC__
+# define alloca __builtin_alloca
+#elif defined _AIX
+# define alloca __alloca
+#elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+#else
+# include <stddef.h>
+# ifdef __cplusplus
+extern "C"
+# endif
+void *alloca (size_t);
+#endif
+
+#include <Ecore.h>
+#include <Ecore_File.h>
+
+#include <Efreet.h>
+#include <Efreet_Mime.h>
+#include "efreet_private.h"
static Eina_List *globs = NULL; /* contains Efreet_Mime_Glob structs */
static Eina_List *magics = NULL; /* contains Efreet_Mime_Magic structs */
static Eina_List *globs = NULL; /* contains Efreet_Mime_Glob structs */
static Eina_List *magics = NULL; /* contains Efreet_Mime_Magic structs */
if (S_ISREG(s.st_mode))
return NULL;
if (S_ISREG(s.st_mode))
return NULL;
if (S_ISLNK(s.st_mode))
return "inode/symlink";
if (S_ISLNK(s.st_mode))
return "inode/symlink";
if (S_ISFIFO(s.st_mode))
return "inode/fifo";
if (S_ISFIFO(s.st_mode))
return "inode/fifo";
if (S_ISBLK(s.st_mode))
return "inode/blockdevice";
if (S_ISBLK(s.st_mode))
return "inode/blockdevice";
if (S_ISSOCK(s.st_mode))
return "inode/socket";
if (S_ISSOCK(s.st_mode))
return "inode/socket";
if (S_ISDIR(s.st_mode))
{
if (S_ISDIR(s.st_mode))
{
-#include "config.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <fnmatch.h>
-#include <limits.h>
-
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#include <Eina.h>
-#include <Ecore.h>
-#include <Ecore_File.h>
-#include <Ecore_Str.h>
-
-#include "efreet_xml.h"
-#include "efreet_ini.h"
-
/**
* @def NEW(x, c)
* Allocate and zero out c structures of type x
/**
* @def NEW(x, c)
* Allocate and zero out c structures of type x
/* vim: set sw=4 ts=4 sts=4 et: */
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
#include <errno.h>
#include <time.h>
#include <errno.h>
#include <time.h>
+
+#include <Ecore_File.h>
+
#include "Efreet.h"
#include "Efreet_Trash.h"
#include "efreet_private.h"
#include "Efreet.h"
#include "Efreet_Trash.h"
#include "efreet_private.h"
/* vim: set sw=4 ts=4 sts=4 et: */
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <limits.h>
+
+#ifdef HAVE_EVIL
+# include <Evil.h>
+#endif
+
#include "Efreet.h"
#include "efreet_private.h"
#include "Efreet.h"
#include "efreet_private.h"
/* vim: set sw=4 ts=4 sts=4 et: */
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <dirent.h>
+#include <fnmatch.h>
+
+#include <Ecore.h>
+#include <Ecore_File.h>
+
#include "Efreet.h"
#include "efreet_private.h"
#include "Efreet.h"
#include "efreet_private.h"
#ifndef EFREET_UTILS_H
#define EFREET_UTILS_H
#ifndef EFREET_UTILS_H
#define EFREET_UTILS_H
typedef enum _Efreet_Desktop_Change Efreet_Desktop_Change;
enum _Efreet_Desktop_Change
typedef enum _Efreet_Desktop_Change Efreet_Desktop_Change;
enum _Efreet_Desktop_Change
/* vim: set sw=4 ts=4 sts=4 et: */
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/mman.h>
+
+#ifdef HAVE_EVIL
+# include <Evil.h>
+#endif
+
+#include <Ecore_File.h>
+
#include "Efreet.h"
#include "efreet_private.h"
#include "Efreet.h"
#include "efreet_private.h"
#if 0
static void efreet_xml_dump(Efreet_Xml *xml, int level);
#if 0
static void efreet_xml_dump(Efreet_Xml *xml, int level);
if (!file) return NULL;
size = ecore_file_size(file);
if (!file) return NULL;
size = ecore_file_size(file);
- if (size <= 0) goto ERROR;
+ if (size <= 0) goto efreet_error;
fd = open(file, O_RDONLY);
fd = open(file, O_RDONLY);
- if (fd == -1) goto ERROR;
+ if (fd == -1) goto efreet_error;
data = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
data = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
- if (data == (void *)-1) goto ERROR;
+ if (data == (void *)-1) goto efreet_error;
error = 0;
xml = efreet_xml_parse(&data, &size);
error = 0;
xml = efreet_xml_parse(&data, &size);
+ if (error) goto efreet_error;
munmap(data, size);
close(fd);
return xml;
munmap(data, size);
close(fd);
return xml;
fprintf(stderr, "[efreet]: could not parse xml file\n");
if (data != (void *)-1) munmap(data, size);
if (fd != -1) close(fd);
fprintf(stderr, "[efreet]: could not parse xml file\n");
if (data != (void *)-1) munmap(data, size);
if (fd != -1) close(fd);
if (buf_size <= 1)
{
fprintf(stderr, "[efreet]: zero length key\n");
if (buf_size <= 1)
{
fprintf(stderr, "[efreet]: zero length key\n");
}
if (buf_size > 256) buf_size = 256;
}
if (buf_size > 256) buf_size = 256;
if (!start)
{
fprintf(stderr, "[efreet]: missing value for attribute!\n");
if (!start)
{
fprintf(stderr, "[efreet]: missing value for attribute!\n");
}
/* search for '"', beginning of value */
}
/* search for '"', beginning of value */
if (!start)
{
fprintf(stderr, "[efreet]: erroneous value for attribute!\n");
if (!start)
{
fprintf(stderr, "[efreet]: erroneous value for attribute!\n");
if (!end)
{
fprintf(stderr, "[efreet]: erroneous value for attribute!\n");
if (!end)
{
fprintf(stderr, "[efreet]: erroneous value for attribute!\n");
}
buf_size = end - start + 1;
if (buf_size <= 1)
{
fprintf(stderr, "[efreet]: zero length value\n");
}
buf_size = end - start + 1;
if (buf_size <= 1)
{
fprintf(stderr, "[efreet]: zero length value\n");
}
if (buf_size > 256) buf_size = 256;
}
if (buf_size > 256) buf_size = 256;
while (count >= 0)
{
if (attr[count].key) eina_stringshare_del(attr[count].key);
while (count >= 0)
{
if (attr[count].key) eina_stringshare_del(attr[count].key);