From 6e73d8531ba409e513c2d491d473a7b593614733 Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周日, 19 4月 2015 05:31:39 +0800 Subject: [PATCH] Remove generationg .so and update makefiles --- libscpi/src/parser.c | 27 +++++++++++++-------------- 1 files changed, 13 insertions(+), 14 deletions(-) diff --git a/libscpi/src/parser.c b/libscpi/src/parser.c index d7f5eee..80a4a00 100644 --- a/libscpi/src/parser.c +++ b/libscpi/src/parser.c @@ -75,7 +75,7 @@ */ static size_t writeDelimiter(scpi_t * context) { if (context->output_count > 0) { - return writeData(context, ",", 2); + return writeData(context, ",", 1); } else { return 0; } @@ -258,15 +258,16 @@ while (1) { cmdlen = scpiParser_detectProgramMessageUnit(&context->parser_state, context->buffer.data + totcmdlen, context->buffer.position - totcmdlen); totcmdlen += cmdlen; - if (context->parser_state.termination == SCPI_MESSAGE_TERMINATION_NL) break; - if (context->parser_state.programHeader.type == SCPI_TOKEN_UNKNOWN) break; - if (totcmdlen >= context->buffer.position) break; - } - if (context->parser_state.termination == SCPI_MESSAGE_TERMINATION_NL) { - result = SCPI_Parse(context, context->buffer.data, totcmdlen); - memmove(context->buffer.data, context->buffer.data + totcmdlen, context->buffer.position - totcmdlen); - context->buffer.position -= totcmdlen; + if (context->parser_state.termination == SCPI_MESSAGE_TERMINATION_NL) { + result = SCPI_Parse(context, context->buffer.data, totcmdlen); + memmove(context->buffer.data, context->buffer.data + totcmdlen, context->buffer.position - totcmdlen); + context->buffer.position -= totcmdlen; + totcmdlen = 0; + } else { + if (context->parser_state.programHeader.type == SCPI_TOKEN_UNKNOWN) break; + if (totcmdlen >= context->buffer.position) break; + } } } @@ -1008,11 +1009,9 @@ } } - - - - - +scpi_bool_t SCPI_Match(const char * pattern, const char * value, size_t len) { + return matchCommand (pattern, value, len); +} -- Gitblit v1.9.1