* Started implementing the new evaluation model.
* Lots of refactorings. * Unit tests.
This commit is contained in:
		
							parent
							
								
									b9f09b3268
								
							
						
					
					
						commit
						822794001c
					
				
					 15 changed files with 742 additions and 202 deletions
				
			
		
							
								
								
									
										60
									
								
								src/globals.hh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								src/globals.hh
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,60 @@ | |||
| #ifndef __GLOBALS_H | ||||
| #define __GLOBALS_H | ||||
| 
 | ||||
| #include <string> | ||||
| 
 | ||||
| using namespace std; | ||||
| 
 | ||||
| 
 | ||||
| /* Database names. */ | ||||
| 
 | ||||
| /* dbRefs :: Hash -> FileName
 | ||||
| 
 | ||||
|    Maintains a mapping from hashes to filenames within the NixValues | ||||
|    directory.  This mapping is for performance only; it can be | ||||
|    reconstructed unambiguously.  The reason is that names in this | ||||
|    directory are not printed hashes but also might carry some | ||||
|    descriptive element (e.g., "aterm-2.0-ae749a...").  Without this | ||||
|    mapping, looking up a value would take O(n) time because we would | ||||
|    need to read the entire directory. */ | ||||
| extern string dbRefs; | ||||
| 
 | ||||
| /* dbNFs :: Hash -> Hash
 | ||||
| 
 | ||||
|    Each pair (h1, h2) in this mapping records the fact that the value | ||||
|    referenced by h2 is a normal form obtained by evaluating the value | ||||
|    referenced by value h1. | ||||
| */ | ||||
| extern string dbNFs; | ||||
| 
 | ||||
| /* dbNetSources :: Hash -> URL
 | ||||
| 
 | ||||
|    Each pair (hash, url) in this mapping states that the value | ||||
|    identified by hash can be obtained by fetching the value pointed | ||||
|    to by url. | ||||
| 
 | ||||
|    TODO: this should be Hash -> [URL] | ||||
| 
 | ||||
|    TODO: factor this out into a separate tool? */ | ||||
| extern string dbNetSources; | ||||
| 
 | ||||
| 
 | ||||
| /* Path names. */ | ||||
| 
 | ||||
| /* nixValues is the directory where all Nix values (both files and
 | ||||
|    directories, and both normal and non-normal forms) live. */ | ||||
| extern string nixValues; | ||||
| 
 | ||||
| /* nixLogDir is the directory where we log evaluations. */  | ||||
| extern string nixLogDir; | ||||
| 
 | ||||
| /* nixDB is the file name of the Berkeley DB database where we
 | ||||
|    maintain the dbXXX mappings. */ | ||||
| extern string nixDB; | ||||
| 
 | ||||
| 
 | ||||
| /* Initialize the databases. */ | ||||
| void initDB(); | ||||
| 
 | ||||
| 
 | ||||
| #endif /* !__GLOBALS_H */ | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue