Commit Graph

1192 Commits

Author SHA1 Message Date
Bryce Harrington 98fd820648 eina: Fix matrix header guard name
Summary:
eina_matrix.h includes matrix2, matrix3, and matrix4, so the header
guards shouldn't specify MATRIX3.

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5508
2017-11-21 11:00:53 +09:00
Bryce Harrington cc14a1288c eina: Indicate in and out parameters for eina_matrix
Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5496
2017-11-20 12:02:24 +09:00
Cedric Bail 7821367b1a eina: properly initialize EINA_ERROR_VALUE_FAILED. 2017-11-17 11:12:06 -08:00
Cedric Bail 7cfb9e00ed eina: properly initialize EINA_ERROR_NOT_MAIN_LOOP. 2017-11-17 11:11:48 -08:00
Cedric Bail 574d4526cb eina: properly initialize EINA_ERROR_MAGIC_FAILED. 2017-11-17 11:11:28 -08:00
Cedric Bail 8fbd8bfe2a eina: fail with an Eina_Error on copy failure. 2017-11-17 10:44:26 -08:00
Andy Williams 63c6724f08 eina: fix docs for manage_read_only_new 2017-11-16 12:49:56 +00:00
Bryce Harrington 1227f914e2 eina: Improve API docs for eina_crc.h
Reviewers: cedric, ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: jpeg, segfaultxavi

Differential Revision: https://phab.enlightenment.org/D5468
2017-11-14 13:14:59 +00:00
Bryce Harrington 7764abe8f6 eina: Fix spelling/punctuation errors in docs (quaternion..rectangle)
Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5450
2017-11-13 12:09:21 +09:00
Bryce Harrington b60c3fb3ba eina: Fix spelling/punctuation errors in documentation (safepointer..strbuf)
Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5458
2017-11-13 12:05:09 +09:00
Bryce Harrington dab3a6fca3 eina: Fix spelling/punctuation errors in documentation (thread..xattr)
Summary:
Also makes some of the doxygen comment line spacing/formatting
consistent.

Interesting ref on grammar of 'an uniform' vs. 'a uniform':
  https://english.stackexchange.com/questions/4700/is-it-a-uniform-or-an-uniform
It is AN honor to work with such A uniform language as English. *sigh*

Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5459
2017-11-13 12:04:59 +09:00
Bryce Harrington d0ded365e9 eina: Add API doxygen for eina_rbtree_inline_lookup()
Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5460
2017-11-13 12:04:39 +09:00
Bryce Harrington 3830cbaa25 eina: Improve eina_alloca API dox
Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5461
2017-11-13 12:04:32 +09:00
Bryce Harrington 50fba34e6c eina: Fix spelling/punctuation errors in documentation (prefix..promise)
Reviewers: cedric, ajwillia.ms

Subscribers: jpeg, segfaultxavi

Differential Revision: https://phab.enlightenment.org/D5438
2017-11-08 15:20:34 +09:00
Bryce Harrington 70f7f88eab eina: Fix spelling errors in documentation (matrixsparse..module)
Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5425
2017-11-07 09:03:57 +00:00
Carsten Haitzler 3790c4d47a eina freeq - make it clear that content is invalid on submission
and that the free function cannot access content of the pointer
(unless the pointer memory size is 0).
2017-11-07 17:36:57 +09:00
Cedric BAIL e891a01749 eina: add a function return a reference to a copy of Eina_Value. 2017-11-03 15:31:30 -07:00
Andy Williams 82b0da0c8a Correct struct labelling
Avoids linking every occurrence of 'The'
2017-11-02 20:57:47 +00:00
Bryce Harrington 054e817572 eina: Fix spelling errors in documentation (log..matrix)
Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5417
2017-11-01 11:36:50 +09:00
Bryce Harrington 57d0617fec eina: Fix spelling errors in documentation (file..lock)
Summary: Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>

Reviewers: cedric, ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5410
2017-10-31 11:31:41 +00:00
Amitesh Singh 3505b7618c eina: eina_value: fix the typo in doc 2017-10-30 16:11:57 +09:00
Amitesh Singh 04fe5e10a2 eina: eina_value - Add "struct tm" support
Ref T6204

@feature
2017-10-30 16:04:53 +09:00
Jean Guyomarc'h 87c2b37d8d eina: enforce strict Eina_Bool parameter 2017-10-29 13:59:17 +01:00
Carsten Haitzler 31f8c6f17e eina debug - ensure sockaddr is 0'd out before filling in to avoid junk
valgrind does complain about this. i'm not sure it matters but it's
safer to 0 it out in case some field is being used that we don't think
is being used that we didn't set.
2017-10-29 11:19:48 +09:00
Bryce Harrington 6ac4497162 eina: fix spelling errors in documentation
Reviewers: cedric, ajwillia.ms

Reviewed By: cedric

Subscribers: segfaultxavi, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-27 12:12:25 -07:00
JinYong Park b550581dde eina: add param, return type description for eina_unicode.
Summary: Add missing parameters and return type description to remove doxygen warning

Test Plan: API Doxygen Revision

Reviewers: cedric, jpeg, myoungwoon, Jaehyun_Cho, id213sin

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-27 12:12:25 -07:00
Jaehyun Cho ccbe98ccb2 eina_ustringshare: Add description of return to resolve doxygen warning
Change-Id: I1994dbb3bf628c67c43763c8521fcfe7c5179308
2017-10-26 13:20:54 +09:00
Jaehyun Cho 2a133ff290 eina_stringshare: Fix doxygen warning
Change-Id: Id2f9e8b16d7e1dd581b71df6842f1b467e535634
2017-10-26 13:20:54 +09:00
Jaehyun Cho e65e8a4fba eina_str: Fix doxygen warning
Change-Id: I4cac2b3836f8d0fb05d76b039af66b41fca0c19f
2017-10-26 13:20:54 +09:00
Jaehyun Cho 786a7ae421 eina_strbuf: Fix doxygen warning
Change-Id: I82b15f1352f6a7925d7cde0dfb91c3d835a35dd7
2017-10-26 13:20:54 +09:00
Jaehyun Cho cb3eb09451 eina_module: Add description of parameter to resolve doxygen warning
Change-Id: I545b68e86976d4e2479fbf87ff5a8b38b9905c13
2017-10-26 13:20:54 +09:00
Cedric BAIL e474edc9f6 eina: add helper to return already known to fail future. 2017-10-25 13:39:44 -07:00
Jaehyun Cho 6c8ca79ff2 eina_matrix: Fix doxygen warnings
Change-Id: I7e697bae24170422d6253f91ce089d9485bd0e64
2017-10-25 21:59:55 +09:00
JinYong Park 61f4a5e033 eina_log: add parameter description on "eina_log_level_check"'s annotation
Summary:
In eina_log_level_check's annotation, parameter description is missing,
so warning is occurred on doxygen

Test Plan: API Doxygen Revision

Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5375
2017-10-25 19:11:19 +09:00
JinYong Park a205d9f60a eina_file: fix space location in annotation
Summary: Space character is located in wrong position, so it occur doxygen warning

Test Plan: API Doxygen Revision

Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5374
2017-10-25 19:11:15 +09:00
Andy Williams 8e25467a65 Fix building on windows
@author vtorri
2017-10-22 20:21:12 +01:00
Cedric BAIL b410417d68 eina: silence warning. 2017-10-19 16:34:25 -07:00
Cedric BAIL 4c44067d0b eina: add Evil include on Windows as strndup is provided by it. 2017-10-19 15:29:35 -07:00
Cedric BAIL 867ad5000b eina: forgotten label on eina_file_unlink on Windows. 2017-10-19 10:28:45 -07:00
Cedric BAIL 38536c9ae9 eina: downgrad ERR to WRN when not finding a file. 2017-10-19 10:26:26 -07:00
Jean-Philippe Andre a1a04629e4 benchmarks: Fix titles in gnuplot
Just replace _ with \_ as _ means subscript.
2017-10-18 11:02:16 +09:00
Cedric Bail 6e64a104a6 eina: use a stringshare to store the filename internally.
T6164
2017-10-17 16:15:19 -07:00
Cedric Bail e0807ce797 eina: fix eina_hash_stringshared_new to actually compute the hash on the pointer.
Before this patch, the key would always be zero and the hash would solely
rely on the rbtree to be efficient. This improve the situation by using the pointer
as the key during hash computation.
2017-10-17 16:15:18 -07:00
Cedric Bail 29c6c3b95b eina: refactor eina hash computation of key length and hash value. 2017-10-17 16:15:18 -07:00
Bowon Ryu a5323998c7 eina: add missing documentation for quad.
Summary: This adds missing doxgen documentation for eina_quad.

Test Plan: API Doxygen Revision

Reviewers: cedric, jpeg, myoungwoon

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-17 11:00:53 -07:00
Bowon Ryu 47f70a43d1 eina: add missing documentation for rectangle.
Summary: This adds missing doxgen documentation for eina_rectangle.

Test Plan: API Doxygen Revision

Reviewers: cedric, jpeg, myoungwoon

Reviewed By: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-17 10:56:23 -07:00
Bowon Ryu a0bcf57bef eina: fix doxygen typo for eina_thread.
Summary: fix typo.

Test Plan: API Doxygen Revision

Reviewers: cedric, jpeg, myoungwoon

Reviewed By: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-17 10:54:24 -07:00
SangHyeon Jade Lee 5798e226d5 fix typo space in include on eina_lock
remove space typo between #sharp and include about inline header
in eina_lock.h
2017-10-17 14:58:56 +09:00
Bowon Ryu 01147d084f eina: 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

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-10-16 13:39:33 -07:00
Prince Kumar Dubey 030a3448fb eina: fix warning if EINA_SAFETY_CHECKS is disabled
Summary:
Putting local variable "d" under preprocessor flag "EINA_SAFETY_CHECKS" to avoid below warning, if "EINA_SAFETY_CHECKS" is disabled.
        1. local variable "d" is assigned but not used.
        2. If warning 1 is resolved then variable "d" will be unused.

Reviewers: raster, cedric

Reviewed By: cedric

Subscribers: jpeg, rajeshps

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-10-16 13:36:12 -07:00
Bryce Harrington 1f6d3b40e4 eina: spellfix comment in matrix code
Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-13 11:51:56 -07:00
Bryce Harrington 150485b5d4 eina: document matrix3 API routines.
Summary: This adds missing doxygen documentation for eight matrix3 operations.

Reviewers: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-13 11:47:58 -07:00
Subodh Kumar be63db00a7 eina: comparing unsigned integer with less than zero.
Summary: Unsigned integer should not be compared less than zero.

Test Plan: NA

Reviewers: cedric

Subscribers: shilpasingh, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-13 11:46:32 -07:00
Amitesh Singh 2cf24eb304 eina: strbuf - Add strftime related functions
eina_strbuf_append_strftime()
eina_strbuf_insert_strftime()
eina_strbuf_prepend_strftime() - macro

We need these functions for implementing generic format function
interface especially for calander.

Ref T6204
2017-10-13 16:04:24 +09:00
Subodh Kumar f418d62af3 eina: comparing less than zero with unsigned long int
Summary:
Unsigned integer should not be compared to less than zero
@fix

Test Plan: NA

Reviewers: cedric

Reviewed By: cedric

Subscribers: jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-09 16:37:50 -07:00
Cedric BAIL 674a75ca8b eina: continue to check for magic. 2017-10-05 09:28:13 -07:00
Cedric Bail 43b524eea2 eina: Eina_Prefix should never contain a NULL, no code expect it. 2017-10-04 20:57:08 -07:00
Cedric Bail 4ccc5d4f68 eina: allow eina_file_close(NULL) to simplify code using Eina_File. 2017-10-04 20:56:15 -07:00
Vincent Torri 10ba064b65 Windows: remove XP support and forbid compilation and run on this platform
Test Plan: run on XP

Reviewers: jpeg, cedric, ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: ajwillia.ms

Differential Revision: https://phab.enlightenment.org/D5245
2017-10-01 18:09:46 +01:00
Carsten Haitzler a37e1e479d eina debug - add missing unlock in erite err case
fix CID 1381503
2017-10-01 16:04:35 +09:00
Carsten Haitzler 05b26102cf eina debug - check write return values and complain on failure
coverity - fix CID 1377521
2017-09-29 12:26:57 +09:00
Carsten Haitzler b7d4372221 eina debug - check write return value and complain
makes coverity happy - CID 1377524
2017-09-29 12:26:57 +09:00
Cedric BAIL 3a3ae49afd eina: add an helper to setup Eina_Value structure description.
This is particularly useful on system like Windows who doesn't allow
setting pointer at compile time in static const structure.
2017-09-27 16:30:31 -07:00
Vincent Torri 9b416d2360 eina: remove EFL_HAVE_WIN32_THREADS define as it is unused since winpthread is used
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-09-26 10:17:04 -07:00
Jeeyong Um c3709d2a5a docs: eina_value: fix a typo 2017-09-25 09:24:16 +09:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Bryce Harrington 224b75b46d eina: document matrix3 multiplication routines
Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-09-18 11:18:43 -07:00
Jean-Philippe Andre 8fb194d969 efl: Use Eina.Position2D for Efl.Gfx.position
Note: This is a little bit more cumbersome in some places but in most
it's more convenient than (x,y).
2017-09-18 13:22:54 +09:00
Jean-Philippe Andre f3eff6eb3e efl: Introduce Eina.Rect and switch EO APIs to it
It's a complex struct but defined in EO as a simple struct. ABI-wise
it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle
also work on Eina_Rect out of the box, most of the code dealing with
x,y,w,h will require no modifications either.

But Eina_Rect provides direct access to a size or position 2d component,
as well as the usual x,y,w,h. The field "rect" is provided as a
convenience for code dealing with both Eina_Rectangle and Eina_Rect. We
may or may not require it.

Note: Size2D could use unsigned values but I have spotted a few places
in the code that actually use -1 to indicate invalid size (as opposed to
0x0).

@feature
2017-09-18 13:22:52 +09:00
Jean-Philippe Andre 05c051405e eina file: Ensure populate is safe to call
This makes sure that the call to madvise is safe. On Linux it's not too
much of an issue as checks are made inside madvise, and the worst that
can happen is an error is returned (EINVAL). Not great.

But if MAP_POPULATE is not present, as is the case on *BSD, then the
internal function _eina_file_map_populate() is used for the populate
rule. In that case actual data is read and we should make sure not to
trigger a segfault or bus error.

Also, this makes sure that in case of HugeTLB we actually populate all
pages, rather than one page out of 8 (we were jumping by 16Mb instead of
2Mb).

Note: Can we get the size of a HugeTLB at runtime? We're assuming 2Mb
which might very well not be the case!
See: https://wiki.debian.org/Hugepages

Tested by disabling MAP_POPULATE and observing crashes :)

@fix
2017-09-18 11:58:53 +09:00
Jean-Philippe Andre b2ea60691e eina file: Fix map_populate on the global map
If eina_file_map_all() is called, the map isn't added to the internal
hash "rmap" and so _eina_file_map_rule_apply() would never be called.

@fix

asa
2017-09-18 11:58:53 +09:00
Jean Guyomarc'h ca731fbfb6 eina: handle errors when creating a mempool
If the backend initialization failed, the mempool would still be
successfully created. The mempool is now destroyed on failure.
2017-09-16 14:28:39 +02:00
Cedric BAIL 112777fc7a eina: add iterator macro for Eina_Value that contain an array. 2017-09-14 11:00:34 -07:00
Cedric BAIL 024c6a9fc3 efl: silent warnings shown on solaris due to missing header files. 2017-09-14 09:59:02 -07:00
Cedric Bail 8fbfab83e9 eina: add an ability to quickly convert from an Eina_Value to an Eina_Binbuf. 2017-09-13 17:26:04 -07:00
Cedric Bail f5487c5d3e eina: fix Eina_Rectangle support in Eina_Value.
Thanks for the review Gustavo.
2017-09-13 10:39:31 -07:00
Cedric Bail 430095d4f1 eina: allow convertion to BLOB from Eina_File Eina_Value by mmap the file. 2017-09-13 10:38:36 -07:00
Cedric Bail af452c439d eina: improve Eina_File support in Eina_Value.
Thanks Gustavo.
2017-09-13 10:36:05 -07:00
Vincent Torri 966577ffed eina: add an Eina_Value helper for Eina_Rectangle. 2017-09-12 17:03:49 -07:00
Cedric BAIL 95dd799715 eina: add an Eina_Value helper for Eina_File. 2017-09-12 17:03:17 -07:00
Cedric BAIL 19e0f35d1c eina: cleanup documentation for promise. 2017-09-12 10:16:44 -07:00
Cedric BAIL fa9acf8b35 eina: add eina_promise_data_set symetric to eina_promise_data_get. 2017-09-11 16:09:43 -07:00
Cedric BAIL 54083a7835 eina: fix typos in eina_promise_all_array documentation. 2017-09-11 16:08:23 -07:00
Stefan Schmidt 79956eee63 eina: fix build for big endian platforms
Summary:
The code in eina_debug.c requires the eina_swapX() functions on big endian platforms, so include the required header.

Test Plan: Do build on big endian platform like ppc64 or s390x.

Subscribers: kubu, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5158
2017-09-11 14:08:41 +02:00
Thiep Ha aced128e85 eina_promise: remove shadowed declaration warning 2017-09-05 15:56:00 +09:00
Jean Guyomarc'h b5e7a00681 eina: fix destruction of the osx semaphores
Well... that's just embarassing... semaphore_destroy() actually takes
the mach task as its first parameter, not the second. This core
amazingly worked very fine on macOS earlier than Sierra.

Fixes T5245
2017-09-05 00:45:04 +02:00
Gustavo Sverzut Barbieri d258774c2a Eina_Future: add eina_future_resolved()
This is a helper that creates a promise, then a future and immediately
resolves the promise, this will let the future be dispatched as usual,
from a clean main loop context.
2017-09-04 10:24:00 -03:00
Guilherme Iscaro 5bd8c9a78d Eina: Add Eina_Promise/Eina_Future.
This commit adds a new promise/future API which aims to replace
efl_future.
2017-09-04 10:24:00 -03:00
Jean-Philippe Andre f4ed430ddc eina_array: Fix magic checks to return
The EINA_MAGIC check inside eina_array were just printing the error
message, without failing. This could lead to more crashes than
necessary.

@fix
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre 4a6b52465d eina: Add convenience eina_rectangle_equal
@feature
2017-08-30 17:29:52 +09:00
Carsten Haitzler a5c8e883d8 eina mmap safety - only map zeropages if it's an eina file that sigbuses
restrict mapping /dev/zero to only eina files having a sigbus
reported. the mmap was before all our file access used eina_file i
think thus the raw mmap of it. now walk all eina files and find the
candidate and only then if it exists flag is as having a faulty i/o
backing and map the zerto pages then return, otherwise call abort.
more restricted mapping and perhaps a fix for not trapping non-efl
issues.

@fix
2017-08-30 12:03:41 +09:00
Carsten Haitzler 15cdd9b71b eina file - use recursive locks for cache and file to avoid deadlock
since we have a sigbusd handler that flags an eina file with io errors
it has to walk the file cache and every file... taking locks. if those
locks were taking already in the current thread the sighandler was
called in... we'd deadlock. since this basicallly never happens (when
do we see i/o errors really? not much)... we never saw this as it'd
also reauire this race condition to happen too. but it is a problem
waiting to happen. this fixes that by moving to recrusive locks.

@fix
2017-08-30 11:31:02 +09:00
Jean Guyomarc'h 232e193673 eina: fix typo in documentation 2017-08-29 20:56:31 +02:00
Gustavo Sverzut Barbieri 71a74aa718 eina_value: silent -Wextra for EINA_VALUE_EMPTY
-Wextra complains about missing initializers, so provide the full 8
 bytes of the first member of the union.
2017-08-28 18:26:29 -03:00
Gustavo Sverzut Barbieri 9ac1cb4fad eina_value: add helper: eina_value_struct_desc_get().
this helper will validate a struct and fetch its description, also
checking if the user version matches.
2017-08-24 11:13:56 -03:00
Gustavo Sverzut Barbieri 103b134916 eina_value_util: eina_value_X_get() helpers.
These helpers will validate the type prior to get its value, also
enforcing the correct pointer is passed.
2017-08-23 18:32:13 -03:00
Gustavo Sverzut Barbieri f4b02d87d6 eina_value_util: init helpers (stack/return).
These helpers are similar to eina_value_X_new(), however do not
allocate the Eina_Value, rather return it.

These are useful when the value struct storage was already there but
needs to be initialized in a single line, like as stack variables or
when returning a value.
2017-08-23 18:32:13 -03:00
Gustavo Sverzut Barbieri c158d5c17a eina_value_util: add missing eina_value_*_new() for basic types.
make all basic types available as _new() helpers.
2017-08-23 18:32:13 -03:00
Gustavo Sverzut Barbieri 39acaab5e9 eina_value_util: remove "_util" from names.
these utilities are very useful, but names became too long. Since they
do not conflict with anything else, shorten them.

Since they were available before as inline function, provide a macro
to rename them for old source that's compiled against newer library.
2017-08-23 18:32:13 -03:00
Guilherme Iscaro 6cbfe100d5 Eina_Value type EINA_value. 2017-08-23 18:32:13 -03:00
Guilherme Iscaro 3ed176370d Eina: Add EINA_VALUE_TYPE_ERROR
This new type will be used by the new promise/future implementation,
which will be used to flag errors.
2017-08-23 18:32:13 -03:00
Gustavo Sverzut Barbieri 4da53492ae add EINA_VALUE_EMPTY, allow flushing empty values.
EINA_VALUE_EMPTY is basically a zeroed Eina_Value, handy for declaring
and returning.

To cope with the rest of efl, free/del/flush on NULL shouldn't
complain, so flusing an empty value should be quiet.
2017-08-23 18:32:13 -03:00
Gustavo Sverzut Barbieri 4cd1257b1b value size is stored in type, no need to manually specify them. 2017-08-15 19:01:23 -03:00
Cedric BAIL b5cede94ea eina: add an API to check if a pointer is a valid element of a mempool. 2017-08-15 13:46:34 -07:00
Jean-Philippe Andre b290cb5de0 eina_slstr: Fix leak in an error case
This function takes ownership of the incoming strbuf
2017-08-04 10:24:03 +09:00
Carsten Haitzler 256450d294 eina debug - remove other swap and comment on the weirdness of this 2017-08-03 09:08:04 +09:00
Cedric BAIL eed23765f9 eina: failing to load a module is actually an ERR that user should see. 2017-08-02 16:16:33 -07:00
Guilherme Iscaro 48443fda8f Eina_File: Avoid using munmap() on file->global_map.
When a virtualized file is created the file->global_map will not
point to a mmapped region, thus it's not safe to use munmap() during
the file cleanup. Only use munmap() if the file is backed by a FD.

Fixes: T5234.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-08-02 16:03:20 -07:00
Carsten Haitzler 470b48d63c eina debug - new debug infra - comment out and make a note on bad endian
bad endian... code... see the comment in the src about why i think
this is bad as obviously the buffer pointed to is a 64bit type always
that is a pointer to something...
2017-08-02 22:41:54 +09:00
Carsten Haitzler cae354d299 eina hamster count - use a fixed version, revision etc. so builds repro
this should help with repdocucable builds by having our hamsters
constant for a build of a specific code revision.

@fix
2017-08-02 17:12:28 +09:00
Carsten Haitzler 573d0cf586 eina debug - set length after freeing/iterating over the keys
found by PVS studio
2017-07-31 10:03:59 +09:00
Carsten Haitzler cfe4f19f54 eina simple xml parser - remove pointless memcmp of 0 bytes
no point - all we are doing is having a final fallback of any tag that
starts with ! that isnt a special one like !DOCTYPE, !-- comment and
![CDATA stuff... analysers dont like these pointless calls.

found by PVS studio
2017-07-29 11:03:01 +09:00
Carsten Haitzler d6785cfeb6 eina debug - if calloc for session struct failed - return NULL
makes analysers happy but really doesnt change anything - moves the
abort/crash/exit somewhere else.

found by PVS studio
2017-07-29 10:37:44 +09:00
Carsten Haitzler b944fc7c9b eina evlog debugging - when freeing debug buf with mmap 0 size after
munmap would not munmap the memory with  a size of 0... so zero the
size after the munmap.

found by PVS studio

@fix
2017-07-29 09:08:40 +09:00
Carsten Haitzler 091146fa34 eina inarray accessor - use right type in parameter
this actually wasn't a bug that would cause a crash. cloning an array
access would fail as the magic check would find its an accessor not an
array. indeed a bug... but we never used this anywhere i can find.

this was cast to the correct func ptr callabck in the accessor struct
as the clone method though.. thus everyhting was happy with it
seemingly.

found by PVS studio

@fix
2017-07-29 08:55:27 +09:00
Carsten Haitzler bb7e8456c4 eina debug timer - handle fail wakeup write with error complaint
fix CID 1377528
2017-07-23 19:26:56 +09:00
Carsten Haitzler 758e7d3562 eina debug - don't try and collect stats on more than a million threads
sanity check... just in case.
2017-07-23 19:09:11 +09:00
Carsten Haitzler 6a65cb2f3c eina debug - add comments to cpu debug using locks to pause sysmon
this is intended so leave comments saying so. coverity doesn't like it
with CID 1377549
2017-07-23 18:43:58 +09:00
Carsten Haitzler c69f9d2837 eina debug - check return value of syscall for errors
this should fix CID 1377550
2017-07-23 18:40:04 +09:00
Jean-Philippe Andre 5db3e557c5 eina_list: Ensure single init
This fixes a crash in make check when --profile=dev is explicitely
enabled. eina_list_init() is called by the standard eina_init() loop
and by eina_debug_init() as well.

Honestly I'm not sure why it doesn't crash for other people as
well...

The crash was in eolian_suite during the second eina_init (called
from eolian_init).
2017-07-20 17:47:51 +09:00
Andy Williams bf8a0eead2 OSX: fix version detection in build 2017-07-17 13:04:30 +01:00
Carsten Haitzler 9d1a8bb082 eina debug bt sig handle - fix build on osx for clockid_t
fix #ifdefs so it should in theory build on osx 10.11.x

@fix
2017-07-17 16:04:01 +09:00
Mike Blumenkrantz 83ff889f6d eina: fix eina_tiler_equal to not always return true
ref e3f4f4457d
broken by D996

@fix
2017-07-14 18:43:00 -04:00
Mike Blumenkrantz 47ddbede05 eina: make tiler function params const where appropriate
stop throwing warnings when passing const params to functions which don't
modify the params
2017-07-14 18:43:00 -04:00
Stefan Schmidt 9e3ff96f7b eina: inarray: remove documentation pointer to non-existing functions
These do not longer exist in our current code base (did they ever?).

Thanks a lot to Vincent Torri for spotting this!
2017-07-13 11:21:59 +02:00
Al Poole 9aeaef55c4 eina_file: fix unmap of unmapped region when Eina_File has copied data and not a map;
Summary:
This was causing problems on non-Linux architectures as eina_file_real_close unmapped not mapped data. Added a "copied" flag to Eina_File which is set on eina_file_virtualize (on copied data), and tested for when eina_file_real_close does the unmap. I'm surprised Linux allowed this. Certainly all of the BSDs crashed with the previous behaviour.

@fix T5479

Test Plan: Example inlcude Rage and Enlightenment Thumb on BSD systems which use eina_file_virtualize with emotion to obtain album artwork.

Reviewers: raster, cedric, jpeg

Reviewed By: jpeg

Maniphest Tasks: T5479

Differential Revision: https://phab.enlightenment.org/D5006
2017-07-07 13:22:53 +09:00
Carsten Haitzler eeb1eb1b74 eina - fix eina_file_virtualize to copy data to an aligned addr
so we copy data to an UNALINED memory address (just after whatever
string we packed on the end of the eina file struct header). this is
bad. especially for non-intel architectures. this forces a 16 byte
alignment which should cover us.

@fix
2017-07-07 12:08:01 +09:00
Jean-Philippe Andre daf87093f8 eina file: Fix rare crash in line iteration
I'm not sure about the rest of this code, so it's possible that
the index is increased even if it shouldn't. But I've observed
a crash at this line, apparently when reaching the end pointer.
2017-07-03 16:23:40 +09:00
Jean Guyomarc'h 077791b7cc eina,ecore_cocoa: fix detection of the macOS SDK version
There was trouble with Homebrew's CI to build EFL on a macOS < 10.12
which uses a 10.12 SDK. See PR #13252 on github, Homebrew/homebrew-core
for details.

@fix
2017-06-27 23:14:31 +02:00
Mike Blumenkrantz 7b4e9f5d77 eina_log: make a log level of 0 disable the log domain
this has always been specified in the docs as the means by which a log domain
is disabled

@fix
2017-06-23 17:43:44 -04:00
Daniel Zaoui 716cc6be5b Eina Debug: include Evil for realpath support 2017-06-11 10:03:53 +03:00
Daniel Zaoui 0e947166aa Eina Debug: fix a bug resulting in registering opcodes twice
The opcodes registration request is sent directly in case the connection
is already made. Otherwise, the request is waiting for the connection to
be made by the dedicated thread (not the main loop).
That's why the request can be sent by the two different threads at the
same time, leading to send it twice. It means a callback for an opcode
would be invoked twice everytime a request with this opcode is received.

This patch fixes it by checking if the request has already been sent.
2017-06-11 09:44:57 +03:00
Al Poole a7e8dff3e4 eina: fix implicit declaration of pthread_set_name_np in eina_debug.
Summary: Checks and includes necessary headers (FreeBSD et. al)

Reviewers: cedric

Subscribers: jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-06-08 13:36:25 -07:00
Cedric BAIL 634715a2ca eina: as we use string.h function in this inline function, we better include it.
Reported by @netstar, thanks.
2017-06-08 11:41:39 -07:00
Cedric BAIL 1aa2b6de14 eina: enable fallthrough warning suppression only on GCC 7 and above. 2017-06-06 09:57:14 -07:00
Jérémy Zurcher 81bcc14615 eina: fix clang compilation with EINA_FALLTHROUGH
btw, using clang 4.0.0, I can't produce fallthrough warnings using
-Weverything, -Wall or -Wimplicit-fallthrough
2017-06-06 09:58:06 +02:00
Cedric BAIL 2995cc16b7 eina: add EINA_FALLTHROUGH to disable warning on useful case serie with no break.
GCC has started introducing a detection for series of case in a switch statement
without break for each case. We do use that trick a lot to reduce our code base.
Even if in most case we have documented this so that people using coverity don't
try to fix it. Now with GCC we need to silence it properly to avoid future
problem.
2017-06-05 12:07:57 -07:00
Cedric BAIL e83914d496 eina: silence gcc warning.
Code is correct and won't lead to a case where size is > 0 and buffer
isn't set, but gcc can't see the relation between both variable.
2017-06-05 12:07:57 -07:00
Jean Guyomarc'h cc4c40769d eina: attempt to make the code more portable
This fixes the build on macOS.
2017-06-05 19:06:35 +02:00
Jeeyong Um 89c55209cf Eina_Debug: Fix missing include of signal.h 2017-06-05 20:18:46 +09:00
Daniel Zaoui fa3e54b15e Eina_Debug: Fix config.h usage
It was used inside eina_debug.h that is a public header.
Terminology compilation was failing when including its own config.h.
2017-06-05 11:49:08 +03:00
Daniel Zaoui c0eb231edb Fix Windows compilation
Thanks to vtorri for his help on this delicate issue named Windows
2017-06-05 08:55:38 +03:00
Daniel Zaoui 897fc331ce Set Eina Debug APIs as Beta 2017-06-05 08:55:38 +03:00
Daniel Zaoui ea50cbd2b3 Support endianness 2017-06-05 08:55:38 +03:00
Daniel Zaoui 758bb0557c Support opcodes registration for Windows
A standard static array with symbols whose addresses are only known at
runtime is not supported in Windows.
2017-06-05 08:55:38 +03:00
Daniel Zaoui ab01f3f696 Rename opcodes for a better readability 2017-06-05 08:55:38 +03:00
Daniel Zaoui 9e47089311 Remove alloca of potential big size 2017-06-05 08:55:38 +03:00
Daniel Zaoui 6e1eb7193d Bt: Remove special handling for mainloop 2017-06-05 08:55:38 +03:00
Daniel Zaoui 253d3ffe44 Remove thread management
The handling to forward requests is let to the callbacks.
2017-06-05 08:55:37 +03:00
Daniel Zaoui 2ff96adcc1 Removes modules feature 2017-06-05 08:55:37 +03:00
Daniel Zaoui 6e93528f41 Init the communication with the daemon from the debug thread 2017-06-05 08:55:37 +03:00
Daniel Zaoui d6e3ab67db Replace shell remote connection with localhost TCP connection 2017-06-05 08:55:37 +03:00
Daniel Zaoui 36959014d3 Remove _session variable as it is not needed anymore 2017-06-05 08:55:37 +03:00
Daniel Zaoui 27228d3dc1 Add data to opcode registration callback 2017-06-05 08:55:37 +03:00
Daniel Zaoui 8babb55646 Add API to get/set data to session 2017-06-05 08:55:36 +03:00
Daniel Zaoui d970c855ea Add API to get the session dispatcher 2017-06-05 08:55:36 +03:00
Daniel Zaoui bb87302808 Clean code and add comments 2017-06-05 08:55:36 +03:00
Daniel Zaoui 87e68e3ed0 Adapt bt stuff to Eina Debug signal infras 2017-06-05 08:55:36 +03:00
Daniel Zaoui 9fadbc00ad Move internals constants to private h file 2017-06-05 08:55:36 +03:00
Daniel Zaoui 76e5a8f268 Fix Coverity issues 2017-06-05 08:55:36 +03:00
Daniel Zaoui f5cbb61bf4 Add a better support of timers
Now, the timers are handled in one dedicated thread. Multiple timers are
supported.
2017-06-05 08:55:36 +03:00
Daniel Zaoui 39c6a9562b Add shell remote connection
This feature is essential to debug remote applications.
2017-06-05 08:55:36 +03:00
Daniel Zaoui 5251ee326d Fix typo 2017-06-05 08:55:36 +03:00
Daniel Zaoui 6ad0d6ab22 Free packet buffer outside of the dispatcher 2017-06-05 08:55:36 +03:00
Daniel Zaoui cd8b2fc66b Close file descriptor when the session is terminated 2017-06-05 08:55:36 +03:00
Daniel Zaoui 5f268ec26a First patch of the Eina Debug layer rewriting
Eina Debug is a new layer aimed for EFL debugging. It offers scalability
by allowing registration of operations not specific to EFL core.

The protocol is simple and the APIs try to provide as much
functionalities/freedom as possible.
2017-06-05 08:51:49 +03:00
Jeeyong Um 0e78ecb325 eina: Fix broken link in doc to introduce integer hash algorithms 2017-05-30 13:34:34 +09:00
Cedric BAIL 26d401351d eina: fix reproductible build.
This make eina hamster depend on when configure was generated. This
should only happen really when we make a new tarball for release.

@fix

T5495
2017-05-18 16:20:06 -07:00
Prasoon Singh 9c62ab525b eina: fix for escapable charachters not getting escaped if it comes after '\t' or '\n'
Summary:
Escaping is not happening whenever any escapable characters is coming after
'\t' or '\n'. It will also fix invalid read of 1 byte which happens for string where
last charachter is '\t' or '\n' like "eina\t".

Test Plan:
Take a string like "eina\t ". Observe space which is followed by tab is not getting
escaped.

Signed-off-by: Prasoon Singh <prasoon.16@samsung.com>

Reviewers: shilpasingh, rajeshps, govi, cedric

Reviewed By: shilpasingh

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-05-09 10:37:16 -07:00
Mike Blumenkrantz ab67217434 eina_tiler: use int size matching Eina_Rectangle internally to avoid overflow
since this code's creation it seems that the internal int size was set to use
short in order to micro-optimize memory usage, while the api function parameters
used Eina_Rectangle which had a larger int size. when initializing the internal
rect struct, this would lead to overflows which resulted in broken tilers which
returned iterators with no valid rects after having valid rects added

test case: run weston-subsurfaces

@fix
2017-04-21 16:16:12 -04:00
Cedric Bail 8187e34741 eina: some architecture don't like prefetch on NULL apparently. 2017-04-21 11:29:38 -07:00
Carsten Haitzler f077fb1e0d eina mmap - fix warnings thanks to missing include
add include for eina_file.h
2017-04-21 16:38:40 +09:00
Carsten Haitzler b26276a7e9 eina debug - fix include of eina_file.h that was missing
fixes new warnings
2017-04-21 16:38:18 +09:00
Cedric BAIL b2893dfc77 eina: use new API eina_file_close_on_exec. 2017-04-18 16:54:03 -07:00
Cedric BAIL 9d8549f7a3 eina: add an API to correctly do close on exec. 2017-04-18 16:53:26 -07:00
Carsten Haitzler 330368c10c eina log - try and fix coverity complaint about integer overflow again
it seems coverity didn't like our checks like if end - start > 0xffff
then dont do anything. this should effectively stop any issues but
seemingly not, so try another way to keep coverity happy.

CID 1361219
2017-04-18 17:30:50 +09:00
Carsten Haitzler f3f032e63f eina log - try and fix coverity complaint about integer overflow again
it seems coverity didn't like our checks like if end - start > 0xffff
then dont do anything. this should effectively stop any issues but
seemingly not, so try another way to keep coverity happy.

CID 1361220
2017-04-18 17:30:50 +09:00
Ivan Furs 0e7ee821cd eina: For Windows fix crash when the file was opened many times.
Summary:
A similar problem as:
    commit 62b469749a

Reviewers: NikaWhite, t.naumenko, an.kroitor, FurryMyad, cedric, raster, vtorri, rimmed

Reviewed By: raster

Subscribers: artem.popov, cedric, jpeg

Tags: #windows, #efl

Differential Revision: https://phab.enlightenment.org/D4788
2017-04-17 11:51:05 +09:00
Gustavo Sverzut Barbieri 13a8842614 eina: fix compilation warning on _WIN32 due missing strndup()
Eina.h will include Evil.h, but those using direct include of internal
headers must include it as well.
2017-03-29 12:44:19 -03:00
Vincent Torri eff7bab48f Eina_Value: strdup() is used, so include string.h 2017-03-27 08:22:06 +09:00
Artem Popov 8d6c90351c Eina_Xattr: fix memory corruption
Summary:
There should be reallocation +1 (for last '\0') and also
checking >0, not !=0, because of getxattr can return -1 in case of error
@fix

Reviewers: cedric, raster, NikaWhite, jpeg

Reviewed By: NikaWhite

Subscribers: myoungwoon

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D4734
2017-03-23 16:27:22 +02:00
Marcel Hollerbach 12d01c1259 eina_debug: do not leak a spinlock when the path is not given 2017-03-18 22:10:43 +01:00
Ivan Furs 4d13273e3b eina_file: fixed T2244
Summary:
dirty fix for 'eet' problems with file deletion on WINDOWS
to work with the commit: D4698, D4699

Reviewers: cedric, NikaWhite, rimmed, vtorri, raster

Reviewed By: cedric

Subscribers: artem.popov, cedric, jpeg

Maniphest Tasks: T2244

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-03-15 10:49:55 -07:00
Chris Michael 3fa7570bda eina: Fix more typo in doxygen
The eina_(rw)_slice_startswith functions both incorrectly describe how
the 'prefix' parameter is used, so fix those also

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-03-13 15:50:37 -04:00
Chris Michael 47f34bb7a3 eina: Fix typo in doxygen
eina_(rw)_slice_startswith functions both incorrectly describe the
return value as 'slice ends with', when clearly the function is used
to find if a slice 'starts with' a prefix

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-03-13 12:11:46 -04:00
Cedric Bail 4766316935 eina: force copy of not copied virtualized file while doing an eina_file_dup.
The other way around is pretty much impossible as you don't know who does
an eina_file_dup and for how long they keep there reference.

T5234
2017-03-08 12:24:41 -08:00
Ivan Furs 8a10ef10cb eina_file: delete handle->fm(handel of function CreateFileMapping)
Summary: CreateFileMapping return handle. The handle before use is always closed. This handle can be immediately closed after use.

Reviewers: cedric, raster, vtorri, rimmed, an.kroitor, FurryMyad, NikaWhite

Reviewed By: raster

Subscribers: artem.popov, cedric, jpeg

Tags: #windows

Differential Revision: https://phab.enlightenment.org/D4699
2017-03-06 19:18:46 +09:00
Marcel Hollerbach 86fe6609c2 eina: move the _eina_main_loop set before we init anything
otherwise we could get into problems.

fix T4891

@fix
2017-02-28 11:46:56 +01:00
Jean-Philippe Andre 1974f5d511 eina_value: Fix min/max values of long for Windows
long is 32 bit on Windows (both 32, 64 bit).

I wonder why eina_value doesn't simply use LONG_MIN/MAX O_o

Fixes T5204
2017-02-28 16:25:18 +09:00
Flavio Ceolin 1cbd32aca1 eina:list: Fix resource leak
Summary:
The usage of the macro EINA_MAGIC_CHECK_LIST can
lead (in some cases) to leaks.

Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>

Reviewers: jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4679
2017-02-28 16:00:45 +09:00
Myoungwoon Roy, Kim ec71f6607a docs: Fix typos and some wrong expressions in Eina API reference doxygen.
Summary: I had fixed some typos and some wrong expressions, such as capital letters, singular, and orders of groups in Eina API reference doxygen.

Test Plan: Doxygen Revision

Reviewers: stefan, cedric, raster, Jaehyun_Cho, jpeg

Reviewed By: jpeg

Subscribers: conr2d

Differential Revision: https://phab.enlightenment.org/D4674
2017-02-21 10:46:28 +09:00
Mykyta Biliavskyi 94eaa792c2 eina utils: fix build without getpwent.
If HAVE_GETPWENT isn't defined - the closing brace was missed.
Also prevent situation when strdup() tried to duplicate NULL
pointer, because that could cause segfault.

@fix
2017-02-20 11:29:56 +02:00
Stefan Schmidt 539bc7552b eina_strbuf / eina_ustrbuf: add since tags for newly added APIs
These six have been added in this cycle but missed the since tags.
2017-02-15 12:31:50 +01:00
Stefan Schmidt b9524b6aa5 eina_lock: add since tag to now exposed eina_lock_debug API
This function was static inline before but form 1.19 onwards its EAPI so give
it a since tag.
2017-02-15 12:31:50 +01:00
Stefan Schmidt b6f84653d4 eina: binbuf: add since tags new append_slice and insert_slice APIs 2017-02-15 12:31:50 +01:00
Stefan Schmidt 73349edc19 eina: make the ein_file_unlink symbol availbale form the ein_file header
It was only defined in the c file. Without any documentation, since tag, etc.

tests/eina/eina_test_file.c:855:4: warning: implicit declaration of function ‘eina_file_unlink’
[-Wimplicit-function-declaration]
2017-02-13 14:30:27 +01:00
Carsten Haitzler d04cd6af10 eina inlist - cast container via void ptr to avoid warnings
we really can't do much here but our direct casting causes warnings in
apps or anyone using this macro so keep things silent as our pointer
tricks are actually ok but the compiler can't figure it out.
2017-02-12 14:45:04 +09:00
Carsten Haitzler ba3ac16b62 evlog/log bt - fix size casting tot stop warning when printing errs 2017-02-12 00:32:22 +09:00
Carsten Haitzler 1a481cfe4d eina utils and vpath - use euid not uid if setuid for correct user
was using uid not euid for "if setuid use safe way to get location" -
ie the user that effectively owns the process, not nominally.

@fix
2017-02-09 18:50:15 +09:00
Carsten Haitzler bb9bb20000 eina debug monitor - dont use XDG_RUNTIME_DIR if setuid
avoids possible issues with debug monitor + setuid
2017-02-08 21:19:39 +09:00