From dd51f7a6aeb5b133dad32918c73c3e7583a96d97 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 5 Dec 2012 11:15:28 -0600 Subject: libmm-glib: document mm_get_uint_from_str() Unlike strtol/stroul, this function doesn't ignore leading or trailing non-digit characters, so document that restriction. --- libmm-glib/mm-common-helpers.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libmm-glib/mm-common-helpers.c b/libmm-glib/mm-common-helpers.c index 9cfb842e..3f100b68 100644 --- a/libmm-glib/mm-common-helpers.c +++ b/libmm-glib/mm-common-helpers.c @@ -700,6 +700,17 @@ mm_get_int_from_match_info (GMatchInfo *match_info, return ret; } +/** + * mm_get_uint_from_str: + * @str: the string to convert to an unsigned int + * @out: on success, the number + * + * Converts a string to an unsigned number. All characters in the string + * MUST be valid digits (0 - 9), otherwise FALSE is returned. + * + * Returns: %TRUE if the string was converted, %FALSE if it was not or if it + * did not contain only digits. + */ gboolean mm_get_uint_from_str (const gchar *str, guint *out) -- cgit v1.2.3