2008-08-06 11:15:24 -07:00
|
|
|
/* EINA - EFL data type library
|
|
|
|
* Copyright (C) 2008 Carsten Haitzler, Vincent Torri, Jorge Luis Zapata Muga
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library;
|
|
|
|
* if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-07-30 05:46:55 -07:00
|
|
|
#ifndef EINA_PRIVATE_H_
|
|
|
|
#define EINA_PRIVATE_H_
|
|
|
|
|
2008-09-07 12:12:49 -07:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
2017-10-22 12:21:12 -07:00
|
|
|
#ifdef _WIN32
|
|
|
|
# include <Evil.h>
|
|
|
|
#endif
|
|
|
|
|
2008-09-25 02:02:41 -07:00
|
|
|
#include "eina_magic.h"
|
2008-08-11 09:30:16 -07:00
|
|
|
#include "eina_iterator.h"
|
|
|
|
#include "eina_accessor.h"
|
2017-10-17 16:14:26 -07:00
|
|
|
#include "eina_stringshare.h"
|
2008-08-11 09:30:16 -07:00
|
|
|
|
2008-07-30 05:46:55 -07:00
|
|
|
#ifndef ABS
|
|
|
|
# define ABS(x) ((x) < 0 ? -(x) : (x))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CLAMP
|
2010-07-27 19:37:05 -07:00
|
|
|
# define CLAMP(x, min, \
|
|
|
|
max) (((x) > (max)) ? (max) : (((x) < (min)) ? (min) : (x)))
|
2008-07-30 05:46:55 -07:00
|
|
|
#endif
|
|
|
|
|
2011-09-05 13:15:12 -07:00
|
|
|
#define EINA_INLIST_JUMP_SIZE 256
|
|
|
|
|
2008-07-30 05:46:55 -07:00
|
|
|
#define READBUFSIZ 65536
|
|
|
|
|
2009-09-02 16:06:55 -07:00
|
|
|
#define EINA_LOG_COLOR_DEFAULT "\033[36m"
|
|
|
|
|
2008-09-25 02:02:41 -07:00
|
|
|
/* eina magic types */
|
2010-07-27 01:55:23 -07:00
|
|
|
#define EINA_MAGIC_SHARE 0x98761234
|
|
|
|
#define EINA_MAGIC_SHARE_HEAD 0x98761235
|
|
|
|
#define EINA_MAGIC_STRINGSHARE_NODE 0x98761254
|
|
|
|
#define EINA_MAGIC_USTRINGSHARE_NODE 0x98761255
|
|
|
|
#define EINA_MAGIC_BINSHARE_NODE 0x98761256
|
2008-09-25 07:46:48 -07:00
|
|
|
|
2010-07-27 19:37:05 -07:00
|
|
|
#define EINA_MAGIC_LIST 0x98761237
|
2008-09-25 07:46:48 -07:00
|
|
|
#define EINA_MAGIC_LIST_ITERATOR 0x98761238
|
|
|
|
#define EINA_MAGIC_LIST_ACCESSOR 0x98761239
|
|
|
|
#define EINA_MAGIC_LIST_ACCOUNTING 0x9876123a
|
|
|
|
|
|
|
|
#define EINA_MAGIC_ARRAY 0x9876123b
|
|
|
|
#define EINA_MAGIC_ARRAY_ITERATOR 0x9876123c
|
|
|
|
#define EINA_MAGIC_ARRAY_ACCESSOR 0x9876123d
|
2008-09-25 02:02:41 -07:00
|
|
|
|
2008-12-07 05:28:29 -08:00
|
|
|
#define EINA_MAGIC_HASH 0x9876123e
|
|
|
|
#define EINA_MAGIC_HASH_ITERATOR 0x9876123f
|
|
|
|
|
2009-01-26 08:27:00 -08:00
|
|
|
#define EINA_MAGIC_TILER 0x98761240
|
|
|
|
#define EINA_MAGIC_TILER_ITERATOR 0x98761241
|
|
|
|
|
2009-09-04 06:43:44 -07:00
|
|
|
#define EINA_MAGIC_MATRIXSPARSE 0x98761242
|
|
|
|
#define EINA_MAGIC_MATRIXSPARSE_ROW 0x98761243
|
|
|
|
#define EINA_MAGIC_MATRIXSPARSE_CELL 0x98761244
|
|
|
|
#define EINA_MAGIC_MATRIXSPARSE_ITERATOR 0x98761245
|
|
|
|
#define EINA_MAGIC_MATRIXSPARSE_ROW_ITERATOR 0x98761246
|
|
|
|
#define EINA_MAGIC_MATRIXSPARSE_ROW_ACCESSOR 0x98761247
|
|
|
|
#define EINA_MAGIC_MATRIXSPARSE_CELL_ITERATOR 0x98761248
|
|
|
|
#define EINA_MAGIC_MATRIXSPARSE_CELL_ACCESSOR 0x98761249
|
|
|
|
|
2010-01-27 12:48:27 -08:00
|
|
|
#define EINA_MAGIC_STRBUF 0x98761250
|
2010-07-27 01:55:23 -07:00
|
|
|
#define EINA_MAGIC_USTRBUF 0x98761257
|
2011-05-18 04:45:32 -07:00
|
|
|
#define EINA_MAGIC_BINBUF 0x98761258
|
2009-09-04 06:43:44 -07:00
|
|
|
|
2010-04-29 10:21:14 -07:00
|
|
|
#define EINA_MAGIC_QUADTREE 0x98761251
|
|
|
|
#define EINA_MAGIC_QUADTREE_ROOT 0x98761252
|
|
|
|
#define EINA_MAGIC_QUADTREE_ITEM 0x98761253
|
2009-09-04 06:43:44 -07:00
|
|
|
|
2011-04-06 03:14:03 -07:00
|
|
|
#define EINA_MAGIC_SIMPLE_XML_TAG 0x98761260
|
|
|
|
#define EINA_MAGIC_SIMPLE_XML_DATA 0x98761261
|
|
|
|
#define EINA_MAGIC_SIMPLE_XML_ATTRIBUTE 0x98761262
|
|
|
|
|
2012-01-09 15:24:18 -08:00
|
|
|
#define EINA_MAGIC_INARRAY 0x98761270
|
|
|
|
#define EINA_MAGIC_INARRAY_ITERATOR 0x98761271
|
|
|
|
#define EINA_MAGIC_INARRAY_ACCESSOR 0x98761272
|
|
|
|
|
2012-01-20 17:30:09 -08:00
|
|
|
#define EINA_MAGIC_MODEL 0x98761280
|
|
|
|
|
2011-04-11 07:07:42 -07:00
|
|
|
#define EINA_MAGIC_CLASS 0x9877CB30
|
|
|
|
|
2008-07-30 05:46:55 -07:00
|
|
|
/* undef the following, we want out version */
|
|
|
|
#undef FREE
|
2010-08-16 08:02:37 -07:00
|
|
|
#define FREE(ptr) \
|
|
|
|
do { \
|
|
|
|
free(ptr); \
|
|
|
|
ptr = NULL; \
|
|
|
|
} while(0);
|
2008-07-30 05:46:55 -07:00
|
|
|
|
|
|
|
#undef IF_FREE
|
2010-08-16 08:02:37 -07:00
|
|
|
#define IF_FREE(ptr) \
|
|
|
|
do { \
|
|
|
|
if (ptr) { \
|
|
|
|
free(ptr); \
|
|
|
|
ptr = NULL; \
|
|
|
|
} \
|
|
|
|
} while(0);
|
2008-07-30 05:46:55 -07:00
|
|
|
|
|
|
|
#undef IF_FN_DEL
|
2010-08-16 08:02:37 -07:00
|
|
|
#define IF_FN_DEL(_fn, ptr) \
|
|
|
|
do { \
|
|
|
|
if (ptr) { \
|
|
|
|
_fn(ptr); \
|
|
|
|
ptr = NULL; \
|
|
|
|
} \
|
|
|
|
} while(0);
|
|
|
|
|
|
|
|
#define MAGIC_FREE(ptr) \
|
|
|
|
do { \
|
|
|
|
if (ptr) { \
|
|
|
|
EINA_MAGIC_SET(ptr, EINA_MAGIC_NONE); \
|
|
|
|
FREE(ptr); \
|
|
|
|
} \
|
|
|
|
} while(0);
|
2008-07-30 05:46:55 -07:00
|
|
|
|
2010-07-13 06:51:00 -07:00
|
|
|
#ifdef EFL_HAVE_THREADS
|
2010-10-12 09:53:30 -07:00
|
|
|
extern Eina_Bool _threads_activated;
|
|
|
|
|
2010-07-27 01:55:23 -07:00
|
|
|
void eina_share_common_threads_init(void);
|
|
|
|
void eina_share_common_threads_shutdown(void);
|
2009-11-01 11:50:18 -08:00
|
|
|
void eina_log_threads_init(void);
|
|
|
|
void eina_log_threads_shutdown(void);
|
|
|
|
#endif
|
|
|
|
|
2012-04-19 02:25:54 -07:00
|
|
|
void eina_cpu_count_internal(void);
|
|
|
|
|
2017-08-29 20:03:41 -07:00
|
|
|
Eina_Bool eina_file_mmap_faulty(void *addr, long page_size);
|
2012-01-03 06:59:07 -08:00
|
|
|
|
2017-01-16 21:07:45 -08:00
|
|
|
#ifndef EINA_FREEQ_H_
|
|
|
|
typedef struct _Eina_FreeQ Eina_FreeQ;
|
|
|
|
#endif
|
|
|
|
|
2017-10-17 16:14:26 -07:00
|
|
|
Eina_Stringshare *eina_file_sanitize(const char *path);
|
|
|
|
|
2017-01-16 21:07:45 -08:00
|
|
|
void eina_freeq_main_set(Eina_FreeQ *fq);
|
|
|
|
|
2013-03-27 05:39:55 -07:00
|
|
|
#include "eina_inline_private.h"
|
|
|
|
|
2008-07-30 05:46:55 -07:00
|
|
|
#endif /* EINA_PRIVATE_H_ */
|
2008-08-11 10:22:36 -07:00
|
|
|
|