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
AC_MSG_CHECKING([whether to use ememoa for memory pool])
AC_MSG_RESULT([$enable_ememoa])
+
### Checks for libraries
PKG_PROG_PKG_CONFIG
AM_CONDITIONAL(EINA_ENABLE_EMEMOA, test "x${enable_ememoa}" = "xyes")
+
### Checks for header files
AC_HEADER_ASSERT
AC_HEADER_DIRENT
AM_CONDITIONAL(EINA_BUILD_DOC, test "x${build_doc}" = "xyes")
+
### Checks for types
### Checks for library functions
+AC_FUNC_ALLOCA
### Make the debug preprocessor configurable
* @todo add other todo items :)
*/
-#include <stdint.h>
-
#ifdef __cplusplus
extern "C" {
#endif
#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"
#define EINA_EACH(Function) ((Eina_Each)Function)
-#endif /*EINA_TYPES_H_*/
+#endif /* EINA_TYPES_H_ */
# 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)
{
/*============================================================================*
* Local *
*============================================================================*/
+
typedef struct _Eina_Iterator_Array Eina_Iterator_Array;
struct _Eina_Iterator_Array
{
/*============================================================================*
* Global *
*============================================================================*/
+
/*============================================================================*
* API *
*============================================================================*/
+
EAPI int
eina_array_init(void)
{
#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)
}
}
+/*============================================================================*
+ * 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
*/
* 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
/*============================================================================*
* Global *
*============================================================================*/
+
/*============================================================================*
* API *
*============================================================================*/
# 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;
/*============================================================================*
- * API *
+ * Global *
+ *============================================================================*/
+
+/*============================================================================*
+ * API *
*============================================================================*/
+
/**
- *
+ *
*/
EAPI int eina_error_init(void)
{
return ++_init_count;
}
/**
- *
+ *
*/
EAPI int eina_error_shutdown(void)
{
return eina_list_count(_error_list);
}
/**
- *
+ *
*/
EAPI Eina_Error eina_error_get(void)
{
return _err;
}
/**
- *
+ *
*/
EAPI void eina_error_set(Eina_Error err)
{
if (level > _error_level)
return;
-
+
va_start(args, fmt);
_print_cb(level, file, fnc, line, fmt, _print_cb_data, args);
va_end(args);
{
_error_level = level;
}
-
* 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 *
*============================================================================*/
# include "config.h"
#endif
+#include <stdlib.h>
+#include <string.h>
#include <stdint.h>
#include "eina_hash.h"
/*============================================================================*
* Global *
*============================================================================*/
+
/*============================================================================*
* API *
*============================================================================*/
* 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"
/*============================================================================*
* Local *
*============================================================================*/
+
typedef struct _Eina_Iterator_Inlist Eina_Iterator_Inlist;
typedef struct _Eina_Accessor_Inlist Eina_Accessor_Inlist;
/*============================================================================*
* Global *
*============================================================================*/
+
/*============================================================================*
* API *
*============================================================================*/
+
/**
* To be documented
* FIXME: To be fixed
# 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)
{
* 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;
Eina_Lalloc_Free free_cb;
};
+/*============================================================================*
+ * Global *
+ *============================================================================*/
+
+/*============================================================================*
+ * API *
+ *============================================================================*/
+
/**
* To be documented
* FIXME: To be fixed
/*============================================================================*
* Global *
*============================================================================*/
+
/*============================================================================*
* API *
*============================================================================*/
* 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
{
static int _eina_magic_string_count = 0;
static Eina_Array *strings = NULL;
+/*============================================================================*
+ * Global *
+ *============================================================================*/
+
+/*============================================================================*
+ * API *
+ *============================================================================*/
+
EAPI int
eina_magic_string_init()
{
* 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)
{
* 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
}
/*============================================================================*
+ * Global *
+ *============================================================================*/
+
+/*============================================================================*
* API *
*============================================================================*/
+
+EAPI Eina_Error EINA_ERROR_NOT_MEMPOOL_MODULE = 0;
+
/**
*
*/
# include "config.h"
#endif
+#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
/*============================================================================*
* Global *
*============================================================================*/
+
/*============================================================================*
* API *
*============================================================================*/
* 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>
/*============================================================================*
* Local *
*============================================================================*/
+
#define EINA_RBTREE_ITERATOR_PREFIX_MASK 0x1
#define EINA_RBTREE_ITERATOR_INFIX_MASK 0x2
#define EINA_RBTREE_ITERATOR_POSTFIX_MASK 0x4
/*============================================================================*
* Global *
*============================================================================*/
+
/*============================================================================*
* API *
*============================================================================*/
+
EAPI Eina_Rbtree *
eina_rbtree_inline_insert(Eina_Rbtree *root, Eina_Rbtree *node, Eina_Rbtree_Cmp_Node_Cb cmp)
{
#include "eina_error.h"
#include "eina_private.h"
+/*============================================================================*
+ * Local *
+ *============================================================================*/
+
typedef struct _Eina_Stringshare Eina_Stringshare;
typedef struct _Eina_Stringshare_Node 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.
* 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.
+ *
+ * @{
*/
/**
* @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)
* 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)
return eina_stringshare_init_count;
}
+/**
+ * @}
+ */
*/
+#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,