2020-04-24 08:36:29 +02:00
|
|
|
#ifndef __XTOOLSCOMMON_H__
|
|
|
|
#define __XTOOLSCOMMON_H__
|
|
|
|
|
2021-04-03 12:55:25 +02:00
|
|
|
#include <posix/posix.h>
|
2020-04-24 08:36:29 +02:00
|
|
|
|
2021-02-10 13:32:07 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <Base.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-04-24 08:36:29 +02:00
|
|
|
|
|
|
|
#define xsize size_t
|
|
|
|
//#define xisize INTN
|
|
|
|
#define MAX_XSIZE SIZE_T_MAX
|
|
|
|
//#define MAX_XISIZE MAX_INTN
|
|
|
|
|
|
|
|
#define XStringGrowByDefault 10
|
|
|
|
#define XArrayGrowByDefault 8
|
2020-08-11 14:43:53 +02:00
|
|
|
#define XBufferGrowByDefault 16
|
2020-04-24 08:36:29 +02:00
|
|
|
|
|
|
|
/* For convience, operator [] is define with int parameter.
|
|
|
|
* Defining __XTOOLS_CHECK_OVERFLOW__ make a check that the parameter is >= 0
|
|
|
|
* TODO : make new XString using __XTOOLS_CHECK_OVERFLOW__
|
|
|
|
*/
|
|
|
|
#define __XTOOLS_CHECK_OVERFLOW__
|
|
|
|
|
2020-09-07 00:19:48 +02:00
|
|
|
#define Xrealloc(ptr, newsize, oldsize) reallocWithOldSize(ptr, newsize, oldsize)
|
2020-04-24 08:36:29 +02:00
|
|
|
|
2021-02-10 13:32:07 +01:00
|
|
|
#define XTOOLS_VA_LIST VA_LIST
|
|
|
|
#define XTOOLS_VA_START VA_START
|
|
|
|
#define XTOOLS_VA_END VA_END
|
2020-04-24 08:36:29 +02:00
|
|
|
|
|
|
|
#endif
|