mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
C API: update README example
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
This commit is contained in:
parent
9d380c0f76
commit
91e53de7d3
1 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ int main() {
|
||||||
|
|
||||||
nix_expr_eval_from_string(NULL, state, "builtins.nixVersion", ".", value);
|
nix_expr_eval_from_string(NULL, state, "builtins.nixVersion", ".", value);
|
||||||
nix_value_force(NULL, state, value);
|
nix_value_force(NULL, state, value);
|
||||||
printf("nix version: %s\n", nix_get_string(NULL, value));
|
printf("Nix version: %s\n", nix_get_string(NULL, value));
|
||||||
|
|
||||||
nix_gc_decref(NULL, value);
|
nix_gc_decref(NULL, value);
|
||||||
nix_state_free(state);
|
nix_state_free(state);
|
||||||
|
@ -52,7 +52,7 @@ int main() {
|
||||||
```
|
```
|
||||||
$ gcc main.c $(pkg-config nix-expr-c --libs --cflags) -o main
|
$ gcc main.c $(pkg-config nix-expr-c --libs --cflags) -o main
|
||||||
$ ./main
|
$ ./main
|
||||||
nix version 1.2.3
|
Nix version: 2.17
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue