diff options
Diffstat (limited to 'salticidae.go')
-rw-r--r-- | salticidae.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/salticidae.go b/salticidae.go index dba50c0..0698f39 100644 --- a/salticidae.go +++ b/salticidae.go @@ -3,8 +3,20 @@ 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))) +} |