1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
extern crate proc_macro;

mod raw_types;
mod utils;

use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2;

#[proc_macro]
pub fn witx_host_types(args: TokenStream) -> TokenStream {
    TokenStream::from(raw_types::gen(
        TokenStream2::from(args),
        raw_types::Mode::Host,
    ))
}

#[proc_macro]
pub fn witx_wasi_types(args: TokenStream) -> TokenStream {
    TokenStream::from(raw_types::gen(
        TokenStream2::from(args),
        raw_types::Mode::Wasi,
    ))
}

#[proc_macro]
pub fn witx_wasi32_types(args: TokenStream) -> TokenStream {
    TokenStream::from(raw_types::gen(
        TokenStream2::from(args),
        raw_types::Mode::Wasi32,
    ))
}