2008-07-30 05:46:55 -07:00
|
|
|
#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>
|
2008-07-30 06:35:49 -07:00
|
|
|
#include <string.h>
|
2008-07-30 05:46:55 -07:00
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#ifndef PATH_MAX
|
|
|
|
# define PATH_MAX 4096
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MIN
|
|
|
|
# define MIN(x, y) (((x) > (y)) ? (y) : (x))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MAX
|
|
|
|
# define MAX(x, y) (((x) > (y)) ? (x) : (y))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ABS
|
|
|
|
# define ABS(x) ((x) < 0 ? -(x) : (x))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CLAMP
|
|
|
|
# define CLAMP(x, min, max) (((x) > (max)) ? (max) : (((x) < (min)) ? (min) : (x)))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define READBUFSIZ 65536
|
|
|
|
|
|
|
|
/* undef the following, we want out version */
|
|
|
|
#undef FREE
|
|
|
|
#define FREE(ptr) free(ptr); ptr = NULL;
|
|
|
|
|
|
|
|
#undef IF_FREE
|
|
|
|
#define IF_FREE(ptr) if (ptr) free(ptr); ptr = NULL;
|
|
|
|
|
|
|
|
#undef IF_FN_DEL
|
|
|
|
#define IF_FN_DEL(_fn, ptr) if (ptr) { _fn(ptr); ptr = NULL; }
|
|
|
|
|
|
|
|
inline void eina_print_warning(const char *function, const char *sparam);
|
|
|
|
|
|
|
|
/* convenience macros for checking pointer parameters for non-NULL */
|
|
|
|
#undef CHECK_PARAM_POINTER_RETURN
|
|
|
|
#define CHECK_PARAM_POINTER_RETURN(sparam, param, ret) \
|
|
|
|
if (!(param)) \
|
|
|
|
{ \
|
|
|
|
eina_print_warning(__FUNCTION__, sparam); \
|
|
|
|
return ret; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef CHECK_PARAM_POINTER
|
|
|
|
#define CHECK_PARAM_POINTER(sparam, param) \
|
|
|
|
if (!(param)) \
|
|
|
|
{ \
|
|
|
|
eina_print_warning(__FUNCTION__, sparam); \
|
|
|
|
return; \
|
|
|
|
}
|
|
|
|
|
|
|
|
void _eina_fps_debug_init(void);
|
|
|
|
void _eina_fps_debug_shutdown(void);
|
|
|
|
void _eina_fps_debug_runtime_add(double t);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int _eina_fps_debug;
|
|
|
|
/* old code finish */
|
2008-08-06 08:41:47 -07:00
|
|
|
|
|
|
|
/* Memory Pool */
|
2008-07-30 05:46:55 -07:00
|
|
|
typedef struct _Eina_Mempool_Backend
|
|
|
|
{
|
2008-07-31 08:08:47 -07:00
|
|
|
void *(*init)(const char *context, const char *options, va_list args);
|
|
|
|
void (*free)(void *data, void *element);
|
|
|
|
void *(*alloc)(void *data, unsigned int size);
|
|
|
|
void *(*realloc)(void *data, void *element, unsigned int size);
|
2008-08-01 05:29:15 -07:00
|
|
|
void (*garbage_collect)(void *data);
|
|
|
|
void (*statistics)(void *data);
|
2008-07-31 08:08:47 -07:00
|
|
|
void (*shutdown)(void *data);
|
2008-07-30 05:46:55 -07:00
|
|
|
} Eina_Mempool_Backend;
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* EINA_PRIVATE_H_ */
|