From cf227ffc2aefbfd2023653e88a06ce951d8965ef Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 13 Oct 2015 21:37:11 -0500 Subject: [PATCH] gril: Remove unused function --- gril/grilutil.c | 79 ------------------------------------------------- gril/grilutil.h | 3 -- 2 files changed, 82 deletions(-) diff --git a/gril/grilutil.c b/gril/grilutil.c index ce51e0a0..18cffffc 100644 --- a/gril/grilutil.c +++ b/gril/grilutil.c @@ -661,85 +661,6 @@ const char *ril_pdp_fail_to_string(int status) } } -void g_ril_util_debug_chat(gboolean in, const char *str, gsize len, - GRilDebugFunc debugf, gpointer user_data) -{ - char type = in ? '<' : '>'; - gsize escaped = 2; /* Enough for '<', ' ' */ - char *escaped_str; - const char *esc = ""; - gsize esc_size = strlen(esc); - const char *ctrlz = ""; - gsize ctrlz_size = strlen(ctrlz); - gsize i; - - if (debugf == NULL || !len) - return; - - for (i = 0; i < len; i++) { - char c = str[i]; - - if (g_ascii_isprint(c)) - escaped += 1; - else if (c == '\r' || c == '\t' || c == '\n') - escaped += 2; - else if (c == 26) - escaped += ctrlz_size; - else if (c == 25) - escaped += esc_size; - else - escaped += 4; - } - - escaped_str = g_try_malloc(escaped + 1); - if (escaped_str == NULL) - return; - - escaped_str[0] = type; - escaped_str[1] = ' '; - escaped_str[2] = '\0'; - escaped_str[escaped] = '\0'; - - for (escaped = 2, i = 0; i < len; i++) { - unsigned char c = str[i]; - - switch (c) { - case '\r': - escaped_str[escaped++] = '\\'; - escaped_str[escaped++] = 'r'; - break; - case '\t': - escaped_str[escaped++] = '\\'; - escaped_str[escaped++] = 't'; - break; - case '\n': - escaped_str[escaped++] = '\\'; - escaped_str[escaped++] = 'n'; - break; - case 26: - strncpy(&escaped_str[escaped], ctrlz, ctrlz_size); - escaped += ctrlz_size; - break; - case 25: - strncpy(&escaped_str[escaped], esc, esc_size); - escaped += esc_size; - break; - default: - if (g_ascii_isprint(c)) - escaped_str[escaped++] = c; - else { - escaped_str[escaped++] = '\\'; - escaped_str[escaped++] = '0' + ((c >> 6) & 07); - escaped_str[escaped++] = '0' + ((c >> 3) & 07); - escaped_str[escaped++] = '0' + (c & 07); - } - } - } - - debugf(escaped_str, user_data); - g_free(escaped_str); -} - void g_ril_util_debug_dump(gboolean in, const unsigned char *buf, gsize len, GRilDebugFunc debugf, gpointer user_data) { diff --git a/gril/grilutil.h b/gril/grilutil.h index be59366f..f216949f 100644 --- a/gril/grilutil.h +++ b/gril/grilutil.h @@ -45,9 +45,6 @@ const char *ril_request_id_to_string(int req); const char *ril_unsol_request_to_string(int request); const char *ril_pdp_fail_to_string(int status); -void g_ril_util_debug_chat(gboolean in, const char *str, gsize len, - GRilDebugFunc debugf, gpointer user_data); - void g_ril_util_debug_dump(gboolean in, const unsigned char *buf, gsize len, GRilDebugFunc debugf, gpointer user_data);