From 6e8b4e6bf088399206ac38a46fcf186122c9d95d Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 30 Sep 2008 04:26:26 +0000 Subject: [PATCH] redefined ase_ccls_t --- ase/include/ase/awk/Awk.hpp | 28 +++++++++++------------ ase/include/ase/cmn/chr.h | 15 ------------- ase/include/ase/macros.h | 6 ++--- ase/include/ase/types.h | 45 +++++++++++++++++++++++++++++++++---- ase/lib/awk/Awk.cpp | 10 ++++----- 5 files changed, 63 insertions(+), 41 deletions(-) diff --git a/ase/include/ase/awk/Awk.hpp b/ase/include/ase/awk/Awk.hpp index 20bba860..d1f7a8af 100644 --- a/ase/include/ase/awk/Awk.hpp +++ b/ase/include/ase/awk/Awk.hpp @@ -1,5 +1,5 @@ /* - * $Id: Awk.hpp 391 2008-09-27 09:51:23Z baconevi $ + * $Id: Awk.hpp 399 2008-09-29 10:26:26Z baconevi $ * * {License} */ @@ -52,17 +52,17 @@ public: enum ccls_type_t { - CCLS_UPPER, - CCLS_LOWER, - CCLS_ALPHA, - CCLS_DIGIT, - CCLS_XDIGIT, - CCLS_ALNUM, - CCLS_SPACE, - CCLS_PRINT, - CCLS_GRAPH, - CCLS_CNTRL, - CCLS_PUNCT + CCLS_UPPER = ASE_CCLS_UPPER, + CCLS_LOWER = ASE_CCLS_LOWER, + CCLS_ALPHA = ASE_CCLS_ALPHA, + CCLS_DIGIT = ASE_CCLS_DIGIT, + CCLS_XDIGIT = ASE_CCLS_XDIGIT, + CCLS_ALNUM = ASE_CCLS_ALNUM, + CCLS_SPACE = ASE_CCLS_SPACE, + CCLS_PRINT = ASE_CCLS_PRINT, + CCLS_GRAPH = ASE_CCLS_GRAPH, + CCLS_CNTRL = ASE_CCLS_CNTRL, + CCLS_PUNCT = ASE_CCLS_PUNCT }; /** @@ -1072,8 +1072,8 @@ protected: static void* reallocMem (void* data, void* ptr, size_t n); static void freeMem (void* data, void* ptr); - static bool_t isType (void* data, cint_t c, int type); - static cint_t transCase (void* data, cint_t c, int type); + static bool_t isType (void* data, cint_t c, ase_ccls_type_t type); + static cint_t transCase (void* data, cint_t c, ase_ccls_type_t type); static real_t pow (void* data, real_t x, real_t y); static int sprintf (void* data, char_t* buf, size_t size, diff --git a/ase/include/ase/cmn/chr.h b/ase/include/ase/cmn/chr.h index 415edbed..18950376 100644 --- a/ase/include/ase/cmn/chr.h +++ b/ase/include/ase/cmn/chr.h @@ -14,21 +14,6 @@ /* sets a pointer to the default memory manager */ #define ASE_CCLS_SETDFL(m) ((ase_ccls)=(m)) -enum ase_ccls_type_t -{ - ASE_CCLS_UPPER, - ASE_CCLS_LOWER, - ASE_CCLS_ALPHA, - ASE_CCLS_DIGIT, - ASE_CCLS_XDIGIT, - ASE_CCLS_ALNUM, - ASE_CCLS_SPACE, - ASE_CCLS_PRINT, - ASE_CCLS_GRAPH, - ASE_CCLS_CNTRL, - ASE_CCLS_PUNCT -}; - #define ASE_CCLS_IS(ccls,c,type) ((ccls)->is((ccls)->data,c,type)) #define ASE_CCLS_TO(ccls,c,type) ((ccls)->to((ccls)->data,c,type)) diff --git a/ase/include/ase/macros.h b/ase/include/ase/macros.h index 8185ed2c..1cf02af1 100644 --- a/ase/include/ase/macros.h +++ b/ase/include/ase/macros.h @@ -1,5 +1,5 @@ /* - * $Id: macros.h 398 2008-09-29 10:01:15Z baconevi $ + * $Id: macros.h 399 2008-09-29 10:26:26Z baconevi $ * * {License} */ @@ -38,8 +38,8 @@ #define ASE_DEAD -1 -#defien AES_MCHAR_EOF ((ase_mcint_t)-1) -#defien AES_WCHAR_EOF ((ase_wcint_t)-1) +#define AES_MCHAR_EOF ((ase_mcint_t)-1) +#define AES_WCHAR_EOF ((ase_wcint_t)-1) #define ASE_CHAR_EOF ((ase_cint_t)-1) #define ASE_SIZEOF(n) (sizeof(n)) diff --git a/ase/include/ase/types.h b/ase/include/ase/types.h index 8b439632..563c21f2 100644 --- a/ase/include/ase/types.h +++ b/ase/include/ase/types.h @@ -1,5 +1,5 @@ /* - * $Id: types.h 398 2008-09-29 10:01:15Z baconevi $ + * $Id: types.h 399 2008-09-29 10:26:26Z baconevi $ * * {License} */ @@ -251,7 +251,6 @@ typedef int ase_mcint_t; * ase_wcint_t - define a type that can hold ase_wchar_t and ASE_WCHAR_EOF ****** */ -typedef char ase_mchar_t; #if defined(__cplusplus) && (!defined(_MSC_VER) || (defined(_MSC_VER)&&defined(_NATIVE_WCHAR_T_DEFINED))) /* C++ */ @@ -376,6 +375,12 @@ struct ase_cstr_t }; /******/ +/****t* ase/ase_mmgr_t + * NAME + * ase_mmgr_t - define a memory manager + * + * SYNOPSIS + */ struct ase_mmgr_t { ase_alloc_t alloc; @@ -383,12 +388,44 @@ struct ase_mmgr_t ase_free_t free; void* data; }; +/******/ +/****t* ase/ase_ccls_type_t + * NAME + * ase_ccls_type_t - define types of character class + * + * SYNOPSIS + */ +enum ase_ccls_type_t +{ + ASE_CCLS_UPPER, + ASE_CCLS_LOWER, + ASE_CCLS_ALPHA, + ASE_CCLS_DIGIT, + ASE_CCLS_XDIGIT, + ASE_CCLS_ALNUM, + ASE_CCLS_SPACE, + ASE_CCLS_PRINT, + ASE_CCLS_GRAPH, + ASE_CCLS_CNTRL, + ASE_CCLS_PUNCT +}; +/******/ + +typedef enum ase_ccls_type_t ase_ccls_type_t; + +/****t* ase/ase_ccls_t + * NAME + * ase_mmgr_t - define a character class handler + * + * SYNOPSIS + */ struct ase_ccls_t { - ase_bool_t (*is) (void* data, ase_cint_t c, int type); - ase_cint_t (*to) (void* data, ase_cint_t c, int type); + ase_bool_t (*is) (void* data, ase_cint_t c, ase_ccls_type_t type); + ase_cint_t (*to) (void* data, ase_cint_t c, ase_ccls_type_t type); void* data; }; +/******/ #endif diff --git a/ase/lib/awk/Awk.cpp b/ase/lib/awk/Awk.cpp index ae62b439..897b202f 100644 --- a/ase/lib/awk/Awk.cpp +++ b/ase/lib/awk/Awk.cpp @@ -1,5 +1,5 @@ /* - * $Id: Awk.cpp 391 2008-09-27 09:51:23Z baconevi $ + * $Id: Awk.cpp 399 2008-09-29 10:26:26Z baconevi $ * * {License} */ @@ -1752,14 +1752,14 @@ void Awk::freeMem (void* data, void* ptr) ((Awk*)data)->freeMem (ptr); } -Awk::bool_t Awk::isType (void* data, cint_t c, int type) +Awk::bool_t Awk::isType (void* data, cint_t c, ase_ccls_type_t type) { - return ((Awk*)data)->isType (c, (Awk::ccls_type_t)type); + return ((Awk*)data)->isType (c, (ccls_type_t)type); } -Awk::cint_t Awk::transCase (void* data, cint_t c, int type) +Awk::cint_t Awk::transCase (void* data, cint_t c, ase_ccls_type_t type) { - return ((Awk*)data)->transCase (c, (Awk::ccls_type_t)type); + return ((Awk*)data)->transCase (c, (ccls_type_t)type); } Awk::real_t Awk::pow (void* data, real_t x, real_t y)