profile/ivi/eina.git
15 years agoRemove warning.
cedric [Tue, 20 Jan 2009 15:42:34 +0000 (15:42 +0000)]
Remove warning.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38661 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years ago Fix wrong order and useless double include.
cedric [Tue, 20 Jan 2009 15:40:36 +0000 (15:40 +0000)]
Fix wrong order and useless double include.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38660 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years ago * fix warning (missing alloca declaration)
caro [Tue, 20 Jan 2009 08:29:41 +0000 (08:29 +0000)]
 * fix warning (missing alloca declaration)
 * formatting

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38657 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoFixed two trivial const correctness issues.
tilman [Sat, 17 Jan 2009 17:13:03 +0000 (17:13 +0000)]
Fixed two trivial const correctness issues.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38621 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoupdate ac_attribute.m4
caro [Wed, 14 Jan 2009 08:36:16 +0000 (08:36 +0000)]
update ac_attribute.m4

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38579 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoThe problem of the detection of __attribute__ on mac os x comes
caro [Tue, 13 Jan 2009 06:19:47 +0000 (06:19 +0000)]
The problem of the detection of __attribute__ on mac os x comes
from the fact that we put a definition of a function in the
body of main(). Moving it outside fixes it. In addition, the
extra flag i added in configure.ac is useless.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38565 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agomac os x port of gcc has problems with __attribute__ and thinks that
caro [Sun, 11 Jan 2009 09:25:47 +0000 (09:25 +0000)]
mac os x port of gcc has problems with __attribute__ and thinks that
there are nested functions. -fnested-functions must be passed to the
compiler to allow the compilation on that platform.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38544 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoAdded debian/rules files with a new permissions set(755).
quaker [Fri, 9 Jan 2009 16:33:51 +0000 (16:33 +0000)]
Added debian/rules files with a new permissions set(755).

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38519 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoprepare debian rules files for new chmod permissions.
quaker [Fri, 9 Jan 2009 16:31:51 +0000 (16:31 +0000)]
prepare debian rules files for new chmod permissions.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38518 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoAdded new set of debian subdirs.
quaker [Thu, 1 Jan 2009 11:35:17 +0000 (11:35 +0000)]
Added new set of debian subdirs.

BROKEN/etox
e
ecore
e_dbus
edje
edje_editor
edje_viewer
eet
efreet
eina
elicit
elitaire
embryo
E-MODULES-EXTRA
emotion
emphasis
empower
emprint
enhance
enity
entrance
ephoto
epsilon
esmart
estickies
etk
etk_extra
evas
evolve
ewl
exhibit
exml
expedite
imlib2
imlib2_loaders
MISC/engage
OLD/eclair
OLD/engrave
OLD/enotes
OLD/entrance_edit_gui
OLD/e_utils
OLD/evoak
OLD/examine
OLD/iconbar
PROTO/etk_server
PROTO/exchange
PROTO/extrackt
rage

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38399 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoRemoved debian subfolders - prepared for a new set of debian subdirs.
quaker [Thu, 1 Jan 2009 11:25:05 +0000 (11:25 +0000)]
Removed debian subfolders - prepared for a new set of debian subdirs.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38398 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agonaruto takahashi's fix for gcc3 patch
raster [Thu, 1 Jan 2009 03:09:48 +0000 (03:09 +0000)]
naruto takahashi's fix for gcc3 patch

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38397 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoMake eina compile on OSX
handyande [Wed, 31 Dec 2008 11:51:37 +0000 (11:51 +0000)]
Make eina compile on OSX

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38382 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoLet's see if the number of people asking what Eina is remains the same.
sachiel [Tue, 30 Dec 2008 15:38:11 +0000 (15:38 +0000)]
Let's see if the number of people asking what Eina is remains the same.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38354 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoDon't generate warning in some little case.
cedric [Mon, 29 Dec 2008 12:41:46 +0000 (12:41 +0000)]
Don't generate warning in some little case.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38348 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoDon't display useless warning.
cedric [Mon, 29 Dec 2008 11:49:35 +0000 (11:49 +0000)]
Don't display useless warning.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38346 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoFix a little mistake.
cedric [Mon, 29 Dec 2008 08:53:19 +0000 (08:53 +0000)]
Fix a little mistake.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38339 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoUse correct type.
cedric [Mon, 29 Dec 2008 08:53:01 +0000 (08:53 +0000)]
Use correct type.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38338 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agooops, it's EINA_SAFETY_CHECKS, not just SAFETY_CHECKS.
barbieri [Fri, 26 Dec 2008 19:14:57 +0000 (19:14 +0000)]
oops, it's EINA_SAFETY_CHECKS, not just SAFETY_CHECKS.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38328 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoeina safety checks.
barbieri [Fri, 26 Dec 2008 18:31:14 +0000 (18:31 +0000)]
eina safety checks.

safety checks will report null pointers and other error conditions on
public api's and can be disabled by compile time check.

note that in order to have these checks working we need to make
EINA_ARG_NONNULL() void, otherwise GCC can remove these checks since
they're known to be false.

This commit also make two minor changes:

  * list and hash accessors and iterators are created even for empty
    entities. This is correct in my point of view since NULL should
    indicate error. Having these in were an optimziation, but not
    worth it, these are not the most common case and hitting this path
    is not of much cost.

 * unmarked some parameters as nonnull, mainly on list and inlist.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38327 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoeina gets lots of gcc attributes to its api.
barbieri [Fri, 26 Dec 2008 13:17:51 +0000 (13:17 +0000)]
eina gets lots of gcc attributes to its api.

this should help with optimizations and code correctness, please see
"info gcc" for detailed explanation on these.

if you experience some functions not working as expected, please
double check if they're not marked with EINA_PURE or EINA_CONST, maybe
I misused them. Remove the macro and try again.

brief explanation:

 * EINA_WARN_UNUSED_RESULT: if you forgot to use the return of some
   function, it will emit a warning (and -Werror will make it an
   error). This way it will be harder to miss the attribution
   "l = eina_list_append(l, v)".

 * EINA_ARG_NONNULL(index, index...): if you give it an explicit NULL
   argument, or some tool (ie: clang) finds it could get a NULL but
   this is not accepted by API, then a warning will be emitted.  This
   will help those that still use eina_hash_add() as if it is
   evas_hash_add().

 * EINA_MALLOC: any non-NULL pointer it returns cannot alias any other
   pointer valid when function returns.

 * EINA_PURE: function have no effects other than the return and this
   return just depend on parameters and/or globals. You might call
   this function in a loop a thousand times and it will return the
   same value, thus you may move this function outside the loop and
   remove it.

 * EINA_CONST: stricter version of EINA_PURE, it will not check for
   global parameters, that is, you cannot consider pointer
   arguments. Use it for math things like "int sqrt(int)".

 * EINA_PRINTF(fmt, arg): will check format parameter specified in
   position "fmt" and passed arguments starting at position "arg", it
   will check for things like giving integers where short or strings
   were expected.

 * EINA_SCANF(fmt, arg): similar to eina_printf().

 * EINA_FORMAT(fmt): for use with things like dgettext(), it will get
   a printf-like format string and modifies it.

Please review and test it with your software, make sure you make clean
before you install the new version so it has any effect.

If you find some functions are missing EINA_WARN_UNUSED_RESULT and
EINA_ARG_NONNULL or others, please add them.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38323 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agofix possible errors with pointer/offset calculation.
barbieri [Tue, 23 Dec 2008 20:05:44 +0000 (20:05 +0000)]
fix possible errors with pointer/offset calculation.

it works on gcc, but maybe it would break in other compilers, so make
it safe.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38302 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoremove dead stores and reduce some variable scope.
barbieri [Tue, 23 Dec 2008 19:17:55 +0000 (19:17 +0000)]
remove dead stores and reduce some variable scope.

from clang report.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38294 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoUse float instead of double.
cedric [Tue, 23 Dec 2008 17:23:35 +0000 (17:23 +0000)]
Use float instead of double.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38292 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoMake it compile on Solaris.
cedric [Tue, 23 Dec 2008 13:33:11 +0000 (13:33 +0000)]
Make it compile on Solaris.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38290 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoRemove now uneeded header.
cedric [Tue, 23 Dec 2008 13:23:10 +0000 (13:23 +0000)]
Remove now uneeded header.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38289 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoRemove PATH_MAX use.
cedric [Tue, 23 Dec 2008 13:12:06 +0000 (13:12 +0000)]
Remove PATH_MAX use.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38288 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoMake code understandable by Visual Studio.
cedric [Tue, 23 Dec 2008 10:04:46 +0000 (10:04 +0000)]
Make code understandable by Visual Studio.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38287 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoDeclaration should be done before any code.
cedric [Tue, 23 Dec 2008 10:02:27 +0000 (10:02 +0000)]
Declaration should be done before any code.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38286 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoEina Win32 VS8 project added
dm [Mon, 22 Dec 2008 23:20:52 +0000 (23:20 +0000)]
Eina Win32 VS8 project added

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38282 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agooops, eina_stringshare_strlen() should never account '\0'.
barbieri [Sun, 21 Dec 2008 06:45:09 +0000 (06:45 +0000)]
oops, eina_stringshare_strlen() should never account '\0'.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38260 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoFix EINA_ARRAY_ITER_NEXT off by one bug. With this fix you can no longer push
cedric [Fri, 19 Dec 2008 17:55:57 +0000 (17:55 +0000)]
Fix EINA_ARRAY_ITER_NEXT off by one bug. With this fix you can no longer push
NULL pointer inside an array.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38232 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoUpdate ac_attribute macro and remove __UNUSED__ declaration from eina.
cedric [Wed, 17 Dec 2008 13:03:00 +0000 (13:03 +0000)]
Update ac_attribute macro and remove __UNUSED__ declaration from eina.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38179 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoAdd small bucket support.
cedric [Tue, 16 Dec 2008 16:49:29 +0000 (16:49 +0000)]
Add small bucket support.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38168 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoAdd include to remove warning.
cedric [Tue, 16 Dec 2008 16:49:00 +0000 (16:49 +0000)]
Add include to remove warning.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38167 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoManipulating NULL iterator should be concidered as a defined behaviour as it
cedric [Thu, 11 Dec 2008 13:54:59 +0000 (13:54 +0000)]
Manipulating NULL iterator should be concidered as a defined behaviour as it
give the possibility to write small code like :

it = eina_hash_iterator_tuple_new(hash);
eina_iterator_foreach(it, do_something_cb, NULL);
eina_iterator_free(it);

If hash is empty, but valid it will return a NULL iterator for this
example.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38104 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoIf we set the data free callback of a hash, we expect it to be called when
cedric [Thu, 11 Dec 2008 13:47:58 +0000 (13:47 +0000)]
If we set the data free callback of a hash, we expect it to be called when
calling all eina_hash_del functions.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38102 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoOnly allocate hash bucket when needed.
cedric [Tue, 9 Dec 2008 17:39:48 +0000 (17:39 +0000)]
Only allocate hash bucket when needed.
Make eina_hash_del_by_key really different from eina_hash_del.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38064 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoAll eina_hash_find* functions should not report problem when hash or key is NULL.
cedric [Tue, 9 Dec 2008 14:59:30 +0000 (14:59 +0000)]
All eina_hash_find* functions should not report problem when hash or key is NULL.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38059 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoRemove uneeded included.
cedric [Tue, 9 Dec 2008 14:30:54 +0000 (14:30 +0000)]
Remove uneeded included.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38058 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoeina_hash_find should not complain when hash or key is NULL.
cedric [Tue, 9 Dec 2008 14:24:08 +0000 (14:24 +0000)]
eina_hash_find should not complain when hash or key is NULL.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38057 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoAdd a visual feedback to counte test.
cedric [Tue, 9 Dec 2008 13:58:04 +0000 (13:58 +0000)]
Add a visual feedback to counte test.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38056 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoChange eina_counter_dump to return a string so it could work easily on windows.
cedric [Tue, 9 Dec 2008 13:55:10 +0000 (13:55 +0000)]
Change eina_counter_dump to return a string so it could work easily on windows.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38055 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoeina_hash_del must honor the data parameter when the key is passed. Propagate
cedric [Tue, 9 Dec 2008 13:52:09 +0000 (13:52 +0000)]
eina_hash_del must honor the data parameter when the key is passed. Propagate
it correctly.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38054 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoIt's cleaner to first include private header as they could define macro
cedric [Tue, 9 Dec 2008 13:06:17 +0000 (13:06 +0000)]
It's cleaner to first include private header as they could define macro
differently than public interface.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38050 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoPrevent warning from Eina Magic when hash population is 0.
cedric [Tue, 9 Dec 2008 13:05:33 +0000 (13:05 +0000)]
Prevent warning from Eina Magic when hash population is 0.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38049 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years ago__UNUSED__ macro is not exported by eina.
cedric [Tue, 9 Dec 2008 11:01:12 +0000 (11:01 +0000)]
__UNUSED__ macro is not exported by eina.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38045 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoAdd integer and pointer hash table helper.
cedric [Mon, 8 Dec 2008 17:31:55 +0000 (17:31 +0000)]
Add integer and pointer hash table helper.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38026 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoFix include related to previous Eina Magic patch.
cedric [Mon, 8 Dec 2008 10:51:51 +0000 (10:51 +0000)]
Fix include related to previous Eina Magic patch.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38017 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoApplication and library using Eina Magic API should be able to decide if they
cedric [Mon, 8 Dec 2008 10:18:05 +0000 (10:18 +0000)]
Application and library using Eina Magic API should be able to decide if they
want to check magic or not. This should not be forced by Eina config.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38014 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agohash: better handling of NULL, add magic checking.
barbieri [Sun, 7 Dec 2008 13:28:29 +0000 (13:28 +0000)]
hash: better handling of NULL, add magic checking.

 * evas: if we automatically destroy hash, check for NULL before
   handling it to eina api, which expect elements to be created with
   eina_hash_new() and thus will fail on NULL.
 * eina: add magic checking for eina_hash and eina_hash_iterator, this will
   help spot when NULL is used.
 * eina_hash_foreach: do not try to create the iterator if hash is NULL.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37982 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agorefactor eina_hash_del*, expose simpler functions and avoid GCC hack.
barbieri [Sat, 6 Dec 2008 06:58:56 +0000 (06:58 +0000)]
refactor eina_hash_del*, expose simpler functions and avoid GCC hack.

By using simpler functions for hash element deletion we can avoid the
hack to shut up GCC warking about hash_num not being used. As these
simple functions are more often needed than the catch-all, expose them
as well.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37962 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoLet valgrind help with EINA_MAGIC.
barbieri [Sat, 6 Dec 2008 06:53:14 +0000 (06:53 +0000)]
Let valgrind help with EINA_MAGIC.

Keep EINA_MAGIC at the end of the structure (WHEN POSSIBLE! Watch out
flexible arrays like char str[] at the end!)

this way if parts use EINA_MAGIC and others do not, it will possible overflow and valgrind can help us.

WARNING: make uninstall before update! Then make clean and make install, check if everything is working with "make check".

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37961 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoFix couple of issues with MAGIC handling.
barbieri [Sat, 6 Dec 2008 06:17:11 +0000 (06:17 +0000)]
Fix couple of issues with MAGIC handling.

eina_magic.h MUST include eina_config.h, otherwise it will not
consider EINA_MAGIC stuff. Worse than that, some files were including
that directly and were considering EINA_MAGIC attribute even if the
file that alloc'ed the memory were not!

Also add missing EINA_MAGIC_SET() to iterators and accessors.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37960 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agogrow array only when required, use step properly.
barbieri [Sat, 6 Dec 2008 06:13:55 +0000 (06:13 +0000)]
grow array only when required, use step properly.

We need to grow when we reach total amount, not when current + step > total.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37959 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoForce dummy_symbol to be visible.
barbieri [Sat, 6 Dec 2008 06:12:30 +0000 (06:12 +0000)]
Force dummy_symbol to be visible.

"make check" was failing with -fvisibility=hidden.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37958 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agodo not segv on NULL inlist.
barbieri [Sat, 6 Dec 2008 06:11:39 +0000 (06:11 +0000)]
do not segv on NULL inlist.

this was exposed by "make check", counter had no tests and it was failing.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37957 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoMake it possible to create iterators outside Eina.
barbieri [Sat, 6 Dec 2008 03:41:03 +0000 (03:41 +0000)]
Make it possible to create iterators outside Eina.

Many places in EFL we just create walk something, create a list with
walked data, return, then the user walks it again and then deletes
(which will walk again). For such cases it's way better to define
iterators or accessors.

I'm not moving any EFL code to it now, but if people are interested,
things like evas_render_method_list(), evas_font_available_list(),
evas_objects_at_xy_get(), evas_objects_in_rectangle_get(),
evas_object_smart_members_get() are good candidates. If the subject is
already using Eina list, then you can just use
eina_list_iterator_new() and return it, otherwise you can define your
own iterator, which is very easy.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37956 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoshut up gcc warning, with comment.
barbieri [Sat, 6 Dec 2008 03:02:30 +0000 (03:02 +0000)]
shut up gcc warning, with comment.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37953 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agofix list accounting on sort! bad - how did this hide for so long?
raster [Sat, 6 Dec 2008 02:51:04 +0000 (02:51 +0000)]
fix list accounting on sort! bad - how did this hide for so long?

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37951 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoFix namespace: Eina_Foreach -> Eina_Hash_Foreach.
barbieri [Sat, 6 Dec 2008 02:21:17 +0000 (02:21 +0000)]
Fix namespace: Eina_Foreach -> Eina_Hash_Foreach.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37950 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoAdd safe Eina list walk function.
barbieri [Sat, 6 Dec 2008 02:13:01 +0000 (02:13 +0000)]
Add safe Eina list walk function.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37949 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years ago Use includedir instead of prefix/include to install Eina headers.
illogict [Thu, 4 Dec 2008 16:25:40 +0000 (16:25 +0000)]
 Use includedir instead of prefix/include to install Eina headers.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37925 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years ago Typo: --enable enables an option.
illogict [Wed, 3 Dec 2008 17:27:51 +0000 (17:27 +0000)]
 Typo: --enable enables an option.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37913 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoFix a little memory leak when iterating.
cedric [Thu, 20 Nov 2008 13:26:18 +0000 (13:26 +0000)]
Fix a little memory leak when iterating.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37718 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoeina needs dl functions (Windows)
caro [Tue, 11 Nov 2008 07:22:47 +0000 (07:22 +0000)]
eina needs dl functions (Windows)

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37583 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoFix some constness.
cedric [Mon, 10 Nov 2008 16:23:56 +0000 (16:23 +0000)]
Fix some constness.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37576 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoFix order of free during hash free.
cedric [Mon, 10 Nov 2008 14:32:14 +0000 (14:32 +0000)]
Fix order of free during hash free.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37572 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoput static functions where they belong
caro [Sat, 8 Nov 2008 16:47:52 +0000 (16:47 +0000)]
put static functions where they belong

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37552 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoAdd missing return value.
englebass [Fri, 7 Nov 2008 06:50:45 +0000 (06:50 +0000)]
Add missing return value.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37528 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoAdd eina_array_data_set.
cedric [Wed, 5 Nov 2008 17:16:07 +0000 (17:16 +0000)]
Add eina_array_data_set.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37475 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoFix documentation.
cedric [Wed, 5 Nov 2008 16:20:37 +0000 (16:20 +0000)]
Fix documentation.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37474 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoAdd and use eina_stringshare_ref().
barbieri [Tue, 4 Nov 2008 16:25:12 +0000 (16:25 +0000)]
Add and use eina_stringshare_ref().

This is a faster "add", if we know we're using a shared string we know
the node without any need to search it, just increment reference and
exit.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37458 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agosmall doc fix
caro [Sun, 2 Nov 2008 09:41:14 +0000 (09:41 +0000)]
small doc fix

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37407 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoAdd dladdr and env code for eina_module from Vincent Torri.
cedric [Sat, 1 Nov 2008 15:39:53 +0000 (15:39 +0000)]
Add dladdr and env code for eina_module from Vincent Torri.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37374 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoffs does not exist on windows CE, so use Evil
caro [Sat, 1 Nov 2008 07:33:02 +0000 (07:33 +0000)]
ffs does not exist on windows CE, so use Evil

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37367 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoformatting
caro [Fri, 31 Oct 2008 16:59:45 +0000 (16:59 +0000)]
formatting

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37358 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoMake eina rectangle handle NULL case.
cedric [Thu, 30 Oct 2008 10:54:58 +0000 (10:54 +0000)]
Make eina rectangle handle NULL case.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37328 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoPack a hole when magic is in use.
barbieri [Wed, 29 Oct 2008 23:50:24 +0000 (23:50 +0000)]
Pack a hole when magic is in use.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37324 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoerror macro.
raster [Wed, 29 Oct 2008 23:41:55 +0000 (23:41 +0000)]
error macro.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37323 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoDo not pad node on 64bits.
barbieri [Wed, 29 Oct 2008 23:33:24 +0000 (23:33 +0000)]
Do not pad node on 64bits.

Instead of padding node we should always refer to offset of str[]
inside node, that way we save some bytes and work properly.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37322 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoadd error catching and output if mempool alloc/init fails.
raster [Wed, 29 Oct 2008 23:12:56 +0000 (23:12 +0000)]
add error catching and output if mempool alloc/init fails.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37321 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoRemove unused attribute warnings.
barbieri [Wed, 29 Oct 2008 14:51:18 +0000 (14:51 +0000)]
Remove unused attribute warnings.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37307 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoFix stringshare on 64bits platforms.
barbieri [Wed, 29 Oct 2008 14:18:29 +0000 (14:18 +0000)]
Fix stringshare on 64bits platforms.

sizeof(Eina_Stringshare_Node) is now 24 bytes on 64bits platforms, but
str[] was pointing to before that, to the 20th byte, causing out of
bounds access.

Adding the padding will cause str[] to use the correct position. It
wastes 4 more bytes, like pre-optimizations, but it's just on big
machines.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37305 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoremove from list properly and don't segv!
raster [Wed, 29 Oct 2008 01:38:47 +0000 (01:38 +0000)]
remove from list properly and don't segv!

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37290 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoignore generated data.
barbieri [Tue, 28 Oct 2008 18:26:06 +0000 (18:26 +0000)]
ignore generated data.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37283 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agorefactor eina_stringshare_del() to make it easier to read.
barbieri [Tue, 28 Oct 2008 18:12:10 +0000 (18:12 +0000)]
refactor eina_stringshare_del() to make it easier to read.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37282 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoimprove readability: avoid macros inside our code
barbieri [Tue, 28 Oct 2008 17:47:59 +0000 (17:47 +0000)]
improve readability: avoid macros inside our code

mixing #ifdef'ed blocks inside code is bad, can lead to warnings if
some variables are not used and it's a pain to read.

instead, just define functions and always call them, choose their
implementation based on the ifdef macros. I opted to have 2
declarations, but one can go like other parts and #ifdef around the
function contents as well.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37281 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agotest small strings.
barbieri [Tue, 28 Oct 2008 17:19:02 +0000 (17:19 +0000)]
test small strings.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37280 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoAdd missing magic check for existing node.
barbieri [Tue, 28 Oct 2008 17:16:42 +0000 (17:16 +0000)]
Add missing magic check for existing node.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37279 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoCode refactor and cleanup of eina_stringshare_add().
barbieri [Tue, 28 Oct 2008 17:15:07 +0000 (17:15 +0000)]
Code refactor and cleanup of eina_stringshare_add().

Cases are now handled in separate, doing less useless steps and easier
to understand since 3 cases are now distinct.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37278 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoThis test is now not defined. Remove it.
cedric [Tue, 28 Oct 2008 16:40:34 +0000 (16:40 +0000)]
This test is now not defined. Remove it.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37277 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agofix _GET macros.
barbieri [Tue, 28 Oct 2008 16:37:32 +0000 (16:37 +0000)]
fix _GET macros.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37276 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoMake Eina_Rectangle_Pool more usable.
cedric [Tue, 28 Oct 2008 15:28:46 +0000 (15:28 +0000)]
Make Eina_Rectangle_Pool more usable.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37275 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoFix a little typo.
cedric [Tue, 28 Oct 2008 14:45:16 +0000 (14:45 +0000)]
Fix a little typo.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37274 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agosave a byte per stringshare node.
barbieri [Tue, 28 Oct 2008 12:34:58 +0000 (12:34 +0000)]
save a byte per stringshare node.

we don't need to use 'begin' flag (that takes a byte) just to see if
we're in the same memory block as the head, just do a pointer math.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37270 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoreduce the popuplation_group size.
barbieri [Tue, 28 Oct 2008 12:26:05 +0000 (12:26 +0000)]
reduce the popuplation_group size.

we just have special case for up to 3 letters, everything else is
regular population.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37269 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agostringshare_del optimization.
barbieri [Tue, 28 Oct 2008 12:23:12 +0000 (12:23 +0000)]
stringshare_del optimization.

trade off safety by speed, we will always assume str was previously
shared, like evas_stringshare_del() did and we can know with zero-cost
the number of references and can avoid strlen() too.

When references drop to zero we still have to do the hash, access the
bucket and then lookup the Red-Black tree, then walk the list of
nodes, but avoiding so would use more memory, unacceptable at this
point.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37268 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoSave 4 bytes per big string shared.
barbieri [Tue, 28 Oct 2008 00:42:35 +0000 (00:42 +0000)]
Save 4 bytes per big string shared.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37258 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 years agoCheap way to get strlen of a shared string.
barbieri [Tue, 28 Oct 2008 00:31:09 +0000 (00:31 +0000)]
Cheap way to get strlen of a shared string.

it's not safe, but it's faster and can help for large strings, maximum
cost is 4 comparisons plus one pointer access.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37257 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33