From 2dcf7d9fecb776290b33c35f80857986ff3e7f21 Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周三, 13 3月 2013 01:42:25 +0800 Subject: [PATCH] Convert pattern matching functions to NFA --- libscpi/src/utils.h | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libscpi/src/utils.h b/libscpi/src/utils.h index 7429246..37e4a7e 100644 --- a/libscpi/src/utils.h +++ b/libscpi/src/utils.h @@ -52,12 +52,15 @@ size_t doubleToStr(double val, char * str, size_t len) LOCAL; size_t strToLong(const char * str, int32_t * val) LOCAL; size_t strToDouble(const char * str, double * val) LOCAL; - bool_t locateText(const char * str1, size_t len1, char ** str2, size_t * len2) LOCAL; - bool_t locateStr(const char * str1, size_t len1, char ** str2, size_t * len2) LOCAL; + bool_t locateText(const char * str1, size_t len1, const char ** str2, size_t * len2) LOCAL; + 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; bool_t matchPattern(const char * pattern, size_t pattern_len, const char * str, size_t str_len) LOCAL; +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#define max(a, b) (((a) > (b)) ? (a) : (b)) +#if 0 #define max(a,b) \ ({ __typeof__ (a) _a = (a); \ __typeof__ (b) _b = (b); \ @@ -68,6 +71,8 @@ __typeof__ (b) _b = (b); \ _a < _b ? _a : _b; }) +#endif + #ifdef __cplusplus } #endif -- Gitblit v1.9.1