From 0e73c5d7d6346a54f84f1e10471aa974f10752c5 Mon Sep 17 00:00:00 2001 From: "Michael J. Chudobiak" Date: Wed, 15 Aug 2012 17:58:49 -0400 Subject: regex unref error fixed; added diag:eprom:size --- parser.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'parser.c') diff --git a/parser.c b/parser.c index d6bcea5..e59cb23 100644 --- a/parser.c +++ b/parser.c @@ -32,12 +32,15 @@ static int Parser_find_commands(int commands[], int command_depth); static gchar* filter_input (gchar *raw_in); static int Parser_get_unit(char **parameter, char **units); static int Parser_channel (int *channel,int with_id_code,int routine_num); -static int Go_freq_32_33(gchar** response, int channel, char *parameter,char *units,int command_type); static int Handle_Units(float *mult,char *units, char *base); static int Is_Min_Command(char *text); static int Is_Max_Command(char *text); + +static int Go_freq_32_33(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_syst_err_11(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_syst_errcnt66(gchar** response, int channel, char *parameter,char *units,int command_type); +static int Go_eprom_siz_86(gchar** response, int channel, int command_type); + static int Parser_id_word(char *id_me, int *channel, int *with_id_code) { @@ -531,7 +534,7 @@ static gchar* filter_input (gchar *raw_in) // remove leading spaces, colons, semicolons GRegex *leading = g_regex_new ("^[\\s:;]*", 0, 0, NULL); gchar *step5 = g_regex_replace_literal (leading, step4, -1, 0, "", 0, NULL); - g_regex_unref (end_semi); + g_regex_unref (leading); g_free (step4); // last step may leave hanging whitespace at end @@ -730,7 +733,9 @@ void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer case 66: error_num=Go_syst_errcnt66(&response,channel,parameter,units,command_type); break; - + case 86: + error_num=Go_eprom_siz_86(&response,channel,command_type); + break; case 9999: // was only whitespace, ignore break; @@ -855,6 +860,20 @@ static int Go_freq_32_33(gchar** response, int channel, char *parameter,char *un } +static int Go_eprom_siz_86(gchar** response, int channel, int command_type) +{ + switch (command_type) { + case query_simple: + return query_int (response, sizeof(globals.Flash)); + break; + + default: + return SyntaxError; + break; + } +} + + static int Handle_Units(float *mult,char *units, char *in_base) { int len_base, len_all, pos; -- cgit