* move header files in efree_provate.h to the source files

* 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)



SVN revision: 40257
This commit is contained in:
Vincent Torri 2009-04-20 23:20:40 +00:00
parent 3ab5491316
commit 1bf086809e
24 changed files with 298 additions and 80 deletions

View File

@ -35,8 +35,31 @@ AC_SUBST(efreet_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_FUNC_ALLOCA
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])

View File

@ -27,15 +27,22 @@
* @li Trash Specification
*/
#include <Eina.h>
#ifdef EAPI
#undef EAPI
# undef EAPI
#endif
#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)
# endif
# endif /* ! EFL_EFREET_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4

View File

@ -13,16 +13,20 @@
* @{
*/
#ifdef EAPI
#undef EAPI
# undef EAPI
#endif
#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)
# endif
# endif /* ! EFL_EFREET_MIME_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4

View File

@ -3,14 +3,19 @@
#define EFREET_TRASH_H
#ifdef EAPI
#undef EAPI
# undef EAPI
#endif
#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)
# endif
# endif /* ! EFL_EFREET_TRASH_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4

View File

@ -1,11 +1,6 @@
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I$(top_builddir) \
-I$(top_srcdir) \
@EFREET_CFLAGS@
lib_LTLIBRARIES = libefreet.la libefreet_mime.la libefreet_trash.la
EFREETHEADERS = \
@ -35,6 +30,13 @@ $(EFREETHEADERS)
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
@ -45,6 +47,11 @@ $(EFREETMIMEHEADERS)
libefreet_mime_la_SOURCES = \
$(EFREETMIMESOURCES)
libefreet_mime_la_CPPFLAGS = \
-I$(top_builddir) \
-I$(top_srcdir) \
@EFL_EFREET_MIME_BUILD@ \
@EFREET_CFLAGS@
EFREETTRASHHEADERS = \
@ -56,16 +63,18 @@ $(EFREETTRASHHEADERS)
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)
libefreet_la_LIBADD = @EFREET_LIBS@
libefreet_la_LDFLAGS = -version-info @version_info@ @efreet_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_LDFLAGS = -version-info @version_info@ @efreet_mime_release_info@
libefreet_trash_la_LDFLAGS = -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

View File

@ -1,6 +1,16 @@
/* 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_xml.h"
static int init = 0;
static int efreet_parsed_locale = 0;

View File

@ -1,4 +1,12 @@
/* 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"

View File

@ -12,8 +12,6 @@
* @{
*/
#include <Eina.h>
EAPI const char *efreet_data_home_get(void);
EAPI Eina_List *efreet_data_dirs_get(void);

View File

@ -1,4 +1,10 @@
/* 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"

View File

@ -1,4 +1,22 @@
/* 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"
@ -549,8 +567,10 @@ static void *
efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop __UNUSED__,
char *exec, int remaining __UNUSED__)
{
#ifndef _WIN32
ecore_exe_run(exec, data);
free(exec);
#endif
return NULL;
}

View File

@ -12,8 +12,6 @@
* @{
*/
#include <Eina.h>
EAPI extern int EFREET_DESKTOP_TYPE_APPLICATION;
EAPI extern int EFREET_DESKTOP_TYPE_LINK;
EAPI extern int EFREET_DESKTOP_TYPE_DIRECTORY;

View File

@ -1,4 +1,21 @@
/* 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"

View File

@ -12,8 +12,6 @@
* @{
*/
#include <Eina.h>
/**
* The possible contexts for an icon directory
*/

View File

@ -1,4 +1,34 @@
/* 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"

View File

@ -1,6 +1,20 @@
/* 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_xml.h"
/**
* Efreet_Menu_Move

View File

@ -12,8 +12,6 @@
* @{
*/
#include <Eina.h>
/**
* The type of entry
*/

View File

@ -1,11 +1,52 @@
/* 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 <sys/time.h>
#include <sys/mman.h>
#include <unistd.h>
#include <time.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"
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
static Eina_List *globs = NULL; /* contains Efreet_Mime_Glob structs */
static Eina_List *magics = NULL; /* contains Efreet_Mime_Magic structs */
@ -635,8 +676,10 @@ efreet_mime_special_check(const char *file)
if (S_ISREG(s.st_mode))
return NULL;
#ifndef _WIN32
if (S_ISLNK(s.st_mode))
return "inode/symlink";
#endif
if (S_ISFIFO(s.st_mode))
return "inode/fifo";
@ -647,8 +690,10 @@ efreet_mime_special_check(const char *file)
if (S_ISBLK(s.st_mode))
return "inode/blockdevice";
#ifndef _WIN32
if (S_ISSOCK(s.st_mode))
return "inode/socket";
#endif
if (S_ISDIR(s.st_mode))
{

View File

@ -11,32 +11,6 @@
* @{
*/
#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

View File

@ -1,6 +1,15 @@
/* 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 <Ecore_File.h>
#include "Efreet.h"
#include "Efreet_Trash.h"
#include "efreet_private.h"

View File

@ -1,4 +1,18 @@
/* 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"

View File

@ -9,8 +9,6 @@
* @{
*/
#include <Ecore.h>
/**
* Efreet_Uri

View File

@ -1,4 +1,18 @@
/* 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"

View File

@ -2,8 +2,6 @@
#ifndef EFREET_UTILS_H
#define EFREET_UTILS_H
#include <Eina.h>
typedef enum _Efreet_Desktop_Change Efreet_Desktop_Change;
enum _Efreet_Desktop_Change

View File

@ -1,6 +1,27 @@
/* 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_xml.h"
#if 0
static void efreet_xml_dump(Efreet_Xml *xml, int level);
@ -64,23 +85,23 @@ efreet_xml_new(const char *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);
if (fd == -1) goto ERROR;
if (fd == -1) goto efreet_error;
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);
if (error) goto ERROR;
if (error) goto efreet_error;
munmap(data, size);
close(fd);
return xml;
ERROR:
efreet_error:
fprintf(stderr, "[efreet]: could not parse xml file\n");
if (data != (void *)-1) munmap(data, size);
if (fd != -1) close(fd);
@ -335,7 +356,7 @@ efreet_xml_attributes_parse(char **data, int *size,
if (buf_size <= 1)
{
fprintf(stderr, "[efreet]: zero length key\n");
goto ERROR;
goto efreet_error;
}
if (buf_size > 256) buf_size = 256;
@ -359,7 +380,7 @@ efreet_xml_attributes_parse(char **data, int *size,
if (!start)
{
fprintf(stderr, "[efreet]: missing value for attribute!\n");
goto ERROR;
goto efreet_error;
}
/* search for '"', beginning of value */
@ -378,7 +399,7 @@ efreet_xml_attributes_parse(char **data, int *size,
if (!start)
{
fprintf(stderr, "[efreet]: erroneous value for attribute!\n");
goto ERROR;
goto efreet_error;
}
/* skip '"' */
@ -402,14 +423,14 @@ efreet_xml_attributes_parse(char **data, int *size,
if (!end)
{
fprintf(stderr, "[efreet]: erroneous value for attribute!\n");
goto ERROR;
goto efreet_error;
}
buf_size = end - start + 1;
if (buf_size <= 1)
{
fprintf(stderr, "[efreet]: zero length value\n");
goto ERROR;
goto efreet_error;
}
if (buf_size > 256) buf_size = 256;
@ -433,7 +454,7 @@ efreet_xml_attributes_parse(char **data, int *size,
}
return;
ERROR:
efreet_error:
while (count >= 0)
{
if (attr[count].key) eina_stringshare_del(attr[count].key);