1 #ifndef __ISDS_TEST_TOOLS_H
2 #define __ISDS_TEST_TOOLS_H
4 #include <stdarg.h> /* va_list */
5 #include <stddef.h> /* size_t, NULL */
7 /* Print formated string into automtically reallocated @uffer.
8 * @buffer automatically reallocated buffer. Must be &NULL or preallocated
10 * @format format string as for printf(3)
11 * @ap list of variadic arguments, after call will be in udefined state
12 * @Returns number of bytes printed. In case of errror, -1 and NULL @buffer*/
13 int test_vasprintf(char **buffer
, const char *format
, va_list ap
);
16 /* Print formated string into automtically reallocated @uffer.
17 * @buffer automatically reallocated buffer. Must be &NULL or preallocated
19 * @format format string as for printf(3)
20 * @... variadic arguments
21 * @Returns number of bytes printed. In case of errror, -1 and NULL @buffer*/
22 int test_asprintf(char **buffer
, const char *format
, ...);
25 /* I/O. Return 0, in case of error -1. */
26 int test_mmap_file(const char *file
, int *fd
, void **buffer
, size_t *length
);
27 int test_munmap_file(int fd
, void *buffer
, size_t length
);