path: root/src/lib/eina (unfollow)
AgeCommit message (Collapse)Author
2021-11-10Eina: sanitize eina_path output on WindowsVincent Torri
Summary: * remove additional \ character * use only / as path separator Test Plan: compilation and run test program : ``` { elm_app_bin_dir_get(); printf("%s\n", eina_vpath_resolve("(:tmp:)/foo")); printf("%s\n", eina_vpath_resolve("(:home:)/foo")); printf("%s\n", eina_vpath_resolve("(:usr.desktop:)/foo")); printf("%s\n", eina_vpath_resolve("(:usr.documents:)/foo")); printf("%s\n", eina_vpath_resolve("(:usr.downloads:)/foo")); printf("%s\n", eina_vpath_resolve("(")); printf("%s\n", eina_vpath_resolve("(")); printf("%s\n", eina_vpath_resolve("(:usr.public:)/foo")); printf("%s\n", eina_vpath_resolve("(:usr.templates:)/foo")); printf("%s\n", eina_vpath_resolve("(:usr.videos:)/foo")); printf("%s\n", eina_vpath_resolve("(")); printf("%s\n", eina_vpath_resolve("(:usr.config:)/foo")); printf("%s\n", eina_vpath_resolve("(:usr.cache:)/foo")); printf("%s\n", eina_vpath_resolve("(")); printf("%s\n", eina_vpath_resolve("(:usr.tmp:)/foo")); printf("%s\n", eina_vpath_resolve("(:app.dir:)/foo")); printf("%s\n", eina_vpath_resolve("(:app.bin:)/foo")); printf("%s\n", eina_vpath_resolve("(:app.lib:)/foo")); printf("%s\n", eina_vpath_resolve("(")); printf("%s\n", eina_vpath_resolve("(:app.locale:)/foo")); printf("%s\n", eina_vpath_resolve("(:app.config:)/foo")); printf("%s\n", eina_vpath_resolve("(:app.local:)/foo")); printf("%s\n", eina_vpath_resolve("(:app.tmp:)/foo")); } ``` before patch : ``` C:\Documents\msys2\tmp/foo C:\Users\vincent.torri/foo C:\Users\vincent.torri\Desktop/foo C:\Users\vincent.torri\Documents/foo C:\Users\vincent.torri\Downloads/foo C:\Users\vincent.torri\Music/foo C:\Users\vincent.torri\Pictures/foo C:\Users\Public\/foo C:\Users\vincent.torri\AppData\Roaming\Microsoft\Windows\Templates/foo C:\Users\vincent.torri\Videos/foo C:\Users\vincent.torri\AppData\Local\/foo C:\Users\vincent.torri\AppData\Roaming\/foo C:\Users\vincent.torri\AppData\Local\/foo C:\Users\vincent.torri\AppData\Roaming/foo C:\Users\vincent.torri\AppData\Local\Temp/foo C:/Documents/msys2/opt/entice_64/bin/foo C:/Documents/msys2/opt/entice_64/bin/foo C:/Documents/msys2/opt/entice_64/lib/foo C:/Documents/msys2/opt/entice_64/share/foo C:/Documents/msys2/opt/entice_64/share/foo C:\Users\vincent.torri\AppData\Roaming\/entice/foo C:\Users\vincent.torri\AppData\Local\/entice/foo C:\Users\vincent.torri\AppData\Local\Temp/entice/foo ``` after patch ``` C:/Documents/msys2/tmp/foo C:/Users/vincent.torri/foo C:/Users/vincent.torri/Desktop/foo C:/Users/vincent.torri/Documents/foo C:/Users/vincent.torri/Downloads/foo C:/Users/vincent.torri/Music/foo C:/Users/vincent.torri/Pictures/foo C:/Users/Public/foo C:/Users/vincent.torri/AppData/Roaming/Microsoft/Windows/Templates/foo C:/Users/vincent.torri/Videos/foo C:/Users/vincent.torri/AppData/Local/foo C:/Users/vincent.torri/AppData/Roaming/foo C:/Users/vincent.torri/AppData/Local/foo C:/Users/vincent.torri/AppData/Roaming/foo C:/Users/vincent.torri/AppData/Local/Temp/foo C:/Documents/msys2/opt/entice_64/bin/foo C:/Documents/msys2/opt/entice_64/bin/foo C:/Documents/msys2/opt/entice_64/lib/foo C:/Documents/msys2/opt/entice_64/share/foo C:/Documents/msys2/opt/entice_64/share/foo C:/Users/vincent.torri/AppData/Roaming/entice/foo C:/Users/vincent.torri/AppData/Local/entice/foo C:/Users/vincent.torri/AppData/Local/Temp/entice/foo ``` Reviewers: raster Reviewed By: raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2021-11-07eina vpath - fix trailing extra / after homeCarsten Haitzler (Rasterman)
fixes T8965 @fix
2021-11-07eina vpath - fix public vpath location - docs say say public not pubCarsten Haitzler (Rasterman)
2021-09-06efl mem - every mmap anon - allow envv ar to turn it off to be mallocCarsten Haitzler (Rasterman)
helps with memory debug to use libc mallocs/callocs etc. set EFL_NO_MMAP_ANON env var to anything to stop anon mmaps
2021-05-26eina file - expand buf a bit to silence warning about data beyond bufferCarsten Haitzler (Rasterman)
2021-05-03Eina: use eina_fnmatch() instead of fnmatch()Vincent Torri
Reviewers: raster Reviewed By: raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2021-05-03Eina: API addition: interface musl's fnmatch() implementationVincent Torri
Summary: addd musl's fnmatch() implementation to Eina Test Plan: compilation and simple test case Reviewers: raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2021-04-17Implement eina_thread for native windowsWander Lairson Costa
Summary: eina: Implement Eina_Thread for native windows The implementation design respects the fact that Eina_Thread is an uintptr_t. Thus we allocate the thread struct in the heap and return a pointer to it. As such, we store the created thread structure in the target thread TLS slot. For threads that were not created through eina API, in eina_thread_self we allocate a new structure, push it to the TLS slot and mark it to be freed on thread exit. Reviewers: jptiz, vtorri, cedric, walac Reviewed By: jptiz, cedric Subscribers: raster, cedric, #reviewers, #committers, lucas Tags: #efl Differential Revision:
2021-04-10eina_promise: do not self feedback when cancelingMarcel Hollerbach
when canceling a all_promise it will cancel all futures. When that happens, and one future is containing a promise, the value is unrolled, and delivered as "Operation canceled" if this is happening to the last future in all or any in race, the promise will then free its base ctx which is already happening due to canceling. With this this is not happening anymore.
2021-02-25eina_promise: Fix unchecked return valueChristopher Michael
Small patch to check return value of eina_value_get reported by Coverity Fixes CID1400993
2021-02-25eina_value: Fix unchecked return valueChristopher Michael
Small patch to check return value of eina_value_type_setup reported by Coverity Fixes CID1401023
2020-11-25eina: Rename EAPI macro to EINA_API in Eina libraryFelipe Magno de Almeida
Summary: Patch from a series of patches to rename EAPI symbols to specific library DSOs. EAPI was designed to be able to pass `__attribute__ ((visibility ("default")))` for symbols with GCC, which would mean that even if -fvisibility=hidden was used when compiling the library, the needed symbols would get exported. MSVC __almost__ works like GCC (or mingw) in which you can declare everything as export and it will just work (slower, but it will work). But there's a caveat: global variables will not work the same way for MSVC, but works for mingw and GCC. For global variables (as opposed to functions), MSVC requires correct DSO visibility for MSVC: instead of declaring a symbol as export for everything, you need to declare it as import when importing from another DSO and export when defining it locally. With current EAPI definitions, we get the following example working in mingw and MSVC (observe it doesn't define any global variables as exported symbols). Example 1: dll1: ``` EAPI void foo(void); EAPI void bar() { foo(); } ``` dll2: ``` EAPI void foo() { printf ("foo\n"); } ``` This works fine with API defined as __declspec(dllexport) in both cases and for gcc defining as `__atttribute__((visibility("default")))` However, the following: Example 2: dll1: ``` EAPI extern int foo; EAPI void foobar(void); EAPI void bar() { foo = 5; foobar(); } ``` dll2: ``` EAPI int foo = 0; EAPI void foobar() { printf ("foo %d\n", foo); } ``` This will work on mingw but will not work for MSVC. And that's why EAPI is the only solution that worked for MSVC. Co-authored-by: João Paulo Taylor Ienczak Zanette <> Co-authored-by: Ricardo Campos <> Co-authored-by: Lucas Cavalcante de Sousa <> Reviewers: jptiz, lucas, woohyun, vtorri, raster Reviewed By: jptiz, lucas, vtorri Subscribers: ProhtMeyhet, cedric, #reviewers, #committers Tags: #efl Differential Revision:
2020-10-08Evil : move mkstemp(s) and mkdtemp in eina_file directlyVincent Torri
Summary: Also replace all mkstemp(s) and mkdtemp with the eina_file functions in the source Test Plan: run eina_file test Reviewers: raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2020-10-05eina - eina eifle - rename eina_file.c to indicate its for posixCarsten Haitzler (Rasterman)
2020-10-03singularize srand in eina_init - only once in one placeCarsten Haitzler (Rasterman)
simplify down to having a single srand() in eina_init and use urandom if it works and is there - if not, time(NULL) will do. it's the best we can...
2020-09-19eina thread - check return of pthread_attr_initCarsten Haitzler (Rasterman)
fix CID 1401031
2020-09-01efl: remove unused functionsMarcel Hollerbach
these are not used, if they are used again in the future, they can be get back via git.
2020-08-30eina - statgen (stat generation) - fix enable api to actually enableCarsten Haitzler (Rasterman)
it wasn't being enabled thus missing an entire optimization limiting stats to "once per frame" etc. to avoid overly syscall+io happy code from having as much of an impact @fix
2020-08-24eina file - fd close - handle fbsd 11 syscall abi as it broke in 12Carsten Haitzler (Rasterman)
2020-08-21eina file - fix getdents64 on older glibc's and use raw syscallCarsten Haitzler (Rasterman)
2020-08-21eina - eina_file_close_from - handle coverity theory that closes changeCarsten Haitzler (Rasterman)
this won't happen as the setup should not have the # of fd's found in 2st pass and 2nd pass for a dirfd change as nothing should interfere. comment to that effect and add a paranoid change num_closes to the number found
2020-08-20ecore - don't do anything with heap between fork and execCarsten Haitzler (Rasterman)
this avoids a possibgle deadlock if a malloc impl is holding a lock and has not released it at the time we fork. @fix
2020-08-17eina: Use INVALID_FILE_ATTRIBUTES instead of magic numberJoão Paulo Taylor Ienczak Zanette
Reviewed-by: Stefan Schmidt <> Reviewed-by: Vincent Torri <> Differential Revision:
2020-07-30eina vpath - fix windows ~username handling to only error when usedCarsten Haitzler (Rasterman)
we would always rrturn 0 on windows ... missing {} in block. fix that. @fix
2020-07-19Eina log: flush stderr on mintty-based terminalsVincent Torri
Summary: on those terminal, stderr is never flushed, so errors messages are not displayed when, for example, the app crashes Test Plan: test program : ```#include <Eina.h> #define ERR(...) EINA_LOG_DOM_ERR(log_dom, __VA_ARGS__) int main() { int log_dom = -1; eina_init(); log_dom = eina_log_domain_register("eet", EINA_COLOR_CYAN); if (log_dom < 0) { printf("error register\n"); return 0; } ERR("an error."); while (1) { } return 0; } ``` without the patch, nothing is displayed, even after a Ctrl-C to finish the program with the patch, the error message is displayed Reviewers: raster Reviewed By: raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2020-07-14docs: Correct the wrong API group name and typo in Evas, Eet, Eina, Eio and ↵Myoungwoon Roy, Kim
Elementary Summary: I found wrong API reference group name in mapbuf, Evas, Eet, Eina, Eio and fixed them. Test Plan: API reference documentation modification only Reviewers: segfaultxavi, stefan_schmidt Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2020-07-03Protect EINA_(UN)LIKELY with parenthesis around the exprWander Lairson Costa
Without it an expression like !EINA_LIKELY(a && b) expands !a && b Reviewed-by: Cedric BAIL <> Reviewed-by: Vincent Torri <> Differential Revision:
2020-06-26Native Windows: Eina: Resolve bad comparison while using windows strerror_sLucas Cavalcante de Sousa
`strerror_s` is the windows alternative of `strerror_r` used by EFL. `strerror_s` never return the error code with the message as `strerror_r` does, because of that, while comparing the first 14 characters of `Unknown error ` to the message from unknown code 4096 (`Unknown error`) they were accusing being different - in UNIX this works because the message returned is `Unknown error 4096`. This error was noticeable at `eina_error_test_failures` test case. This Diff adds the error code to the message in case of an `Unknown error`, making the windows implementation compliant with UNIX. Reviewed-by: Vincent Torri <> Reviewed-by: Wander Lairson Costa <> Reviewed-by: Stefan Schmidt <> Differential Revision:
2020-06-26Windows: fix eina_file_map_new()Vincent Torri
the offset passed to MapViewOfFile() must be a multiple of the granularity. is taken as basis for this patch Reviewed-by: Stefan Schmidt <> Reviewed-by: Wander Lairson Costa <> Differential Revision:
2020-06-25eina_array: micro optimize eina_array_pushMarcel Hollerbach
This commit does two things: - Tell the compiler that it is unlikely that we need to grow, and that it is unlikely that data is NULL. Sometimes the if check for data would get dropped out by the compiler when it can be ensured that it is != NULL. However, if we for example efl_add something and eina_push the result, the condition would not be removed, as there is no assertion efl_add would be != NULL. - Do not hide the array assignment in a branch, but make it the default branch, this way instruction cache caches the correct instruction, as branch prediction will now hopefully, due to the hinting, take the correct branch. While benchmarking this here (simply in elementary_perf), this reduced pipeline faults in eina_array_push quite a bit. (Btw. it is hard to track *which* exact calls to eina_array_push do cause that, as mostly this API gets inlined, so it was easier optimizing that, instead of the method arround) Reviewed-by: Stefan Schmidt <> Differential Revision:
2020-06-23Get rid of trailing whitespaces (8 / 14)Elyes HAOUAS
Remove trailing whitespaces Differential Revision:
2020-06-22eina_strbuf: introduce change last occurrence functionAli Alzyod
Reviewers: cedric, woohyun, bowonryu Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8757 Differential Revision:
2020-06-22eina_strbuf: if readonly strbuf is malloc, then it will stop being readonlyAli Alzyod
Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8757 Differential Revision:
2020-06-22eina_strbuf_manage_new: update documentationAli Alzyod
Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8757 Differential Revision:
2020-06-22eina_strbuf: resolve segfault when replace used with read_only bufferAli Alzyod
Summary: when eina_strbuf_replace is used by read_only buffer, this will cause segfault (access invalid memory) Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8757 Differential Revision:
2020-06-20eina_unicode: have explicit type conversionsBoris Faure
Summary: Found by running terminology's tests with UBSAN: include/eina-1/eina/eina_inline_unicode.x: runtime error: implicit conversion from type 'char' of value -62 (8-bit, signed) to type 'unsigned char' changed the value to 194 (8-bit, unsigned) Reviewers: #reviewers, vtorri Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2020-06-18meson: add Solaris supportVincent Torri
Summary: Add Solaris support for meson Test Plan: test on OpenIndiana Reviewers: raster, bu5hm4n, stefan_schmidt Reviewed By: raster, stefan_schmidt Subscribers: alarcher, stefan_schmidt, bu5hm4n, cedric, #reviewers, #committers Tags: #efl Differential Revision:
2020-06-11eina: only enable EINA_LOG_BACKTRACE when backtrace API is presentDaniel Kolesa
This prevents build breakage on platforms that either don't have backtrace() or don't have the appropriate library for it installed.
2020-06-10Use extern after EAPIVincent Torri
Reviewed-by: Stefan Schmidt <> Differential Revision:
2020-06-09eina - prefix - use smaller buffers for building stringsCarsten Haitzler (Rasterman)
use less stack space but no features as buffers are big enough for all content used or alloca'd now.
2020-06-09eina - abstratc content - smaller stack buffer for limited size stringCarsten Haitzler (Rasterman)
no need for a 4k buffer when 128 bytes will be plenty - short string.
2020-05-28build: make eina drag in the -lm flagMarcel Hollerbach
eina uses math.h we need to drag in this flag everywhere. Differential Revision:
2020-05-28build: rely on automatic pkg file generation for einaMarcel Hollerbach
this automatically brings it to efl-one, which makes this easier. Differential Revision:
2020-05-27build: add correct flags to efl-one.pcMarcel Hollerbach
they are required, and normally dragged in via eina.
2020-05-27refactor buildMarcel Hollerbach
libraries are split into deps, external deps, and pub deps. Evas engines are refactored to use the predefined engine deps. this is preparation work for efl-one. Reviewed-by: Stefan Schmidt <> Differential Revision:
2020-05-26build: lib: harmonize the use of package_c_args in all libsStefan Schmidt
Add it to subprojects which are not using it and remove and old ELEMENTARY_BUILD define we no longer use. This allows us to have a central place in the main file to set this variable. Reviewed-by: Marcel Hollerbach <> Reviewed-by: Vincent Torri <> Reviewed-by: João Paulo Taylor Ienczak Zanette <> Differential Revision:
2020-05-25eina - dont use SCHED_BATCH or SCHED_IDLE unless they are definedCarsten Haitzler (Rasterman)
2020-05-23ecore thread - feedback threads should not be background threads...Carsten Haitzler (Rasterman)
if try_no_queue is used - its a thread that clearly wantt to be out of the queue to run on its own so probably wants to wake up accurately and thus not be a backgroun rpriority task but and urgent one. ensure we set up priority accordingly as we didn't before. this should fix scheduling when under load for vsync @fix
2020-05-18Revert "Fix EAPI definition by defining EFL_BUILD for each built DLL"Carsten Haitzler (Rasterman)
This reverts commit 3ade45cbc82bea1772c7ad1afb7e1ba5dd67d930.
2020-05-18Fix EAPI definition by defining EFL_BUILD for each built DLLVincent Torri
Summary: EAPI must be defined to dllexport when building DLL, and to dllimport when using these DLL. To achieve this, define EFL_BUILD for each library and module, and set DLL_EXPORT unconditionally. Static library are and will be not supported Test Plan: compilation Reviewers: zmike, raster, jptiz Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: