From 1215bd6a9d607018e0af7ad7afa85bc35cb713a0 Mon Sep 17 00:00:00 2001 From: Tambet Ingo Date: Wed, 18 Feb 2009 14:48:08 +0200 Subject: Rework unsolicited message handling. Implement registration using unsolicited messages for generic GSM class (which is disabled by default, HSO and Huawei plugins enable it). Modify all GSM modem subclasses that used unsolicited messages to use the new method. --- src/mm-util.c | 57 --------------------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 src/mm-util.c (limited to 'src/mm-util.c') diff --git a/src/mm-util.c b/src/mm-util.c deleted file mode 100644 index 46badcf3..00000000 --- a/src/mm-util.c +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -#include "mm-util.h" - -static gboolean -remove_eval_cb (const GMatchInfo *match_info, - GString *result, - gpointer user_data) -{ - int *result_len = (int *) user_data; - int start; - int end; - - if (g_match_info_fetch_pos (match_info, 0, &start, &end)) - *result_len -= (end - start); - - return FALSE; -} - -void -mm_util_strip_string (GString *string, - GRegex *regex, - MMUtilStripFn callback, - gpointer user_data) -{ - GMatchInfo *match_info; - gboolean matches; - char *str; - - g_return_if_fail (string != NULL); - g_return_if_fail (regex != NULL); - - matches = g_regex_match_full (regex, string->str, string->len, 0, 0, &match_info, NULL); - if (callback) { - while (g_match_info_matches (match_info)) { - str = g_match_info_fetch (match_info, 1); - callback (str, user_data); - g_free (str); - - g_match_info_next (match_info, NULL); - } - } - - g_match_info_free (match_info); - - if (matches) { - /* Remove matches */ - int result_len = string->len; - - str = g_regex_replace_eval (regex, string->str, string->len, 0, 0, - remove_eval_cb, &result_len, NULL); - - g_string_truncate (string, 0); - g_string_append_len (string, str, result_len); - g_free (str); - } -} -- cgit v1.2.3-70-g09d2