worker-protocol.hh 1.5 KB

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