예제 #1
0
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
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}
}