| 43 | extern "C" { |
| 44 | |
| 45 | nix_err nix_libexpr_init(nix_c_context * context) |
| 46 | { |
| 47 | if (context) |
| 48 | context->last_err_code = NIX_OK; |
| 49 | { |
| 50 | auto ret = nix_libutil_init(context); |
| 51 | if (ret != NIX_OK) |
| 52 | return ret; |
| 53 | } |
| 54 | { |
| 55 | auto ret = nix_libstore_init(context); |
| 56 | if (ret != NIX_OK) |
| 57 | return ret; |
| 58 | } |
| 59 | try { |
| 60 | nix::initGC(); |
| 61 | } |
| 62 | NIXC_CATCH_ERRS |
| 63 | } |
| 64 | |
| 65 | nix_err nix_expr_eval_from_string( |
| 66 | nix_c_context * context, EvalState * state, const char * expr, const char * path, nix_value * value) |