54 lines
755 B
Markdown
54 lines
755 B
Markdown
|
# Host files
|
||
|
|
||
|
File path: `out/dir/api.rs`
|
||
|
|
||
|
```rust
|
||
|
// Host code
|
||
|
/* Rust API */
|
||
|
#[derive(Debug)]
|
||
|
pub enum Commands {
|
||
|
Trinitrix(trinitrix::Trinitrix),
|
||
|
}
|
||
|
/// [...]
|
||
|
/// "å🙂" => "å" then "🙂" (full Unicode support!)
|
||
|
/// [...]
|
||
|
pub mod trinitrix {
|
||
|
#[derive(Debug)]
|
||
|
pub enum Trinitrix {}
|
||
|
}
|
||
|
/* C API */
|
||
|
pub mod trinitrix_c {}
|
||
|
// vim: filetype=rust
|
||
|
```
|
||
|
|
||
|
# Auxiliary files
|
||
|
|
||
|
File path: `dist/interface.h`
|
||
|
|
||
|
```c
|
||
|
#if !defined TRIXY_MAIN_HEADER
|
||
|
#define TRIXY_MAIN_HEADER
|
||
|
|
||
|
#include "errno.h"
|
||
|
#include "string.h"
|
||
|
#include "vec.h"
|
||
|
|
||
|
/**
|
||
|
[...]
|
||
|
*/
|
||
|
/**
|
||
|
"å🙂" => "å" then "🙂" (full Unicode support!)
|
||
|
*/
|
||
|
/**
|
||
|
[...]
|
||
|
*/
|
||
|
struct trinitrix
|
||
|
{
|
||
|
};
|
||
|
|
||
|
const struct trinitrix trinitrix = {};
|
||
|
|
||
|
#endif // if !defined TRIXY_MAIN_HEADER
|
||
|
// vim: filetype=c
|
||
|
```
|