comparison semiconginev2/core/utils.nim @ 1234:841e12f33c47

add: text & font rendering, not tested yet
author sam <sam@basx.dev>
date Sat, 20 Jul 2024 00:03:57 +0700
parents 56781cc0fc7c
children
comparison
equal deleted inserted replaced
1233:1cf698973dca 1234:841e12f33c47
14 result = join(str[0 ..< i]) 14 result = join(str[0 ..< i])
15 break 15 break
16 16
17 func ToCPointer*[T](list: openArray[T]): ptr T = 17 func ToCPointer*[T](list: openArray[T]): ptr T =
18 if list.len > 0: addr(list[0]) else: nil 18 if list.len > 0: addr(list[0]) else: nil
19
20 # required for some external libraries
21 proc nativeFree(p: pointer) {.importc: "free".}
19 22
20 proc StaticExecChecked*(command: string, input = ""): string {.compileTime.} = 23 proc StaticExecChecked*(command: string, input = ""): string {.compileTime.} =
21 let (output, exitcode) = gorgeEx( 24 let (output, exitcode) = gorgeEx(
22 command = command, 25 command = command,
23 input = input) 26 input = input)