コード例 #1
0
ファイル: libshout.go プロジェクト: boedy/go-libshout
func (s *Shout) send(buffer []byte) error {
	ptr := (*C.uchar)(&buffer[0])
	C.shout_send(s.struc, ptr, C.size_t(len(buffer)))

	errno := int(C.shout_get_errno(s.struc))
	if errno != C.SHOUTERR_SUCCESS {
		fmt.Println("something went wrong: %d", errno)
	}

	C.shout_sync(s.struc)
	return nil
}
コード例 #2
0
ファイル: shout.go プロジェクト: Bevinsky/icecast-proxy-go
func (self *Shout) createShoutError() ShoutError {
	/* Creates a Go error of the C library */
	errno := int(C.shout_get_errno(self.shout))
	errstr := C.GoString(C.shout_get_error(self.shout))
	return ShoutError{errno, errstr}
}