From 3f796fcf771107bd9f0823dcc96ac6dc0db37074 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 18 Dec 2012 13:13:40 +0000 Subject: - preference mgmt --- src/ats/ats_api_performance.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/ats/ats_api_performance.c') diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c index 5cb199266..25b492614 100644 --- a/src/ats/ats_api_performance.c +++ b/src/ats/ats_api_performance.c @@ -829,6 +829,22 @@ GNUNET_ATS_performance_list_addresses_cancel (struct GNUNET_ATS_AddressListHandl } +/** + * Convert a GNUNET_ATS_PreferenceType to a string + * + * @param type the preference type + * @return a string or NULL if invalid + */ +const char * +GNUNET_ATS_print_preference_type (uint32_t type) +{ + char *prefs[GNUNET_ATS_PreferenceCount] = GNUNET_ATS_PreferenceTypeString; + if (type < GNUNET_ATS_PreferenceCount) + return prefs[type]; + return NULL; +} + + /** * Change preferences for the given peer. Preference changes are forgotten if peers * disconnect. -- cgit v1.2.3