>From 588126076e1fc10f57b75afe734d51046ab46d6d Mon Sep 17 00:00:00 2001 From: Zhenhua Zhang Date: Wed, 17 Mar 2010 16:36:22 +0800 Subject: [PATCH] Remove old server_parse_line --- gatchat/gatserver.c | 49 ------------------------------------------------- 1 files changed, 0 insertions(+), 49 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 079451f..7577de2 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -173,57 +173,8 @@ static void g_at_server_send_result(GAtServer *server, GAtServerResult result) send_common(server, buf, MIN(len, sizeof(buf)-1)); } -static inline gboolean is_at_command_prefix(const char c) -{ - switch (c) { - case '+': - case '*': - case '!': - case '%': - return TRUE; - default: - return FALSE; - } -} - -static void parse_at_command(GAtServer *server, char *buf) -{ - g_at_server_send_result(server, G_AT_SERVER_RESULT_ERROR); -} - -static void parse_v250_settings(GAtServer *server, char *buf) -{ - g_at_server_send_result(server, G_AT_SERVER_RESULT_ERROR); -} - static void server_parse_line(GAtServer *server, char *line) { - gsize i = 0; - char c; - - if (line == NULL) { - g_at_server_send_result(server, G_AT_SERVER_RESULT_ERROR); - goto done; - } - - if (line[0] == '\0') { - g_at_server_send_result(server, G_AT_SERVER_RESULT_OK); - goto done; - } - - c = line[i]; - /* skip semicolon */ - if (c == ';') - c = line[++i]; - - if (is_at_command_prefix(c) || c == 'A' || c == 'D' || c == 'H') - parse_at_command(server, line + i); - else if (g_ascii_isalpha(c) || c == '&') - parse_v250_settings(server, line + i); - else - g_at_server_send_result(server, G_AT_SERVER_RESULT_ERROR); - -done: g_free(line); } -- 1.6.6.1