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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
pub mod errors;
pub use crate::errors::*;
use std::os::raw::c_char;
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum MetaType {
Null,
Integer,
String,
Boolean,
}
impl MetaType {
pub fn from_code(code: i32) -> Result<Self, i32> {
use self::MetaType::*;
match code as u32 {
META_TYPE_NULL => Ok(Null),
META_TYPE_INTEGER => Ok(Integer),
META_TYPE_STRING => Ok(String),
META_TYPE_BOOLEAN => Ok(Boolean),
_ => Err(code),
}
}
}
impl YR_MATCHES {
pub fn get_head(&self) -> *const YR_MATCH {
unsafe { self.__bindgen_anon_1.head }
}
pub fn get_tail(&self) -> *const YR_MATCH {
unsafe { self.__bindgen_anon_2.tail }
}
}
impl YR_META {
pub fn get_identifier(&self) -> *const c_char {
unsafe { self.__bindgen_anon_1.identifier }
}
pub fn get_string(&self) -> *const c_char {
unsafe { self.__bindgen_anon_2.string }
}
}
impl YR_NAMESPACE {
pub fn get_name(&self) -> *const c_char {
unsafe { self.__bindgen_anon_1.name }
}
}
impl YR_RULE {
pub fn get_identifier(&self) -> *const c_char {
unsafe { self.__bindgen_anon_1.identifier }
}
pub fn get_tags(&self) -> *const c_char {
unsafe { self.__bindgen_anon_2.tags }
}
pub fn get_metas(&self) -> *const YR_META {
unsafe { self.__bindgen_anon_3.metas }
}
pub fn get_strings(&self) -> *const YR_STRING {
unsafe { self.__bindgen_anon_4.strings }
}
pub fn get_ns(&self) -> *const YR_NAMESPACE {
unsafe { self.__bindgen_anon_5.ns }
}
}
impl YR_STRING {
pub fn get_identifier(&self) -> *const c_char {
unsafe { self.__bindgen_anon_1.identifier }
}
pub fn get_string(&self) -> *const c_char {
unsafe { self.__bindgen_anon_2.string as _ }
}
}