-
-
Notifications
You must be signed in to change notification settings - Fork 112
/
compat.c
37 lines (31 loc) · 796 Bytes
/
compat.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <yara.h>
/*
Wrappers functions whose sole purpose is converting uintptr as
returned by (*os.File).Fd() to HANDLE on Windows systems
*/
#ifdef _WIN32
int _yr_compiler_add_fd(
YR_COMPILER* compiler,
int rules_fd,
const char* namespace_,
const char* file_name)
{
return yr_compiler_add_fd(compiler, (YR_FILE_DESCRIPTOR)(intptr_t)rules_fd, namespace_, file_name);
}
int _yr_rules_scan_fd(
YR_RULES* rules,
int fd,
int flags,
YR_CALLBACK_FUNC callback,
void* user_data,
int timeout)
{
return yr_rules_scan_fd(rules, (YR_FILE_DESCRIPTOR)(intptr_t)fd, flags, callback, user_data, timeout);
}
int _yr_scanner_scan_fd(
YR_SCANNER* scanner,
int fd)
{
return yr_scanner_scan_fd(scanner, (YR_FILE_DESCRIPTOR)(intptr_t)fd);
}
#endif