diff options
Diffstat (limited to 'src/util/mq.c')
-rw-r--r-- | src/util/mq.c | 24 |
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 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | */ | 17 | */ |
@@ -1270,5 +1270,27 @@ GNUNET_MQ_count_handlers (const struct GNUNET_MQ_MessageHandler *handlers) | |||
1270 | } | 1270 | } |
1271 | 1271 | ||
1272 | 1272 | ||
1273 | /** | ||
1274 | * Convert an `enum GNUNET_MQ_PreferenceType` to a string | ||
1275 | * | ||
1276 | * @param type the preference type | ||
1277 | * @return a string or NULL if invalid | ||
1278 | */ | ||
1279 | const char * | ||
1280 | GNUNET_MQ_preference_to_string (enum GNUNET_MQ_PreferenceKind type) | ||
1281 | { | ||
1282 | switch (type) { | ||
1283 | case GNUNET_MQ_PREFERENCE_NONE: | ||
1284 | return "NONE"; | ||
1285 | case GNUNET_MQ_PREFERENCE_BANDWIDTH: | ||
1286 | return "BANDWIDTH"; | ||
1287 | case GNUNET_MQ_PREFERENCE_LATENCY: | ||
1288 | return "LATENCY"; | ||
1289 | case GNUNET_MQ_PREFERENCE_RELIABILITY: | ||
1290 | return "RELIABILITY"; | ||
1291 | }; | ||
1292 | return NULL; | ||
1293 | } | ||
1294 | |||
1273 | 1295 | ||
1274 | /* end of mq.c */ | 1296 | /* end of mq.c */ |