[][src]Struct tcc::Tcc

pub struct Tcc { /* fields omitted */ }

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]

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

impl Drop for Tcc[src]

impl Default for Tcc[src]

impl Debug for Tcc[src]

Auto Trait Implementations

impl !Send for Tcc

impl !Sync for Tcc

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]