summaryrefslogtreecommitdiff
path: root/libmm-glib/mm-common-helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmm-glib/mm-common-helpers.c')
-rw-r--r--libmm-glib/mm-common-helpers.c11
1 files changed, 11 insertions, 0 deletions
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)