On Sat, Nov 21, 2015 at 10:10 PM, <
alex....@gmail.com> wrote:
> For example. I compile my lib: go build -buildmode=c-archive sp.go. It let
> me link my static library to project on C.
> Golang generate sp.a and sp.h files. Inside sp.h you can see lines:
> //...
> typedef struct { char *p; GoInt n; } GoString;
> typedef void *GoMap;
> typedef void *GoChan;
> typedef struct { void *t; void *v; } GoInterface;
> typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
> //...
> Byt I need to know how to use this types in C.
I'm sorry, to me it seems like you restated your question rather than
answering mine. What are you really trying to do?
Ian
> вівторок, 20 жовтня 2015 р. 21:02:34 UTC+7 користувач Ian Lance Taylor
> написав:
>>
>> On Tue, Oct 20, 2015 at 4:35 AM, 施健 <
shiji...@gmail.com> wrote:
>> >
>> > As I know, that I can not declare a C func with GoInterface or GoInt
>> > parameter and called by go. But I can export go func to C with
>> > GoInterface
>> > parameter. If so, I can never get a GoInterface type, because I cannot
>> > build
>> > a GoInterface type in C code. And I cannot get them form go-call-c. So
>> > what
>> > is these types defined in _cgo_export.h for?
>>
>> Those types are used internally by cgo. They aren't documented and
>> they aren't intended for use by the program using cgo.
>>
>> What are you really trying to do?
>>
>> Ian
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
golang-nuts...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.