Commit Graph

16 Commits

Author SHA1 Message Date
Gustavo Sverzut Barbieri e4af7c100c EINA API BREAK: no more individual modules init/shutdown.
Being able to indivually initialize individual modules was initially
"good", but at end it's putting complexities on users that would try
to "optimize" by doing just what they used, but in the end most people
would get them wrong, users would have to do lots of code and etc. At
the end it does not worth.

Most module init just register handful errors and log domains, so are
cheap. The exception is mempool users, that would dlopen() stuff, but
people that are concerned (embedded) can just compile those statically
in eina.

Since at the end any real application would use most of modules, we
actually end saving lots of function calls that would do nothing other
than increment a global counter.

I also did the init/shutdown use an array, making it easier to
maintain. The inital dependencies were analysed by a script I wrote, I
hope it's all right.

Please fix any breakages you find!



SVN revision: 42300
2009-09-06 22:21:56 +00:00
Vincent Torri 72b87160a2 * add eina_config.h in all source files. Fix linking with Visual Studio
* move eina_private.h and eina_safety_checks.h just after eina_config.h


SVN revision: 42077
2009-08-28 12:03:34 +00:00
Gustavo Sverzut Barbieri c8534587f2 do not check for data, eina_iterator_next/eina_accessor_data_get() does that.
SVN revision: 41984
2009-08-25 21:05:00 +00:00
Gustavo Sverzut Barbieri e3cce7b79d New macros, documentation and consistency for iterators and accessors.
EINA_ITERATOR_FOREACH() and EINA_ACCESSOR_FOREACH() are new macros to
help us forget about nasty C details (like cast to (void **)).

Document most iterators and accessors.

All iterators now set EINA_ERROR_OUT_OF_MEMORY if it's the case.



SVN revision: 39267
2009-02-27 16:32:22 +00:00
Gustavo Sverzut Barbieri ab95d9183d 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.



SVN revision: 38327
2008-12-26 18:31:14 +00:00
Gustavo Sverzut Barbieri 7eb0826e29 remove dead stores and reduce some variable scope.
from clang report.


SVN revision: 38294
2008-12-23 19:17:55 +00:00
Gustavo Sverzut Barbieri 5939d76d9c 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.



SVN revision: 37960
2008-12-06 06:17:11 +00:00
Vincent Torri d6ae9053ad minor formatting
SVN revision: 36293
2008-09-28 13:10:08 +00:00
Cedric BAIL 550ebc9ab1 Add hash and rbtree delete callback, cleanup the code and improve performance (hash as a new internal structure).
We still need a hash function for removing a node from the hash and destroying it at the same time.



SVN revision: 36222
2008-09-24 17:14:29 +00:00
Cedric BAIL 8acad8a50e Add rbtree destructor without tree reorder and use it.
SVN revision: 36188
2008-09-23 16:07:48 +00:00
Vincent Torri 78c9527052 * add documentation. The tutorial needs to be written, though
* rename eina_arra_count() to eina_array_count_get() and
   eina_arra_get() to eina_array_data_get()


SVN revision: 36003
2008-09-15 19:17:15 +00:00
Cedric BAIL 3e562ccfc2 Add a context to the callback.
SVN revision: 35719
2008-08-28 16:33:40 +00:00
Cedric BAIL 9494785cb7 Inline red black tree lookup.
SVN revision: 35716
2008-08-28 14:37:26 +00:00
Cedric BAIL 9596935138 Fix rbtree removal. Was a bug due to rotation and parent lost.
SVN revision: 35714
2008-08-28 13:54:51 +00:00
Vincent Torri dafd079639 * move standard header files from eina_private.h to source files
* minor formatting


SVN revision: 35705
2008-08-28 07:46:42 +00:00
Cedric BAIL 394c787dde Add Red Black tree API. Right now only insertion, lookup and iterator work.
The current implementation choose to move the node allocation outside of eina
control like eina_inlist. They currently have the same memory footprint as
eina_inlist and the implementation of insertion and lookup are iterative
making it quite fast. This should make them a good competitor of eina_inlist
for eina_hash and eina_stringshare.



SVN revision: 35689
2008-08-27 10:07:12 +00:00