Use only the needed headers per file and remove some warning.

SVN revision: 35253
This commit is contained in:
Cedric BAIL 2008-07-30 13:35:49 +00:00
parent f4bfef330c
commit 86f58ba639
17 changed files with 41 additions and 30 deletions

View File

@ -1,6 +1,8 @@
#ifndef EINA_ERROR_H_ #ifndef EINA_ERROR_H_
#define EINA_ERROR_H_ #define EINA_ERROR_H_
#include "eina_types.h"
#define EINA_ERROR_PERR(fmt, ...) \ #define EINA_ERROR_PERR(fmt, ...) \
eina_error_print(EINA_ERROR_LEVEL_ERR, __FILE__, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__) eina_error_print(EINA_ERROR_LEVEL_ERR, __FILE__, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)

View File

@ -1,6 +1,8 @@
#ifndef EINA_FILE_H_ #ifndef EINA_FILE_H_
#define EINA_FILE_H_ #define EINA_FILE_H_
#include "eina_types.h"
/** /**
* @defgroup File_Group Memory File * @defgroup File_Group Memory File
* @{ * @{

View File

@ -1,6 +1,8 @@
#ifndef EINA_HASH_H_ #ifndef EINA_HASH_H_
#define EINA_HASH_H_ #define EINA_HASH_H_
#include "eina_types.h"
/** /**
* *
*/ */

View File

@ -1,6 +1,8 @@
#ifndef EINA_INLIST_H_ #ifndef EINA_INLIST_H_
#define EINA_INLIST_H_ #define EINA_INLIST_H_
#include "eina_types.h"
/** /**
* @defgroup Inline_List_Group Inline List * @defgroup Inline_List_Group Inline List
* @{ * @{

View File

@ -1,6 +1,8 @@
#ifndef EINA_LALLOC_H_ #ifndef EINA_LALLOC_H_
#define EINA_LALLOC_H_ #define EINA_LALLOC_H_
#include "eina_types.h"
/** /**
* @defgroup Array_Group Array * @defgroup Array_Group Array
* @{ * @{

View File

@ -1,6 +1,8 @@
#ifndef EINA_LIST_H_ #ifndef EINA_LIST_H_
#define EINA_LIST_H_ #define EINA_LIST_H_
#include "eina_types.h"
/** /**
* @defgroup List_Group List * @defgroup List_Group List
* @{ * @{

View File

@ -1,6 +1,8 @@
#ifndef EINA_MEMPOOL_H_ #ifndef EINA_MEMPOOL_H_
#define EINA_MEMPOOL_H_ #define EINA_MEMPOOL_H_
#include "eina_types.h"
/** /**
* @defgroup Memory_Pool_Group Memory Pool * @defgroup Memory_Pool_Group Memory Pool
* @{ * @{

View File

@ -1,6 +1,9 @@
#ifndef EINA_MODULE_H_ #ifndef EINA_MODULE_H_
#define EINA_MODULE_H_ #define EINA_MODULE_H_
#include "eina_types.h"
#include "eina_list.h"
/** /**
* @defgroup Module_Group Module * @defgroup Module_Group Module
* @{ * @{

View File

@ -8,7 +8,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <string.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#include <stddef.h> #include <stddef.h>
@ -18,7 +17,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <limits.h> #include <limits.h>
#include <dirent.h> #include <dirent.h>
#include <string.h>
#define DEBUG #define DEBUG
#include <assert.h> #include <assert.h>

View File

@ -1,4 +1,5 @@
#include "Eina.h" #include "eina_error.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
@ -24,9 +25,9 @@ static int _err;
#ifdef DEBUG #ifdef DEBUG
static _error_level = EINA_ERROR_LEVEL_DBG; static Eina_Error_Level _error_level = EINA_ERROR_LEVEL_DBG;
#else #else
static _error_level = EINA_ERROR_LEVEL_ERR; static Eina_Error_Level _error_level = EINA_ERROR_LEVEL_ERR;
#endif #endif
static char *_colors[EINA_ERROR_LEVELS] = { static char *_colors[EINA_ERROR_LEVELS] = {
@ -67,7 +68,7 @@ EAPI int eina_error_init(void)
char *level; char *level;
/* TODO register the eina's basic errors */ /* TODO register the eina's basic errors */
/* TODO load the environment variable for getting the log level */ /* TODO load the environment variable for getting the log level */
if (level = getenv("EINA_ERROR_LEVEL")) if ((level = getenv("EINA_ERROR_LEVEL")))
{ {
_error_level = atoi(level); _error_level = atoi(level);
} }
@ -119,7 +120,7 @@ EAPI int eina_error_get(void)
/** /**
* *
*/ */
EAPI int eina_error_set(int err) EAPI void eina_error_set(int err)
{ {
_err = err; _err = err;
} }

View File

@ -1,4 +1,7 @@
#include "Eina.h" #define _GNU_SOURCE
#include <string.h>
#include "eina_file.h"
#include "eina_private.h" #include "eina_private.h"
/*============================================================================* /*============================================================================*
* API * * API *
@ -18,10 +21,8 @@ EAPI void eina_file_dir_list(const char *dir, int recursive, Eina_File_Dir_List_
if (!d) if (!d)
return; return;
while (de = readdir(d)) while ((de = readdir(d)))
{ {
int length;
if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, "..")) if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, ".."))
continue; continue;
@ -64,7 +65,7 @@ EAPI void eina_file_path_nth_get(const char *path, int n, char **left, char **ri
inc = -1; inc = -1;
end = (char *)path; end = (char *)path;
} }
for (tmp = p; tmp != end, num != n; tmp += inc) for (tmp = p, delim = p; tmp != end && num != n; tmp += inc)
{ {
if (*tmp == '/') if (*tmp == '/')
{ {

View File

@ -1,4 +1,6 @@
#include "Eina.h" #include "eina_hash.h"
#include "eina_inlist.h"
#include "eina_error.h"
#include "eina_private.h" #include "eina_private.h"
/*============================================================================* /*============================================================================*
* Local * * Local *
@ -94,12 +96,6 @@ eina_hash_add(Eina_Hash *hash, const char *key, const void *data)
el->data = (void *)data; el->data = (void *)data;
hash_num = _eina_hash_gen(key); hash_num = _eina_hash_gen(key);
hash->buckets[hash_num] = eina_inlist_prepend(hash->buckets[hash_num], el); hash->buckets[hash_num] = eina_inlist_prepend(hash->buckets[hash_num], el);
if (eina_list_alloc_error())
{
_eina_hash_alloc_error = 1;
free(el);
return hash;
}
hash->population++; hash->population++;
return hash; return hash;
} }
@ -157,12 +153,6 @@ eina_hash_direct_add(Eina_Hash *hash, const char *key, const void *data)
el->data = (void *)data; el->data = (void *)data;
hash_num = _eina_hash_gen(key); hash_num = _eina_hash_gen(key);
hash->buckets[hash_num] = eina_inlist_prepend(hash->buckets[hash_num], el); hash->buckets[hash_num] = eina_inlist_prepend(hash->buckets[hash_num], el);
if (eina_list_alloc_error())
{
_eina_hash_alloc_error = 1;
free(el);
return hash;
}
hash->population++; hash->population++;
return hash; return hash;
} }

View File

@ -1,4 +1,4 @@
#include "Eina.h" #include "eina_inlist.h"
#include "eina_private.h" #include "eina_private.h"
/* TODO please, refactor this :) */ /* TODO please, refactor this :) */

View File

@ -1,4 +1,4 @@
#include "Eina.h" #include "eina_lalloc.h"
#include "eina_private.h" #include "eina_private.h"
struct _Eina_Array struct _Eina_Array

View File

@ -1,4 +1,4 @@
#include "Eina.h" #include "eina_list.h"
#include "eina_private.h" #include "eina_private.h"
struct _Eina_List /** A linked list node */ struct _Eina_List /** A linked list node */

View File

@ -1,4 +1,6 @@
#include "Eina.h" #include "eina_mempool.h"
#include "eina_list.h"
#include "eina_module.h"
#include "eina_private.h" #include "eina_private.h"
/*============================================================================* /*============================================================================*
* Local * * Local *

View File

@ -1,4 +1,5 @@
#include "Eina.h" #include "eina_module.h"
#include "eina_file.h"
#include "eina_private.h" #include "eina_private.h"
#include <dirent.h> #include <dirent.h>