Re: [go-nuts] Re: callback for c code wrapper around go function

2017-12-21 Thread Ian Lance Taylor
On Thu, Dec 21, 2017 at 6:44 AM, wrote: > No I am not talking about the exported function, but the function from the C > function within the preamble, and what about the first part of the question > (scroll up) thank you Yes, I think I understand. I am saying that if you use //export in the Go

Re: [go-nuts] Re: callback for c code wrapper around go function

2017-12-21 Thread roupesy
No, I am talking about the function in the C preamble will they be part of the header and share object ? On Thursday, December 21, 2017 at 9:39:07 AM UTC-5, Ian Lance Taylor wrote: > > On Thu, Dec 21, 2017 at 6:15 AM, > wrote: > > > > 2 - Do all functions added into the preamble get exported t

Re: [go-nuts] Re: callback for c code wrapper around go function

2017-12-21 Thread roupesy
No I am not talking about the exported function, but the function from the C function within the preamble, and what about the first part of the question (scroll up) thank you On Thursday, December 21, 2017 at 9:39:07 AM UTC-5, Ian Lance Taylor wrote: > > On Thu, Dec 21, 2017 at 6:15 AM, > wrot

Re: [go-nuts] Re: callback for c code wrapper around go function

2017-12-21 Thread Ian Lance Taylor
On Thu, Dec 21, 2017 at 6:15 AM, wrote: > > 2 - Do all functions added into the preamble get exported to the header and > the shared object that go build creates? Yes they do, if you use //export, as documented at https://golang.org/cmd/cgo. Ian -- You received this message because you are su

Re: [go-nuts] Re: callback for c code wrapper around go function

2017-12-21 Thread roupesy
Hey Ian, Thanks again for replying, however I'm a bit confused by the code you've provided. am I passing the go callback into that function ? I have few questions: 1- * I tried to do the do the following * /* #include #include void parse(char* err, int status) { // will get

Re: [go-nuts] Re: callback for c code wrapper around go function

2017-12-19 Thread Ian Lance Taylor
On Tue, Dec 19, 2017 at 9:40 AM, wrote: > > Thanks for your response, are you referring to something like this: > /* > #include > #include > > void parse(char* err, int status) { > // do work > } > */ > > > > > func Ccomputation(address *C.char) { > > ptr := uintptr(unsafe.Pointer(C.parse)