gnu: guix: Update to 846403e.
[jackhill/guix/guix.git] / nix / libstore / worker-protocol.hh
1 #pragma once
2
3 namespace nix {
4
5
6 #define WORKER_MAGIC_1 0x6e697863
7 #define WORKER_MAGIC_2 0x6478696f
8
9 #define PROTOCOL_VERSION 0x163
10 #define GET_PROTOCOL_MAJOR(x) ((x) & 0xff00)
11 #define GET_PROTOCOL_MINOR(x) ((x) & 0x00ff)
12
13
14 typedef enum {
15 wopIsValidPath = 1,
16 wopHasSubstitutes = 3,
17 wopQueryPathHash = 4,
18 wopQueryReferences = 5,
19 wopQueryReferrers = 6,
20 wopAddToStore = 7,
21 wopAddTextToStore = 8,
22 wopBuildPaths = 9,
23 wopEnsurePath = 10,
24 wopAddTempRoot = 11,
25 wopAddIndirectRoot = 12,
26 wopSyncWithGC = 13,
27 wopFindRoots = 14,
28 wopExportPath = 16,
29 wopQueryDeriver = 18,
30 wopSetOptions = 19,
31 wopCollectGarbage = 20,
32 wopQuerySubstitutablePathInfo = 21,
33 wopQueryDerivationOutputs = 22,
34 wopQueryAllValidPaths = 23,
35 wopQueryFailedPaths = 24,
36 wopClearFailedPaths = 25,
37 wopQueryPathInfo = 26,
38 wopImportPaths = 27,
39 wopQueryDerivationOutputNames = 28,
40 wopQueryPathFromHashPart = 29,
41 wopQuerySubstitutablePathInfos = 30,
42 wopQueryValidPaths = 31,
43 wopQuerySubstitutablePaths = 32,
44 wopQueryValidDerivers = 33,
45 wopOptimiseStore = 34,
46 wopVerifyStore = 35,
47 wopBuiltinBuilders = 80
48 } WorkerOp;
49
50
51 #define STDERR_NEXT 0x6f6c6d67
52 #define STDERR_READ 0x64617461 // data needed from source
53 #define STDERR_WRITE 0x64617416 // data for sink
54 #define STDERR_LAST 0x616c7473
55 #define STDERR_ERROR 0x63787470
56
57
58 Path readStorePath(Source & from);
59 template<class T> T readStorePaths(Source & from);
60
61
62 }