aboutsummaryrefslogtreecommitdiff
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.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libmm-glib/mm-common-helpers.c b/libmm-glib/mm-common-helpers.c
index cdb9115c..8e0fc601 100644
--- a/libmm-glib/mm-common-helpers.c
+++ b/libmm-glib/mm-common-helpers.c
@@ -1492,6 +1492,31 @@ mm_get_u64_from_match_info (GMatchInfo *match_info,
}
gboolean
+mm_get_uint_from_hex_match_info (GMatchInfo *match_info,
+ guint32 match_index,
+ guint *out)
+{
+ guint64 num;
+
+ if (!mm_get_u64_from_hex_match_info (match_info, match_index, &num) || num > G_MAXUINT)
+ return FALSE;
+
+ *out = (guint)num;
+ return TRUE;
+}
+
+gboolean
+mm_get_u64_from_hex_match_info (GMatchInfo *match_info,
+ guint32 match_index,
+ guint64 *out)
+{
+ g_autofree gchar *s = NULL;
+
+ s = mm_get_string_unquoted_from_match_info (match_info, match_index);
+ return (s ? mm_get_u64_from_hex_str (s, out) : FALSE);
+}
+
+gboolean
mm_get_double_from_str (const gchar *str,
gdouble *out)
{