summaryrefslogtreecommitdiff
path: root/src/examples/ecore
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:09 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:10 -0500
commit6326e18b3fb2a4757f8ffa22be5d55a75da23049 (patch)
tree31d586b52638aa0d0b1c759869a8e3368c9daf5d /src/examples/ecore
parent7924660d54500285d3844bfa384394c683825cd9 (diff)
efl.file: improve api a bit
Summary: the previous implementation/api had a number of issues: * "file" property contained both "file" and "key" values - also performed file loading operation * "load_error" property which was specific to image objects * no methods for controlling file loading/unloading this patch attempts the following changes: * split "file" property into "file" and "key" properties - also remove "key" from existing "mmap" property * remove "load_error" * directly return error codes from operations * add "load" and "unload" methods for directly controlling load state * add implicit file loading if file/mmap is set during construction * rewrite all efl.file implementations to move file loading into load() method * rewrite all usage of efl.file api based on these changes * add C extension functions to mimic previous behavior ref T7577 Reviewers: segfaultxavi, bu5hm4n, cedric Reviewed By: segfaultxavi Subscribers: vitor.sousa, #reviewers, #committers Tags: #efl_api Maniphest Tasks: T7577 Differential Revision: https://phab.enlightenment.org/D8018
Diffstat (limited to 'src/examples/ecore')
-rw-r--r--src/examples/ecore/efl_io_copier_example.c4
-rw-r--r--src/examples/ecore/efl_net_dialer_http_example.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/examples/ecore/efl_io_copier_example.c b/src/examples/ecore/efl_io_copier_example.c
index 25a81140bd..13f26b8577 100644
--- a/src/examples/ecore/efl_io_copier_example.c
+++ b/src/examples/ecore/efl_io_copier_example.c
@@ -664,7 +664,7 @@ efl_main(void *data EINA_UNUSED,
664 { 664 {
665 /* regular file, open with flags: read-only and close-on-exec */ 665 /* regular file, open with flags: read-only and close-on-exec */
666 input = efl_add_ref(EFL_IO_FILE_CLASS, NULL, 666 input = efl_add_ref(EFL_IO_FILE_CLASS, NULL,
667 efl_file_set(efl_added, input_fname, NULL), /* mandatory */ 667 efl_file_set(efl_added, input_fname), /* mandatory */
668 efl_io_file_flags_set(efl_added, O_RDONLY), /* default */ 668 efl_io_file_flags_set(efl_added, O_RDONLY), /* default */
669 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE), /* recommended, set *after* flags, or include O_CLOEXEC in flags -- be careful with _WIN32 that doesn't support it. */ 669 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE), /* recommended, set *after* flags, or include O_CLOEXEC in flags -- be careful with _WIN32 that doesn't support it. */
670 efl_event_callback_array_add(efl_added, input_cbs(), NULL) /* optional */ 670 efl_event_callback_array_add(efl_added, input_cbs(), NULL) /* optional */
@@ -940,7 +940,7 @@ efl_main(void *data EINA_UNUSED,
940 * create if did not exist and truncate if exist. 940 * create if did not exist and truncate if exist.
941 */ 941 */
942 output = efl_add_ref(EFL_IO_FILE_CLASS, NULL, 942 output = efl_add_ref(EFL_IO_FILE_CLASS, NULL,
943 efl_file_set(efl_added, output_fname, NULL), /* mandatory */ 943 efl_file_set(efl_added, output_fname), /* mandatory */
944 efl_io_file_flags_set(efl_added, O_WRONLY | O_CREAT | O_TRUNC), /* mandatory for write */ 944 efl_io_file_flags_set(efl_added, O_WRONLY | O_CREAT | O_TRUNC), /* mandatory for write */
945 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE), /* recommended, set *after* flags, or include O_CLOEXEC in flags -- be careful with _WIN32 that doesn't support it. */ 945 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE), /* recommended, set *after* flags, or include O_CLOEXEC in flags -- be careful with _WIN32 that doesn't support it. */
946 efl_io_file_mode_set(efl_added, 0644), /* mandatory for write */ 946 efl_io_file_mode_set(efl_added, 0644), /* mandatory for write */
diff --git a/src/examples/ecore/efl_net_dialer_http_example.c b/src/examples/ecore/efl_net_dialer_http_example.c
index 70861dc438..02783dc165 100644
--- a/src/examples/ecore/efl_net_dialer_http_example.c
+++ b/src/examples/ecore/efl_net_dialer_http_example.c
@@ -321,7 +321,7 @@ efl_main(void *data EINA_UNUSED,
321 { 321 {
322 input = efl_add(EFL_IO_FILE_CLASS, loop, 322 input = efl_add(EFL_IO_FILE_CLASS, loop,
323 efl_name_set(efl_added, "input"), 323 efl_name_set(efl_added, "input"),
324 efl_file_set(efl_added, input_fname, NULL), 324 efl_file_set(efl_added, input_fname),
325 efl_io_file_flags_set(efl_added, O_RDONLY), 325 efl_io_file_flags_set(efl_added, O_RDONLY),
326 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE), /* recommended, set *after* flags, or include O_CLOEXEC in flags -- be careful with _WIN32 that doesn't support it. */ 326 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE), /* recommended, set *after* flags, or include O_CLOEXEC in flags -- be careful with _WIN32 that doesn't support it. */
327 efl_event_callback_add(efl_added, EFL_IO_READER_EVENT_EOS, _eos, NULL)); 327 efl_event_callback_add(efl_added, EFL_IO_READER_EVENT_EOS, _eos, NULL));
@@ -336,7 +336,7 @@ efl_main(void *data EINA_UNUSED,
336 { 336 {
337 output = efl_add(EFL_IO_FILE_CLASS, loop, 337 output = efl_add(EFL_IO_FILE_CLASS, loop,
338 efl_name_set(efl_added, "output"), 338 efl_name_set(efl_added, "output"),
339 efl_file_set(efl_added, output_fname, NULL), 339 efl_file_set(efl_added, output_fname),
340 efl_io_file_mode_set(efl_added, 0644), 340 efl_io_file_mode_set(efl_added, 0644),
341 efl_io_file_flags_set(efl_added, O_WRONLY | O_TRUNC | O_CREAT), 341 efl_io_file_flags_set(efl_added, O_WRONLY | O_TRUNC | O_CREAT),
342 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE)); /* recommended, set *after* flags, or include O_CLOEXEC in flags -- be careful with _WIN32 that doesn't support it. */ 342 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE)); /* recommended, set *after* flags, or include O_CLOEXEC in flags -- be careful with _WIN32 that doesn't support it. */