redefined ase_ccls_t

This commit is contained in:
hyung-hwan 2008-09-30 04:26:26 +00:00
parent febbaadc31
commit 6e8b4e6bf0
5 changed files with 63 additions and 41 deletions

View File

@ -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} * {License}
*/ */
@ -52,17 +52,17 @@ public:
enum ccls_type_t enum ccls_type_t
{ {
CCLS_UPPER, CCLS_UPPER = ASE_CCLS_UPPER,
CCLS_LOWER, CCLS_LOWER = ASE_CCLS_LOWER,
CCLS_ALPHA, CCLS_ALPHA = ASE_CCLS_ALPHA,
CCLS_DIGIT, CCLS_DIGIT = ASE_CCLS_DIGIT,
CCLS_XDIGIT, CCLS_XDIGIT = ASE_CCLS_XDIGIT,
CCLS_ALNUM, CCLS_ALNUM = ASE_CCLS_ALNUM,
CCLS_SPACE, CCLS_SPACE = ASE_CCLS_SPACE,
CCLS_PRINT, CCLS_PRINT = ASE_CCLS_PRINT,
CCLS_GRAPH, CCLS_GRAPH = ASE_CCLS_GRAPH,
CCLS_CNTRL, CCLS_CNTRL = ASE_CCLS_CNTRL,
CCLS_PUNCT CCLS_PUNCT = ASE_CCLS_PUNCT
}; };
/** /**
@ -1072,8 +1072,8 @@ protected:
static void* reallocMem (void* data, void* ptr, size_t n); static void* reallocMem (void* data, void* ptr, size_t n);
static void freeMem (void* data, void* ptr); static void freeMem (void* data, void* ptr);
static bool_t isType (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, int 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 real_t pow (void* data, real_t x, real_t y);
static int sprintf (void* data, char_t* buf, size_t size, static int sprintf (void* data, char_t* buf, size_t size,

View File

@ -14,21 +14,6 @@
/* sets a pointer to the default memory manager */ /* sets a pointer to the default memory manager */
#define ASE_CCLS_SETDFL(m) ((ase_ccls)=(m)) #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_IS(ccls,c,type) ((ccls)->is((ccls)->data,c,type))
#define ASE_CCLS_TO(ccls,c,type) ((ccls)->to((ccls)->data,c,type)) #define ASE_CCLS_TO(ccls,c,type) ((ccls)->to((ccls)->data,c,type))

View File

@ -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} * {License}
*/ */
@ -38,8 +38,8 @@
#define ASE_DEAD -1 #define ASE_DEAD -1
#defien AES_MCHAR_EOF ((ase_mcint_t)-1) #define AES_MCHAR_EOF ((ase_mcint_t)-1)
#defien AES_WCHAR_EOF ((ase_wcint_t)-1) #define AES_WCHAR_EOF ((ase_wcint_t)-1)
#define ASE_CHAR_EOF ((ase_cint_t)-1) #define ASE_CHAR_EOF ((ase_cint_t)-1)
#define ASE_SIZEOF(n) (sizeof(n)) #define ASE_SIZEOF(n) (sizeof(n))

View File

@ -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} * {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 * 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))) #if defined(__cplusplus) && (!defined(_MSC_VER) || (defined(_MSC_VER)&&defined(_NATIVE_WCHAR_T_DEFINED)))
/* C++ */ /* 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 struct ase_mmgr_t
{ {
ase_alloc_t alloc; ase_alloc_t alloc;
@ -383,12 +388,44 @@ struct ase_mmgr_t
ase_free_t free; ase_free_t free;
void* data; 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 struct ase_ccls_t
{ {
ase_bool_t (*is) (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, int type); ase_cint_t (*to) (void* data, ase_cint_t c, ase_ccls_type_t type);
void* data; void* data;
}; };
/******/
#endif #endif

View File

@ -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} * {License}
*/ */
@ -1752,14 +1752,14 @@ void Awk::freeMem (void* data, void* ptr)
((Awk*)data)->freeMem (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) Awk::real_t Awk::pow (void* data, real_t x, real_t y)