代码拉取完成,页面将自动刷新
package fastlike
// xqd_multivalue is not an actual ABI method, but it's an implementation of a mechanism used by
// the guest to make multiple hostcalls via a cursor
// For usage, see the abi methods for headers
func xqd_multivalue(memory *Memory, data []string, addr int32, maxlen int32, cursor int32, ending_cursor_out int32, nwritten_out int32) XqdStatus {
// If there's no data, return early
if len(data) == 0 {
memory.PutUint32(uint32(0), int64(nwritten_out))
// Set the cursor to -1 to stop asking
memory.PutInt64(-1, int64(ending_cursor_out))
return XqdStatusOK
}
// If the cursor points past our slice, return early
if int(cursor) >= len(data) {
memory.PutUint32(uint32(0), int64(nwritten_out))
// Set the cursor to -1 to stop asking
memory.PutInt64(-1, int64(ending_cursor_out))
return XqdStatusOK
}
if len([]byte(data[cursor]))+1 > int(maxlen) {
return XqdErrBufferLength
}
var v = []byte(data[cursor])
v = append(v, '\x00')
nwritten, err := memory.WriteAt(v, int64(addr))
check(err)
memory.PutUint32(uint32(nwritten), int64(nwritten_out))
// If there's more entries, set the cursor to +1
var ec int
if int(cursor) < len(data)-1 {
ec = int(cursor) + 1
} else {
ec = -1
}
memory.PutInt64(int64(ec), int64(ending_cursor_out))
return XqdStatusOK
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。