,,SVN revion 2009-11-02 - !r43404,, [[TOC]] '''Important Note''': the included code should be used only as conceptual idea of how something works. == Eina == === Accessor === Accessors allow a random access of the data of a container. They can access an element at any position. === Arrays === Create and manage arrays, very fast access to data list. === Benchmarks === Allow you to add benchmark framework in a project for timing critical part and detect slow parts of code. === Convert === These functions allow you to convert integer or real numbers to string or conversely. === Cpu === Get the features of a cpu, like mmx, se, altivec, etc === File === * list the content of a directory, recusrsively or not, and can call a callback function for eachfound file. * split a path into all the subdirectories that compose it, according to the separator of the file system. === Hash === Hash management Hash functions are mostly used to speed up table lookup or data comparison tasks such as finding items in a database, detecting duplicated or similar records in a large file, finding similar stretches in DNA sequences, and so on. === Rectangle === Rectangle coordenades and calculations === Stringshare === These functions allow you to store one copy of a string, and use it throughout your program. It sounds like micro-optimizing, but profiling has shown this can have a significant impact as you scale the number of copies up. It improves string creation/destruction speed, reduces memory use and decreases memory fragmentation, so a win all-around. === Trash === Instead to malloc/free pointers, just put them in the trash, you can reuse it later too, you can free the entire trash later. FIXME: is that ok ? === List === Lists management * for (foreach) * free lists * next/prev/last * append/prepend/*relative * data get * counter * find * sort * remove * promote: move the specified data to the first of the list * nth: get the nth number of the member in the list * merge/split * iterator === Iterator === This is like a cursor to access the elements sequentially in a container === Lalloc === Lazy Allocator, that is, for lazy developers or ppl that has a cheapo keyboard. FIXME === Log === Functions to add logs in your code with level of verbosity control and the management of specific-code logs {{{ #!C EINA_LOG_ERR("BIG FAT ERROR!"); EINA_LOG_INFO("Message only visible running app with high log level set"); EINA_LOG_DBG("Running foo, only with big verbosity"); }}} === Error === The Eina error module provides a way to manage errors in a simple but powerful way in libraries and modules. You can register your own error messages, and so get the last error message ocurred too. {{{ #!C Eina_Error MY_ERROR_NEGATIVE; void *data_new() { eina_error_set(MY_ERROR_NEGATIVE); return; } int main(void) { Eina_Error err; void *data; MY_ERROR_NEGATIVE = eina_error_msg_register("Your data is Negative!"); if (err) printf ("Error is: %s\n", eina_error_msg_get(err)); data = data_new(); // We set the state of an error err = eina_error_get(); // We get the message for the ID of the error if (err) printf ("Error is: %s\n", eina_error_msg_get(err)); } }}} === Magic === Magic checks (WTF, better description) FIXME. Add example FIXME === Matrix Sparse === What's that for, what means the sparse thing there ? FIXME === Red & Black Tree === Self-balancing binary search tree, a data structure, good for use in associative arays, very efficient and fast, removes and insert intelligently the data on the tree, so it is balanced for optimization reasons. FIXME ? === Memory Pool === FIXME: description FIXME: elements: * register/unregister ? * malloc/realloc ? * add/del/free ? * statistics === Modules === Which kind of modules ? eina modules so extra libs features ? FIXME === Safety Checks === Set of macros to check for parameters or values that should never happen, doesn't abort the program but it logs instead The meant of this is to remove possible segfaults when they will be not so important and continue with the process of program FIXME: is this code good ? {{{ #!C EAPI void my_func(Ethumb *e) { EINA_SAFETY_ON_NULL_RETURN(e); // return if our pointer is null do_something; }}} === Tiler === FIXME: description repetitive fill for rectangles (???) === MACROS === FIXME: Add description of these usages: * EINA_WARN_UNUSED_RESULT * EINA_ARG_NONNULL * EINA_DEPRECATED * EINA_PURE * EINA_UNLIKELY/LIKELY * EINA_FALSE/TRUE: equivalent to FALSE/TRUE macros