Skip to content

Commit

Permalink
let bindgen generate RULE_FLAGS_NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
jpohls1 committed Nov 27, 2023
1 parent a5c14b1 commit 3779d84
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/internals/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl<'a> Iterator for RuleIterator<'a> {
let rule = unsafe { *self.head };
let mut result: Option<Self::Item> = None;

if (rule.flags & yara_sys::RULE_FLAGS_NULL) != 0 {
if ((rule.flags as u32) & yara_sys::RULE_FLAGS_NULL) != 0 {
self.head = std::ptr::null();
} else {
let rule_data = Rule::from(unsafe { &*self.head });
Expand Down
1 change: 1 addition & 0 deletions yara-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ mod bindings {
.allowlist_var("META_FLAGS_LAST_IN_RULE")
.allowlist_var("OBJECT_TYPE_.*")
.allowlist_var("STRING_FLAGS_LAST_IN_RULE")
.allowlist_var("RULE_FLAGS_NULL")
.allowlist_var("YARA_ERROR_LEVEL_.*")
.allowlist_var("SCAN_FLAGS_.*")
.allowlist_var("YR_CONFIG_.*")
Expand Down
2 changes: 0 additions & 2 deletions yara-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]

pub const RULE_FLAGS_NULL: i32 = 0x04;

pub mod errors;

pub use crate::errors::*;
Expand Down

0 comments on commit 3779d84

Please sign in to comment.