[−][src]Struct tcc::Tcc
Main struct of this crate, can be used to compile C code into machine code.
Methods
impl Tcc
[src]
pub fn new() -> Self
[src]
create a new TCC compilation context
pub fn set_lib_path<P: AsRef<Path>>(&mut self, path: P)
[src]
set CONFIG_TCCDIR at runtime
pub fn set_error_func(&mut self, error_func: Option<Box<dyn Fn(&str)>>)
[src]
set error/warning display callback
pub fn set_options(&mut self, options: &str)
[src]
set options as from command line (multiple supported)
pub fn add_include_path<P: AsRef<Path>>(&mut self, path: P) -> Result<(), ()>
[src]
add include path
pub fn add_sysinclude_path<P: AsRef<Path>>(&mut self, path: P) -> Result<(), ()>
[src]
add in system include path
pub fn define_symbol(&mut self, sym: &str, value: &str)
[src]
define preprocessor symbol 'sym'. Can put optional value
pub fn undefine_symbol(&mut self, sym: &str)
[src]
undefine preprocess symbol 'sym'
pub fn add_file<P: AsRef<Path>>(&mut self, path: P) -> Result<(), ()>
[src]
add a file (C file, dll, object, library, ld script)
pub fn compile_string(&mut self, buf: &str) -> Result<(), ()>
[src]
compile a string containing a C source
pub fn set_output_type(&mut self, output_type: OutputType) -> Result<(), ()>
[src]
set output type. MUST BE CALLED before any compilation
pub fn add_library_path<P: AsRef<Path>>(&mut self, path: P) -> Result<(), ()>
[src]
equivalent to -Lpath option
pub fn add_library(&mut self, name: &str) -> Result<(), ()>
[src]
the library name is the same as the argument of the '-l' option
pub fn add_symbol<S: Symbol>(
&mut self,
name: &str,
symbol: &S
) -> Result<(), ()>
[src]
&mut self,
name: &str,
symbol: &S
) -> Result<(), ()>
add a symbol to the compiled program
pub fn output_file<P: AsRef<Path>>(&mut self, path: P) -> Result<(), ()>
[src]
output an executable, library or object file
pub fn run(&mut self, args: &[&str]) -> Result<(), ()>
[src]
link and run main() function and return its value
pub fn relocate(self) -> Result<RelocatedTcc, Tcc>
[src]
do all relocations
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,