From: caro Date: Thu, 28 Aug 2008 07:46:42 +0000 (+0000) Subject: * move standard header files from eina_private.h to source files X-Git-Tag: submit/2.0alpha-wayland/20121127.222009~1961 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c092f52e8f01124a006f58cc091cd922c32a0ab3;p=profile%2Fivi%2Feina.git * move standard header files from eina_private.h to source files * minor formatting git-svn-id: http://svn.enlightenment.org/svn/e/trunk/PROTO/eina@35705 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/configure.in b/configure.in index 7c0ec71..9c60383 100644 --- a/configure.in +++ b/configure.in @@ -24,12 +24,14 @@ version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN" AC_SUBST(VMAJ) AC_SUBST(version_info) + ### Needed information MODULE_ARCH="$host_os-$host_cpu" AC_SUBST(MODULE_ARCH) AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture") + ### Additional options to configure # Unit tests @@ -97,6 +99,7 @@ AC_ARG_ENABLE([ememoa], AC_MSG_CHECKING([whether to use ememoa for memory pool]) AC_MSG_RESULT([$enable_ememoa]) + ### Checks for libraries PKG_PROG_PKG_CONFIG @@ -137,6 +140,7 @@ fi AM_CONDITIONAL(EINA_ENABLE_EMEMOA, test "x${enable_ememoa}" = "xyes") + ### Checks for header files AC_HEADER_ASSERT AC_HEADER_DIRENT @@ -176,6 +180,7 @@ EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"]) AM_CONDITIONAL(EINA_BUILD_DOC, test "x${build_doc}" = "xyes") + ### Checks for types @@ -208,6 +213,7 @@ AC_SUBST(lt_enable_auto_import) ### Checks for library functions +AC_FUNC_ALLOCA ### Make the debug preprocessor configurable diff --git a/src/include/Eina.h b/src/include/Eina.h index 363936b..0bfa7a7 100644 --- a/src/include/Eina.h +++ b/src/include/Eina.h @@ -57,8 +57,6 @@ * @todo add other todo items :) */ -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/src/include/eina_private.h b/src/include/eina_private.h index 7b5a918..acc8e0f 100644 --- a/src/include/eina_private.h +++ b/src/include/eina_private.h @@ -19,26 +19,6 @@ #ifndef EINA_PRIVATE_H_ #define EINA_PRIVATE_H_ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - #include "eina_iterator.h" #include "eina_accessor.h" diff --git a/src/include/eina_types.h b/src/include/eina_types.h index 422b8f8..61ee053 100644 --- a/src/include/eina_types.h +++ b/src/include/eina_types.h @@ -80,4 +80,4 @@ typedef Eina_Bool (*Eina_Each)(const void *container, #define EINA_EACH(Function) ((Eina_Each)Function) -#endif /*EINA_TYPES_H_*/ +#endif /* EINA_TYPES_H_ */ diff --git a/src/lib/eina_accessor.c b/src/lib/eina_accessor.c index adae00f..450af72 100644 --- a/src/lib/eina_accessor.c +++ b/src/lib/eina_accessor.c @@ -23,9 +23,19 @@ # include "config.h" #endif +#include + #include "eina_accessor.h" #include "eina_private.h" +/*============================================================================* + * Global * + *============================================================================*/ + +/*============================================================================* + * API * + *============================================================================*/ + EAPI void eina_accessor_free(Eina_Accessor *accessor) { diff --git a/src/lib/eina_array.c b/src/lib/eina_array.c index c2cc409..3edf6aa 100644 --- a/src/lib/eina_array.c +++ b/src/lib/eina_array.c @@ -35,6 +35,7 @@ /*============================================================================* * Local * *============================================================================*/ + typedef struct _Eina_Iterator_Array Eina_Iterator_Array; struct _Eina_Iterator_Array { @@ -100,9 +101,11 @@ eina_array_accessor_free(Eina_Accessor_Array *it) /*============================================================================* * Global * *============================================================================*/ + /*============================================================================* * API * *============================================================================*/ + EAPI int eina_array_init(void) { diff --git a/src/lib/eina_convert.c b/src/lib/eina_convert.c index e5a2158..1a13396 100644 --- a/src/lib/eina_convert.c +++ b/src/lib/eina_convert.c @@ -26,15 +26,15 @@ #include "eina_convert.h" +/*============================================================================* + * Local * + *============================================================================*/ + static const char look_up_table[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; static int _init_count = 0; -EAPI Eina_Error EINA_ERROR_CONVERT_P_NOT_FOUND = 0; -EAPI Eina_Error EINA_ERROR_CONVERT_0X_NOT_FOUND = 0; -EAPI Eina_Error EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH = 0; - #define HEXA_TO_INT(Hexa) (Hexa >= 'a') ? Hexa - 'a' + 10 : Hexa - '0' static inline void reverse(char s[], int length) @@ -49,6 +49,18 @@ static inline void reverse(char s[], int length) } } +/*============================================================================* + * Global * + *============================================================================*/ + +/*============================================================================* + * API * + *============================================================================*/ + +EAPI Eina_Error EINA_ERROR_CONVERT_P_NOT_FOUND = 0; +EAPI Eina_Error EINA_ERROR_CONVERT_0X_NOT_FOUND = 0; +EAPI Eina_Error EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH = 0; + /* * Come from the second edition of The C Programming Language ("K&R2") on page 64 */ diff --git a/src/lib/eina_counter.c b/src/lib/eina_counter.c index 81c1a00..fcb19b4 100644 --- a/src/lib/eina_counter.c +++ b/src/lib/eina_counter.c @@ -16,15 +16,23 @@ * if not, see . */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include #include #include "eina_counter.h" #include "eina_inlist.h" #include "eina_error.h" #include "eina_private.h" + /*============================================================================* - * Local * + * Local * *============================================================================*/ + typedef struct _Eina_Clock Eina_Clock; struct _Eina_Counter @@ -52,6 +60,7 @@ static int EINA_COUNTER_ERROR_OUT_OF_MEMORY = 0; /*============================================================================* * Global * *============================================================================*/ + /*============================================================================* * API * *============================================================================*/ diff --git a/src/lib/eina_error.c b/src/lib/eina_error.c index 705f273..162614f 100644 --- a/src/lib/eina_error.c +++ b/src/lib/eina_error.c @@ -20,20 +20,26 @@ # include "config.h" #endif +#include +#include + #include "eina_error.h" #include "eina_list.h" #include "eina_private.h" + /* TODO * + printing errors to stdout or stderr can be implemented - * using a queue, usful for multiple threads printing + * using a queue, useful for multiple threads printing * + add a wapper for assert? * + add common error numbers, messages * + add a calltrace of erros, not only store the last error but a list of them * and also store the function that set it */ + /*============================================================================* - * Local * + * Local * *============================================================================*/ + static int _init_count = 0; static Eina_List *_error_list; static Eina_Error _err; @@ -63,10 +69,15 @@ static char *_colors[EINA_ERROR_LEVELS] = { /*============================================================================* - * API * + * Global * + *============================================================================*/ + +/*============================================================================* + * API * *============================================================================*/ + /** - * + * */ EAPI int eina_error_init(void) { @@ -85,7 +96,7 @@ EAPI int eina_error_init(void) return ++_init_count; } /** - * + * */ EAPI int eina_error_shutdown(void) { @@ -114,14 +125,14 @@ EAPI Eina_Error eina_error_register(const char *msg) return eina_list_count(_error_list); } /** - * + * */ EAPI Eina_Error eina_error_get(void) { return _err; } /** - * + * */ EAPI void eina_error_set(Eina_Error err) { @@ -146,7 +157,7 @@ EAPI void eina_error_print(Eina_Error_Level level, const char *file, if (level > _error_level) return; - + va_start(args, fmt); _print_cb(level, file, fnc, line, fmt, _print_cb_data, args); va_end(args); @@ -190,4 +201,3 @@ EAPI void eina_error_log_level_set(Eina_Error_Level level) { _error_level = level; } - diff --git a/src/lib/eina_file.c b/src/lib/eina_file.c index 91d9ff4..1c29283 100644 --- a/src/lib/eina_file.c +++ b/src/lib/eina_file.c @@ -16,16 +16,43 @@ * if not, see . */ +#ifdef HAVE_CONFIG_H +# include +#endif + #define _GNU_SOURCE #include #include #include #include +#include + +#ifdef HAVE_ALLOCA_H +# include +#elif defined __GNUC__ +# define alloca __builtin_alloca +#elif defined _AIX +# define alloca __alloca +#elif defined _MSC_VER +# include +# define alloca _alloca +#else +# include +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +#endif + #include "eina_file.h" #include "eina_private.h" /*============================================================================* + * Global * + *============================================================================*/ + +/*============================================================================* * API * *============================================================================*/ diff --git a/src/lib/eina_hash.c b/src/lib/eina_hash.c index d593231..3b77b9d 100644 --- a/src/lib/eina_hash.c +++ b/src/lib/eina_hash.c @@ -21,6 +21,8 @@ # include "config.h" #endif +#include +#include #include #include "eina_hash.h" @@ -242,6 +244,7 @@ _eina_hash_iterator_free(Eina_Iterator_Hash *it) /*============================================================================* * Global * *============================================================================*/ + /*============================================================================* * API * *============================================================================*/ diff --git a/src/lib/eina_inlist.c b/src/lib/eina_inlist.c index d748896..05067d8 100644 --- a/src/lib/eina_inlist.c +++ b/src/lib/eina_inlist.c @@ -16,6 +16,13 @@ * if not, see . */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include + #include "eina_inlist.h" #include "eina_private.h" @@ -24,6 +31,7 @@ /*============================================================================* * Local * *============================================================================*/ + typedef struct _Eina_Iterator_Inlist Eina_Iterator_Inlist; typedef struct _Eina_Accessor_Inlist Eina_Accessor_Inlist; @@ -119,9 +127,11 @@ eina_inlist_accessor_free(Eina_Accessor_Inlist *it) { /*============================================================================* * Global * *============================================================================*/ + /*============================================================================* * API * *============================================================================*/ + /** * To be documented * FIXME: To be fixed diff --git a/src/lib/eina_iterator.c b/src/lib/eina_iterator.c index 2d94422..edcaef5 100644 --- a/src/lib/eina_iterator.c +++ b/src/lib/eina_iterator.c @@ -23,9 +23,19 @@ # include "config.h" #endif +#include + #include "eina_iterator.h" #include "eina_private.h" +/*============================================================================* + * Global * + *============================================================================*/ + +/*============================================================================* + * API * + *============================================================================*/ + EAPI void eina_iterator_free(Eina_Iterator *iterator) { diff --git a/src/lib/eina_lalloc.c b/src/lib/eina_lalloc.c index 4675e1d..c78e92f 100644 --- a/src/lib/eina_lalloc.c +++ b/src/lib/eina_lalloc.c @@ -16,9 +16,19 @@ * if not, see . */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include + #include "eina_lalloc.h" #include "eina_private.h" +/*============================================================================* + * Local * + *============================================================================*/ + struct _Eina_Lalloc { void *data; @@ -29,6 +39,14 @@ struct _Eina_Lalloc Eina_Lalloc_Free free_cb; }; +/*============================================================================* + * Global * + *============================================================================*/ + +/*============================================================================* + * API * + *============================================================================*/ + /** * To be documented * FIXME: To be fixed diff --git a/src/lib/eina_list.c b/src/lib/eina_list.c index 01026ea..984a4a1 100644 --- a/src/lib/eina_list.c +++ b/src/lib/eina_list.c @@ -274,6 +274,7 @@ eina_list_accessor_free(Eina_Accessor_List *it) /*============================================================================* * Global * *============================================================================*/ + /*============================================================================* * API * *============================================================================*/ diff --git a/src/lib/eina_magic.c b/src/lib/eina_magic.c index 0a160c6..961f26e 100644 --- a/src/lib/eina_magic.c +++ b/src/lib/eina_magic.c @@ -16,16 +16,25 @@ * if not, see . */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include + #include "eina_array.h" #include "eina_error.h" - #include "eina_private.h" #ifndef DEBUG -#define DEBUG +# define DEBUG #endif #include "eina_magic.h" +/*============================================================================* + * Local * + *============================================================================*/ + typedef struct _Eina_Magic_String Eina_Magic_String; struct _Eina_Magic_String { @@ -36,6 +45,14 @@ struct _Eina_Magic_String static int _eina_magic_string_count = 0; static Eina_Array *strings = NULL; +/*============================================================================* + * Global * + *============================================================================*/ + +/*============================================================================* + * API * + *============================================================================*/ + EAPI int eina_magic_string_init() { diff --git a/src/lib/eina_main.c b/src/lib/eina_main.c index 31157ae..fdb632f 100644 --- a/src/lib/eina_main.c +++ b/src/lib/eina_main.c @@ -16,12 +16,24 @@ * if not, see . */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include "eina_error.h" #include "eina_hash.h" #include "eina_stringshare.h" #include "eina_list.h" #include "eina_array.h" +/*============================================================================* + * Global * + *============================================================================*/ + +/*============================================================================* + * API * + *============================================================================*/ + EAPI int eina_init(void) { diff --git a/src/lib/eina_mempool.c b/src/lib/eina_mempool.c index 76e6b79..4a3c8f2 100644 --- a/src/lib/eina_mempool.c +++ b/src/lib/eina_mempool.c @@ -16,18 +16,24 @@ * if not, see . */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + #include "eina_mempool.h" #include "eina_list.h" #include "eina_module.h" #include "eina_private.h" + /*============================================================================* * Local * *============================================================================*/ + static Eina_Module_Group *_group; static int _init_count = 0; -EAPI Eina_Error EINA_ERROR_NOT_MEMPOOL_MODULE = 0; - struct _Eina_Mempool { #ifdef DEBUG @@ -69,8 +75,15 @@ _new_from_buffer(const char *module, const char *context, const char *options, v } /*============================================================================* + * Global * + *============================================================================*/ + +/*============================================================================* * API * *============================================================================*/ + +EAPI Eina_Error EINA_ERROR_NOT_MEMPOOL_MODULE = 0; + /** * */ diff --git a/src/lib/eina_module.c b/src/lib/eina_module.c index 20c3c68..2a75a47 100644 --- a/src/lib/eina_module.c +++ b/src/lib/eina_module.c @@ -20,6 +20,7 @@ # include "config.h" #endif +#include #include #include #include @@ -225,6 +226,7 @@ _eina_dir_module_cb(const char *name, const char *path, Eina_Dir_List *data) /*============================================================================* * Global * *============================================================================*/ + /*============================================================================* * API * *============================================================================*/ diff --git a/src/lib/eina_rbtree.c b/src/lib/eina_rbtree.c index 60f02a0..8cd1327 100644 --- a/src/lib/eina_rbtree.c +++ b/src/lib/eina_rbtree.c @@ -16,6 +16,10 @@ * if not, see . */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include #include #include @@ -27,6 +31,7 @@ /*============================================================================* * Local * *============================================================================*/ + #define EINA_RBTREE_ITERATOR_PREFIX_MASK 0x1 #define EINA_RBTREE_ITERATOR_INFIX_MASK 0x2 #define EINA_RBTREE_ITERATOR_POSTFIX_MASK 0x4 @@ -229,9 +234,11 @@ _eina_rbtree_inline_double_rotation(Eina_Rbtree *node, Eina_Rbtree_Direction dir /*============================================================================* * Global * *============================================================================*/ + /*============================================================================* * API * *============================================================================*/ + EAPI Eina_Rbtree * eina_rbtree_inline_insert(Eina_Rbtree *root, Eina_Rbtree *node, Eina_Rbtree_Cmp_Node_Cb cmp) { diff --git a/src/lib/eina_stringshare.c b/src/lib/eina_stringshare.c index 3030794..7c71aa1 100644 --- a/src/lib/eina_stringshare.c +++ b/src/lib/eina_stringshare.c @@ -64,6 +64,10 @@ #include "eina_error.h" #include "eina_private.h" +/*============================================================================* + * Local * + *============================================================================*/ + typedef struct _Eina_Stringshare Eina_Stringshare; typedef struct _Eina_Stringshare_Node Eina_Stringshare_Node; @@ -81,8 +85,16 @@ struct _Eina_Stringshare_Node static Eina_Stringshare *share = NULL; static int eina_stringshare_init_count = 0; +/*============================================================================* + * Global * + *============================================================================*/ + +/*============================================================================* + * API * + *============================================================================*/ + /** - * @defgroup Eina_Stringshare_Group String Instance Functions + * @addtogroup Eina_Stringshare_Group String Instance Functions * * These functions allow you to store one copy of a string, and use it * throughout your program. @@ -99,6 +111,8 @@ static int eina_stringshare_init_count = 0; * 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. + * + * @{ */ /** @@ -129,7 +143,6 @@ eina_stringshare_init() * @param str The string to retrieve an instance of. * @return A pointer to an instance of the string on success. * @c NULL on failure. - * @ingroup Eina_Stringshare_Group */ EAPI const char * eina_stringshare_add(const char *str) @@ -171,7 +184,6 @@ eina_stringshare_add(const char *str) * It will free the string if no other instances are left. * * @param str string The given string. - * @ingroup Eina_Stringshare_Group */ EAPI void eina_stringshare_del(const char *str) @@ -243,3 +255,6 @@ eina_stringshare_shutdown() return eina_stringshare_init_count; } +/** + * @} + */ diff --git a/src/lib/eina_value.c b/src/lib/eina_value.c index 4119127..dc48025 100644 --- a/src/lib/eina_value.c +++ b/src/lib/eina_value.c @@ -24,9 +24,21 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include "eina_types.h" #include "eina_private.h" +/*============================================================================* + * Global * + *============================================================================*/ + +/*============================================================================* + * API * + *============================================================================*/ + EAPI const unsigned int eina_prime_table[] = { 17, 31, 61, 127, 257, 509, 1021,