summaryrefslogtreecommitdiff
path: root/src/util/mq.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/mq.c')
-rw-r--r--src/util/mq.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/util/mq.c b/src/util/mq.c
index eaac85575..8bf1f9752 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -11,7 +11,7 @@
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -1270,5 +1270,27 @@ GNUNET_MQ_count_handlers (const struct GNUNET_MQ_MessageHandler *handlers)
}
+/**
+ * Convert an `enum GNUNET_MQ_PreferenceType` to a string
+ *
+ * @param type the preference type
+ * @return a string or NULL if invalid
+ */
+const char *
+GNUNET_MQ_preference_to_string (enum GNUNET_MQ_PreferenceKind type)
+{
+ switch (type) {
+ case GNUNET_MQ_PREFERENCE_NONE:
+ return "NONE";
+ case GNUNET_MQ_PREFERENCE_BANDWIDTH:
+ return "BANDWIDTH";
+ case GNUNET_MQ_PREFERENCE_LATENCY:
+ return "LATENCY";
+ case GNUNET_MQ_PREFERENCE_RELIABILITY:
+ return "RELIABILITY";
+ };
+ return NULL;
+}
+
/* end of mq.c */