about summary refs log tree commit diff
path: root/src/fix-ng/primops.hh
blob: e48883b0bb01c271d55e3861ca1fd9a019553798 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#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);


/* Construct (as a unobservable) side effect) a Nix derivation
   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);


/* 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);


#endif /* !__PRIMOPS_H */