代码拉取完成,页面将自动刷新
//----------------------------------------
//
// Copyright © ying32. All Rights Reserved.
//
// Licensed under Apache License 2.0
//
//----------------------------------------
package api
import (
"fmt"
"unsafe"
)
// ---------------- liblcl ----------------
func initLCLStdStr() {
fmt.Println("Library Character Encoding: UTF-8")
GoStrToDStr = lcl_GoStrToDStr
DStrToGoStr = lcl_DStrToGoStr
getBuff = lcl_getBuff
getBuffPtr = lcl_getBuffPtr
getTextBuf = lcl_getTextBuf
}
// Go的string转换为Lazarus的string
func lcl_GoStrToDStr(s string) uintptr {
if s == "" {
return 0
}
return uintptr(unsafe.Pointer(StringToUTF8Ptr(s)))
}
// Lazarus的string转换为Go的string
func lcl_DStrToGoStr(ustr uintptr) string {
l := DStrLen(ustr)
if l == 0 {
return ""
}
str := make([]uint8, l)
DMove(ustr, uintptr(unsafe.Pointer(&str[0])), l)
return string(str)
}
func lcl_getBuff(size int32) interface{} {
return make([]uint8, size+1)
}
func lcl_getBuffPtr(buff interface{}) uintptr {
return uintptr(unsafe.Pointer(&(buff.([]uint8))[0]))
}
func lcl_getTextBuf(strBuff interface{}, Buffer *string, slen int) {
*Buffer = string((strBuff.([]uint8))[:slen])
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。