eina_str speedups.
authorbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 27 Feb 2010 03:42:27 +0000 (03:42 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 27 Feb 2010 03:42:27 +0000 (03:42 +0000)
commitf7e0f3c2d890578ac60f386f9aa974e86b67ff6f
treecf57bfc3423ee5eeec7e3a526caffc8f9d8e2ea2
parentc3c21cdd909df31c04a6cd3eadacc7ced2ccdb45
eina_str speedups.

 * eina_str_split() now does the minimum number of passes and
   allocations. The first pass figures out the string size (strlen())
   and number of delimiters, so we can allocate the exact number of
   elements in array. The second repeats the loop copying elements to
   string and also setting them to the result array.

 * eina_str_split_full() is a variation of eina_str_split() that
   returns also the number of elements in array, in the case you need
   to pre-allocate another array to copy.

 * eina_strlen_bounded() is introduced to limit strlen() results, this
   is used in has_prefix and has_suffix, but possibly other use cases
   where string must be of a maximum size as we don't do useless
   iterations;

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@46547 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
src/include/Makefile.am
src/include/eina_inline_str.x [new file with mode: 0644]
src/include/eina_str.h
src/lib/eina_str.c
src/tests/Makefile.am
src/tests/eina_suite.c
src/tests/eina_suite.h
src/tests/eina_test_str.c [new file with mode: 0644]