fn generate_function(ptr: &FnPtr, name: Ident, extern_type: &str) -> Item {
            Item::ForeignMod(ItemForeignMod {
                attrs: vec![],
                abi: Abi {
                    extern_token: Extern {
                        span: Span::call_site(),
                    },
                    name: Some(syn::LitStr::new(extern_type, Span::call_site())),
                },
                brace_token: syn::token::Brace {
                    span: Span::call_site(),
                },
                items: vec![ForeignItem::Fn(ForeignItemFn {
                    attrs: vec![],
                    vis: Visibility::Public(VisPublic {
                        pub_token: Pub {
                            span: Span::call_site(),
                        },
                    }),
                    sig: extract_signature(ptr, name, false, false),
                    semi_token: syn::token::Semi {
                        spans: [Span::call_site()],
                    },
                })],
            })
        }
/// Generates a "extern C" or "extern system" free function definition
Generates a "extern C" or "extern system" free function definition
Generates a " extern C " or " extern system " free function definition
fn generate_function(ptr: &FnPtr, name: Ident, extern_type: &str) -> Item {
            Item::ForeignMod(ItemForeignMod {
                attrs: vec![],
                abi: Abi {
                    extern_token: Extern {
                        span: Span::call_site(),
                    },
                    name: Some(syn::LitStr::new(extern_type, Span::call_site())),
                },
                brace_token: syn::token::Brace {
                    span: Span::call_site(),
                },
                items: vec![ForeignItem::Fn(ForeignItemFn {
                    attrs: vec![],
                    vis: Visibility::Public(VisPublic {
                        pub_token: Pub {
                            span: Span::call_site(),
                        },
                    }),
                    sig: extract_signature(ptr, name, false, false),
                    semi_token: syn::token::Semi {
                        spans: [Span::call_site()],
                    },
                })],
            })
        }
fn generate_function ( ptr : & FnPtr , name : Ident , extern_type : & str ) -> Item { Item :: ForeignMod ( ItemForeignMod { attrs : vec ! [ ] , abi : Abi { extern_token : Extern { span : Span :: call_site ( ) , } , name : Some ( syn :: LitStr :: new ( extern_type , Span :: call_site ( ) ) ) , } , brace_token : syn :: token :: Brace { span : Span :: call_site ( ) , } , items : vec ! [ ForeignItem Fn ( ForeignItemFn { attrs vec [ ] vis Visibility Public ( VisPublic { pub_token Pub { span Span call_site ( ) } } ) sig extract_signature ( ptr name false false ) semi_token syn token Semi { spans [ Span call_site ( ) ] } } ) ] , } ) }
Generates a "extern C" or "extern system" free function definition
Generates a " extern C " or " extern system " free function definition
ptr
&FnPtr
name
Ident
extern_type
&str
ptr
&FnPtr
name
Ident
extern_type
&str