MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / get_library_dep_trees

Function get_library_dep_trees

src/analysis/header.rs:325–349  ·  view source on GitHub ↗
(deopt: &Deopt)

Source from the content-addressed store, hash-verified

323}
324
325fn get_library_dep_trees(deopt: &Deopt) -> &'static Vec<TreeNode> {
326 static TREES: OnceCell<Vec<TreeNode>> = OnceCell::new();
327 TREES.get_or_init(|| {
328 let executor = Executor::new(deopt).unwrap();
329 let header_dir = deopt.get_library_build_header_path().unwrap();
330 let headers = crate::deopt::utils::read_all_files_in_dir(&header_dir).unwrap();
331 let mut header_trees = Vec::new();
332 for header in headers {
333 let ext = header.extension();
334 if ext.is_none() {
335 continue;
336 }
337 let ext = ext.unwrap().to_string_lossy().to_string();
338 if ext != "h" && ext != "hpp" && ext != "hxx" {
339 continue;
340 }
341 let tree = executor.extract_header_dependency(&header).unwrap();
342 if tree.is_invalid() {
343 continue;
344 }
345 header_trees.push(tree);
346 }
347 header_trees
348 })
349}
350
351pub fn get_include_lib_headers(deopt: &Deopt) -> Result<Vec<String>> {
352 let header_trees = get_library_dep_trees(deopt);

Callers 2

get_include_lib_headersFunction · 0.85
get_include_sys_headersFunction · 0.85

Calls 6

read_all_files_in_dirFunction · 0.85
is_noneMethod · 0.80
is_invalidMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected