gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 01/05: mq/prio-prefs: New macro 'prio-prefs'.


From: gnunet
Subject: [gnunet-scheme] 01/05: mq/prio-prefs: New macro 'prio-prefs'.
Date: Mon, 07 Feb 2022 15:22:27 +0100

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit 4637a88058536b93c022ee65cf78db7c771c9469
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sun Feb 6 13:03:16 2022 +0000

    mq/prio-prefs: New macro 'prio-prefs'.
    
    * gnu/gnunet/mq/prio-prefs.scm (prio-prefs): Define it.
---
 gnu/gnunet/mq/prio-prefs.scm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gnu/gnunet/mq/prio-prefs.scm b/gnu/gnunet/mq/prio-prefs.scm
index a66300f..ced57d4 100644
--- a/gnu/gnunet/mq/prio-prefs.scm
+++ b/gnu/gnunet/mq/prio-prefs.scm
@@ -1,5 +1,5 @@
 ;; This file is part of scheme-GNUnet.
-;; Copyright (C) 2012-2016, 2021 GNUnet e.V.
+;; Copyright © 2012-2016, 2021-2022 GNUnet e.V.
 ;;
 ;; scheme-GNUnet is free software: you can redistribute it and/or modify it
 ;; under the terms of the GNU Affero General Public License as published
@@ -23,6 +23,7 @@
 ;; @brief General-purpose message queue (priorities, numeric)
 (library (gnu gnunet mq prio-prefs)
   (export priority-preference priority-preference?
+         prio-prefs
          PRIORITY_MASK
          prio-prefs->integer
          prio-pref:?
@@ -42,6 +43,14 @@ return its numeric value."
       (apply bitwise-ior
             (map (compose (cute expt 2 <>) value->index) values)))
 
+    (define-syntax prio-prefs
+      (syntax-rules ()
+       "Return the numeric value of the priority-preference flags
+@code{pref:x} @code{...}."
+       ((_ pref:x ...)
+        (prio-prefs->integer
+         (symbol-value priority-preference pref:x) ...))))
+
     (define (prio-pref:? integer flag)
       "Is the flag @var{flag} (an enum value) set in
 the integer @var{integer}?"

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]