From c81d00810317502a7a97a2ee466dad00afb29955 Mon Sep 17 00:00:00 2001
From: Iztok Jeras <iztok.jeras@redpitaya.com>
Date: 摹曛, 08 10月 2015 03:00:33 +0800
Subject: [PATCH] integer parser: fixed buffer size for 64bit integers

---
 libscpi/src/utils_private.h |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/libscpi/src/utils_private.h b/libscpi/src/utils_private.h
index b90f08f..5e91276 100644
--- a/libscpi/src/utils_private.h
+++ b/libscpi/src/utils_private.h
@@ -53,14 +53,17 @@
 
     char * strnpbrk(const char *str, size_t size, const char *set) LOCAL;
     scpi_bool_t compareStr(const char * str1, size_t len1, const char * str2, size_t len2) LOCAL;
-    scpi_bool_t compareStrAndNum(const char * str1, size_t len1, const char * str2, size_t len2) LOCAL;    
-    size_t strToLong(const char * str, int32_t * val, int8_t base) LOCAL;
+    scpi_bool_t compareStrAndNum(const char * str1, size_t len1, const char * str2, size_t len2, int32_t * num) LOCAL;
+    size_t strToInt32(const char * str, int32_t * val, int8_t base) LOCAL;
+    size_t strToUInt32(const char * str, uint32_t * val, int8_t base) LOCAL;
+    size_t strToInt64(const char * str, int64_t * val, int8_t base) LOCAL;
+    size_t strToUInt64(const char * str, uint64_t * val, int8_t base) LOCAL;
     size_t strToDouble(const char * str, double * val) LOCAL;
     scpi_bool_t locateText(const char * str1, size_t len1, const char ** str2, size_t * len2) LOCAL;
     scpi_bool_t locateStr(const char * str1, size_t len1, const char ** str2, size_t * len2) LOCAL;
     size_t skipWhitespace(const char * cmd, size_t len) LOCAL;
-    scpi_bool_t matchPattern(const char * pattern, size_t pattern_len, const char * str, size_t str_len) LOCAL;
-    scpi_bool_t matchCommand(const char * pattern, const char * cmd, size_t len) LOCAL;
+    scpi_bool_t matchPattern(const char * pattern, size_t pattern_len, const char * str, size_t str_len, int32_t * num) LOCAL;
+    scpi_bool_t matchCommand(const char * pattern, const char * cmd, size_t len, int32_t *numbers, size_t numbers_len, int32_t default_value) LOCAL;
     scpi_bool_t composeCompoundCommand(const scpi_token_t * prev, scpi_token_t * current) LOCAL;
 
 #if !HAVE_STRNLEN

--
Gitblit v1.9.1