Re: [go-nuts] cannot use CallBack (type func(*_Ctype_char, *_Ctype_char, _Ctype_ulong)) as type *[0]byte in argument to _Cfunc_reload_pattern_db

2019-04-24 Thread Jan Mercl
On Wed, Apr 24, 2019 at 4:16 PM Nitish Saboo wrote: > >>Why size_t, char is going to be undefined here ? I followed the exact steps > >>mentioned in 'https://github.com/golang/go/wiki/cgo#function-variables' > >>under the topic 'Function pointer callback'. > I have to pass the callback

Re: [go-nuts] cannot use CallBack (type func(*_Ctype_char, *_Ctype_char, _Ctype_ulong)) as type *[0]byte in argument to _Cfunc_reload_pattern_db

2019-04-24 Thread Nitish Saboo
On Wed, Apr 24, 2019 at 1:51 PM Nitish Saboo wrote: > > Hi, > > I followed the link ' https://github.com/golang/go/wiki/cgo#function-variables' and made the following changes: > 1)main.go > package main > //#cgo CFLAGS: -I./syslog-ng-3.6.2/ > //#cgo LDFLAGS: syslog-node.so > //#cgo LDFLAGS:

Re: [go-nuts] cannot use CallBack (type func(*_Ctype_char, *_Ctype_char, _Ctype_ulong)) as type *[0]byte in argument to _Cfunc_reload_pattern_db

2019-04-24 Thread Jan Mercl
On Wed, Apr 24, 2019 at 1:51 PM Nitish Saboo wrote: > > Hi, > > I followed the link > 'https://github.com/golang/go/wiki/cgo#function-variables' and made the > following changes: > 1)main.go > package main > //#cgo CFLAGS: -I./syslog-ng-3.6.2/ > //#cgo LDFLAGS: syslog-node.so > //#cgo LDFLAGS:

Re: [go-nuts] cannot use CallBack (type func(*_Ctype_char, *_Ctype_char, _Ctype_ulong)) as type *[0]byte in argument to _Cfunc_reload_pattern_db

2019-04-24 Thread Nitish Saboo
Hi, I followed the link ' https://github.com/golang/go/wiki/cgo#function-variables' and made the following changes: *1)main.go* package main //#cgo CFLAGS: -I./syslog-ng-3.6.2/ //#cgo LDFLAGS: syslog-node.so //#cgo LDFLAGS: -L/usr/local/lib/ -lsyslog-ng //#cgo LDFLAGS: -L/usr/local/lib/syslog-ng

Re: [go-nuts] cannot use CallBack (type func(*_Ctype_char, *_Ctype_char, _Ctype_ulong)) as type *[0]byte in argument to _Cfunc_reload_pattern_db

2019-04-24 Thread Jan Mercl
On Wed, Apr 24, 2019 at 10:47 AM Nitish Saboo wrote: > ./main.go:80:32: cannot use key (type *_Ctype_char) as type string in map > index func CallBack(ckey *C.char, value *C.char, value_len C.size_t){ key := C.GoString(ckey) if remap, ok := field_mappings[key]; ok {

[go-nuts] cannot use CallBack (type func(*_Ctype_char, *_Ctype_char, _Ctype_ulong)) as type *[0]byte in argument to _Cfunc_reload_pattern_db

2019-04-24 Thread Nitish Saboo
Hi, I am facing the following issue: I have a GO code that has to be called from the C code: var field_mappings map[string]string = map[string]string{ " A": "a", "B": "b", "C": "c", "D": "d"} //export CallBack func CallBack(key *C.char, value *C.char, value_len C.size_t){