summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-04-21 10:42:24 +0100
committerGuix Patches Tester <>2024-04-21 11:53:12 +0200
commit6c4d0c54ff88d67380e7a1cbbc8b9fcea4cd21e7 (patch)
treef345e82a7f5c164cef1ae4dbb3fd7dd72762cb29
parent04e1d526b396574568ca1f14b915070a934940a6 (diff)
downloadguix-patches-6c4d0c54ff88d67380e7a1cbbc8b9fcea4cd21e7.tar
guix-patches-6c4d0c54ff88d67380e7a1cbbc8b9fcea4cd21e7.tar.gz
store: Export protocol related constants.
* guix/store.scm (%protocol-version, %worker-magic-1, %worker-magic-2): Export variables. (protocol-major, protocol-minor, protocol-version): Export procedures. (%stderr-next, %stderr-read, %stderr-write, %stderr-last, %stderr-error): Move from process-stderr and export variables. Change-Id: Id0b1b5e6feeac5260875558f33aa5d923d5e0903
-rw-r--r--guix/store.scm26
1 files changed, 13 insertions, 13 deletions
diff --git a/guix/store.scm b/guix/store.scm
index c3b58090e5..578e46507e 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -206,18 +206,25 @@
derivation-log-file
log-file))
-(define %protocol-version #x164)
+(define-public %protocol-version #x164)
-(define %worker-magic-1 #x6e697863) ; "nixc"
-(define %worker-magic-2 #x6478696f) ; "dxio"
+(define-public %worker-magic-1 #x6e697863) ; "nixc"
+(define-public %worker-magic-2 #x6478696f) ; "dxio"
-(define (protocol-major magic)
+(define-public (protocol-major magic)
(logand magic #xff00))
-(define (protocol-minor magic)
+(define-public (protocol-minor magic)
(logand magic #x00ff))
-(define (protocol-version major minor)
+(define-public (protocol-version major minor)
(logior major minor))
+;; magic cookies from worker-protocol.hh
+(define-public %stderr-next #x6f6c6d67) ; "olmg", build log
+(define-public %stderr-read #x64617461) ; "data", data needed from source
+(define-public %stderr-write #x64617416) ; "dat\x16", data for sink
+(define-public %stderr-last #x616c7473) ; "alts", we're done
+(define-public %stderr-error #x63787470) ; "cxtp", error reporting
+
(define-syntax define-enumerate-type
(syntax-rules ()
((_ name->int (name id) ...)
@@ -709,13 +716,6 @@ encoding conversion errors."
(define p
(store-connection-socket server))
- ;; magic cookies from worker-protocol.hh
- (define %stderr-next #x6f6c6d67) ; "olmg", build log
- (define %stderr-read #x64617461) ; "data", data needed from source
- (define %stderr-write #x64617416) ; "dat\x16", data for sink
- (define %stderr-last #x616c7473) ; "alts", we're done
- (define %stderr-error #x63787470) ; "cxtp", error reporting
-
(let ((k (read-int p)))
(cond ((= k %stderr-write)
;; Write a byte stream to USER-PORT.