[Forensics-changes] [yara] 99/160: Add YR_ prefix to FILE_DESCRIPTOR
Hilko Bengen
bengen at moszumanska.debian.org
Sat Jul 1 10:29:22 UTC 2017
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag v3.4.0
in repository yara.
commit 7b3f5d19ae5b5848ea02a8e49a08dab97027de00
Author: Victor M. Alvarez <plusvic at gmail.com>
Date: Thu Apr 30 13:07:00 2015 +0200
Add YR_ prefix to FILE_DESCRIPTOR
---
libyara/filemap.c | 13 +++++++------
libyara/include/yara/filemap.h | 8 ++++----
libyara/include/yara/rules.h | 3 +--
libyara/rules.c | 2 +-
4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/libyara/filemap.c b/libyara/filemap.c
index 575b935..27220d1 100644
--- a/libyara/filemap.c
+++ b/libyara/filemap.c
@@ -53,12 +53,13 @@ YR_API int yr_filemap_map(
}
//
-// yr_filemap_map_file
+// yr_filemap_map_fd
//
// Maps a portion of a file (specified by descriptor) into memory.
//
// Args:
-// FILE_DESCRIPTOR file - file descriptor representing the file to map
+// YR_FILE_DESCRIPTOR file - File descriptor representing the file to
+// map
// off_t offset - File offset where the mapping will begin.
// This offset must be multiple of 1MB and not
// greater than the actual file size.
@@ -79,7 +80,7 @@ YR_API int yr_filemap_map(
#ifdef _WIN32
YR_API int yr_filemap_map_fd(
- FILE_DESCRIPTOR file,
+ YR_FILE_DESCRIPTOR file,
off_t offset,
size_t size,
YR_MAPPED_FILE* pmapped_file)
@@ -164,7 +165,7 @@ YR_API int yr_filemap_map_fd(
#else // POSIX
YR_API int yr_filemap_map_fd(
- FILE_DESCRIPTOR file,
+ YR_FILE_DESCRIPTOR file,
off_t offset,
size_t size,
YR_MAPPED_FILE* pmapped_file)
@@ -256,7 +257,7 @@ YR_API int yr_filemap_map_ex(
if (file_path == NULL)
return ERROR_INVALID_ARGUMENT;
- FILE_DESCRIPTOR fd = CreateFileA(
+ YR_FILE_DESCRIPTOR fd = CreateFileA(
file_path,
GENERIC_READ,
FILE_SHARE_READ,
@@ -282,7 +283,7 @@ YR_API int yr_filemap_map_ex(
if (file_path == NULL)
return ERROR_INVALID_ARGUMENT;
- FILE_DESCRIPTOR fd = open(file_path, O_RDONLY);
+ YR_FILE_DESCRIPTOR fd = open(file_path, O_RDONLY);
if (fd == -1)
return ERROR_COULD_NOT_OPEN_FILE;
diff --git a/libyara/include/yara/filemap.h b/libyara/include/yara/filemap.h
index d6c44a3..e86c731 100644
--- a/libyara/include/yara/filemap.h
+++ b/libyara/include/yara/filemap.h
@@ -25,9 +25,9 @@ limitations under the License.
#ifdef _WIN32
#include <windows.h>
-#define FILE_DESCRIPTOR HANDLE
+#define YR_FILE_DESCRIPTOR HANDLE
#else
-#define FILE_DESCRIPTOR int
+#define YR_FILE_DESCRIPTOR int
#endif
#include <stdlib.h>
@@ -38,7 +38,7 @@ limitations under the License.
typedef struct _YR_MAPPED_FILE
{
- FILE_DESCRIPTOR file;
+ YR_FILE_DESCRIPTOR file;
size_t size;
uint8_t* data;
#ifdef _WIN32
@@ -54,7 +54,7 @@ YR_API int yr_filemap_map(
YR_API int yr_filemap_map_fd(
- FILE_DESCRIPTOR file,
+ YR_FILE_DESCRIPTOR file,
off_t offset,
size_t size,
YR_MAPPED_FILE* pmapped_file);
diff --git a/libyara/include/yara/rules.h b/libyara/include/yara/rules.h
index 43c9f4b..3d7b221 100644
--- a/libyara/include/yara/rules.h
+++ b/libyara/include/yara/rules.h
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-
#ifndef YR_RULES_H
#define YR_RULES_H
@@ -77,7 +76,7 @@ YR_API int yr_rules_scan_file(
YR_API int yr_rules_scan_fd(
YR_RULES* rules,
- FILE_DESCRIPTOR fd,
+ YR_FILE_DESCRIPTOR fd,
int flags,
YR_CALLBACK_FUNC callback,
void* user_data,
diff --git a/libyara/rules.c b/libyara/rules.c
index 54bada6..1ebec41 100644
--- a/libyara/rules.c
+++ b/libyara/rules.c
@@ -553,7 +553,7 @@ YR_API int yr_rules_scan_file(
YR_API int yr_rules_scan_fd(
YR_RULES* rules,
- FILE_DESCRIPTOR fd,
+ YR_FILE_DESCRIPTOR fd,
int flags,
YR_CALLBACK_FUNC callback,
void* user_data,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git
More information about the forensics-changes
mailing list