Documentation
¶
Overview ¶
Package tcc offers go bindings to libtcc.
The libtcc library allows you to call the tcc compiler programatically. It is available as a static C library. This package has go bindings to it.
It doesn't implement every method available in libtcc yet. If there's a libtcc method that you need and is not implemented in this package, feel free to open an issue or submit a pull request.
To use it you must have libtcc installed. You can download tcc from the website above. After that you can extract and run
./configure make make install
If everything works, you will have libtcc installed. Note that you need a C compiler like gcc for the above to work.
Index ¶
- Constants
- type Tcc
- func (tcc *Tcc) AddIncludePath(path string)
- func (tcc *Tcc) CompileString(src string) error
- func (tcc *Tcc) Delete()
- func (tcc *Tcc) OutputFile(path string)
- func (tcc *Tcc) Run(argv []string) (int, error)
- func (tcc *Tcc) SetLibPath(path string)
- func (tcc *Tcc) SetOptions(opts string)
- func (tcc *Tcc) SetOutputType(outputType int)
Constants ¶
const OUTPUT_DLL = 3
dynamic library
const OUTPUT_EXE = 2
executable file
const OUTPUT_MEMORY = 1
output will be run in memory (default)
const OUTPUT_OBJ = 4
object file
const OUTPUT_PREPROCESS = 5
only preprocess (used internally)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tcc ¶
type Tcc struct {
// contains filtered or unexported fields
}
func (*Tcc) CompileString ¶
compile a string containing a C source.
func (*Tcc) OutputFile ¶
output an executable, library or object file.
func (*Tcc) SetOptions ¶
set options as from command line (multiple supported)
func (*Tcc) SetOutputType ¶
set output type. MUST BE CALLED before any compilation