2003-10-31 19:09:31 +02:00
|
|
|
#ifndef __PRIMOPS_H
|
|
|
|
#define __PRIMOPS_H
|
|
|
|
|
|
|
|
#include "eval.hh"
|
|
|
|
|
|
|
|
|
|
|
|
/* Load and evaluate an expression from path specified by the
|
|
|
|
argument. */
|
|
|
|
Expr primImport(EvalState & state, Expr arg);
|
|
|
|
|
2004-02-04 18:03:29 +02:00
|
|
|
/* Construct (as a unobservable side effect) a Nix derivation
|
2003-10-31 19:09:31 +02:00
|
|
|
expression that performs the derivation described by the argument
|
|
|
|
set. Returns the original set extended with the following
|
|
|
|
attributes: `outPath' containing the primary output path of the
|
|
|
|
derivation; `drvPath' containing the path of the Nix expression;
|
|
|
|
and `type' set to `derivation' to indicate that this is a
|
|
|
|
derivation. */
|
|
|
|
Expr primDerivation(EvalState & state, Expr args);
|
|
|
|
|
2003-11-02 18:31:35 +02:00
|
|
|
/* Return the base name of the given string, i.e., everything
|
|
|
|
following the last slash. */
|
|
|
|
Expr primBaseNameOf(EvalState & state, Expr arg);
|
|
|
|
|
|
|
|
/* Convert the argument (which can be a path or a uri) to a string. */
|
|
|
|
Expr primToString(EvalState & state, Expr arg);
|
|
|
|
|
2004-02-04 18:03:29 +02:00
|
|
|
/* Boolean constructors. */
|
|
|
|
Expr primTrue(EvalState & state);
|
|
|
|
Expr primFalse(EvalState & state);
|
|
|
|
|
2003-11-05 18:27:40 +02:00
|
|
|
/* Return the null value. */
|
2003-11-06 16:41:49 +02:00
|
|
|
Expr primNull(EvalState & state);
|
2003-11-05 18:27:40 +02:00
|
|
|
|
|
|
|
/* Determine whether the argument is the null value. */
|
|
|
|
Expr primIsNull(EvalState & state, Expr arg);
|
|
|
|
|
2003-11-02 18:31:35 +02:00
|
|
|
|
2003-10-31 19:09:31 +02:00
|
|
|
#endif /* !__PRIMOPS_H */
|