Skip to content

Commit

Permalink
added underscore to _z_null and _z_check
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Aug 19, 2024
1 parent 98500d8 commit adf74a0
Show file tree
Hide file tree
Showing 32 changed files with 718 additions and 718 deletions.
16 changes: 8 additions & 8 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1244,15 +1244,15 @@ pub fn find_drop_functions(path_in: &str) -> Vec<FunctionSignature> {

pub fn find_null_functions(path_in: &str) -> Vec<FunctionSignature> {
let bindings = std::fs::read_to_string(path_in).unwrap();
let re = Regex::new(r"(\w+)_null\(struct (\w+) \*(\w+)\);").unwrap();
let re = Regex::new(r" (_\w+_null)\(struct (\w+) \*(\w+)\);").unwrap();
let mut res = Vec::<FunctionSignature>::new();

for (_, [func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) {
let (_, _, semantic, _) = split_type_name(arg_type);
let f = FunctionSignature::new(
semantic,
"void",
func_name.to_string() + "_null",
func_name.to_string(),
vec![FuncArg::new(&(arg_type.to_string() + "*"), arg_name)],
);
res.push(f);
Expand All @@ -1262,15 +1262,15 @@ pub fn find_null_functions(path_in: &str) -> Vec<FunctionSignature> {

pub fn find_check_functions(path_in: &str) -> Vec<FunctionSignature> {
let bindings = std::fs::read_to_string(path_in).unwrap();
let re = Regex::new(r"bool (\w+)_check\(const struct (\w+) \*(\w+)\);").unwrap();
let re = Regex::new(r"bool (_\w+_check)\(const struct (\w+) \*(\w+)\);").unwrap();
let mut res = Vec::<FunctionSignature>::new();

for (_, [func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) {
let (_, _, semantic, _) = split_type_name(arg_type);
let f = FunctionSignature::new(
semantic,
"bool",
func_name.to_string() + "_check",
func_name.to_string(),
vec![FuncArg::new(
&("const ".to_string() + arg_type + "*"),
arg_name,
Expand Down Expand Up @@ -1460,11 +1460,11 @@ pub fn generate_move_functions_cpp(macro_func: &[FunctionSignature]) -> String {
}

pub fn generate_generic_null_c(macro_func: &[FunctionSignature]) -> String {
generate_generic_c(macro_func, "z_null", false)
generate_generic_c(macro_func, "_z_null", false)
}

pub fn generate_generic_check_c(macro_func: &[FunctionSignature]) -> String {
generate_generic_c(macro_func, "z_check", true)
generate_generic_c(macro_func, "_z_check", true)
}

pub fn generate_generic_call_c(macro_func: &[FunctionSignature]) -> String {
Expand Down Expand Up @@ -1589,11 +1589,11 @@ pub fn generate_generic_take_cpp(macro_func: &[FunctionSignature]) -> String {
}

pub fn generate_generic_null_cpp(macro_func: &[FunctionSignature]) -> String {
generate_generic_cpp(macro_func, "z_null", false)
generate_generic_cpp(macro_func, "_z_null", false)
}

pub fn generate_generic_check_cpp(macro_func: &[FunctionSignature]) -> String {
generate_generic_cpp(macro_func, "z_check", true)
generate_generic_cpp(macro_func, "_z_check", true)
}

pub fn generate_generic_call_cpp(macro_func: &[FunctionSignature]) -> String {
Expand Down
Loading

0 comments on commit adf74a0

Please sign in to comment.