From 36f2d7dab1e65507841067073dd66d72b2dc663c Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周二, 04 12月 2012 17:24:30 +0800 Subject: [PATCH] Correct type refactoryng in README --- scpi/scpi_utils.h | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/scpi/scpi_utils.h b/scpi/scpi_utils.h index 348eeaf..7da171a 100644 --- a/scpi/scpi_utils.h +++ b/scpi/scpi_utils.h @@ -37,8 +37,8 @@ #ifndef SCPI_UTILS_H #define SCPI_UTILS_H -#include "scpi.h" #include <stdint.h> +#include "scpi_types.h" #ifdef __cplusplus extern "C" { @@ -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