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

Function format_library_header_strings

src/deopt.rs:665–683  ·  view source on GitHub ↗

format the headers of this library that should include as a single String.

(deopt: &Deopt)

Source from the content-addressed store, hash-verified

663
664 /// format the headers of this library that should include as a single String.
665 pub fn format_library_header_strings(deopt: &Deopt) -> &'static str {
666 static HEADER: OnceCell<String> = OnceCell::new();
667 HEADER.get_or_init(|| {
668 let mut content = String::new();
669 for header in get_standard_headers() {
670 content.push_str(&format!("#include <{header}>\n"));
671 }
672 for header in get_library_headers(deopt).unwrap() {
673 if header.ends_with(".h") {
674 content.push_str("extern \"C\" {\n");
675 content.push_str(&format!("#include <{header}>\n"));
676 content.push_str("}\n");
677 } else {
678 content.push_str(&format!("#include <{header}>\n"));
679 }
680 }
681 content
682 })
683 }
684
685 pub fn get_library_headers(deopt: &Deopt) -> Result<Vec<String>> {
686 get_include_lib_headers(deopt)

Callers 5

save_programMethod · 0.85
save_succ_programMethod · 0.85
save_err_programMethod · 0.85
synthesis_batchMethod · 0.85

Calls 2

get_standard_headersFunction · 0.85
get_library_headersFunction · 0.85

Tested by

no test coverage detected