From c40c83d88cbbe3b3a5695b5cbe9d514c99061a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 31 May 2024 08:18:52 +0200 Subject: [PATCH] docs: fixup description of builtins.importNative There was an argument missing and the fact that the imported function is called. --- src/libexpr/eval-settings.hh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libexpr/eval-settings.hh b/src/libexpr/eval-settings.hh index f1fb539bd25..d01de980fa4 100644 --- a/src/libexpr/eval-settings.hh +++ b/src/libexpr/eval-settings.hh @@ -19,18 +19,18 @@ struct EvalSettings : Config Enable built-in functions that allow executing native code. In particular, this adds: - - `builtins.importNative` *path* - - Load a dynamic shared object (DSO) at *path* which exposes a function pointer to a procedure that initialises a Nix language value, and return that value. - The procedure must have the following signature: + - `builtins.importNative` *path* *symbol* + + Opens dynamic shared object (DSO) at *path*, loads the function with the symbol name *symbol* from it and runs it. + The loaded function must have the following signature: ```cpp extern "C" typedef void (*ValueInitialiser) (EvalState & state, Value & v); - ``` - + ``` + The [Nix C++ API documentation](@docroot@/contributing/documentation.md#api-documentation) has more details on evaluator internals. - + - `builtins.exec` *arguments* - + Execute a program, where *arguments* are specified as a list of strings, and parse its output as a Nix expression. )"};