本文整理匯總了Golang中C.cfish_Err_get_error函數的典型用法代碼示例。如果您正苦於以下問題:Golang cfish_Err_get_error函數的具體用法?Golang cfish_Err_get_error怎麽用?Golang cfish_Err_get_error使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了cfish_Err_get_error函數的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Obtain
func (lock *LockIMP) Obtain() error {
self := (*C.lucy_Lock)(clownfish.Unwrap(lock, "lock"))
success := C.LUCY_Lock_Obtain(self)
if !success {
cfErr := C.cfish_Err_get_error()
return clownfish.WRAPAny(unsafe.Pointer(C.cfish_incref(unsafe.Pointer(cfErr)))).(error)
}
return nil
}
示例2: Window
func (fh *FileHandleIMP) Window(window FileWindow, offset, length int64) error {
self := (*C.lucy_FileHandle)(clownfish.Unwrap(fh, "fh"))
windowC := (*C.lucy_FileWindow)(clownfish.Unwrap(window, "window"))
success := C.LUCY_FH_Window(self, windowC, C.int64_t(offset), C.int64_t(length))
if !success {
cfErr := C.cfish_Err_get_error()
return clownfish.WRAPAny(unsafe.Pointer(C.cfish_incref(unsafe.Pointer(cfErr)))).(error)
}
return nil
}
示例3: ReleaseWindow
func (fh *FileHandleIMP) ReleaseWindow(window FileWindow) error {
self := (*C.lucy_FileHandle)(clownfish.Unwrap(fh, "fh"))
windowC := (*C.lucy_FileWindow)(clownfish.Unwrap(window, "window"))
success := C.LUCY_FH_Release_Window(self, windowC)
if !success {
cfErr := C.cfish_Err_get_error()
return clownfish.WRAPAny(unsafe.Pointer(C.cfish_incref(unsafe.Pointer(cfErr)))).(error)
}
return nil
}
示例4: LocalMkDir
func (f *FolderIMP) LocalMkDir(name string) error {
self := (*C.lucy_Folder)(clownfish.Unwrap(f, "f"))
nameC := (*C.cfish_String)(clownfish.GoToClownfish(name, unsafe.Pointer(C.CFISH_STRING), false))
defer C.cfish_decref(unsafe.Pointer(nameC))
success := C.LUCY_Folder_Local_MkDir(self, nameC)
if !success {
cfErr := C.cfish_Err_get_error()
return clownfish.WRAPAny(unsafe.Pointer(C.cfish_incref(unsafe.Pointer(cfErr)))).(error)
}
return nil
}
示例5: OpenCompoundFileReader
func OpenCompoundFileReader(folder Folder) (reader CompoundFileReader, err error) {
err = clownfish.TrapErr(func() {
folderC := (*C.lucy_Folder)(clownfish.Unwrap(folder, "Folder"))
cfObj := C.lucy_CFReader_open(folderC)
if cfObj == nil {
cfErr := C.cfish_Err_get_error()
panic(clownfish.WRAPAny(unsafe.Pointer(C.cfish_incref(unsafe.Pointer(cfErr)))).(error))
}
reader = WRAPCompoundFileReader(unsafe.Pointer(cfObj))
})
return reader, err
}
示例6: LocalOpenDir
func (f *FolderIMP) LocalOpenDir() (retval DirHandle, err error) {
err = clownfish.TrapErr(func() {
self := (*C.lucy_Folder)(clownfish.Unwrap(f, "f"))
retvalC := C.LUCY_Folder_Local_Open_Dir(self)
if retvalC == nil {
cfErr := C.cfish_Err_get_error()
panic(clownfish.WRAPAny(unsafe.Pointer(C.cfish_incref(unsafe.Pointer(cfErr)))).(error))
}
retval = WRAPDirHandle(unsafe.Pointer(retvalC))
})
return retval, err
}
示例7: OpenFSDirHandle
func OpenFSDirHandle(path string) (dh FSDirHandle, err error) {
err = clownfish.TrapErr(func() {
pathC := (*C.cfish_String)(clownfish.GoToClownfish(path, unsafe.Pointer(C.CFISH_STRING), false))
defer C.cfish_decref(unsafe.Pointer(pathC))
cfObj := C.lucy_FSDH_open(pathC)
if cfObj == nil {
cfErr := C.cfish_Err_get_error()
panic(clownfish.WRAPAny(unsafe.Pointer(C.cfish_incref(unsafe.Pointer(cfErr)))).(error))
}
dh = WRAPFSDirHandle(unsafe.Pointer(cfObj))
})
return dh, err
}
示例8: HardLink
func (f *FolderIMP) HardLink(from, to string) error {
self := (*C.lucy_Folder)(clownfish.Unwrap(f, "f"))
fromC := (*C.cfish_String)(clownfish.GoToClownfish(from, unsafe.Pointer(C.CFISH_STRING), false))
toC := (*C.cfish_String)(clownfish.GoToClownfish(to, unsafe.Pointer(C.CFISH_STRING), false))
defer C.cfish_decref(unsafe.Pointer(fromC))
defer C.cfish_decref(unsafe.Pointer(toC))
success := C.LUCY_Folder_Hard_Link(self, fromC, toC)
if !success {
cfErr := C.cfish_Err_get_error()
return clownfish.WRAPAny(unsafe.Pointer(C.cfish_incref(unsafe.Pointer(cfErr)))).(error)
}
return nil
}
示例9: OpenOutStream
func OpenOutStream(file interface{}) (out OutStream, err error) {
err = clownfish.TrapErr(func() {
fileC := (*C.cfish_Obj)(clownfish.GoToClownfish(file, unsafe.Pointer(C.CFISH_OBJ), false))
defer C.cfish_decref(unsafe.Pointer(fileC))
cfObj := C.lucy_OutStream_open(fileC)
if cfObj == nil {
cfErr := C.cfish_Err_get_error()
panic(clownfish.WRAPAny(unsafe.Pointer(C.cfish_incref(unsafe.Pointer(cfErr)))).(error))
}
out = WRAPOutStream(unsafe.Pointer(cfObj))
})
return out, err
}
示例10: OpenRAMFileHandle
func OpenRAMFileHandle(path string, flags uint32, ramFile RAMFile) (fh RAMFileHandle, err error) {
err = clownfish.TrapErr(func() {
pathC := (*C.cfish_String)(clownfish.GoToClownfish(path, unsafe.Pointer(C.CFISH_STRING), false))
ramFileC := (*C.lucy_RAMFile)(clownfish.GoToClownfish(ramFile, unsafe.Pointer(C.LUCY_RAMFILE), true))
defer C.cfish_decref(unsafe.Pointer(pathC))
cfObj := C.lucy_RAMFH_open(pathC, C.uint32_t(flags), ramFileC)
if cfObj == nil {
cfErr := C.cfish_Err_get_error()
panic(clownfish.WRAPAny(unsafe.Pointer(C.cfish_incref(unsafe.Pointer(cfErr)))).(error))
}
fh = WRAPRAMFileHandle(unsafe.Pointer(cfObj))
})
return fh, err
}
示例11: LocalOpenFileHandle
func (f *FolderIMP) LocalOpenFileHandle(name string, flags uint32) (retval FileHandle, err error) {
err = clownfish.TrapErr(func() {
self := (*C.lucy_Folder)(clownfish.Unwrap(f, "f"))
nameC := (*C.cfish_String)(clownfish.GoToClownfish(name, unsafe.Pointer(C.CFISH_STRING), false))
defer C.cfish_decref(unsafe.Pointer(nameC))
retvalC := C.LUCY_Folder_Local_Open_FileHandle(self, nameC, C.uint32_t(flags))
if retvalC == nil {
cfErr := C.cfish_Err_get_error()
panic(clownfish.WRAPAny(unsafe.Pointer(C.cfish_incref(unsafe.Pointer(cfErr)))).(error))
}
retval = WRAPFileHandle(unsafe.Pointer(retvalC))
})
return retval, err
}
示例12: OpenDir
func (f *FolderIMP) OpenDir(path string) (retval DirHandle, err error) {
err = clownfish.TrapErr(func() {
self := (*C.lucy_Folder)(clownfish.Unwrap(f, "f"))
pathC := (*C.cfish_String)(clownfish.GoToClownfish(path, unsafe.Pointer(C.CFISH_STRING), false))
defer C.cfish_decref(unsafe.Pointer(pathC))
retvalC := C.LUCY_Folder_Open_Dir(self, pathC)
if retvalC == nil {
cfErr := C.cfish_Err_get_error()
panic(clownfish.WRAPAny(unsafe.Pointer(C.cfish_incref(unsafe.Pointer(cfErr)))).(error))
}
retval = WRAPDirHandle(unsafe.Pointer(retvalC))
})
return retval, err
}
示例13: ListR
func (f *FolderIMP) ListR(path string) (retval []string, err error) {
err = clownfish.TrapErr(func() {
self := (*C.lucy_Folder)(clownfish.Unwrap(f, "f"))
pathC := (*C.cfish_String)(clownfish.GoToClownfish(path, unsafe.Pointer(C.CFISH_STRING), false))
defer C.cfish_decref(unsafe.Pointer(pathC))
retvalC := C.LUCY_Folder_List_R(self, pathC)
if retvalC == nil {
cfErr := C.cfish_Err_get_error()
panic(clownfish.WRAPAny(unsafe.Pointer(C.cfish_incref(unsafe.Pointer(cfErr)))).(error))
}
defer C.cfish_decref(unsafe.Pointer(retvalC))
retval = vecToStringSlice(retvalC)
})
return retval, err
}