Gustavo Sverzut Barbieri
b21c687f61
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.
SVN revision: 37962
2008-12-06 06:58:56 +00:00
Gustavo Sverzut Barbieri
09924b54e5
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".
SVN revision: 37961
2008-12-06 06:53:14 +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
Gustavo Sverzut Barbieri
08832b519b
grow array only when required, use step properly.
...
We need to grow when we reach total amount, not when current + step > total.
SVN revision: 37959
2008-12-06 06:13:55 +00:00
Gustavo Sverzut Barbieri
6203f4b6be
do not segv on NULL inlist.
...
this was exposed by "make check", counter had no tests and it was failing.
SVN revision: 37957
2008-12-06 06:11:39 +00:00
Gustavo Sverzut Barbieri
a00eaac6a6
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.
SVN revision: 37956
2008-12-06 03:41:03 +00:00
Gustavo Sverzut Barbieri
f8868ffa96
Fix namespace: Eina_Foreach -> Eina_Hash_Foreach.
...
SVN revision: 37950
2008-12-06 02:21:17 +00:00
Gustavo Sverzut Barbieri
03fca99e56
Add safe Eina list walk function.
...
SVN revision: 37949
2008-12-06 02:13:01 +00:00
Chidambar Zinnoury
5c2c6049f1
Use includedir instead of prefix/include to install Eina headers.
...
SVN revision: 37925
2008-12-04 16:25:40 +00:00
Cedric BAIL
5257321d9a
Fix some constness.
...
SVN revision: 37576
2008-11-10 16:23:56 +00:00
Cedric BAIL
e8ed3963c8
Add eina_array_data_set.
...
SVN revision: 37475
2008-11-05 17:16:07 +00:00
Cedric BAIL
e63dde947d
Fix documentation.
...
SVN revision: 37474
2008-11-05 16:20:37 +00:00
Gustavo Sverzut Barbieri
9e80a086f6
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.
SVN revision: 37458
2008-11-04 16:25:12 +00:00
Vincent Torri
c8e2f1f51f
small doc fix
...
SVN revision: 37407
2008-11-02 09:41:14 +00:00
Cedric BAIL
437c220266
Add dladdr and env code for eina_module from Vincent Torri.
...
SVN revision: 37374
2008-11-01 15:39:53 +00:00
Gustavo Sverzut Barbieri
72ae858dac
fix _GET macros.
...
SVN revision: 37276
2008-10-28 16:37:32 +00:00
Cedric BAIL
e243e4408a
Make Eina_Rectangle_Pool more usable.
...
SVN revision: 37275
2008-10-28 15:28:46 +00:00
Gustavo Sverzut Barbieri
24ee564949
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.
SVN revision: 37257
2008-10-28 00:31:09 +00:00
Cedric BAIL
72e45419ec
Add Eina_Rectangle_Pool support. Typically help for font handling in OpenGL or
...
any case where you need to split a rectangle in many differents small rectangle.
SVN revision: 37252
2008-10-27 20:24:12 +00:00
Carsten Haitzler
089b8ac181
add a stringshare dumper so we can examine what's in there and improve usage.
...
SVN revision: 37186
2008-10-27 00:36:22 +00:00
Carsten Haitzler
7d0d0aaf7f
handle some bizarre build issues...
...
SVN revision: 37048
2008-10-24 10:57:00 +00:00
Sebastian Dransfeld
a8c2834987
modules most export init and shutdown as EAPI
...
SVN revision: 37042
2008-10-24 06:24:08 +00:00
Cedric BAIL
b114ef85de
Really return Eina_Bool.
...
SVN revision: 37022
2008-10-23 12:50:33 +00:00
Cedric BAIL
4bb02bdf37
Add more error information during eina module load.
...
SVN revision: 36955
2008-10-22 08:56:19 +00:00
Gustavo Sverzut Barbieri
93a280b7d7
eina_bool is now an unsigned char.
...
This makes clear what size and if we have a signal or not in our type,
so no compilers have the right to choose different for us (like they
do with enum).
Also fixes compile of C++ programs with eina_rectangle.h, that
contains some inline code, the expression evaluates a boolean
expression and compiler does not know how to convert that to old
Eina_Bool.
SVN revision: 36939
2008-10-21 15:21:37 +00:00
Cedric BAIL
430fb672cd
Rename EINA_LIST_ITER_NEXT to EINA_LIST_FOREACH.
...
SVN revision: 36930
2008-10-21 12:49:29 +00:00
Cedric BAIL
68d377afe6
Rename EINA_INLIST_ITER_NEXT/EINA_INLIST_ITER_LAST to EINA_INLIST_FOREACH/
...
EINA_INLIST_REVERSE_FOREACH so it best match is behaviour. Asked by Gustavo.
SVN revision: 36928
2008-10-21 12:19:57 +00:00
Cedric BAIL
1950725606
Add merge function to list data type.
...
SVN revision: 36922
2008-10-21 11:28:38 +00:00
Cedric BAIL
c9779e876f
Actually include eina_convert in the main header.
...
SVN revision: 36860
2008-10-20 15:01:01 +00:00
Cedric BAIL
a52cc857fa
Put the mempool backend structure with other structure.
...
SVN revision: 36855
2008-10-20 13:23:18 +00:00
Carsten Haitzler
31727e370d
actually compile!
...
SVN revision: 36849
2008-10-20 12:08:16 +00:00
Cedric BAIL
4953eb74fe
Apps can now provide their own mempool.
...
SVN revision: 36847
2008-10-20 11:40:01 +00:00
Cedric BAIL
a61ba1c35a
Fix some warning.
...
SVN revision: 36563
2008-10-10 09:33:40 +00:00
Cedric BAIL
5cddd1f760
Remove dead code.
...
SVN revision: 36493
2008-10-07 11:07:03 +00:00
Cedric BAIL
195b2da188
Give more choice to eina_list mempool.
...
SVN revision: 36479
2008-10-06 14:47:09 +00:00
Cedric BAIL
36b46ca065
Remove dead declaration.
...
SVN revision: 36399
2008-10-02 16:23:27 +00:00
Cedric BAIL
439401682d
Reduce code size, and improve sort speed.
...
SVN revision: 36382
2008-10-01 16:30:30 +00:00
Cedric BAIL
7c47066009
Change module API to use Eina_Array as we want to use mempool and module for Eina_List.
...
Fix at the same time a closing bug in eina_module.c.
SVN revision: 36312
2008-09-29 13:28:42 +00:00
Vincent Torri
79375f9123
* fix clean and dist rules
...
* create eina-$(maj_version).pc.in file automatically
SVN revision: 36292
2008-09-28 12:43:21 +00:00
Cedric BAIL
8b33d245e6
Inlined functions require NULL, so including stdlib.h is required.
...
SVN revision: 36266
2008-09-26 15:26:36 +00:00
Cedric BAIL
6f5b3584dd
Store build information inside eina_config.h, and fix magic use.
...
SVN revision: 36263
2008-09-26 11:41:55 +00:00
Cedric BAIL
42d39725b4
Last part of quarium patch.
...
SVN revision: 36257
2008-09-25 14:46:48 +00:00
Cedric BAIL
8b85ce70d4
Patch from quarium.
...
Add magic to array and list.
Need to patch autotools to generate something like eina_config.h.
SVN revision: 36256
2008-09-25 14:46:16 +00:00
Cedric BAIL
e8b25fb405
Add a sort benchmark.
...
SVN revision: 36250
2008-09-25 12:41:49 +00:00
Cedric BAIL
040e5573d9
Patch from Arnaud de Turckheim "quarium" <quarium@gmail.com>.
...
Use magic inside stringshare without slowdown of benchmark.
Fix magic when not in DEBUG mode.
SVN revision: 36246
2008-09-25 09:02:41 +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
bf418729d2
Group all rbtree functions.
...
SVN revision: 36209
2008-09-24 12:58:31 +00:00
Jorge Luis Zapata Muga
c9f08f6124
New module API. Port this API to the mempool subsystem and the tests.
...
Now the modules can define a default function that will be called when the module is loaded and unloaded.
SVN revision: 36207
2008-09-24 12:55:31 +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
476222cc6c
add main doc for eina_convert
...
SVN revision: 36187
2008-09-23 15:57:57 +00:00
Vincent Torri
4313d2b084
* fix list doc
...
* minor other doc fixes
* link the mempool modules statically to libeina when requested
* don't compile static lib of mempool when they are built as shared lib
SVN revision: 36178
2008-09-23 05:17:49 +00:00
Cedric BAIL
3fc07d2aac
Add helper for inlined red black tree manipulation.
...
SVN revision: 36164
2008-09-22 13:02:08 +00:00
Cedric BAIL
710354bd96
Change eina_benchmark_register API as it can fail in many occasion.
...
SVN revision: 36097
2008-09-19 12:32:24 +00:00
Vincent Torri
f50feadeae
* add benchmark and file documentation
...
* reorganize a bit more. it's not finished
* fix spellingg and formatting
* gnuplot file names generated by our bechmarks tests have an
absolute time description and not H:M:S description, as this
breaks the check out of the repo on Windows.
SVN revision: 36090
2008-09-19 05:22:43 +00:00
Cedric BAIL
8bda22fced
Add some type checking to Inlined List.
...
SVN revision: 36084
2008-09-18 14:22:48 +00:00
Cedric BAIL
80e138df1b
Remove moved declaration.
...
SVN revision: 36082
2008-09-18 14:21:38 +00:00
Cedric BAIL
4423005ab4
Avoid some dereferencing and provide inline for mempool alloc/free/realloc.
...
SVN revision: 36078
2008-09-18 14:16:47 +00:00
Cedric BAIL
ce16573cb3
Add init/shutdown to benchmark and fix its users.
...
SVN revision: 36073
2008-09-18 10:04:46 +00:00
Cedric BAIL
9d54723060
Add forgotten declaration.
...
SVN revision: 36069
2008-09-18 10:01:45 +00:00
Vincent Torri
54de28cc68
* add doc for counter and convert modules
...
* minor spelling, formatting and doxygen fixes
SVN revision: 36057
2008-09-17 18:55:54 +00:00
Cedric BAIL
f7d92d57a4
Add statistics, gc support to mempool and a workaround path lookup for module.
...
SVN revision: 36051
2008-09-17 15:20:35 +00:00
Vincent Torri
7fd7cc717c
* update the doc of stringshre
...
* fix minor warnings from doxygen
SVN revision: 36004
2008-09-15 19:58:36 +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
e3e2afca18
Don't compute string length when not really needed.
...
SVN revision: 36001
2008-09-15 13:38:42 +00:00
Cedric BAIL
9979edd82a
Don't limite the range of the hash function. It's the dutty of the caller.
...
SVN revision: 35998
2008-09-15 12:35:27 +00:00
Cedric BAIL
c52f7b7b62
Make inline only usefull function.
...
Return information about potential error during eina_array_remove.
SVN revision: 35888
2008-09-08 12:19:15 +00:00
Vincent Torri
b73180cd01
* add array doc
...
* eina_array_push() returns now a bool
* fix compilation
SVN revision: 35871
2008-09-07 19:12:49 +00:00
Vincent Torri
557107790a
* add accessor doc
...
* fix and add some links
SVN revision: 35865
2008-09-07 07:19:19 +00:00
Vincent Torri
0b6f01fec5
* add doc for iterators
...
* add table of content on the main page
SVN revision: 35864
2008-09-07 05:44:00 +00:00
Vincent Torri
ae2e95969f
* add documentation and a tutorial for the error module
...
* change api (eina_error_register to eina_error_msg_register)
SVN revision: 35838
2008-09-05 07:58:38 +00:00
Cedric BAIL
991867bd7b
Share eina_benchmark to other libs also.
...
SVN revision: 35832
2008-09-04 15:06:26 +00:00
Cedric BAIL
a257cf02f3
Add a routine to extract path information.
...
SVN revision: 35814
2008-09-03 14:40:12 +00:00
Cedric BAIL
345242f6c3
Update copyright credit correctly.
...
SVN revision: 35774
2008-09-01 12:42:16 +00:00
Cedric BAIL
3e562ccfc2
Add a context to the callback.
...
SVN revision: 35719
2008-08-28 16:33:40 +00:00
Cedric BAIL
f6bcf421ce
Forgotten declaration.
...
SVN revision: 35718
2008-08-28 16:28:35 +00:00
Cedric BAIL
9494785cb7
Inline red black tree lookup.
...
SVN revision: 35716
2008-08-28 14:37:26 +00:00
Cedric BAIL
f2a6fcb19c
Add needed minimal header.
...
SVN revision: 35708
2008-08-28 11:12:23 +00:00
Cedric BAIL
2c38b1df51
Add more type description and include all the headers.
...
SVN revision: 35707
2008-08-28 10:05:22 +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
Vincent Torri
4485f06f66
fix a bit list documentation. Not finished yet.
...
SVN revision: 35702
2008-08-28 06:31:18 +00:00
Vincent Torri
9824a1a86c
Update documentation:
...
* run 'make doc' to generate the documentation. Hence
gendoc disappear. Doxyfile is moved to doc/
* update main page and doc of hash table, but it has to
be filled.
SVN revision: 35692
2008-08-27 13:34:04 +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
Cedric BAIL
4390a37a70
Add eina_array_pop and rename eina_array_append by eina_array_push.
...
SVN revision: 35679
2008-08-26 10:23:45 +00:00
Jorge Luis Zapata Muga
7ae301f601
Place pre-conditions where they belong
...
Remove unused rectangle functions
SVN revision: 35634
2008-08-23 19:50:21 +00:00
Cedric BAIL
4bc094c45a
As we are heavy user of int to string and double to string in the EFL, provide a fast and portable one.
...
SVN revision: 35604
2008-08-21 14:20:41 +00:00
Cedric BAIL
da8c3be66f
Add a proposal for a module/plugins API that should match every requirement I
...
received. It's a little huge right now, but work quite nicely.
It support "static" module, version, recursive lookup and should be able to
replace the module/plugins support in evas and ecore.
SVN revision: 35534
2008-08-18 08:18:16 +00:00
Cedric BAIL
ee5f9b2d75
Use the right type name.
...
SVN revision: 35458
2008-08-13 09:25:22 +00:00
Cedric BAIL
13e1ab352d
Constness++
...
SVN revision: 35457
2008-08-13 09:24:49 +00:00
Cedric BAIL
911cd4deda
Add iterator/accessor to eina list.
...
Change list size type to unsigned int.
SVN revision: 35454
2008-08-13 09:19:34 +00:00
Cedric BAIL
bd76226a8f
Expose Iterator/Accessor API for Inlist.
...
SVN revision: 35447
2008-08-12 16:02:09 +00:00
Cedric BAIL
9c1d8d3d95
Change function name to match its new behaviour. jumpt_at -> get_at.
...
SVN revision: 35444
2008-08-12 08:41:39 +00:00
Cedric BAIL
a46c20d137
Easier API and follow gustavo's remark.
...
SVN revision: 35440
2008-08-11 17:22:36 +00:00
Cedric BAIL
43cc2dca6f
Add first try for an accessor and iterator API, comment welcome (lack inlist and list currently).
...
Rewrite EINA_ARRAY_ITER_NEXT, still fast, need one more parameter, but no more EINA_ARRAY_ITER_END.
SVN revision: 35438
2008-08-11 16:30:16 +00:00
Cedric BAIL
ea0fb7d1b5
Cleanup.
...
SVN revision: 35437
2008-08-11 16:21:51 +00:00
Cedric BAIL
c1959429af
Add some meaningfull const.
...
SVN revision: 35436
2008-08-11 16:21:19 +00:00
Cedric BAIL
79fb88b08e
Just some alignment.
...
SVN revision: 35411
2008-08-08 15:56:17 +00:00
Cedric BAIL
6eacc6aa2d
After benchmarking, providing inline does impact performance of list and array user.
...
SVN revision: 35407
2008-08-08 14:25:37 +00:00
Cedric BAIL
ce23f3c2a9
After benchmarking, providing inline does impact performance of list and array user.
...
SVN revision: 35406
2008-08-08 14:20:11 +00:00
Jorge Luis Zapata Muga
ee54713d9d
Allow user provided functions for printing messages
...
Make the stdout print mgs function exportable
Add a FILE * print msg function (useful for logging)
SVN revision: 35404
2008-08-08 10:39:47 +00:00
Cedric BAIL
cf5bc3129d
Use the common out of memory error.
...
SVN revision: 35379
2008-08-07 13:11:13 +00:00