This commit is contained in:
2008-08-21 03:58:42 +00:00
parent 89b9bf7296
commit 01dd1ad765
6 changed files with 52 additions and 28 deletions

View File

@ -13,6 +13,7 @@
static ase_bool_t ccls_is (void* data, ase_cint_t c, ase_ccls_type_t type)
{
/* TODO: use GetStringTypeW/A for WIN32 to implement these */
#error NOT IMPLEMENTED YET.
}
static ase_cint_t ccls_to (void* data, ase_cint_t c, in type)
@ -29,40 +30,63 @@ static ase_cint_t ccls_to (void* data, ase_cint_t c, in type)
#include <wctype.h>
static ase_bool_t ccls_is (void* data, ase_cint_t c, ase_ccls_type_t type)
static ase_bool_t ccls_is (void* data, ase_cint_t c, int type)
{
static const char* name[] =
{
"upper",
"lower",
"alpha",
"digit",
"xdigit",
"alnum",
"space",
"print",
"graph",
"cntrl",
"punct"
};
static wctype_t desc[] =
{
wctype("upper"),
wctype("lower"),
wctype("alpha"),
wctype("digit"),
wctype("xdigit"),
wctype("alnum"),
wctype("space"),
wctype("print"),
wctype("graph"),
wctype("cntrl"),
wctype("punct")
(wctype_t)0,
(wctype_t)0,
(wctype_t)0,
(wctype_t)0,
(wctype_t)0,
(wctype_t)0,
(wctype_t)0,
(wctype_t)0,
(wctype_t)0,
(wctype_t)0,
(wctype_t)0
};
ASE_ASSERTX (type >= ASE_CCLS_UPPER && type <= ASE_CCLS_PUNCT,
"The character type should be one of ase_ccls_type_t values");
if (desc[type] == (wctype_t)0) desc[type] = wctype(name[type]);
return iswctype (c, desc[type]);
}
static ase_cint_t ccls_to (void* data, ase_cint_t c, in type)
static ase_cint_t ccls_to (void* data, ase_cint_t c, int type)
{
static wctype_t desc[] =
static const char* name[] =
{
wctrans("toupper"),
wctrans("tolower")
"upper",
"lower"
};
static wctrans_t desc[] =
{
(wctrans_t)0,
(wctrans_t)0
};
ASE_ASSERTX (type >= ASE_CCLS_UPPER && type <= ASE_CCLS_LOWER,
"The character type should be one of ASE_CCLS_UPPER and ASE_CCLS_LOWER");
if (desc[type] == (wctrans_t)0) desc[type] = wctrans(name[type]);
return towctrans (c, desc[type]);
}

View File

@ -29,7 +29,7 @@ ase_dll_t* ase_dll_open (
if (mmgr == ASE_NULL) return ASE_NULL;
}
dll = ASE_MALLOC (mmgr, ASE_SIZEOF(ase_dll_t) + extension);
dll = ASE_MMGR_ALLOC (mmgr, ASE_SIZEOF(ase_dll_t) + extension);
if (dll == ASE_NULL) return ASE_NULL;
ASE_MEMSET (dll, 0, ASE_SIZEOF(ase_dll_t) + extension);

View File

@ -29,7 +29,7 @@ ase_sll_t* ase_sll_open (
if (mmgr == ASE_NULL) return ASE_NULL;
}
sll = ASE_MALLOC (mmgr, ASE_SIZEOF(ase_sll_t) + extension);
sll = ASE_MMGR_ALLOC (mmgr, ASE_SIZEOF(ase_sll_t) + extension);
if (sll == ASE_NULL) return ASE_NULL;
ASE_MEMSET (sll, 0, ASE_SIZEOF(ase_sll_t) + extension);