* move standard header files from eina_private.h to source files
authorcaro <caro>
Thu, 28 Aug 2008 07:46:42 +0000 (07:46 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 28 Aug 2008 07:46:42 +0000 (07:46 +0000)
 * minor formatting

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/PROTO/eina@35705 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

22 files changed:
configure.in
src/include/Eina.h
src/include/eina_private.h
src/include/eina_types.h
src/lib/eina_accessor.c
src/lib/eina_array.c
src/lib/eina_convert.c
src/lib/eina_counter.c
src/lib/eina_error.c
src/lib/eina_file.c
src/lib/eina_hash.c
src/lib/eina_inlist.c
src/lib/eina_iterator.c
src/lib/eina_lalloc.c
src/lib/eina_list.c
src/lib/eina_magic.c
src/lib/eina_main.c
src/lib/eina_mempool.c
src/lib/eina_module.c
src/lib/eina_rbtree.c
src/lib/eina_stringshare.c
src/lib/eina_value.c

index 7c0ec71..9c60383 100644 (file)
@@ -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
index 363936b..0bfa7a7 100644 (file)
@@ -57,8 +57,6 @@
  * @todo add other todo items :)
  */
 
-#include <stdint.h>
-
 #ifdef __cplusplus
 extern "C" {
 #endif
index 7b5a918..acc8e0f 100644 (file)
 #ifndef EINA_PRIVATE_H_
 #define EINA_PRIVATE_H_
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <dirent.h>
-#include <string.h>
-
-#include <assert.h>
-
 #include "eina_iterator.h"
 #include "eina_accessor.h"
 
index 422b8f8..61ee053 100644 (file)
@@ -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_ */
index adae00f..450af72 100644 (file)
 # include "config.h"
 #endif
 
+#include <stdlib.h>
+
 #include "eina_accessor.h"
 #include "eina_private.h"
 
+/*============================================================================*
+ *                                 Global                                     *
+ *============================================================================*/
+
+/*============================================================================*
+ *                                   API                                      *
+ *============================================================================*/
+
 EAPI void
 eina_accessor_free(Eina_Accessor *accessor)
 {
index c2cc409..3edf6aa 100644 (file)
@@ -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)
 {
index e5a2158..1a13396 100644 (file)
 
 #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
  */
index 81c1a00..fcb19b4 100644 (file)
  * if not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <string.h>
 #include <time.h>
 
 #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                                      *
  *============================================================================*/
index 705f273..162614f 100644 (file)
 # include "config.h"
 #endif
 
+#include <stdio.h>
+#include <string.h>
+
 #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;
 }
-
index 91d9ff4..1c29283 100644 (file)
  * if not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 #define _GNU_SOURCE
 #include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <dirent.h>
+
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#elif defined __GNUC__
+# define alloca __builtin_alloca
+#elif defined _AIX
+# define alloca __alloca
+#elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+#else
+# include <stddef.h>
+# ifdef  __cplusplus
+extern "C"
+# endif
+void *alloca (size_t);
+#endif
+
 
 #include "eina_file.h"
 #include "eina_private.h"
 
 /*============================================================================*
+ *                                 Global                                     *
+ *============================================================================*/
+
+/*============================================================================*
  *                                   API                                      * 
  *============================================================================*/
 
index d593231..3b77b9d 100644 (file)
@@ -21,6 +21,8 @@
 # include "config.h"
 #endif
 
+#include <stdlib.h>
+#include <string.h>
 #include <stdint.h>
 
 #include "eina_hash.h"
@@ -242,6 +244,7 @@ _eina_hash_iterator_free(Eina_Iterator_Hash *it)
 /*============================================================================*
  *                                 Global                                     *
  *============================================================================*/
+
 /*============================================================================*
  *                                   API                                      *
  *============================================================================*/
index d748896..05067d8 100644 (file)
  * if not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <assert.h>
+
 #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
index 2d94422..edcaef5 100644 (file)
 # include "config.h"
 #endif
 
+#include <stdlib.h>
+
 #include "eina_iterator.h"
 #include "eina_private.h"
 
+/*============================================================================*
+ *                                 Global                                     *
+ *============================================================================*/
+
+/*============================================================================*
+ *                                   API                                      *
+ *============================================================================*/
+
 EAPI void
 eina_iterator_free(Eina_Iterator *iterator)
 {
index 4675e1d..c78e92f 100644 (file)
  * if not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+
 #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
index 01026ea..984a4a1 100644 (file)
@@ -274,6 +274,7 @@ eina_list_accessor_free(Eina_Accessor_List *it)
 /*============================================================================*
  *                                 Global                                     *
  *============================================================================*/
+
 /*============================================================================*
  *                                   API                                      *
  *============================================================================*/
index 0a160c6..961f26e 100644 (file)
  * if not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <string.h>
+
 #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()
 {
index 31157ae..fdb632f 100644 (file)
  * if not, see <http://www.gnu.org/licenses/>.
  */
 
+#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)
 {
index 76e6b79..4a3c8f2 100644 (file)
  * if not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <assert.h>
+
 #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;
+
 /**
  *
  */
index 20c3c68..2a75a47 100644 (file)
@@ -20,6 +20,7 @@
 # include "config.h"
 #endif
 
+#include <stdio.h>
 #include <sys/types.h>
 #include <dirent.h>
 #include <string.h>
@@ -225,6 +226,7 @@ _eina_dir_module_cb(const char *name, const char *path, Eina_Dir_List *data)
 /*============================================================================*
  *                                 Global                                     *
  *============================================================================*/
+
 /*============================================================================*
  *                                   API                                      *
  *============================================================================*/
index 60f02a0..8cd1327 100644 (file)
  * if not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -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)
 {
index 3030794..7c71aa1 100644 (file)
 #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;
 }
 
+/**
+ * @}
+ */
index 4119127..dc48025 100644 (file)
@@ -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,