This repository has been archived on 2024-05-26. You can view files and clone it, but cannot push or open issues or pull requests.
2024-03-27 08:58:08 +00:00
|
|
|
# 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 */
|
2024-03-27 21:26:21 +00:00
|
|
|
pub mod trinitrix_c {
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
use crate::callback_function;
|
|
|
|
}
|
2024-03-27 08:58:08 +00:00
|
|
|
// 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"
|
|
|
|
|
|
|
|
/**
|
2024-03-27 09:51:39 +00:00
|
|
|
* [...]
|
|
|
|
* "å🙂" => "å" then "🙂" (full Unicode support!)
|
|
|
|
* [...]
|
|
|
|
*/
|
2024-03-27 08:58:08 +00:00
|
|
|
struct trinitrix
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
const struct trinitrix trinitrix = {};
|
|
|
|
|
|
|
|
#endif // if !defined TRIXY_MAIN_HEADER
|
|
|
|
// vim: filetype=c
|
|
|
|
```
|