Commit Graph

890 Commits

Author SHA1 Message Date
Gustavo Sverzut Barbieri ef5c356153 Use EINA_PATH_MAX where it makes sense.
All the access to Eina_File_Direct_Info::path should be using the
actual size (EINA_PATH_MAX) and not another constant (PATH_MAX).



SVN revision: 55403
2010-12-09 10:14:11 +00:00
Marco Trevisan (Treviño) bbc439bdb7 SVN revision: 3
Subject: [E-devel] [PATCH] eina share common check for node type

Hello, recentely I've been experiencing a lot of segfaults when running
an Elementary application which uses a genlist with some swallowed parts
in which I put some elm icons (png files).
When running it I often get crashes... Debugging it I found this:

=========
CRI<14207>: eina_share_common.c:561 _eina_share_common_node_from_str()
*** Eina Magic Check Failed !!!
    Input handle is wrong type
        Expected: 98761254 - Eina Stringshare Node
            Supplied: 6e657070 - (unknown)
            *** NAUGHTY PROGRAMMER!!!
            *** SPANK SPANK SPANK!!!
            *** Now go fix your code. Tut tut tut!
            
            
            //DEBUG: Node referencies 622869060 (slen: 1145307236)
            
            
            Program received signal SIGSEGV, Segmentation fault.
            eina_share_common_del (share=0x65c810, str=0x7ffff1219150
"5hhu %5hu '%
s'\n")
    at eina_share_common.c:858
    858        node->references--;
    =========
    
    So it seems that edje tries to delete an invalid eina_share_common
    string (is this a bug that should be fixed or is it
theme-dependent?),
and so the "node" pointer in eina share is not valid...

However eina never checks for its validity, so it seg-faults...
The attached patch fix this issue, setting the node to null when its
magic is not valid, and then always checking for its validity.

Is this fine?


Full stack trace:

#0  eina_share_common_del (share=0x65c810, str=0x7ffff1219150 "5hhu %5hu
'%s'\n")
    at eina_share_common.c:858
    #1  0x00007ffff120e047 in eina_stringshare_del (str=0x7ffff1219150
"5hhu
%5hu '%s'\n")
    at eina_stringshare.c:632
    #2  0x00007ffff1e1f7bc in _edje_text_recalc_apply (ed=0x95b900,
    ep=0x70c3a0, 
        params=0x70c500, chosen_desc=<value optimized out>) at
        edje_text.c:556
        #3  0x00007ffff1de402d in _edje_part_recalc (ed=0x95b900,
ep=0x70c3a0,
flags=3)
    at edje_calc.c:2007
    #4  0x00007ffff1de4d86 in _edje_recalc_do (ed=0x95b900) at
    edje_calc.c:268
    #5  0x00007ffff1e25c7d in edje_object_part_swallow (obj=<value
optimized
out>, 
    part=0x7fffe001484c "elm.swallow.icon", obj_swallow=0x7fffe0017860)
        at edje_util.c:2300
        #6  0x00007ffff1b5d5fc in _item_realize (it=0x7fffe0016ed0,
in=10,
calc=1)
    at elm_genlist.c:1489
    #7  0x00007ffff1b5db89 in _item_block_recalc (itb=0x95b6a0,
in=<value
optimized out>, 
    qadd=<value optimized out>, norender=<value optimized out>) at
    elm_genlist.c:1609
    #8  0x00007ffff1b5e329 in _queue_proecess (wd=0x721b70,
norender=<value
optimized out>)
    at elm_genlist.c:2425
    #9  0x00007ffff1b5e567 in _item_queue (wd=0x721b70, it=<value
optimized
out>)
    at elm_genlist.c:2476
    #10 0x00007ffff1b5ead9 in elm_genlist_item_append (obj=<value
optimized
out>, 
    itc=0x7ffff2977040, data=0x8fed90, parent=0x0,
    flags=ELM_GENLIST_ITEM_NONE, 
        func=<value optimized out>, func_data=0x0) at elm_genlist.c:2528
        
        [eina-share-common-del-check-for-node.patch  text/x-patch
(1.2KB)]
Index: src/lib/eina_share_common.c
===================================================================
--- src/lib/eina_share_common.c(revisione 55018)
+++ src/lib/eina_share_common.c(copia locale)
@@ -558,7 +558,7 @@
    const size_t offset = offsetof(Eina_Share_Common_Node, str);
     
         node = (Eina_Share_Common_Node *)(str - offset);
         -   EINA_MAGIC_CHECK_SHARE_COMMON_NODE(node, node_magic, );
         +   EINA_MAGIC_CHECK_SHARE_COMMON_NODE(node, node_magic, node
= NULL);
    return node;
     
         (void) node_magic; /* When magic are disable, node_magic is
unused, this remove a warning. */
@@ -821,6 +821,7 @@
 
     SHARE_COMMON_LOCK_BIG();
         node = _eina_share_common_node_from_str(str,
share->node_magic);
+   if (!node) return str;
    node->references++;
        DBG("str=%p refs=%u", str, node->references);
         
         @@ -847,6 +848,9 @@
             SHARE_COMMON_LOCK_BIG();
              
                  node = _eina_share_common_node_from_str(str,
share->node_magic);
+   if (!node)
+      return;
+
    slen = node->length;
        eina_share_common_population_del(share, slen);
            if (node->references > 1)
            @@ -901,6 +905,7 @@
                   return -1;
                    
                        node = _eina_share_common_node_from_str(str,
share->node_magic);
+   if (!node) return 0;
    return node->length;
     }
      


SVN revision: 55265
2010-12-05 03:14:03 +00:00
Cedric BAIL bf3d026f41 * eina: fix typos.
SVN revision: 55223
2010-12-03 18:46:49 +00:00
Cedric BAIL bf066c2390 * eina: fix typo.
SVN revision: 55212
2010-12-03 18:12:19 +00:00
Cedric BAIL 7ad0ae92b5 * eina: add forgotten header.
SVN revision: 55211
2010-12-03 18:02:51 +00:00
Cedric BAIL fb1c587dde * eina: fix gettimeofday usage.
SVN revision: 55197
2010-12-03 16:30:26 +00:00
Cedric BAIL cb402e2a5a * eina: we don't plan to provide ABI compatibility until 1.0.
This kind of trick are for after 1.0, if you really need you can
	just pick that patch.


SVN revision: 55075
2010-11-29 23:16:19 +00:00
Mike Blumenkrantz 269a6ab702 closes ticket 634
SVN revision: 55074
2010-11-29 23:14:35 +00:00
Cedric BAIL aaae4e223a * eina: eina_array_clean should be inlined from the beginning.
NOTE: to prevent ABI break, I added the old symbol in eina_abi.c.
	So binary/library using eina_array_clean should continue to work
	without any problem.


SVN revision: 55068
2010-11-29 18:32:30 +00:00
helen be33a14270 Missing include in eina_inlist.c
Including eina_log.h in eina_inlist.c
Removing warning:
        warning: implicit declaration of function ‘EINA_LOG_ERR’
If you do not include it, and compile eina with safety checks disabled,
Evas and Elementary will not find the EINA_LOG_ERR symbol when
compiling

SVN revision: 54995
2010-11-25 19:00:59 +00:00
Cedric BAIL 0d5e9175bf * eina: use available mempool.
Patch from the OpenBSD team :
	      Fabien Romano <fabien@openbsd.org>
	      Jonathan Armani <armani@opensbd.org>	      


SVN revision: 54759
2010-11-21 10:54:26 +00:00
Mike Blumenkrantz 249a42185d more descriptive error message for inlist_remove when item is not an inlist
SVN revision: 54711
2010-11-19 05:43:28 +00:00
Mike Blumenkrantz 28a0b763d2 fix compile warnings without using private functions
SVN revision: 54577
2010-11-16 03:04:55 +00:00
Mike Blumenkrantz 5c4f02671a fix some compile warnings
SVN revision: 54570
2010-11-15 19:42:00 +00:00
Cedric BAIL 759d4efaec * eina: little doxy fix.
Thanks to kuri <kuri@paranoia.abuser.eu>


SVN revision: 54398
2010-11-10 10:54:53 +00:00
Vincent Torri d0458b87eb cosmetic: compile the files in alphabetic order
SVN revision: 54253
2010-11-06 23:40:21 +00:00
Vincent Torri b4571378c2 and add file
SVN revision: 54251
2010-11-06 21:01:36 +00:00
Vincent Torri 899983412b * port eina_file_*_ls() on Windows and put the code in another file
* on Windows eina_file_stat_ls() is the same that eina_file_direct_ls()

SVN revision: 54250
2010-11-06 21:00:58 +00:00
Vincent Torri 7ee0e4655b * improve doc
* remove eina_binshare_init() and eina_binshare_shutdown()
   from eina_binshare.h as they must not be exported


SVN revision: 54223
2010-11-06 12:34:55 +00:00
Vincent Torri eccd70139b formatting, whitespaces--
SVN revision: 54221
2010-11-06 07:37:52 +00:00
Cedric BAIL 57997619c9 * eina: fix eina_tiler_iterator_new API to be consistent with the
rest of the iterator API and usage.

	WARNING !!! THIS IS REALLY BAD BUT FOR CONSISTENCY, I THINK THAT THIS
	API BREAK WAS NEEDED. IN FACT IT'S MORE AN ABI BREAK AS IT WILL NOT
	TRIGGER WARNING OR ERROR IN CURRENT PROGRAM USING
	eina_tiler_iterator_new SO YOU ARE WARNED !

	Reported by playya <frederik.sdun@googlemail.com>.


SVN revision: 54153
2010-11-04 14:53:00 +00:00
Cedric BAIL 64aa07c793 * eina: fix typos.
SVN revision: 54127
2010-11-03 17:32:07 +00:00
Cedric BAIL c40d642b02 * eina: fix possible race condition between opendir/readdir_r/pathconf.
See http://womble.decadent.org.uk/readdir_r-advisory.html .


SVN revision: 54117
2010-11-03 10:19:55 +00:00
Cedric BAIL 19bce347b0 * eina: use fstatat when available.
Maybe we could add an eina_file_lstat_ls.


SVN revision: 54108
2010-11-02 17:47:19 +00:00
Cedric BAIL 17973f336e * eina: add eina_file_stat_ls and guaranty that eina_file_direct_ls
will not call anything else than readdir_r.


SVN revision: 54105
2010-11-02 17:07:04 +00:00
Cedric BAIL eb4cd21f0c * eina: remove dirent so apps don't rely on non portable code.
SVN revision: 54103
2010-11-02 15:11:05 +00:00
Carsten Haitzler a08524ea65 aaagh. dirent... bad! too many things in dirent that are not portable
- d_type for example... so put that into the direct_info struct and
handle the compat in eina.



SVN revision: 54015
2010-10-30 05:48:07 +00:00
Tiago Rezende Campos Falcao 1e78927ed1 Remove possivle null pointer.
Reported in:
http://people.profusion.mobi/~lfelipe/static_analysis/efl/efl-53990/eina/2010-10-29-1/report-mqFB7z.html#EndPath

SVN revision: 53998
2010-10-29 17:19:15 +00:00
Cedric BAIL 2794a9afc9 * eina: fix usage of eina_file_*ls in thread.
SVN revision: 53948
2010-10-28 09:59:27 +00:00
Cedric BAIL 4d36ee36e2 * eina: make eina_file_ls and eina_file_direct_ls container be DIR*.
SVN revision: 53862
2010-10-25 12:25:24 +00:00
Cedric BAIL 59671af073 * eina: improve eina_rbtree doc to please discomfitor.
SVN revision: 53835
2010-10-24 15:29:23 +00:00
Carsten Haitzler 6199da8d8a fix doc s!
SVN revision: 53665
2010-10-20 13:54:01 +00:00
Cedric BAIL c7245e24ed * eina: fix amalgamation build.
SVN revision: 53392
2010-10-14 11:07:10 +00:00
Cedric BAIL 0d02671e99 * eina: improve chained mempool speed.
By removing pthread lock when thread safety is not required.
	By not walking over the buffer for nothing.


SVN revision: 53310
2010-10-12 16:53:30 +00:00
Gustavo Sverzut Barbieri b11b2f95b5 auto-init threads and fix spinlock initialization checks.
* it is valid to use eina_log_threads_enable() without
   eina_threads_init(), so call eina_log_threads_init() in that case.

 * pthread_spin_init() returns 0 on success! check that and report any errors.



SVN revision: 53169
2010-10-07 22:14:03 +00:00
Eduardo de Barros Lima a5a3fc18e5 Eina: Don't #define _GNU_SOURCE
Instead use AC_GNU_SOURCE macro in configure.ac



SVN revision: 53157
2010-10-07 19:29:32 +00:00
Carsten Haitzler f1cac3e69c add pid to eina log.
SVN revision: 53091
2010-10-06 07:09:05 +00:00
Chidambar Zinnoury be17392520 eina: strrchr--.
SVN revision: 53000
2010-10-03 15:08:18 +00:00
Marc Andre Tanner 3966e2e027 eina: fix compilation if safety checks are disabled
A few files include eina_safety_checks.h and then expect that
eina_log.h is also dragged in, however this isn't the case if
the safety checks were disabled at configure stage.

Include eina_log.h explicitly to fix this.

Patch by: Marc Andre Tanner <mat@brain-dump.org>



SVN revision: 52949
2010-10-01 12:18:39 +00:00
Vincent Torri 72c7182a15 fix
SVN revision: 52882
2010-09-29 08:12:08 +00:00
Vincent Torri e06c65f79d NAME_MAX defined to 255 on sun (if not defined).
SVN revision: 52881
2010-09-29 06:37:56 +00:00
Lucas De Marchi 6666a9e795 Exclude win from prio drop implementation
Win will use another completely different approach. So, change the
guards to EFL_HAVE_POSIX_THREADS.

Also, include eina_sched.h as should have been done.



SVN revision: 52654
2010-09-23 20:58:19 +00:00
Lucas De Marchi a95105a888 Implement function to drop priority of current thread
This function is useful for libraries like ecore and evas that have to
set some worker threads. The first thing these threads should do is to
call this function, so the main thread might continue running without
the worker threads interrupting it too much.



SVN revision: 52651
2010-09-23 20:38:48 +00:00
Mike Blumenkrantz f7bf462ef4 revert whoops
SVN revision: 52537
2010-09-21 06:52:10 +00:00
Mike Blumenkrantz 005cf69302 ecore_con_url_free migration
SVN revision: 52536
2010-09-21 06:51:07 +00:00
Eduardo de Barros Lima acae2fc370 Eina_List: Revert changes introduced in r52253
The patch was trying to fix an error caused by wrong usage of this function



SVN revision: 52496
2010-09-20 18:20:40 +00:00
Lucas De Marchi 71cba7da35 Fix typos
"he->the" where appropriate



SVN revision: 52493
2010-09-20 17:09:13 +00:00
Eduardo de Barros Lima 2216c53641 Eina_List: Avoid Segfault
Some inputs in which tmp - cur is greater than the number of previous nodes
in list, were causing ct to be null at end of loop.

Patch by Jonas M. Gastal <jgastal@profusion.mobi>



SVN revision: 52253
2010-09-14 18:29:30 +00:00
Vincent Torri f7b1362905 add braces to remove ambiguous condition warning
SVN revision: 52246
2010-09-14 15:57:20 +00:00
Mike Blumenkrantz 534bd43e9d initial doxy patch for rbtree from vtorri
CEDRIC WRITE DOCS FOR THIS!


SVN revision: 52172
2010-09-12 19:28:18 +00:00
Mike Blumenkrantz 1970f8dd6c more doxy from vtorri
SVN revision: 52164
2010-09-12 08:03:21 +00:00
Mike Blumenkrantz eb775222a5 variable name changes for accessor functions
patch by vtorry
compile testing frowned upon by andredieb


SVN revision: 52163
2010-09-12 06:49:57 +00:00
Lucas De Marchi c4a0cef6e6 Fix typos in docs
* eina_thread_init doesn't exist. eina_threads_init it is;
* 'mutexes' is a more common spelling, not 'mutexs'



SVN revision: 52136
2010-09-10 12:01:52 +00:00
Lucas De Marchi 935cd5b9e5 Fix common misspellings
Following misspellings were fixed:

occured->occurred
immediatly->immediately



SVN revision: 52018
2010-09-09 02:19:54 +00:00
Iván Briano 8374dea693 Evil patch from Evil vtorri. Some improvements to Eina docs.
Yup, docs.. truly evil.


SVN revision: 51993
2010-09-08 17:41:05 +00:00
Cedric BAIL 6c69d6f60e * eina: fix doc, patch by Vincent Torri.
SVN revision: 51983
2010-09-08 08:38:48 +00:00
Lucas De Marchi 33dcb37afe Fix common misspellings
The following misspellings were fixed:

asociated->associated
convertion->conversion
exemple->example
existant->existent
immediatly->immediately
isnt->isn't
loosing->losing
memeber->member
occured->occurred
occurence->occurrence
occurences->occurrences
ocurred->occurred
recomended->recommended
sucess->success
teh->the
tiem->time
usefull->useful




SVN revision: 51962
2010-09-08 03:21:16 +00:00
Lucas De Marchi 15ae42344e Fix typo in doxygen
SVN revision: 51932
2010-09-06 22:48:58 +00:00
Vincent Torri 490413be14 use Eina_Bool instead of unsigned int
SVN revision: 51825
2010-09-01 22:31:43 +00:00
Vincent Torri c85dffafd8 typo
SVN revision: 51799
2010-09-01 06:48:52 +00:00
Vincent Torri a4a7bc6b43 format a bit the doc and add corner cases
SVN revision: 51798
2010-09-01 06:45:33 +00:00
Mike Blumenkrantz 05f38ae44a yarrrrrrr I've got yer rum right here, you landlubber! HAR HAR HAR!
SVN revision: 51790
2010-08-31 22:39:02 +00:00
Mike Blumenkrantz bc7bb345a6 move function into local, reformat
SVN revision: 51787
2010-08-31 21:19:54 +00:00
Lucas De Marchi d8002ff386 Revert and re-apply badnull patch
Revert previous patch generated by badnull.cocci script, and apply the new one.
The main difference is that assert and assert-like functions are not touched
anymore.




SVN revision: 51650
2010-08-26 01:34:13 +00:00
Carsten Haitzler c69a28315c force to unisgned char
SVN revision: 51624
2010-08-25 02:04:37 +00:00
Carsten Haitzler ed78d8a36b mempool -> init the mempool with calloc. we cannot know for sure the
mempool backend inits all members, so make sure they are set to 0. not
a cost worth quibbling over. how many mempools do you really create
during the life of an app?



SVN revision: 51548
2010-08-22 22:35:24 +00:00
Carsten Haitzler 9b006054b7 again -> shut cppcheck up.
SVN revision: 51547
2010-08-22 22:32:30 +00:00
Carsten Haitzler b1dee3fc6d leak-- in win32 code.
SVN revision: 51546
2010-08-22 22:30:55 +00:00
Carsten Haitzler 64d565228a cppcheck doesn't like it if u dont first init all data before using
contents of that struct (minus the thing u are about to set)



SVN revision: 51545
2010-08-22 22:29:25 +00:00
Carsten Haitzler eb1a43bfbf oops - formatting at start too - not just end
SVN revision: 51510
2010-08-22 05:47:44 +00:00
Carsten Haitzler 1974702021 fmting
SVN revision: 51507
2010-08-22 02:32:47 +00:00
Joerg Sonnenberger 4497367d7f From: Joerg Sonnenberger <joerg@britannica.bec.de>
pthread_t is opaque, so make less assumptions...



SVN revision: 51506
2010-08-22 01:15:47 +00:00
Vincent Torri 0686aa04af add vasprintf declaration on Windows
SVN revision: 51497
2010-08-21 17:25:46 +00:00
Lucas De Marchi 5a8a8c9014 Convert (hopefully) all comparisons to NULL
Apply badzero.cocci, badnull.coci and badnull2.cocci

This should convert all cases where there's a comparison to NULL to simpler
forms. This patch applies the following transformations:

code before patch               ||code after patch
===============================================================

return a == NULL;                 return !a;

return a != NULL;                 return !!a;

func(a == NULL);                  func(!a);

func(a != NULL);                  func(!!a);

b = a == NULL;                    b = !a;

b = a != NULL;                    b = !!a;

b = a == NULL ? c : d;            b = !a ? c : d;

b = a != NULL ? c : d;            b = a ? c : d;


other cases:

a == NULL                         !a
a != NULL                         a




SVN revision: 51487
2010-08-21 13:52:25 +00:00
Cedric BAIL e6f9cee051 * eina: fix structure content to be more futur proof and reduce
risk of ABI breakage.


SVN revision: 51390
2010-08-19 12:02:28 +00:00
Tom Hacohen 6a0b488468 Eina: Moved the private headers to src/lib where they belong.
SVN revision: 51388
2010-08-19 08:30:01 +00:00
Cedric BAIL ccebf54881 * eina: fix some warning by Albin Tonnerre.
SVN revision: 51246
2010-08-17 11:48:50 +00:00
Vincent Torri ca4497509e i forgot about amalgamation. fix declaration too
SVN revision: 51243
2010-08-17 07:39:53 +00:00
Vincent Torri 333b64f15e some doc fixes
SVN revision: 51242
2010-08-17 06:58:26 +00:00
Vincent Torri d4cd8f28ae formatting
SVN revision: 51241
2010-08-17 06:05:21 +00:00
Vincent Torri 32932b4135 alloca() declaration
SVN revision: 51240
2010-08-17 05:44:11 +00:00
Vincent Torri 4e09c14e08 formatting
SVN revision: 51239
2010-08-17 05:28:34 +00:00
Vincent Torri 13a1bdf6e0 formatting
SVN revision: 51237
2010-08-17 05:21:13 +00:00
Lucas De Marchi 80b44315f7 eina-0 is no more, check for the right package name
SVN revision: 51235
2010-08-17 03:59:29 +00:00
Cedric BAIL 6293bd87fa * eina: fix amalgamation.
SVN revision: 51210
2010-08-16 13:52:34 +00:00
Cedric BAIL f75eab161d * eina: remove thread safe data type for now. They will be back !
SVN revision: 51179
2010-08-16 09:32:09 +00:00
Carsten Haitzler c747bfaadb well got to start somewhere. eina 1.0.0 alpha readied. need to go over
code formatting still (headers specifically). bring doc building
in-line with other efl libs. README is useful now. Changelog waiting
to be filled in for 1.0.0



SVN revision: 51154
2010-08-16 05:40:50 +00:00
Mike Blumenkrantz ad00478247 fix threadsafe api
SVN revision: 51118
2010-08-14 16:10:19 +00:00
Cedric BAIL 3b269d6f04 * eina: don't direct people in the wrong direction.
SVN revision: 51117
2010-08-14 15:50:07 +00:00
Mike Blumenkrantz 689a24559c add threadsafety for hashes
SVN revision: 51106
2010-08-14 03:05:35 +00:00
Mike Blumenkrantz f973f8c72a add #ifdefs for some threadsafety stuff
cedric SPANK SPANK SPANK!!!


SVN revision: 51105
2010-08-14 03:03:32 +00:00
Iván Briano 02031b60bf Remark that data being deleted from the hash will be mercilessly killed if a blackops free function was given to the hash on creation.
SVN revision: 51079
2010-08-13 14:34:36 +00:00
Mike Blumenkrantz c8f669a27f more variable renames, null check alloc, malloc+memset0 -> calloc, rwlocks in structs
SVN revision: 51066
2010-08-13 06:58:43 +00:00
Mike Blumenkrantz 3618cf1227 rename variables and typedefs to sane values
SVN revision: 51064
2010-08-13 05:22:33 +00:00
Tom Hacohen d2988fe707 Eina: "FIX" EINA_UNICODE_EMPTY_STRING.
SVN revision: 51038
2010-08-12 14:16:32 +00:00
Cedric BAIL a6645cb746 * eina: fix eina array threadsafe version.
Also add iterator and accessor ability to walk threadsafely.
	Rename EINA_EACH to EINA_EACH_CB to match other callback cast.


SVN revision: 51000
2010-08-11 14:32:30 +00:00
Mike Blumenkrantz 7833796e00 right...this is malloc...
SVN revision: 50963
2010-08-10 12:25:34 +00:00
Mike Blumenkrantz c09c5ed690 and these
SVN revision: 50961
2010-08-10 12:05:51 +00:00
Mike Blumenkrantz cbf7f7b58a array threadsafing wip, get rid of dumb undefineds from earlier
SVN revision: 50959
2010-08-10 11:57:20 +00:00
Mike Blumenkrantz 5b4ec5bd35 change EINA_ARRAY_THREADSAFE_ITER_RETURN to EINA_ARRAY_THREADSAFE_ITER_ESCAPE to match forthcoming threadsafe list api
SVN revision: 50956
2010-08-10 07:48:00 +00:00
Mike Blumenkrantz 6bc0a6cb14 errr use the right define for this
SVN revision: 50952
2010-08-10 03:37:21 +00:00
Mike Blumenkrantz 56a0bd9396 implement threadsafety for arrays, alter all eina internal array usage to (hopefully) be threadsafe
call eina_threads_init() to enable this if you have pthread rwlock support (posix 2001)
note some function prototypes have lost const on array params to allow locking
WARNING: you should NOT call eina_threads_shutdown unless you are positive that you will not use any arrays which were created while threadsafe mode were enabled, and vice versa.  Failing to adhere to this warning WILL result in either deadlocks or memory leaks.


SVN revision: 50951
2010-08-10 03:26:15 +00:00
Tom Hacohen ed0f5eb857 eina: fix strdup calloc, it's number of elements and then size, and not the other way around.
SVN revision: 50898
2010-08-08 12:03:18 +00:00
Cedric BAIL 476f09d29b * eina: add some doc for one big mempool.
SVN revision: 50834
2010-08-05 12:52:30 +00:00
Lucas De Marchi 0a4617ae38 FORMATTING
* Remove vim modelines:
 find . -name '*.[chx]' -exec sed -i '/\/\*$/ {N;N;/ \* vim:ts/d}' \{\} \;
 find . -name '*.[chx]' -exec sed -i '/\/[\*\/] *vim:/d' \{\} \;

* Remove leading blank lines:
 find . -name '*.[cxh]' -exec sed -i '/./,$!d'

If you use vim, use this in your .vimrc:
set ts=8 sw=3 sts=8 expandtab cino=>5n-3f0^-2{2(0W1st0



SVN revision: 50816
2010-08-04 16:57:32 +00:00
Gustavo Lima Chaves faa7644e22 Better documenting EINA_MAGIC_SET()'s use.
Patch by Jonas Gastal.



SVN revision: 50744
2010-08-02 16:57:38 +00:00
Brett Nash 9da847b538 Fix eina_unicode_strncpy
SVN revision: 50741
2010-08-02 09:44:11 +00:00
Brett Nash 7f83020567 Terminate the string after strcpy
SVN revision: 50739
2010-08-02 09:44:01 +00:00
Brett Nash 9e468e94e7 Update eina_unicode_strnlen
SVN revision: 50738
2010-08-02 09:43:57 +00:00
Brett Nash 1e8074954f Fix end points
SVN revision: 50708
2010-07-31 05:24:45 +00:00
Brett Nash db89ba43d7 eina: Actually implement strnlen for eina_unicode.
SVN revision: 50700
2010-07-31 03:54:09 +00:00
Mike Blumenkrantz d409884148 incomplete doxy!
cedric SPANK SPANK SPANK!!!


SVN revision: 50694
2010-07-30 21:18:40 +00:00
Cedric BAIL c9d5d8a62e * eina: add a way to move a key to another without triggering the Free_Cb.
SVN revision: 50683
2010-07-30 09:06:58 +00:00
Brett Nash 4414556323 Unicde strnlen, and a slight fix to the header so at least part can be read by
humans.

Also strlen/strnlen are pure.


SVN revision: 50676
2010-07-30 03:39:12 +00:00
Iván Briano 55baf0a4f1 DO export this thingies
SVN revision: 50645
2010-07-29 14:08:02 +00:00
Cedric BAIL 836721fc6e * eina: remove some warning.
SVN revision: 50644
2010-07-29 13:59:31 +00:00
Tom Hacohen 713354b764 Eina: Fixed a bug in eina_*share_dump functions and fixed a documentation error.
SVN revision: 50600
2010-07-28 17:53:10 +00:00
Mike Blumenkrantz 5028d6a282 lots of doxy fixes and stop casting to char*
SVN revision: 50582
2010-07-28 03:34:25 +00:00
Mike Blumenkrantz a124fffeca start binshare
SVN revision: 50581
2010-07-28 03:33:49 +00:00
Carsten Haitzler 15c71af0a5 fix formatting also
SVN revision: 50577
2010-07-28 03:03:25 +00:00
Carsten Haitzler bed21c315d errrr... hmmm why did this change?
SVN revision: 50574
2010-07-28 02:48:11 +00:00
Carsten Haitzler ddc6ba2c2a uncrustify eina.
SVN revision: 50573
2010-07-28 02:37:05 +00:00
Tom Hacohen e6ec7adedb Eina: Fix the segfault in eina_stringshare_shutdown with-enable-amalgamation.
SVN revision: 50548
2010-07-27 16:53:49 +00:00
Tom Hacohen 32c7a50118 Eina: Fix compilation with --enable-amalgamation.
Sorry dh :P

SVN revision: 50545
2010-07-27 15:15:45 +00:00
Tom Hacohen 6b69189efd Eina: Added ustringshare and binshare tests.
Fixed a small bug in binshare (in the length function).
Moved some debug messages around.

SVN revision: 50541
2010-07-27 11:43:37 +00:00
Tom Hacohen 279da003e0 Eina: Added Eina_UStrbuf.
Same as Eina_Strbuf but for Eina_Unicode strings.

SVN revision: 50534
2010-07-27 09:05:41 +00:00
Tom Hacohen 3675a5f02b Eina: Add Eina_UStringshare and Eina_Binshare.
Also modified Eina_Stringshare to share most of the code with the two above.
Added Magics for Eina_UStrbuf as well as for UStringshare/Binshare.

SVN revision: 50533
2010-07-27 08:55:23 +00:00
Tom Hacohen 270f765c91 Eina: Added Eina_Unicode.
SVN revision: 50532
2010-07-27 08:22:20 +00:00
Cedric BAIL 07ad9d5139 * eina: add a mempool that just do one big malloc.
SVN revision: 50510
2010-07-26 15:52:43 +00:00
Mike Blumenkrantz f3ad2982b8 +eina_stringshare_vprintf for using a va_list
SVN revision: 50501
2010-07-26 05:09:02 +00:00
Brett Nash 8b858d5f7b Use offsetof rather the manual pointer compares. C89 can be taken as given I
think.  Also update authors to add Mwa, and fix copyright statement to be
useful.  (Always list years, not ranges of years... longer, but covered by
	international conventions).


SVN revision: 50500
2010-07-26 04:21:47 +00:00
Mike Blumenkrantz e43175fa37 add doxy
SVN revision: 50491
2010-07-25 19:32:03 +00:00
Mike Blumenkrantz 7ff1096672 +eina_stringshare_printf
+eina_stringshare_nprintf
the long awaited printf functions for stringshare!


SVN revision: 50490
2010-07-25 19:18:26 +00:00
Mike Blumenkrantz 37de5b807f +eina_error_msg_modify to change the error string of a registered error; preserves allocation state of message creation (errors created with static_register() will remain statically allocated)
SVN revision: 50484
2010-07-25 06:25:06 +00:00
Mike Blumenkrantz 846e224fd2 +eina_str_toupper for completion
SVN revision: 50483
2010-07-25 02:03:10 +00:00
Mike Blumenkrantz 2f183fa194 eina_hash_modify_or_add -> eina_hash_set
SVN revision: 50448
2010-07-23 13:04:21 +00:00
Mike Blumenkrantz 55f0882da4 revert previous. why would I do that in the first place?
SVN revision: 50407
2010-07-21 05:02:17 +00:00
Mike Blumenkrantz 50e621c5c2 remove tolower() from eina_str_tolower
SVN revision: 50404
2010-07-21 03:59:37 +00:00
Mike Blumenkrantz 489cae4eee +eina_hash_modify_or_add to always add a value to the hash at the specified key
SVN revision: 50402
2010-07-21 03:15:39 +00:00
Cedric BAIL 9660c1c66f * eina: fix tolower call.
SVN revision: 50366
2010-07-19 11:25:10 +00:00
Mike Blumenkrantz f18e1899e5 +eina_str_tolower for lowercasing an entire string in one line
SVN revision: 50361
2010-07-19 01:56:42 +00:00
Mike Blumenkrantz 0c983ac8d8 dox fixes
SVN revision: 50355
2010-07-18 18:59:01 +00:00
Mike Blumenkrantz c146935917 +eina_stringshare_replace_length to replace a stringshared string with a given length of another string
SVN revision: 50320
2010-07-18 07:39:21 +00:00
Mike Blumenkrantz 9dcd70a33d and macro whoops
SVN revision: 50319
2010-07-18 06:48:08 +00:00
Mike Blumenkrantz 9276378041 +eina_strbuf_string_free to free string in strbuf without freeing strbuf
SVN revision: 50316
2010-07-18 06:21:50 +00:00
Mike Blumenkrantz d3982d4b5c +eina_hash_free_buckets to free buckets without freeing a hash
SVN revision: 50315
2010-07-18 04:24:24 +00:00
Mike Blumenkrantz af32bf04f0 well this was just plain wrong
SVN revision: 50314
2010-07-18 03:55:53 +00:00
Mike Blumenkrantz 7d3bf122ac on the fifth day the rasterman said "let there be docs for hash tables!"
but there were no docs for hash tables because k-s and cedric were busy writing new functions for hash tables. so rasterman again said "let there be docs for hash tables! really guys, I mean it this time!"
and this time there were docs, but these docs were incomplete and in some places vague and misleading.
these docs frustrated little discomfitor, who had just healed up after learning to ride his edje bicycle and was just starting to read. so he read all that he could, and then he started to write. he wrote his little heart out until finally there were more docs for hash tables like the rasterman had wanted.
then he went and got ice cream.

The End.


SVN revision: 50313
2010-07-18 03:29:10 +00:00
Lucas De Marchi 749cc7478c Remove unneeded code with notnull.cocci script
This continues previous commit with more complex places, where it required
more than just removing some "ifs".



SVN revision: 50242
2010-07-14 02:20:30 +00:00
Vincent Torri c7bb6d41f5 include sys/syslimits.h on mac os x for PATH_MAX and NAME_MAX
i really dislike having PATH_MAX in a header file...



SVN revision: 50231
2010-07-13 19:17:35 +00:00
Vincent Torri 84efd3507f leak--, thanks cedric
SVN revision: 50225
2010-07-13 16:43:15 +00:00
Vincent Torri c97a897584 use Win32 native mutex on Windows. To use it, pass the following option
to configure:

--enable-win32-threads

By default, pthreads are used


SVN revision: 50220
2010-07-13 13:51:00 +00:00
Vincent Torri c012d2e7f6 fix compilation on Windows
SVN revision: 50179
2010-07-11 11:52:43 +00:00
Lucas De Marchi b07f70b85c Update doc of eina_str_split functions
Mention that they can return NULL in case malloc() fails.



SVN revision: 50127
2010-07-08 15:08:31 +00:00
Gustavo Sverzut Barbieri ed15713785 add eina_file_direct_ls()
Similar to eina_file_ls(), but useful when one wants to apply some
filters to the names before using them as it provides sizes of the
whole path and basename, index of the basename inside the path, dirent
structure for reference (skip directories, etc) and last but not
least, it is faster as it does not stringshare or even builds the full
path at each iteration, instead it keeps the invariant prefix
untouched and just copy the filename.

All in all this is a faster version of eina_file_ls(), use it as
possible as it will avoid overheads.



SVN revision: 50065
2010-07-06 15:45:12 +00:00
Cedric BAIL d4059c7107 * eina: rename ecore_file_ls_iterator to eina_file_ls.
SVN revision: 50002
2010-07-02 17:23:05 +00:00
Brett Nash 977221953e Stringshare doesn't have a 64k limit. Don't say it does.
SVN revision: 49992
2010-07-02 08:56:09 +00:00
Gustavo Lima Chaves e868c81b30 Documentation fix for eina iterators.
SVN revision: 49951
2010-06-30 18:41:16 +00:00
Vincent Torri f5d7f3ea1a printf modifiers are different on Windows
SVN revision: 49876
2010-06-26 14:26:54 +00:00
Cedric BAIL cf128ea0e4 * eina: improve quadtree to support more stuff needed by evas.
SVN revision: 49784
2010-06-21 13:17:09 +00:00
Vincent Torri 61753a99a6 fix eina_convert examples
SVN revision: 49774
2010-06-20 18:39:35 +00:00
Vincent Torri 9ac5d78958 fix doc
SVN revision: 49740
2010-06-18 07:08:22 +00:00
Vincent Torri 5e09673fce typo
SVN revision: 49736
2010-06-17 21:27:41 +00:00
Carsten Haitzler 9b41314165 remove semi-colon
SVN revision: 49272
2010-05-29 06:28:38 +00:00
Carsten Haitzler 02503dd152 eina gets version thing ala eet.
SVN revision: 49267
2010-05-29 03:05:04 +00:00
Vincent Torri 9c210617f7 declare variables at the beginning of the block
SVN revision: 49254
2010-05-28 19:04:44 +00:00
Vincent Torri 247674b26c do not declare inlined functions in the source file,
fix a bit the doc of inlined functions

SVN revision: 49253
2010-05-28 19:03:26 +00:00
Vincent Torri f446a5b9f9 vasprintf is not declared in mingw too
SVN revision: 49252
2010-05-28 18:59:43 +00:00
Vincent Torri 52e3f2d0ab do not declare _eina_small_share twice
SVN revision: 49251
2010-05-28 18:58:49 +00:00
Vincent Torri 440fb47e30 fix pthread support with mingw
SVN revision: 49250
2010-05-28 18:57:19 +00:00
Brett Nash 2677b8d493 Minor doc update: It's nice when examples compile without warnings ;-)
SVN revision: 49091
2010-05-21 09:48:46 +00:00
Cedric BAIL bb85e11b50 * eina: don't shadow global variable.
SVN revision: 48614
2010-05-04 16:26:29 +00:00
Cedric BAIL 197a9a879e * eina: use previous cached result in quadtree.
SVN revision: 48607
2010-05-04 14:42:13 +00:00
Cedric BAIL 9d8b1da4cb * eina: make quadtree faster.
SVN revision: 48575
2010-05-03 13:17:52 +00:00
Vincent Torri 0cc286508a indentation and comments
SVN revision: 48522
2010-05-01 20:35:16 +00:00
Cedric BAIL 6caac50006 * eina: improve QuadTree API.
SVN revision: 48482
2010-04-30 17:04:28 +00:00
Cedric BAIL d239b6c524 * eina: oops forgotten file.
SVN revision: 48425
2010-04-29 17:30:18 +00:00
Cedric BAIL 9367b5f7c7 * eina: Add first version of a Quad Tree data type.
NOTE: consider the API experimental and subject to change.


SVN revision: 48424
2010-04-29 17:21:14 +00:00
Cedric BAIL 49c0a1e6e2 * eina: add tests for eina fixed point sin/cos functions.
SVN revision: 48423
2010-04-29 17:08:24 +00:00
Carsten Haitzler 87efa72125 apparently fbsd is unaware of expr substr...
SVN revision: 48275
2010-04-24 14:31:23 +00:00
Vincent Torri 09a2e65378 forgot a semicolon
SVN revision: 48016
2010-04-15 06:53:23 +00:00
Vincent Torri c76d3cea37 remove useless semicolon
SVN revision: 48015
2010-04-15 06:28:22 +00:00
Vincent Torri 16b01952a9 include Evil.h with vc++ for vasprintf
SVN revision: 48014
2010-04-15 06:16:59 +00:00
Vincent Torri 1e8c976b28 include private headers after standard headers
SVN revision: 48013
2010-04-15 06:13:08 +00:00
Tiago Rezende Campos Falcao 8a8ef913c8 Using value returned from vasprintf, and removed warnings
SVN revision: 47967
2010-04-12 18:30:07 +00:00
Tiago Rezende Campos Falcao b7e410d621 Adding strbuf printfs
SVN revision: 47877
2010-04-09 15:56:20 +00:00
Vincent Torri f2b9c65adb define strcasecmp() as stricmp() for vc++, remove
useless include of Evil.h (was included for strcasecmp
when vc++ is used)


SVN revision: 47741
2010-04-03 21:29:01 +00:00
Vincent Torri 2c91c3cf21 add colored log on Windows with the DOS console and MSYS
without rxvt emulation. It does not work with MSYS with
rxvt emulation. I don't know the status of the cygwin
terminal.


SVN revision: 47486
2010-03-26 08:08:52 +00:00
Vincent Torri 762313eff2 declare buddy init/shutdown functions it this
mempool is statically linked


SVN revision: 47484
2010-03-26 07:47:11 +00:00
Vincent Torri 8126debb06 fix most compilation errors with vc++ (there are still a
problem with eina_log and output of the log messages:
STDERR_FILENO, STDOUT_FILENO and isatty())

fix some warnings and header files inclusion

update vcproj files


SVN revision: 47384
2010-03-23 06:41:17 +00:00
Vincent Torri 8358354e09 * declare variables at the beginning of the block
* minor formatting


SVN revision: 47383
2010-03-23 05:45:35 +00:00
Gustavo Sverzut Barbieri 10dc981b38 fix docs.
By: Eduardo Felipe <eduardofelipe87@gmail.com>

NOTE: I changed code -> verbatim where it should be.



SVN revision: 47163
2010-03-12 19:23:06 +00:00
Vincent Torri 85b56aebd5 update string buffer documentation
SVN revision: 47084
2010-03-09 16:36:14 +00:00
Vincent Torri b3019e3d4b * fix more str doc
* move static stringshare functions to the 'private'
   part of the file (hence doc fixes)


SVN revision: 46933
2010-03-07 07:11:13 +00:00
Vincent Torri 993b4a6960 fix doc for eina_str
SVN revision: 46931
2010-03-07 06:59:28 +00:00
Gustavo Sverzut Barbieri 90c5c1daaa doc improvements.
SVN revision: 46670
2010-02-28 21:29:30 +00:00
Gustavo Sverzut Barbieri 54b0b06c1e Better resize rotine, linear instead of double.
Increment in steps linearly instead of doubling them, otherwise it
will get to maximum limit of 4096 too soon.

Also replace the loop with simple math.



SVN revision: 46585
2010-02-27 16:41:24 +00:00
Gustavo Sverzut Barbieri 4d9ed8cb79 macro -> inline
clear, type checking and same runtime cost.



SVN revision: 46584
2010-02-27 15:38:58 +00:00
Gustavo Sverzut Barbieri 08127ecc3e 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;



SVN revision: 46547
2010-02-27 03:42:27 +00:00
Gustavo Sverzut Barbieri 2a204c684a find and replace too much!
SVN revision: 46535
2010-02-26 23:41:43 +00:00
Gustavo Sverzut Barbieri bba70aef2e eina_strbuf_insert variants and fix leak with eina_strbuf_append_escaped()
SVN revision: 46521
2010-02-26 21:33:17 +00:00
Gustavo Sverzut Barbieri 3a8741c75e more docs for strbuf
SVN revision: 46518
2010-02-26 20:25:09 +00:00
Gustavo Sverzut Barbieri 2511972dde documentation improvements for eina_strbuf.
SVN revision: 46517
2010-02-26 20:23:12 +00:00
Gustavo Sverzut Barbieri f32672764d add eina_strbuf_append_length()
SVN revision: 46516
2010-02-26 20:09:36 +00:00
Gustavo Sverzut Barbieri ff6532a1bd minor documentation fixes.
still needs someone to read and review that.


SVN revision: 46499
2010-02-26 00:57:20 +00:00
Gustavo Sverzut Barbieri 7c8ca04def Remove eina_error deprecated functions.
There were deprecated looooooooong ago, use eina_log if there are some
alien users out there.



SVN revision: 46496
2010-02-26 00:28:58 +00:00
Christopher Michael 140de33a79 Fix some doxy typos.
SVN revision: 46450
2010-02-24 23:58:27 +00:00
Vincent Torri 2e004582d7 add mempool description in the doc
SVN revision: 46307
2010-02-19 13:42:34 +00:00
Sebastian Dransfeld 0b3bea06ec Include safety checks before function include
SVN revision: 46169
2010-02-14 19:01:51 +00:00
Sebastian Dransfeld 7ae4c793e7 safety checks
SVN revision: 46155
2010-02-13 19:26:34 +00:00
Sebastian Dransfeld 5c49be6e01 Add const where we don't modify pointer
SVN revision: 46153
2010-02-13 19:06:16 +00:00
Sebastian Dransfeld d7b706e4f6 Add eina unlikely to alloc errors
SVN revision: 46152
2010-02-13 18:55:47 +00:00
Iván Briano 071969c41f Use length of source string to copy.
SVN revision: 46114
2010-02-12 14:58:00 +00:00
Sebastian Dransfeld 852f9e8ac5 We always need to null terminate
SVN revision: 46107
2010-02-12 06:33:31 +00:00
Sebastian Dransfeld fb8d1dc110 Since we know we have enough space, use memcpy
SVN revision: 46103
2010-02-11 22:00:02 +00:00
Sebastian Dransfeld 9df3524f3a Good coverage for strbuf
SVN revision: 46101
2010-02-11 21:53:00 +00:00
Vincent Torri b49d61f502 missing "
SVN revision: 46087
2010-02-11 18:54:04 +00:00
Gustavo Sverzut Barbieri 9cce47d3b8 let's not return NULL but a more useful result.
SVN revision: 46086
2010-02-11 18:49:12 +00:00
Christopher Michael e9bc23874c Fix typo in doc.
SVN revision: 46083
2010-02-11 17:38:24 +00:00
Vincent Torri b64d398ffd warnings--
SVN revision: 46079
2010-02-11 15:29:20 +00:00
Vincent Torri f8e1057fc0 warning--
SVN revision: 46078
2010-02-11 15:22:41 +00:00
Sebastian Dransfeld 229e5de19d remove trailing whitespace
SVN revision: 46029
2010-02-09 21:12:03 +00:00
Sebastian Dransfeld 5847c6f245 string_remove -> string_steal
Better naming

SVN revision: 46028
2010-02-09 21:06:27 +00:00
Sebastian Dransfeld fe99f062e9 Check whether alloc works, return false on error
SVN revision: 46027
2010-02-09 21:06:16 +00:00
Sebastian Dransfeld 459fef8aea unset eina magic on free
SVN revision: 46026
2010-02-09 21:06:06 +00:00
Cedric BAIL 13df61db0d * eina: Remove warning in eina_stringshare.
SVN revision: 46009
2010-02-09 12:59:31 +00:00
Gustavo Sverzut Barbieri c52d867527 delete trailing whitespace.
SVN revision: 46002
2010-02-09 03:00:47 +00:00
Gustavo Sverzut Barbieri 728f10a269 delete trailing whitespace.
SVN revision: 46001
2010-02-09 02:51:23 +00:00
Gustavo Sverzut Barbieri 7e043d87c8 apply global log level if global domain exists.
This allows setting global log level after eina_init() and have it to
behave properly.



SVN revision: 45999
2010-02-09 02:14:40 +00:00
Gustavo Sverzut Barbieri ebed1f20fe minor matching speedups.
keep log level name size (namelen) and use it before strcmp().



SVN revision: 45998
2010-02-09 02:13:55 +00:00
Gustavo Sverzut Barbieri 0b2b716214 just try fnmatch (glob) if no specific level was set.
SVN revision: 45997
2010-02-09 01:47:52 +00:00
Gustavo Sverzut Barbieri 191d87d78a eina log level utilities.
couple of functions that are useful outside and should be fast.



SVN revision: 45996
2010-02-09 01:43:58 +00:00
Gustavo Sverzut Barbieri f7cd9786f1 eina log parameters getters and setters.
allow external users to check or set flags that are initialized based
on environment variables such as EINA_LOG_COLOR_DISABLE.



SVN revision: 45995
2010-02-09 00:52:00 +00:00
Iván Briano 752a730b38 More parentheses so the macro works inside if()
SVN revision: 45992
2010-02-08 21:20:28 +00:00
Gustavo Sverzut Barbieri c87dbf93ab disable color based on $TERM and isatty().
Smarter eina log that disables color automatically based on $TERM and
isatty of output file descriptor.



SVN revision: 45988
2010-02-08 17:53:22 +00:00
Vincent Torri 8840ed4118 on some platform, iconv.h defines iconv() with a macro,
hence the check with AC_SEARCH_LIBS s not sufficient. So
we link a complete program.


SVN revision: 45981
2010-02-08 13:14:30 +00:00
Vincent Torri 6ac6ee026c * fix compilation when iconv.h is detected but libiconv is not
* fix warning and clang report


SVN revision: 45970
2010-02-07 20:46:39 +00:00
Sebastian Dransfeld f285bc7ae9 And since resize adds + 1 to size, grow must do to
SVN revision: 45969
2010-02-07 19:31:26 +00:00
Sebastian Dransfeld 216aabeaa0 And add () for increased safety
SVN revision: 45968
2010-02-07 19:30:01 +00:00
Sebastian Dransfeld 95d903dab7 And correct return type
SVN revision: 45967
2010-02-07 19:24:28 +00:00
Sebastian Dransfeld 69368ae6bd Fix return values
If we don't need to grow, return EINA_TRUE.
Use EINA_TRUE and EINA_FALSE where possible.

SVN revision: 45966
2010-02-07 19:22:04 +00:00
dieb 470188ca4f Eina: fix compilation on strbuf.
SVN revision: 45965
2010-02-07 17:33:26 +00:00
Sebastian Dransfeld 0cead88ce8 Don't change size, since we don't realloc
Thanks Peter

SVN revision: 45964
2010-02-07 12:23:27 +00:00
Sebastian Dransfeld 5408dedfe7 Don't shrink when we append
SVN revision: 45963
2010-02-07 12:21:28 +00:00
Sebastian Dransfeld 5b5107471f Work with escaped string
SVN revision: 45962
2010-02-07 12:21:07 +00:00
Sebastian Dransfeld 2587c28d9a Add eina_strbuf_reset
Function to reset the internal string, so we can reuse the allocated
mem.

SVN revision: 45952
2010-02-06 21:43:22 +00:00
Sebastian Dransfeld 522a0ab1ab Add eina_strbuf_append_escaped for edje
SVN revision: 45950
2010-02-06 21:43:02 +00:00
Sebastian Dransfeld 72fccca0eb Add eina_str_escape
SVN revision: 45949
2010-02-06 21:42:51 +00:00
Sebastian Dransfeld da1b1ee801 Add shrink buffer code
SVN revision: 45946
2010-02-06 20:42:14 +00:00
Sebastian Dransfeld f99d9ccf4b Simpler to use _eina_strbuf_resize
Add space for '\0' in _eina_strbuf_resize, so that we alwyas just pass
inn the wanted string space as requirement.

Correct len in eina_strbuf_append_n, we needed +1 for '\0' for resize
and strlcpy, but not for ->len

SVN revision: 45945
2010-02-06 20:42:03 +00:00