#define fopen __real_fopen
#define fclose __real_fclose
#define fgets __real_fgets
#define lseek __real_lseek
#define close __real_close
#define ZBX_MOCK_MAX_FILES 16
void *mock_streams[ZBX_MOCK_MAX_FILES];
static zbx_mock_handle_t fragments;
static FILE *(*fopen_mock_callback)(const char *, const char *) = NULL;
FILE *__wrap_fopen(const char *path, const char *mode);
int __wrap_fclose(FILE *fp);
char *__wrap_fgets(char *s, int size, FILE *stream);
int __wrap_fstat(int __fildes, struct stat *__stat_buf);
int __wrap_connect(int socket, void *addr, socklen_t address_len);
int __wrap_poll(struct pollfd *pds, int nfds, int timeout);
off_t __wrap_lseek(int fd, off_t offset, int whence);
int __wrap_close(int fd);
ssize_t __wrap_read(int fildes, void *buf, size_t nbyte);
int __wrap_open(const char *path, int oflag, ...);
int __wrap_stat(const char *path, struct stat *buf);
int __wrap___xstat(int ver, const char *pathname, struct stat *buf);
int __wrap___fxstat(int __ver, int __fildes, struct stat *__stat_buf);
int __real_open(const char *path, int oflag, ...);
int __real_stat(const char *path, struct stat *buf);
int __real_fstat(int __fildes, struct stat *__stat_buf);
int __real___fxstat(int __ver, int __fildes, struct stat *__stat_buf);
static int is_profiler_path(const char *path)
if ((ZBX_CONST_STRLEN(".gcda") < len && 0 == strcmp(path + len - ZBX_CONST_STRLEN(".gcda"), ".gcda")) ||
(ZBX_CONST_STRLEN(".gcno") < len &&
0 == strcmp(path + len - ZBX_CONST_STRLEN(".gcno"), ".gcno")))
static int is_mock_stream(FILE *stream)
for (i = 0; i < ZBX_MOCK_MAX_FILES && NULL != mock_streams[i]; i++)