pub struct StdlibPrototypes { /* private fields */ }Expand description
Built-in C Standard Library Prototype Database
Contains all 150+ functions from ISO C99 §7
Implementations§
Source§impl StdlibPrototypes
impl StdlibPrototypes
Sourcepub fn get_prototype(&self, name: &str) -> Option<&FunctionProto>
pub fn get_prototype(&self, name: &str) -> Option<&FunctionProto>
Get prototype for a stdlib function by name
Sourcepub fn inject_prototypes_for_header(&self, header: StdHeader) -> String
pub fn inject_prototypes_for_header(&self, header: StdHeader) -> String
Inject prototypes for a specific header
Only injects function declarations for the specified header. This prevents parser overload from injecting all 55+ prototypes at once.
§Examples
use decy_stdlib::{StdlibPrototypes, StdHeader};
let stdlib = StdlibPrototypes::new();
let string_protos = stdlib.inject_prototypes_for_header(StdHeader::String);
assert!(string_protos.contains("strlen"));
assert!(!string_protos.contains("printf")); // stdio function, not stringSourcepub fn inject_all_prototypes(&self) -> String
pub fn inject_all_prototypes(&self) -> String
Inject all stdlib prototypes as C declarations
Note: Prefer inject_prototypes_for_header() to avoid parser overload.
This method injects ALL 55+ prototypes which may cause parsing issues.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StdlibPrototypes
impl RefUnwindSafe for StdlibPrototypes
impl Send for StdlibPrototypes
impl Sync for StdlibPrototypes
impl Unpin for StdlibPrototypes
impl UnwindSafe for StdlibPrototypes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more