| 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 0x164
|
| 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 | wopSubstituteURLs = 81
|
| 49 | } WorkerOp;
|
| 50 |
|
| 51 |
|
| 52 | #define STDERR_NEXT 0x6f6c6d67
|
| 53 | #define STDERR_READ 0x64617461
|
| 54 | #define STDERR_WRITE 0x64617416
|
| 55 | #define STDERR_LAST 0x616c7473
|
| 56 | #define STDERR_ERROR 0x63787470
|
| 57 |
|
| 58 |
|
| 59 | Path readStorePath(Source & from);
|
| 60 | template<class T> T readStorePaths(Source & from);
|
| 61 |
|
| 62 | Path readStorePathStrict(Source & from);
|
| 63 | template<class T> T readStorePathsStrict(Source & from);
|
| 64 |
|
| 65 |
|
| 66 | }
|