Enlightenment CVS committal Author : doursse Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_file Modified Files: Ecore_File.h Makefile.am ecore_file.c ecore_file_download.c ecore_file_monitor.c ecore_file_monitor_inotify.c ecore_file_monitor_poll.c ecore_file_path.c ecore_file_private.h Log Message: integration of evil in ecore. It's compiling on windows and my ubuntu. The commit is big, please report any problem =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_file/Ecore_File.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -3 -r1.36 -r1.37 --- Ecore_File.h 19 Jan 2008 22:50:46 -0000 1.36 +++ Ecore_File.h 26 May 2008 05:16:33 -0000 1.37 @@ -1,23 +1,31 @@ /* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ + #ifndef ECORE_FILE_H #define ECORE_FILE_H +#include <Ecore_Data.h> + /* * TODO: * - More events, move/rename of directory file */ #ifdef EAPI -#undef EAPI +# undef EAPI #endif -#ifdef _MSC_VER -# ifdef BUILDING_DLL -# define EAPI __declspec(dllexport) + +#ifdef _WIN32 +# ifdef EFL_ECORE_FILE_BUILD +# ifdef DLL_EXPORT +# define EAPI __declspec(dllexport) +# else +# define EAPI +# endif /* ! DLL_EXPORT */ # else # define EAPI __declspec(dllimport) -# endif +# endif /* ! EFL_ECORE_FILE_BUILD */ #else # ifdef __GNUC__ # if __GNUC__ >= 4 @@ -28,22 +36,20 @@ # else # define EAPI # endif -#endif +#endif /* ! _WIN32 */ /** * @file Ecore_File.h * @brief Files utility functions */ -#include <Ecore_Data.h> - #ifdef __cplusplus extern "C" { #endif typedef struct _Ecore_File_Monitor Ecore_File_Monitor; typedef struct _Ecore_File_Monitor_Event Ecore_File_Monitor_Event; - + typedef enum { ECORE_FILE_EVENT_NONE, @@ -54,17 +60,17 @@ ECORE_FILE_EVENT_DELETED_SELF, ECORE_FILE_EVENT_MODIFIED } Ecore_File_Event; - - + + EAPI int ecore_file_init (void); EAPI int ecore_file_shutdown (void); EAPI long long ecore_file_mod_time (const char *file); - EAPI long long ecore_file_size (const char *file); + EAPI long long ecore_file_size (const char *file); EAPI int ecore_file_exists (const char *file); EAPI int ecore_file_is_dir (const char *file); EAPI int ecore_file_mkdir (const char *dir); EAPI int ecore_file_rmdir (const char *dir); - EAPI int ecore_file_recursive_rm (const char *dir); + EAPI int ecore_file_recursive_rm (const char *dir); EAPI int ecore_file_mkpath (const char *path); EAPI int ecore_file_cp (const char *src, const char *dst); EAPI int ecore_file_mv (const char *src, const char *dst); @@ -82,7 +88,7 @@ EAPI char *ecore_file_app_exe_get (const char *app); EAPI char *ecore_file_escape_name (const char *filename); EAPI char *ecore_file_strip_ext (const char *file); - + EAPI Ecore_File_Monitor * ecore_file_monitor_add(const char *path, void (*func) (void *data, Ecore_File_Monitor *em, Ecore_File_Event event, @@ -94,16 +100,16 @@ EAPI int ecore_file_path_dir_exists(const char *in_dir); EAPI int ecore_file_app_installed(const char *exe); EAPI Ecore_List *ecore_file_app_list(void); - + EAPI int ecore_file_download(const char *url, const char *dst, void (*completion_cb)(void *data, const char *file, int status), - int (*progress_cb)(void *data, - const char *file, - long int dltotal, - long int dlnow, - long int ultotal, + int (*progress_cb)(void *data, + const char *file, + long int dltotal, + long int dlnow, + long int ultotal, long int ulnow), void *data); EAPI void ecore_file_download_abort_all(void); @@ -112,4 +118,5 @@ #ifdef __cplusplus } #endif + #endif =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_file/Makefile.am,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- Makefile.am 9 Mar 2008 16:43:32 -0000 1.14 +++ Makefile.am 26 May 2008 05:16:33 -0000 1.15 @@ -4,7 +4,12 @@ -I$(top_srcdir)/src/lib/ecore \ -I$(top_srcdir)/src/lib/ecore_con \ -I$(top_builddir)/src/lib/ecore \ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ \ [EMAIL PROTECTED]@ + +if BUILD_ECORE_CON +lib_ecore_con_la = $(top_builddir)/src/lib/ecore_con/libecore_con.la +endif if BUILD_ECORE_FILE @@ -22,10 +27,10 @@ libecore_file_la_LIBADD = \ $(top_builddir)/src/lib/ecore/libecore.la \ -$(top_builddir)/src/lib/ecore_con/libecore_con.la \ [EMAIL PROTECTED]@ @winsock_libs@ +$(lib_ecore_con_la) \ [EMAIL PROTECTED]@ -libecore_file_la_LDFLAGS = @create_shared_lib@ -version-info @version_info@ +libecore_file_la_LDFLAGS = @lt_no_undefined@ @lt_enable_auto_import@ -version-info @version_info@ endif =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_file/ecore_file.c,v retrieving revision 1.74 retrieving revision 1.75 diff -u -3 -r1.74 -r1.75 --- ecore_file.c 17 Apr 2008 02:04:02 -0000 1.74 +++ ecore_file.c 26 May 2008 05:16:33 -0000 1.75 @@ -2,7 +2,9 @@ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ -#include <config.h> +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif #ifndef _FILE_OFFSET_BITS # define _FILE_OFFSET_BITS 64 @@ -12,132 +14,13 @@ # include <features.h> #endif #include <ctype.h> -#include "ecore_file_private.h" #include <errno.h> -#ifdef _WIN32 -# include <shlobj.h> -# include <objidl.h> -#endif /* _WIN32 */ +#include "ecore_file_private.h" static int init = 0; -#ifdef _WIN32 - -/* FIXME: Windows has no symbolic link. */ -/* Nevertheless, it can create and read .lnk files */ -static int -symlink(const char *oldpath, const char *newpath) -{ - IShellLink *pISL; - IShellLink **shell_link; - IPersistFile *pIPF; - IPersistFile **persit_file; - wchar_t new_path[MB_CUR_MAX]; - - /* Hack to cleanly remove a warning */ - if (FAILED(CoInitialize(NULL))) - return -1; - - shell_link = &pISL; - if (FAILED(CoCreateInstance(&CLSID_ShellLink, - NULL, - CLSCTX_INPROC_SERVER, - &IID_IShellLink, - (void **)shell_link))) - goto no_instance; - - if (FAILED(pISL->lpVtbl->SetPath(pISL, oldpath))) - goto no_setpath; - - /* Hack to cleanly remove a warning */ - persit_file = &pIPF; - if (FAILED(pISL->lpVtbl->QueryInterface(pISL, &IID_IPersistFile, (void **)persit_file))) - goto no_queryinterface; - - mbstowcs(new_path, newpath, MB_CUR_MAX); - if (FAILED(pIPF->lpVtbl->Save(pIPF, new_path, FALSE))) - goto no_save; - - pIPF->lpVtbl->Release(pIPF); - pISL->lpVtbl->Release(pISL); - CoUninitialize(); - - return 0; - - no_save: - pIPF->lpVtbl->Release(pIPF); - no_queryinterface: - no_setpath: - pISL->lpVtbl->Release(pISL); - no_instance: - CoUninitialize(); - return -1; -} - -static int -readlink(const char *path, char *buf, size_t bufsiz) -{ - IShellLink *pISL; - IShellLink **shell_link; - IPersistFile *pIPF; - IPersistFile **persit_file; - wchar_t old_path[MB_CUR_MAX]; - char new_path[MB_CUR_MAX]; - int length; - - /* Hack to cleanly remove a warning */ - if (FAILED(CoInitialize(NULL))) - return -1; - - persit_file = &pIPF; - if (FAILED(CoCreateInstance(&CLSID_ShellLink, - NULL, - CLSCTX_INPROC_SERVER, - &IID_IPersistFile, - (void **)persit_file))) - goto no_instance; - - mbstowcs(old_path, path, MB_CUR_MAX); - if (FAILED(pIPF->lpVtbl->Load(pIPF, old_path, STGM_READWRITE))) - goto no_load; - - shell_link = &pISL; - if (FAILED(pIPF->lpVtbl->QueryInterface(pIPF, &IID_IShellLink, (void **)shell_link))) - goto no_queryinterface; - - if (FAILED(pISL->lpVtbl->GetPath(pISL, new_path, MB_CUR_MAX, NULL, 0))) - goto no_getpath; - - length = strlen(new_path); - if (length > bufsiz) - length = bufsiz; - - memcpy(buf, new_path, length); - - pISL->lpVtbl->Release(pISL); - pIPF->lpVtbl->Release(pIPF); - CoUninitialize(); - - return length; - - no_getpath: - pISL->lpVtbl->Release(pISL); - no_queryinterface: - no_load: - pIPF->lpVtbl->Release(pIPF); - no_instance: - CoUninitialize(); - return -1; -} - -#define realpath(file_name, resolved_name) _fullpath((resolved_name), (file_name), PATH_MAX) - -#define mkdir(path, mode) _mkdir((path)) - -#endif /* _WIN32 */ - /* externally accessible functions */ /** * Initialize Ecore_File and the services it will use. Call this function @@ -242,9 +125,8 @@ return 0; } -#ifndef _WIN32 static mode_t default_mode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; -#endif /* _WIN32 */ + /** * Create a new directory * @param dir The name of the directory to create =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_file/ecore_file_download.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- ecore_file_download.c 2 May 2008 15:33:09 -0000 1.24 +++ ecore_file_download.c 26 May 2008 05:16:33 -0000 1.25 @@ -1,6 +1,11 @@ /* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + #include "Ecore_Con.h" #include "ecore_file_private.h" @@ -42,6 +47,7 @@ EAPI int ecore_file_download_init(void) { +#ifndef _WIN32 ecore_con_url_init(); if (init++ == 0) @@ -49,7 +55,7 @@ #ifdef HAVE_CURL _url_complete_handler = ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE, _ecore_file_download_url_complete_cb, NULL); _url_progress_download = ecore_event_handler_add(ECORE_CON_EVENT_URL_PROGRESS, _ecore_file_download_url_progress_cb, NULL); -#endif +#endif } if (!_job_list) { @@ -58,11 +64,15 @@ } return 1; +#else + return 0; +#endif } EAPI int ecore_file_download_shutdown(void) { +#ifndef _WIN32 if (--init == 0) { if (_url_complete_handler) @@ -77,6 +87,9 @@ } return ecore_con_url_shutdown(); +#else + return 0; +#endif } EAPI void =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_file/ecore_file_monitor.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- ecore_file_monitor.c 19 Jan 2008 22:50:46 -0000 1.10 +++ ecore_file_monitor.c 26 May 2008 05:16:33 -0000 1.11 @@ -1,6 +1,11 @@ /* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + #include "ecore_file_private.h" static int init = 0; =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- ecore_file_monitor_inotify.c 23 Jul 2007 16:25:38 -0000 1.22 +++ ecore_file_monitor_inotify.c 26 May 2008 05:16:33 -0000 1.23 @@ -1,6 +1,11 @@ /* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + #include "ecore_file_private.h" /* =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_file/ecore_file_monitor_poll.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- ecore_file_monitor_poll.c 12 Jul 2007 21:45:55 -0000 1.16 +++ ecore_file_monitor_poll.c 26 May 2008 05:16:33 -0000 1.17 @@ -1,6 +1,11 @@ /* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + #include "ecore_file_private.h" #ifdef HAVE_POLL =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_file/ecore_file_path.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- ecore_file_path.c 6 Aug 2007 20:00:28 -0000 1.22 +++ ecore_file_path.c 26 May 2008 05:16:33 -0000 1.23 @@ -1,6 +1,11 @@ /* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + #include "ecore_file_private.h" static int init = 0; =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_file/ecore_file_private.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- ecore_file_private.h 5 Nov 2007 18:57:11 -0000 1.19 +++ ecore_file_private.h 26 May 2008 05:16:33 -0000 1.20 @@ -5,8 +5,14 @@ #ifdef __linux__ # include <features.h> #endif -#include "ecore_private.h" + #include "Ecore.h" +#include "ecore_private.h" + +#ifdef HAVE_EVIL +# include <Evil.h> +#endif + #include "Ecore_File.h" /* ecore_file_monitor */ ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs