本文整理汇总了Golang中C.RWseek函数的典型用法代码示例。如果您正苦于以下问题:Golang RWseek函数的具体用法?Golang RWseek怎么用?Golang RWseek使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RWseek函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: RWtell
func (ctx *RWops) RWtell() int64 {
if ctx == nil {
return 0
}
_ctx := (*C.SDL_RWops)(unsafe.Pointer(ctx))
return (int64)(C.RWseek(_ctx, 0, RW_SEEK_CUR))
}
示例2: RWseek
func (ctx *RWops) RWseek(offset int64, whence int) int64 {
if ctx == nil {
return -1
}
_ctx := (*C.SDL_RWops)(unsafe.Pointer(ctx))
_offset := (C.Sint64)(offset)
_whence := (C.int)(whence)
return (int64)(C.RWseek(_ctx, _offset, _whence))
}
示例3: Seek
func (rw *RWops) Seek(offset int64, whence int) (int64, error) {
var w C.int
switch whence {
case 0:
w = C.SEEK_SET
case 1:
w = C.SEEK_CUR
case 2:
w = C.SEEK_END
default:
return offset, errors.New("Bad whence.")
}
return int64(C.RWseek((*C.SDL_RWops)(rw), C.int(offset), w)), nil
}
示例4: RWtell
func (ctx *RWops) RWtell() int64 {
if ctx == nil {
return 0
}
return int64(C.RWseek(ctx.cptr(), 0, RW_SEEK_CUR))
}
示例5: RWseek
func (ctx *RWops) RWseek(offset int64, whence int) int64 {
if ctx == nil {
return -1
}
return int64(C.RWseek(ctx.cptr(), C.Sint64(offset), C.int(whence)))
}