2022-06-14 19:33:00 +02:00
|
|
|
import
|
|
|
|
|
"."/[csources]
|
|
|
|
|
|
|
|
|
|
{.pragma: importcFunc, cdecl, gcsafe, noSideEffect, raises: [].}
|
|
|
|
|
{.pragma: headerFunc, importcFunc, header: "bearssl.h".}
|
|
|
|
|
{.used.}
|
|
|
|
|
|
|
|
|
|
const
|
|
|
|
|
bearRootPath = bearSrcPath
|
|
|
|
|
|
2022-06-24 20:09:06 +02:00
|
|
|
{.compile: bearRootPath & "settings.c".}
|
2022-06-14 19:33:00 +02:00
|
|
|
|
|
|
|
|
type
|
|
|
|
|
ConfigOption* {.importc: "br_config_option", header: "bearssl.h", bycopy.} = object
|
|
|
|
|
name* {.importc: "name".}: cstring
|
|
|
|
|
value* {.importc: "value".}: clong
|
|
|
|
|
|
|
|
|
|
# TODO: missing `extern "C"` in bearssl.h means this function cannot
|
|
|
|
|
# be used from C++
|
|
|
|
|
proc getConfig*(): ptr ConfigOption {.importcFunc, importc: "br_get_config",
|
|
|
|
|
headerFunc.}
|