Commit Graph

74 Commits

Author SHA1 Message Date
Vincent Torri f5b01ac5ce all: Simplify definition of EAPI
This will help in the transition from Autotools to Meson. This has been
tested on Windows for which EFL_XXX_BUILD were first introduced.
2018-01-18 18:04:03 +09:00
WooHyun Jung 9fc1dd1a4e ecore_file_monitor: replace EINA_LIST_FOREACH to EINA_LIST_FOREACH_SAFE
If ecore_file_monitor_del is called inside the file monitor callback function,
eina_list found from monitor_hash would be freed. (You can check this inside
eina_hash_list_remove.)
Then, EINA_LIST_FOREACH makes one more for loop with invalid eina_list pointer.

EINA_LIST_FOREACH_SAFE can prevent from this problem.
2018-01-15 13:54:01 +09:00
Carsten Haitzler 9bedda14b3 efl loop - rename ecore_main_loop_get to efl_main_loop_get
ecore_main_loop_get() is really a new "eo api" but it's using our old
ecore_* namespace, so move to the new efl namespace.
2018-01-02 16:13:54 +09:00
Andy Williams d234458dfc Fix and simpligy windows behaviour.
Author: Vincent Torri
2017-12-31 16:08:31 +00:00
JinYong Park b05cae250c ecore_file: rename parameter for doxygen
Summary:
Some parameter's name are different in annotations and statements,
so it occurs doxygen warning.
To fix it, rename that parameters.

Test Plan: API Doxygen Revision

Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D5313

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-13 14:02:37 -07:00
Mike Blumenkrantz 11e92cdc86 ecore-file: do not emit events when an inotify watch is removed
???????????????????????????????????????????????????????????????????????????????

@fix
2017-10-03 13:34:22 -04:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Cedric BAIL 214e22bf72 ecore_file: use new API eina_file_close_on_exec. 2017-04-18 16:56:18 -07:00
Carsten Haitzler c65782b15c ecore file - use eina_file_mkstmp to solve umask complaint
this fixes coverity CID 1039614
2017-04-18 17:30:50 +09:00
Myoungwoon Roy, Kim 8c19d9251d docs: Fix typos and some wrong expressions
Covers: Ecore_Drm, Ecore_Evas, Ecore_File, Ecore_IMF, and
Ecore_IMF_Evas API reference doxygen.

Summary: I had fixed some typos and wrong expressions, such
as capital letters, singular Etc. in Ecore_Drm, Ecore_Evas,
Ecore_File, Ecore_IMF, and Ecore_IMF_Evas API reference doxygen.

Test Plan: Doxygen Revision

Reviewers: stefan, cedric, raster, jpeg, Jaehyun_Cho

Subscribers: conr2d

Differential Revision: https://phab.enlightenment.org/D4680
2017-02-27 19:37:43 +09:00
Gustavo Sverzut Barbieri a679c4a322 cmake: add ecore_file. 2017-02-02 17:15:31 -02:00
Ivan Furs 12ee780653 ecore_file: add case to properly rename a file in Windows
Summary:
If the file with a new path was created and 'rename' wants to replace the old path to the new path. 'rename' will return:
   Windows 7: -1 (errno=EEXIST) (EEXIST == 17)
   Ubuntu: 0

**EEXIST**
**Ubuntu**: The link named by new is a directory that is not an empty directory. (https://linux.die.net/man/3/rename)
**Windows 7**: Files exist. An attempt has been made to create a file that already exists. For example, the _O_CREAT and _O_EXCL flags are specified in an _open call, but the named file already exists.(https://msdn.microsoft.com/en-us/library/5814770t.aspx)

Test Plan:
**Sample code to rename in Linux and Windows if the file with the new name already exists:**

int main()
{
	const char *_old = "old";
	const char *_new = "new";

	int fd1 = open(_old, O_CREAT);
	close(fd1);
	int fd2 = open(_new, O_CREAT);
	close(fd2);
	printf("rename:\t%s -> %s\n", _old, _new);
	int r = rename(_old, _new);
	if (r == 0)
	{
		printf("GOOD\n");
	}
	else
	{
		printf("CODE ERROR:\n"                  );
		printf(" -rename...: %d\n", r    );
		printf(" -errno....: %d\n", errno);
	}
	return 0;
}

Reviewers: raster, vtorri, jpeg, NikaWhite, reutskiy.v.v, an.kroitor, cedric

Reviewed By: cedric

Subscribers: artem.popov, cedric, jpeg

Tags: #efl, #windows

Differential Revision: https://phab.enlightenment.org/D4561

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-01-12 16:24:34 -08:00
Vyacheslav Reutskiy 67d228230a Revert "ecore_file: use win api for delete folder"
It was mistake, rmdir work correct, problem was fixed in commit
56c202614b

This reverts commit 5e25b8037c.
2016-11-30 14:03:00 +02:00
Gustavo Sverzut Barbieri 4b771d3e1b ecore_file_download: callback completion_cb with status=1.
When download is aborted we must call completion_cb using status == 1,
this was checked in the test suite.
2016-11-23 16:23:58 -02:00
Vyacheslav Reutskiy dc18e71903 ecore_file: get stat from correct file 2016-11-23 16:20:06 +02:00
Vyacheslav Reutskiy 5e25b8037c ecore_file: use win api for delete folder
The RemoveDirectory on Windows guarantee that given folder will be
delete.
2016-11-23 16:20:03 +02:00
Vyacheslav Reutskiy 164ece9e3f ecore_file: update docs for ecore_file_rmdir 2016-11-23 16:19:48 +02:00
Cedric BAIL 1b5e8fe3a2 ecore_file: restore past behavior and fix ecore_file_download tests. 2016-11-22 11:57:40 -08:00
Gustavo Sverzut Barbieri 02d352e1f2 ecore_file_download: use new efl_net_dialer_http.
Greatly reduce code complexity while providing better support, at
least according to @netstar efl_net_dialer_http works better than
traditional ecore_con_url on BSD.
2016-11-21 19:47:35 -02:00
Jee-Yong Um 3b4293ffa3 ecore_file/ipc: clean up documentation
Summary: move comment from c source to header and adjust ingroup relationship

Reviewers: cedric, jpeg, Hermet

Reviewed By: Hermet

Differential Revision: https://phab.enlightenment.org/D4328
2016-10-04 21:08:17 +09:00
Artem Popov 132ae9683c ecore_file: Fix improper way of comparing in ecore_file_path_dir_exists @fix
Summary: There is wrong comparing while using strcmp function. Should be inverted.

Reviewers: cedric, raster, NikaWhite

Reviewed By: NikaWhite

Subscribers: cedric, NikaWhite, jpeg

Differential Revision: https://phab.enlightenment.org/D4291
2016-09-20 19:52:23 +03:00
Jean Guyomarc'h 8bbab0d015 ecore_file: fix memory leak
@fix
2016-05-06 22:18:57 +02:00
Carsten Haitzler bbcde33f93 fix efreet/file monitor stringshare optimization
fixes e4d815dc48 that i just put in a
few days back - it's a good idea to copy the string into your buffer
to use it.. not just 0 terminate it. :)
2016-04-23 23:45:28 +09:00
Carsten Haitzler e4d815dc48 efreetd - reduce memory usage by using stringshare much more
lots of long paths for monitoring file paths for icons etc. are in
memory for efreetd. this reduces that memory by sharing them much more.

@optimization
2016-04-23 23:07:48 +09:00
Vincent Torri 68107e5eb8 Ecore_File: fix merge and simplify logic in ecore_file_file_get() on WindoWS
Summary: Ecore_File: fix merge and simplify logic in ecore_file_file_get() on WindowS

Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3404
2015-12-07 14:08:19 +09:00
Vincent Torri 892df20bd4 ecore_file: fix ecore_file_file_get() on Windows
@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 11:35:24 -08:00
Jaehyun Cho 39f154f8ca ecore_file: Fix ecore_file_file_get function on Windows.
On Windows, both backslash and slash can be used as file path
separators. Therefore, it is fixed to consider backslash as a file path
separator as well on Windows.

@fix
2015-11-02 10:32:10 +09:00
Vincent Torri b72be67388 ecore_file: remove whitespaces
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-12 17:21:59 -07:00
Vincent Torri b9ed3375f2 ecore_file: fix ecore_file management function on Windows
On windows, stat() returns -1 if a path is finished with a \ or /,
so replace all stat() calls with a function which removes the trailing
slash or backslash on Windows

At this stage the code duplicate many code path for avoiding potential
borkage on Unix system. During 1.17 release cycle, it would be nice to
refactor this piece.

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-12 17:21:59 -07:00
Vincent Torri 315e1f5a2b Ecore_File: use ecore_file_mkdir() 2015-07-03 16:23:06 +01:00
Vincent Torri 308dbff141 Ecore_File: better implementation of ecore_file_mkdir() 2015-07-03 16:23:06 +01:00
Vincent Torri a46adde19d Ecore_File: improve comment of ecore_file_mkdir() 2015-07-03 16:23:06 +01:00
Cedric BAIL 241d0d3e18 ecore_file: use portable environment lookup. 2015-05-14 18:41:48 +02:00
Cedric BAIL ce5ccfb5be ecore: remove the need to order the header correctly for Windows. 2015-05-07 09:53:10 +02:00
Mike Blumenkrantz ee5c81b736 ecore-file: use hash list for inotify monitor tracking
inotify reuses watches for multiple instances on the same file, so
keeping a multimap here is necessary to avoid hash collision

fix T2360
2015-04-23 08:55:35 -04:00
kabeer khan 963fe509ca ecore_file: less confusing documentation of ecore_file_download API
Summary: Signed-off-by: kabeer khan <kabeer.khan@samsung.com>

Reviewers: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2373

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-17 12:06:47 +02:00
Mike Blumenkrantz ce15918593 ecore-file: use hash for finding monitors
this should hugely improve the speed of file monitor event processing;
in my test case, 800,000+ monitors were present and the application was
entirely unable to process them
2015-04-09 20:01:18 -04:00
Carsten Haitzler 4e716fb779 ecore_file - fix nasty memory issues in ecore_file_app_exe_get()
valgrind was most unhappy with ecore_file_app_exe_get(). like:

==8331== Invalid write of size 1
==8331==    at 0x68DE90A: ecore_file_app_exe_get (ecore_file.c:994)
==8331==  Address 0x1348e58f is 0 bytes after a block of size 31 alloc'd
==8331==    at 0x4C28C20: malloc (vg_replace_malloc.c:296)
==8331== Invalid write of size 1
==8331==    at 0x68DE948: ecore_file_app_exe_get (ecore_file.c:1000)
==8331==  Address 0x1348e599 is 10 bytes after a block of size 31 alloc'd
==8331==    at 0x4C28C20: malloc (vg_replace_malloc.c:296)

etc. etc. - so i rewrote it cleanly using strbuf to save code and
effort. cleaner now and ACTUALLY works correctly... and no valgrind
complaints.

@fix
2015-04-01 09:37:27 +09:00
kabeer khan 9c26b572d0 ecore_file : Changed documentation of ecore_file_mksubdirs
Summary:
Corrected documentation of ecore_file_mksubdirs by replacing dirs with subdirs

Signed-off-by: kabeer khan <kabeer.khan@samsung.com>

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1674
2014-11-21 09:17:31 -05:00
kabeer khan 0abcd5133e Ecore File: Corrected documentation of ecore_file_monitor_add API
Summary:
Added condition that if given path does not exist it returns NULL

@fix

Signed-off-by: kabeer khan <kabeer.khan@samsung.com>

Reviewers: englebass, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1640
2014-11-04 08:53:33 -05:00
kabeer khan 61d2e8cdf6 Ecore File: Corrected documentation of ecore_file_monitor_add API
Summary:
Existing doc specifies that ecore_file_monitor_add returns NULL if path is not file.
Removed this line as it works if path is either file or directory.

Signed-off-by: kabeer khan <kabeer.khan@samsung.com>

Reviewers: devilhorns, englebass

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1635
2014-11-03 08:13:57 -05:00
Chris Michael fc2fbcc7b8 ecore-file: Fix formatting
Summary: No functional changes, just formatting

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-11-03 08:13:32 -05:00
Chris Michael ff2f1e086a ecore-file: Fix formatting.
Summary: No functional changes, just formatting

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-11-03 08:13:32 -05:00
Jean-Philippe Andre 8d9c6c0a00 inotify: Fix safety after read in 3 places
Fixes Coverity issues:
 - CID 1039565
 - CID 1039566
2014-10-28 10:54:51 +09:00
Pierre Le Magourou 42a7d9b71c ecore_file: remove ecore_file_ls_iterator function from header.
It has no implementation in the ecore_file.c file.
This has been forgotten in commit d4059c7 when moving this function to
Eina library.
2014-10-20 18:17:26 +02:00
Stefan Schmidt 40b395666b ecore_file: Check return value of chmod()
Handle the error case here if chmod() fails.

CID: 1039696
2014-08-08 11:28:57 +02:00
Cedric BAIL 2d4fc8838d ecore_file: this parameter is indeed not used. 2014-06-27 13:41:39 +02:00
Carsten Haitzler 555df8f510 Revert "fix allocator sizeof operand mismatch reported by clang"
This reverts commit 955cc579d4.

why? wrong. no. and it breaks actual execution/functioning. segv land
2014-01-09 10:02:26 +09:00
Jihoon Kim 955cc579d4 fix allocator sizeof operand mismatch reported by clang
https://build.enlightenment.org/job/nightly_efl_clang_x86_64/lastSuccessfulBuild/artifact/scan-build/build/2014-01-07-1/report-QL6MiM.html#EndPath
https://build.enlightenment.org/job/nightly_efl_clang_x86_64/lastSuccessfulBuild/artifact/scan-build/build/2014-01-07-1/report-a2l0Ci.html#EndPath
https://build.enlightenment.org/job/nightly_efl_clang_x86_64/lastSuccessfulBuild/artifact/scan-build/build/2014-01-07-1/report-McvqNf.html#EndPath
2014-01-09 09:10:02 +09:00
Daniel Juyung Seo 76d8532b54 efl: Unified eina critical manro to CRI.
Being annoyed by different types of eina critical macros - CRI, CRIT,
 CRITICAL -, I concluded to unify them to one. Discussed on IRC and
 finally, CRI was chosen to meet the consistency with other macros -
 ERR, WRN, INF, DBG - in terms of the number of characters.
If there is any missing bits, please let me know.
2013-12-26 12:27:13 +09:00