aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs17
-rw-r--r--src/parse.rs6
2 files changed, 11 insertions, 12 deletions
diff --git a/src/main.rs b/src/main.rs
index ebc9d71..732805c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,9 +1,9 @@
use std::env::{current_dir, set_current_dir};
-use std::fs::{create_dir_all, metadata};
+use std::fs::{create_dir_all, metadata, read_to_string};
use std::path::Path;
use std::process::Command;
-use clang::{Clang, Index};
+mod parse;
const TARGET_TAG: &str = "v3.1.5";
@@ -24,8 +24,6 @@ fn main() {
"--quiet",
"https://github.com/wxWidgets/wxWidgets.git",
"orig",
- "--depth",
- "1",
])
.status()
.unwrap();
@@ -66,12 +64,7 @@ fn main() {
assert!(cargo_new.success());
}
- let clang = Clang::new().unwrap();
- let index = Index::new(&clang, true, true);
-
- let mut root_header_parser = index.parser("orig/include/wx/wx.h");
- root_header_parser.keep_going(true);
- root_header_parser.arguments(&["-Iorig/include", "-D"]);
- let root_header = root_header_parser.parse().unwrap();
- println!("{}", root_header.get_entity().get_pretty_printer().print());
+ let wx_h_text = read_to_string("orig/include/wx/wx.h").unwrap();
+ let lib_root_h = parse::parse(&wx_h_text);
+ dbg!(lib_root_h);
}
diff --git a/src/parse.rs b/src/parse.rs
new file mode 100644
index 0000000..e528f01
--- /dev/null
+++ b/src/parse.rs
@@ -0,0 +1,6 @@
+#[derive(Debug)]
+pub struct FileItem;
+
+pub fn parse(file: &str) -> Vec<FileItem> {
+ todo!()
+}