LTP GCOV extension - code coverage report
Current view: directory - src/libstore - derivations.hh
Test: app.info
Date: 2006-10-11 Instrumented lines: 6
Code covered: 100.0 % Executed lines: 6

       1                 : #ifndef __DERIVATIONS_H
       2                 : #define __DERIVATIONS_H
       3                 : 
       4                 : typedef struct _ATerm * ATerm;
       5                 : 
       6                 : #include "hash.hh"
       7                 : 
       8                 : #include <map>
       9                 : 
      10                 : 
      11                 : namespace nix {
      12                 : 
      13                 : 
      14                 : /* Extension of derivations in the Nix store. */
      15            2752 : const string drvExtension = ".drv";
      16                 : 
      17                 : 
      18                 : /* Abstract syntax of derivations. */
      19                 : 
      20                 : struct DerivationOutput
      21                 : {
      22                 :     Path path;
      23                 :     string hashAlgo; /* hash used for expected hash computation */
      24                 :     string hash; /* expected hash, may be null */
      25                 :     DerivationOutput()
      26             946 :     {
      27                 :     }
      28                 :     DerivationOutput(Path path, string hashAlgo, string hash)
      29             348 :     {
      30             174 :         this->path = path;
      31             174 :         this->hashAlgo = hashAlgo;
      32             174 :         this->hash = hash;
      33                 :     }
      34                 : };
      35                 : 
      36                 : typedef std::map<string, DerivationOutput> DerivationOutputs;
      37                 : 
      38                 : /* For inputs that are sub-derivations, we specify exactly which
      39                 :    output IDs we are interested in. */
      40                 : typedef std::map<Path, StringSet> DerivationInputs;
      41                 : 
      42                 : typedef std::map<string, string> StringPairs;
      43                 : 
      44                 : struct Derivation
      45                 : {
      46                 :     DerivationOutputs outputs; /* keyed on symbolic IDs */
      47                 :     DerivationInputs inputDrvs; /* inputs that are sub-derivations */
      48                 :     PathSet inputSrcs; /* inputs that are sources */
      49                 :     string platform;
      50                 :     Path builder;
      51                 :     Strings args;
      52                 :     StringPairs env;
      53                 : };
      54                 : 
      55                 : 
      56                 : /* Hash an aterm. */
      57                 : Hash hashTerm(ATerm t);
      58                 : 
      59                 : /* Write a derivation to the Nix store, and return its path. */
      60                 : Path writeDerivation(const Derivation & drv, const string & name);
      61                 : 
      62                 : /* Parse a derivation. */
      63                 : Derivation parseDerivation(ATerm t);
      64                 : 
      65                 : /* Parse a derivation. */
      66                 : ATerm unparseDerivation(const Derivation & drv);
      67                 : 
      68                 : /* Check whether a file name ends with the extensions for
      69                 :    derivations. */
      70                 : bool isDerivation(const string & fileName);
      71                 : 
      72                 :  
      73                 : }
      74                 : 
      75                 : 
      76                 : #endif /* !__DERIVATIONS_H */

Generated by: LTP GCOV extension version 1.1