2019-05-19 16:55:31 -05:00
|
|
|
// 19 may 2019
|
|
|
|
|
2019-06-01 19:20:11 -05:00
|
|
|
#include "../../sharedbits/printfwarn_header.h"
|
|
|
|
|
|
|
|
sharedbitsPrintfFunc(
|
|
|
|
extern void testingprivInternalError(const char *fmt, ...),
|
|
|
|
1, 2);
|
2019-05-19 16:55:31 -05:00
|
|
|
|
2019-05-30 22:11:08 -05:00
|
|
|
#define sharedbitsPrefix testingpriv
|
|
|
|
|
|
|
|
#include "../../sharedbits/alloc_header.h"
|
2019-05-19 16:55:31 -05:00
|
|
|
#define testingprivNew(T) ((T *) testingprivAlloc(sizeof (T), #T))
|
|
|
|
#define testingprivNewArray(T, n) ((T *) testingprivAlloc(n * sizeof (T), #T "[]"))
|
|
|
|
#define testingprivResizeArray(x, T, old, new) ((T *) testingprivRealloc(x, old * sizeof (T), new * sizeof (T), #T "[]"))
|
|
|
|
|
2019-05-30 22:47:07 -05:00
|
|
|
#include "../../sharedbits/array_header.h"
|
|
|
|
#define testingprivArrayStaticInit(T, nGrow, what) { NULL, 0, 0, sizeof (T), nGrow, what }
|
|
|
|
#define testingprivArrayInit(arr, T, nGrow, what) testingprivArrayInitFull(&(arr), sizeof (T), nGrow, what)
|
|
|
|
#define testingprivArrayFree(arr) testingprivArrayFreeFull(&(arr))
|
2019-05-19 16:55:31 -05:00
|
|
|
#define testingprivArrayAt(arr, T, n) (((T *) (arr.buf)) + (n))
|
|
|
|
|
2019-06-08 17:39:59 -05:00
|
|
|
#include "../../sharedbits/strdup_header.h"
|
|
|
|
|
2019-05-30 22:11:08 -05:00
|
|
|
#undef sharedbitsPrefix
|
|
|
|
|
2019-06-01 10:40:16 -05:00
|
|
|
extern int testingprivVsnprintf(char *s, size_t n, const char *fmt, va_list ap);
|
2019-06-01 19:20:11 -05:00
|
|
|
sharedbitsPrintfFunc(
|
|
|
|
extern int testingprivSnprintf(char *s, size_t n, const char *fmt, ...),
|
|
|
|
3, 4);
|
2019-05-19 22:15:35 -05:00
|
|
|
extern char *testingprivVsmprintf(const char *fmt, va_list ap);
|
2019-06-01 19:20:11 -05:00
|
|
|
sharedbitsPrintfFunc(
|
|
|
|
extern char *testingprivSmprintf(const char *fmt, ...),
|
|
|
|
1, 2);
|
2019-05-19 22:15:35 -05:00
|
|
|
|
|
|
|
// a testingprivOutbuf of NULL writes directly to stdout
|
|
|
|
typedef struct testingprivOutbuf testingprivOutbuf;
|
|
|
|
extern testingprivOutbuf *testingprivNewOutbuf(void);
|
|
|
|
extern void testingprivOutbufFree(testingprivOutbuf *o);
|
|
|
|
extern void testingprivOutbufVprintf(testingprivOutbuf *o, const char *fmt, va_list ap);
|
2019-05-28 23:35:51 -05:00
|
|
|
extern void testingprivOutbufVprintfIndented(testingprivOutbuf *o, const char *fmt, va_list ap);
|
2019-06-01 19:20:11 -05:00
|
|
|
sharedbitsPrintfFunc(
|
|
|
|
extern void testingprivOutbufPrintf(testingprivOutbuf *o, const char *fmt, ...),
|
|
|
|
2, 3);
|
2019-05-20 09:57:31 -05:00
|
|
|
extern void testingprivOutbufAppendOutbuf(testingprivOutbuf *o, testingprivOutbuf *src);
|
2019-05-20 21:03:56 -05:00
|
|
|
extern const char *testingprivOutbufString(testingprivOutbuf *o);
|
2019-06-01 19:20:11 -05:00
|
|
|
|
|
|
|
#undef sharedbitsPrintfFunc
|