* move standard header files from eina_private.h to source files
* minor formatting SVN revision: 35705
This commit is contained in:
parent
29313e097f
commit
dafd079639
|
@ -24,12 +24,14 @@ version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
|
||||||
AC_SUBST(VMAJ)
|
AC_SUBST(VMAJ)
|
||||||
AC_SUBST(version_info)
|
AC_SUBST(version_info)
|
||||||
|
|
||||||
|
|
||||||
### Needed information
|
### Needed information
|
||||||
|
|
||||||
MODULE_ARCH="$host_os-$host_cpu"
|
MODULE_ARCH="$host_os-$host_cpu"
|
||||||
AC_SUBST(MODULE_ARCH)
|
AC_SUBST(MODULE_ARCH)
|
||||||
AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")
|
AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")
|
||||||
|
|
||||||
|
|
||||||
### Additional options to configure
|
### Additional options to configure
|
||||||
|
|
||||||
# Unit tests
|
# Unit tests
|
||||||
|
@ -97,6 +99,7 @@ AC_ARG_ENABLE([ememoa],
|
||||||
AC_MSG_CHECKING([whether to use ememoa for memory pool])
|
AC_MSG_CHECKING([whether to use ememoa for memory pool])
|
||||||
AC_MSG_RESULT([$enable_ememoa])
|
AC_MSG_RESULT([$enable_ememoa])
|
||||||
|
|
||||||
|
|
||||||
### Checks for libraries
|
### Checks for libraries
|
||||||
|
|
||||||
PKG_PROG_PKG_CONFIG
|
PKG_PROG_PKG_CONFIG
|
||||||
|
@ -137,6 +140,7 @@ fi
|
||||||
|
|
||||||
AM_CONDITIONAL(EINA_ENABLE_EMEMOA, test "x${enable_ememoa}" = "xyes")
|
AM_CONDITIONAL(EINA_ENABLE_EMEMOA, test "x${enable_ememoa}" = "xyes")
|
||||||
|
|
||||||
|
|
||||||
### Checks for header files
|
### Checks for header files
|
||||||
AC_HEADER_ASSERT
|
AC_HEADER_ASSERT
|
||||||
AC_HEADER_DIRENT
|
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")
|
AM_CONDITIONAL(EINA_BUILD_DOC, test "x${build_doc}" = "xyes")
|
||||||
|
|
||||||
|
|
||||||
### Checks for types
|
### Checks for types
|
||||||
|
|
||||||
|
|
||||||
|
@ -208,6 +213,7 @@ AC_SUBST(lt_enable_auto_import)
|
||||||
|
|
||||||
|
|
||||||
### Checks for library functions
|
### Checks for library functions
|
||||||
|
AC_FUNC_ALLOCA
|
||||||
|
|
||||||
|
|
||||||
### Make the debug preprocessor configurable
|
### Make the debug preprocessor configurable
|
||||||
|
|
|
@ -57,8 +57,6 @@
|
||||||
* @todo add other todo items :)
|
* @todo add other todo items :)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -19,26 +19,6 @@
|
||||||
#ifndef EINA_PRIVATE_H_
|
#ifndef EINA_PRIVATE_H_
|
||||||
#define 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_iterator.h"
|
||||||
#include "eina_accessor.h"
|
#include "eina_accessor.h"
|
||||||
|
|
||||||
|
|
|
@ -80,4 +80,4 @@ typedef Eina_Bool (*Eina_Each)(const void *container,
|
||||||
#define EINA_EACH(Function) ((Eina_Each)Function)
|
#define EINA_EACH(Function) ((Eina_Each)Function)
|
||||||
|
|
||||||
|
|
||||||
#endif /*EINA_TYPES_H_*/
|
#endif /* EINA_TYPES_H_ */
|
||||||
|
|
|
@ -23,9 +23,19 @@
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "eina_accessor.h"
|
#include "eina_accessor.h"
|
||||||
#include "eina_private.h"
|
#include "eina_private.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* API *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
eina_accessor_free(Eina_Accessor *accessor)
|
eina_accessor_free(Eina_Accessor *accessor)
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* Local *
|
* Local *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
typedef struct _Eina_Iterator_Array Eina_Iterator_Array;
|
typedef struct _Eina_Iterator_Array Eina_Iterator_Array;
|
||||||
struct _Eina_Iterator_Array
|
struct _Eina_Iterator_Array
|
||||||
{
|
{
|
||||||
|
@ -100,9 +101,11 @@ eina_array_accessor_free(Eina_Accessor_Array *it)
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* Global *
|
* Global *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* API *
|
* API *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
eina_array_init(void)
|
eina_array_init(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,15 +26,15 @@
|
||||||
|
|
||||||
#include "eina_convert.h"
|
#include "eina_convert.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Local *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
static const char look_up_table[] = {'0', '1', '2', '3', '4',
|
static const char look_up_table[] = {'0', '1', '2', '3', '4',
|
||||||
'5', '6', '7', '8', '9',
|
'5', '6', '7', '8', '9',
|
||||||
'a', 'b', 'c', 'd', 'e', 'f'};
|
'a', 'b', 'c', 'd', 'e', 'f'};
|
||||||
static int _init_count = 0;
|
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'
|
#define HEXA_TO_INT(Hexa) (Hexa >= 'a') ? Hexa - 'a' + 10 : Hexa - '0'
|
||||||
|
|
||||||
static inline void reverse(char s[], int length)
|
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
|
* Come from the second edition of The C Programming Language ("K&R2") on page 64
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -16,15 +16,23 @@
|
||||||
* if not, see <http://www.gnu.org/licenses/>.
|
* 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 <time.h>
|
||||||
|
|
||||||
#include "eina_counter.h"
|
#include "eina_counter.h"
|
||||||
#include "eina_inlist.h"
|
#include "eina_inlist.h"
|
||||||
#include "eina_error.h"
|
#include "eina_error.h"
|
||||||
#include "eina_private.h"
|
#include "eina_private.h"
|
||||||
|
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* Local *
|
* Local *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
typedef struct _Eina_Clock Eina_Clock;
|
typedef struct _Eina_Clock Eina_Clock;
|
||||||
|
|
||||||
struct _Eina_Counter
|
struct _Eina_Counter
|
||||||
|
@ -52,6 +60,7 @@ static int EINA_COUNTER_ERROR_OUT_OF_MEMORY = 0;
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* Global *
|
* Global *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* API *
|
* API *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
|
@ -20,20 +20,26 @@
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "eina_error.h"
|
#include "eina_error.h"
|
||||||
#include "eina_list.h"
|
#include "eina_list.h"
|
||||||
#include "eina_private.h"
|
#include "eina_private.h"
|
||||||
|
|
||||||
/* TODO
|
/* TODO
|
||||||
* + printing errors to stdout or stderr can be implemented
|
* + 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 a wapper for assert?
|
||||||
* + add common error numbers, messages
|
* + add common error numbers, messages
|
||||||
* + add a calltrace of erros, not only store the last error but a list of them
|
* + add a calltrace of erros, not only store the last error but a list of them
|
||||||
* and also store the function that set it
|
* and also store the function that set it
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* Local *
|
* Local *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
static int _init_count = 0;
|
static int _init_count = 0;
|
||||||
static Eina_List *_error_list;
|
static Eina_List *_error_list;
|
||||||
static Eina_Error _err;
|
static Eina_Error _err;
|
||||||
|
@ -63,10 +69,15 @@ static char *_colors[EINA_ERROR_LEVELS] = {
|
||||||
|
|
||||||
|
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* API *
|
* Global *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* API *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
EAPI int eina_error_init(void)
|
EAPI int eina_error_init(void)
|
||||||
{
|
{
|
||||||
|
@ -85,7 +96,7 @@ EAPI int eina_error_init(void)
|
||||||
return ++_init_count;
|
return ++_init_count;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
EAPI int eina_error_shutdown(void)
|
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);
|
return eina_list_count(_error_list);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
EAPI Eina_Error eina_error_get(void)
|
EAPI Eina_Error eina_error_get(void)
|
||||||
{
|
{
|
||||||
return _err;
|
return _err;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
EAPI void eina_error_set(Eina_Error 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)
|
if (level > _error_level)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
_print_cb(level, file, fnc, line, fmt, _print_cb_data, args);
|
_print_cb(level, file, fnc, line, fmt, _print_cb_data, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
@ -190,4 +201,3 @@ EAPI void eina_error_log_level_set(Eina_Error_Level level)
|
||||||
{
|
{
|
||||||
_error_level = level;
|
_error_level = level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,15 +16,42 @@
|
||||||
* if not, see <http://www.gnu.org/licenses/>.
|
* if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.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_file.h"
|
||||||
#include "eina_private.h"
|
#include "eina_private.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* API *
|
* API *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "eina_hash.h"
|
#include "eina_hash.h"
|
||||||
|
@ -242,6 +244,7 @@ _eina_hash_iterator_free(Eina_Iterator_Hash *it)
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* Global *
|
* Global *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* API *
|
* API *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
|
@ -16,6 +16,13 @@
|
||||||
* if not, see <http://www.gnu.org/licenses/>.
|
* 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_inlist.h"
|
||||||
#include "eina_private.h"
|
#include "eina_private.h"
|
||||||
|
|
||||||
|
@ -24,6 +31,7 @@
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* Local *
|
* Local *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
typedef struct _Eina_Iterator_Inlist Eina_Iterator_Inlist;
|
typedef struct _Eina_Iterator_Inlist Eina_Iterator_Inlist;
|
||||||
typedef struct _Eina_Accessor_Inlist Eina_Accessor_Inlist;
|
typedef struct _Eina_Accessor_Inlist Eina_Accessor_Inlist;
|
||||||
|
|
||||||
|
@ -119,9 +127,11 @@ eina_inlist_accessor_free(Eina_Accessor_Inlist *it) {
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* Global *
|
* Global *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* API *
|
* API *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To be documented
|
* To be documented
|
||||||
* FIXME: To be fixed
|
* FIXME: To be fixed
|
||||||
|
|
|
@ -23,9 +23,19 @@
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "eina_iterator.h"
|
#include "eina_iterator.h"
|
||||||
#include "eina_private.h"
|
#include "eina_private.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* API *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
eina_iterator_free(Eina_Iterator *iterator)
|
eina_iterator_free(Eina_Iterator *iterator)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,9 +16,19 @@
|
||||||
* if not, see <http://www.gnu.org/licenses/>.
|
* 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_lalloc.h"
|
||||||
#include "eina_private.h"
|
#include "eina_private.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Local *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
struct _Eina_Lalloc
|
struct _Eina_Lalloc
|
||||||
{
|
{
|
||||||
void *data;
|
void *data;
|
||||||
|
@ -29,6 +39,14 @@ struct _Eina_Lalloc
|
||||||
Eina_Lalloc_Free free_cb;
|
Eina_Lalloc_Free free_cb;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* API *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To be documented
|
* To be documented
|
||||||
* FIXME: To be fixed
|
* FIXME: To be fixed
|
||||||
|
|
|
@ -274,6 +274,7 @@ eina_list_accessor_free(Eina_Accessor_List *it)
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* Global *
|
* Global *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* API *
|
* API *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
|
@ -16,16 +16,25 @@
|
||||||
* if not, see <http://www.gnu.org/licenses/>.
|
* 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_array.h"
|
||||||
#include "eina_error.h"
|
#include "eina_error.h"
|
||||||
|
|
||||||
#include "eina_private.h"
|
#include "eina_private.h"
|
||||||
|
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
#define DEBUG
|
# define DEBUG
|
||||||
#endif
|
#endif
|
||||||
#include "eina_magic.h"
|
#include "eina_magic.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Local *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
typedef struct _Eina_Magic_String Eina_Magic_String;
|
typedef struct _Eina_Magic_String Eina_Magic_String;
|
||||||
struct _Eina_Magic_String
|
struct _Eina_Magic_String
|
||||||
{
|
{
|
||||||
|
@ -36,6 +45,14 @@ struct _Eina_Magic_String
|
||||||
static int _eina_magic_string_count = 0;
|
static int _eina_magic_string_count = 0;
|
||||||
static Eina_Array *strings = NULL;
|
static Eina_Array *strings = NULL;
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* API *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
eina_magic_string_init()
|
eina_magic_string_init()
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,12 +16,24 @@
|
||||||
* if not, see <http://www.gnu.org/licenses/>.
|
* if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "eina_error.h"
|
#include "eina_error.h"
|
||||||
#include "eina_hash.h"
|
#include "eina_hash.h"
|
||||||
#include "eina_stringshare.h"
|
#include "eina_stringshare.h"
|
||||||
#include "eina_list.h"
|
#include "eina_list.h"
|
||||||
#include "eina_array.h"
|
#include "eina_array.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* API *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
eina_init(void)
|
eina_init(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,18 +16,24 @@
|
||||||
* if not, see <http://www.gnu.org/licenses/>.
|
* 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_mempool.h"
|
||||||
#include "eina_list.h"
|
#include "eina_list.h"
|
||||||
#include "eina_module.h"
|
#include "eina_module.h"
|
||||||
#include "eina_private.h"
|
#include "eina_private.h"
|
||||||
|
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* Local *
|
* Local *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
static Eina_Module_Group *_group;
|
static Eina_Module_Group *_group;
|
||||||
static int _init_count = 0;
|
static int _init_count = 0;
|
||||||
|
|
||||||
EAPI Eina_Error EINA_ERROR_NOT_MEMPOOL_MODULE = 0;
|
|
||||||
|
|
||||||
struct _Eina_Mempool
|
struct _Eina_Mempool
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -68,9 +74,16 @@ _new_from_buffer(const char *module, const char *context, const char *options, v
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* API *
|
* API *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
|
EAPI Eina_Error EINA_ERROR_NOT_MEMPOOL_MODULE = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -225,6 +226,7 @@ _eina_dir_module_cb(const char *name, const char *path, Eina_Dir_List *data)
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* Global *
|
* Global *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* API *
|
* API *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
|
@ -16,6 +16,10 @@
|
||||||
* if not, see <http://www.gnu.org/licenses/>.
|
* if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -27,6 +31,7 @@
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* Local *
|
* Local *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
#define EINA_RBTREE_ITERATOR_PREFIX_MASK 0x1
|
#define EINA_RBTREE_ITERATOR_PREFIX_MASK 0x1
|
||||||
#define EINA_RBTREE_ITERATOR_INFIX_MASK 0x2
|
#define EINA_RBTREE_ITERATOR_INFIX_MASK 0x2
|
||||||
#define EINA_RBTREE_ITERATOR_POSTFIX_MASK 0x4
|
#define EINA_RBTREE_ITERATOR_POSTFIX_MASK 0x4
|
||||||
|
@ -229,9 +234,11 @@ _eina_rbtree_inline_double_rotation(Eina_Rbtree *node, Eina_Rbtree_Direction dir
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* Global *
|
* Global *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* API *
|
* API *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
EAPI Eina_Rbtree *
|
EAPI Eina_Rbtree *
|
||||||
eina_rbtree_inline_insert(Eina_Rbtree *root, Eina_Rbtree *node, Eina_Rbtree_Cmp_Node_Cb cmp)
|
eina_rbtree_inline_insert(Eina_Rbtree *root, Eina_Rbtree *node, Eina_Rbtree_Cmp_Node_Cb cmp)
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,6 +64,10 @@
|
||||||
#include "eina_error.h"
|
#include "eina_error.h"
|
||||||
#include "eina_private.h"
|
#include "eina_private.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Local *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
typedef struct _Eina_Stringshare Eina_Stringshare;
|
typedef struct _Eina_Stringshare Eina_Stringshare;
|
||||||
typedef struct _Eina_Stringshare_Node Eina_Stringshare_Node;
|
typedef struct _Eina_Stringshare_Node Eina_Stringshare_Node;
|
||||||
|
|
||||||
|
@ -81,8 +85,16 @@ struct _Eina_Stringshare_Node
|
||||||
static Eina_Stringshare *share = NULL;
|
static Eina_Stringshare *share = NULL;
|
||||||
static int eina_stringshare_init_count = 0;
|
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
|
* These functions allow you to store one copy of a string, and use it
|
||||||
* throughout your program.
|
* 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
|
* a significant impact as you scale the number of copies up. It improves
|
||||||
* string creation/destruction speed, reduces memory use and decreases
|
* string creation/destruction speed, reduces memory use and decreases
|
||||||
* memory fragmentation, so a win all-around.
|
* memory fragmentation, so a win all-around.
|
||||||
|
*
|
||||||
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -129,7 +143,6 @@ eina_stringshare_init()
|
||||||
* @param str The string to retrieve an instance of.
|
* @param str The string to retrieve an instance of.
|
||||||
* @return A pointer to an instance of the string on success.
|
* @return A pointer to an instance of the string on success.
|
||||||
* @c NULL on failure.
|
* @c NULL on failure.
|
||||||
* @ingroup Eina_Stringshare_Group
|
|
||||||
*/
|
*/
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eina_stringshare_add(const char *str)
|
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.
|
* It will free the string if no other instances are left.
|
||||||
*
|
*
|
||||||
* @param str string The given string.
|
* @param str string The given string.
|
||||||
* @ingroup Eina_Stringshare_Group
|
|
||||||
*/
|
*/
|
||||||
EAPI void
|
EAPI void
|
||||||
eina_stringshare_del(const char *str)
|
eina_stringshare_del(const char *str)
|
||||||
|
@ -243,3 +255,6 @@ eina_stringshare_shutdown()
|
||||||
return eina_stringshare_init_count;
|
return eina_stringshare_init_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
|
@ -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_types.h"
|
||||||
#include "eina_private.h"
|
#include "eina_private.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* API *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
EAPI const unsigned int eina_prime_table[] =
|
EAPI const unsigned int eina_prime_table[] =
|
||||||
{
|
{
|
||||||
17, 31, 61, 127, 257, 509, 1021,
|
17, 31, 61, 127, 257, 509, 1021,
|
||||||
|
|
Loading…
Reference in New Issue