* move standard header files from eina_private.h to source files

* minor formatting


SVN revision: 35705
This commit is contained in:
Vincent Torri 2008-08-28 07:46:42 +00:00
parent 29313e097f
commit dafd079639
22 changed files with 219 additions and 44 deletions

View 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

View File

@ -57,8 +57,6 @@
* @todo add other todo items :)
*/
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -19,26 +19,6 @@
#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"

View 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_ */

View File

@ -23,9 +23,19 @@
# 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)
{

View 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)
{

View File

@ -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
*/

View File

@ -16,15 +16,23 @@
* 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 *
*============================================================================*/

View File

@ -20,20 +20,26 @@
# 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;
}

View File

@ -16,15 +16,42 @@
* 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 *
*============================================================================*/

View 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 *
*============================================================================*/

View File

@ -16,6 +16,13 @@
* 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

View File

@ -23,9 +23,19 @@
# 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)
{

View File

@ -16,9 +16,19 @@
* 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

View File

@ -274,6 +274,7 @@ eina_list_accessor_free(Eina_Accessor_List *it)
/*============================================================================*
* Global *
*============================================================================*/
/*============================================================================*
* API *
*============================================================================*/

View File

@ -16,16 +16,25 @@
* 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()
{

View File

@ -16,12 +16,24 @@
* 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)
{

View File

@ -16,18 +16,24 @@
* 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
@ -68,9 +74,16 @@ _new_from_buffer(const char *module, const char *context, const char *options, v
return NULL;
}
/*============================================================================*
* Global *
*============================================================================*/
/*============================================================================*
* API *
*============================================================================*/
EAPI Eina_Error EINA_ERROR_NOT_MEMPOOL_MODULE = 0;
/**
*
*/

View 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 *
*============================================================================*/

View File

@ -16,6 +16,10 @@
* 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)
{

View File

@ -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;
}
/**
* @}
*/

View 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,