From 2df8ee6c6f411e5fa0b774874e759c5e7b045121 Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周二, 27 11月 2012 19:52:23 +0800 Subject: [PATCH] Units parsing completition --- scpi/scpi_utils.h | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/scpi/scpi_utils.h b/scpi/scpi_utils.h index 348eeaf..521fe87 100644 --- a/scpi/scpi_utils.h +++ b/scpi/scpi_utils.h @@ -50,8 +50,21 @@ size_t doubleToStr(double val, char * str, size_t len); size_t strToLong(const char * str, int32_t * val); size_t strToDouble(const char * str, double * val); + bool_t locateText(const char * str1, size_t len1, char ** str2, size_t * len2); bool_t locateStr(const char * str1, size_t len1, char ** str2, size_t * len2); size_t skipWhitespace(const char * cmd, size_t len); + bool_t matchPattern(const char * pattern, size_t pattern_len, const char * str, size_t str_len); + + +#define max(a,b) \ + ({ __typeof__ (a) _a = (a); \ + __typeof__ (b) _b = (b); \ + _a > _b ? _a : _b; }) + +#define min(a,b) \ + ({ __typeof__ (a) _a = (a); \ + __typeof__ (b) _b = (b); \ + _a < _b ? _a : _b; }) #ifdef __cplusplus } -- Gitblit v1.9.1