aboutsummaryrefslogtreecommitdiff
path: root/salticidae.go
blob: 8676a3d9a1ea25ab3372710ea727133fe448e7af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package salticidae

// #cgo CFLAGS: -I${SRCDIR}/salticidae/include/
// #cgo LDFLAGS: ${SRCDIR}/salticidae/libsalticidae.so -Wl,-rpath=${SRCDIR}/salticidae/
// #include "salticidae/util.h"
import "C"
import "unsafe"

type rawptr_t = unsafe.Pointer
type Opcode = uint8
type Error = C.struct_SalticidaeCError

func (self *Error) GetCode() int { return int((*C.struct_SalticidaeCError)(self).code) }

func NewError() Error {
	return C.struct_SalticidaeCError{}
}

func StrError(code int) string {
	return C.GoString(C.salticidae_strerror(C.int(code)))
}