54 lines
663 B
Markdown
54 lines
663 B
Markdown
|
# Host files
|
||
|
|
||
|
File path: `out/dir/api.rs`
|
||
|
|
||
|
```rust
|
||
|
// Host code
|
||
|
/* Rust API */
|
||
|
#[derive(Debug)]
|
||
|
pub enum Commands {
|
||
|
Test(test::Test),
|
||
|
}
|
||
|
/// an empty doc comment:
|
||
|
///
|
||
|
/// doc comment continued.
|
||
|
pub mod test {
|
||
|
#[derive(Debug)]
|
||
|
pub enum Test {}
|
||
|
}
|
||
|
/* C API */
|
||
|
pub mod test_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"
|
||
|
|
||
|
/**
|
||
|
an empty doc comment:
|
||
|
*/
|
||
|
/**
|
||
|
|
||
|
*/
|
||
|
/**
|
||
|
doc comment continued.
|
||
|
*/
|
||
|
struct test
|
||
|
{
|
||
|
};
|
||
|
|
||
|
const struct test test = {};
|
||
|
|
||
|
#endif // if !defined TRIXY_MAIN_HEADER
|
||
|
// vim: filetype=c
|
||
|
```
|