This commit is contained in:
2008-08-21 04:58:19 +00:00
parent 6dbf01ade0
commit 713586d04a
14 changed files with 192 additions and 264 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.cpp 332 2008-08-18 11:21:48Z baconevi $
* $Id: Awk.cpp 341 2008-08-20 10:58:19Z baconevi $
*
* {License}
*/
@ -231,7 +231,7 @@ void Awk::Argument::clear ()
void* Awk::Argument::operator new (size_t n, awk_t* awk) throw ()
{
void* ptr = ase_awk_malloc (awk, ASE_SIZEOF(awk) + n);
void* ptr = ase_awk_alloc (awk, ASE_SIZEOF(awk) + n);
if (ptr == ASE_NULL) return ASE_NULL;
*(awk_t**)ptr = awk;
@ -240,7 +240,7 @@ void* Awk::Argument::operator new (size_t n, awk_t* awk) throw ()
void* Awk::Argument::operator new[] (size_t n, awk_t* awk) throw ()
{
void* ptr = ase_awk_malloc (awk, ASE_SIZEOF(awk) + n);
void* ptr = ase_awk_alloc (awk, ASE_SIZEOF(awk) + n);
if (ptr == ASE_NULL) return ASE_NULL;
*(awk_t**)ptr = awk;
@ -871,7 +871,7 @@ Awk::Run::Run (Awk* awk):
}
Awk::Run::Run (Awk* awk, run_t* run):
awk (awk), run (run), callbackFailed (false), custom (ASE_NULL)
awk (awk), run (run), callbackFailed (false), data (ASE_NULL)
{
ASE_ASSERT (this->run != ASE_NULL);
}
@ -1008,14 +1008,14 @@ int Awk::Run::getGlobal (int id, Argument& global) const
return global.init (ase_awk_getglobal(this->run,id));
}
void Awk::Run::setCustom (void* custom)
void Awk::Run::setCustom (void* data)
{
this->custom = custom;
this->data = data;
}
void* Awk::Run::getCustom () const
{
return this->custom;
return this->data;
}
//////////////////////////////////////////////////////////////////
@ -1029,24 +1029,13 @@ Awk::Awk (): awk (ASE_NULL), functionMap (ASE_NULL),
{
this->errmsg[0] = ASE_T('\0');
mmgr.malloc = allocMem;
mmgr.realloc = reallocMem;
mmgr.free = freeMem;
mmgr.data = this;
mmgr.alloc = allocMem;
mmgr.realloc = reallocMem;
mmgr.free = freeMem;
mmgr.data = this;
ccls.is_upper = isUpper;
ccls.is_lower = isLower;
ccls.is_alpha = isAlpha;
ccls.is_digit = isDigit;
ccls.is_xdigit = isXdigit;
ccls.is_alnum = isAlnum;
ccls.is_space = isSpace;
ccls.is_print = isPrint;
ccls.is_graph = isGraph;
ccls.is_cntrl = isCntrl;
ccls.is_punct = isPunct;
ccls.to_upper = toUpper;
ccls.to_lower = toLower;
ccls.is = isType;
ccls.to = transCase;
ccls.data = this;
prmfns.pow = pow;
@ -1326,7 +1315,7 @@ int Awk::run (const char_t* main, const char_t** args, size_t nargs)
if (nargs > 0)
{
runarg = (ase_awk_runarg_t*) ase_awk_malloc (
runarg = (ase_awk_runarg_t*) ase_awk_alloc (
awk, ASE_SIZEOF(ase_awk_runarg_t)*(nargs+1));
if (runarg == ASE_NULL)
@ -1453,7 +1442,7 @@ int Awk::addFunction (
ASE_ASSERT (awk != ASE_NULL);
FunctionHandler* tmp = (FunctionHandler*)
ase_awk_malloc (awk, ASE_SIZEOF(handler));
ase_awk_alloc (awk, ASE_SIZEOF(handler));
if (tmp == ASE_NULL)
{
setError (ERR_NOMEM);
@ -1677,9 +1666,9 @@ void Awk::freeFunctionMapValue (void* owner, void* value)
ase_awk_free (awk->awk, value);
}
void Awk::onRunStart (run_t* run, void* custom)
void Awk::onRunStart (run_t* run, void* data)
{
Run* r = (Run*)custom;
Run* r = (Run*)data;
// the actual run_t value for the run-time callback is set here.
// r here refers to runctx declared in Awk::run. As onRunStart
@ -1693,9 +1682,9 @@ void Awk::onRunStart (run_t* run, void* custom)
r->awk->triggerOnRunStart (*r);
}
void Awk::onRunEnd (run_t* run, int errnum, void* custom)
void Awk::onRunEnd (run_t* run, int errnum, void* data)
{
Run* r = (Run*)custom;
Run* r = (Run*)data;
if (errnum == ERR_NOERR && r->callbackFailed)
{
@ -1705,9 +1694,9 @@ void Awk::onRunEnd (run_t* run, int errnum, void* custom)
r->awk->onRunEnd (*r);
}
void Awk::onRunReturn (run_t* run, val_t* ret, void* custom)
void Awk::onRunReturn (run_t* run, val_t* ret, void* data)
{
Run* r = (Run*)custom;
Run* r = (Run*)data;
if (r->callbackFailed) return;
Argument x (r);
@ -1721,113 +1710,58 @@ void Awk::onRunReturn (run_t* run, val_t* ret, void* custom)
}
}
void Awk::onRunStatement (run_t* run, size_t line, void* custom)
void Awk::onRunStatement (run_t* run, size_t line, void* data)
{
Run* r = (Run*)custom;
Run* r = (Run*)data;
if (r->callbackFailed) return;
r->awk->onRunStatement (*r, line);
}
void* Awk::allocMem (void* custom, size_t n)
void* Awk::allocMem (void* data, size_t n)
{
return ((Awk*)custom)->allocMem (n);
return ((Awk*)data)->allocMem (n);
}
void* Awk::reallocMem (void* custom, void* ptr, size_t n)
void* Awk::reallocMem (void* data, void* ptr, size_t n)
{
return ((Awk*)custom)->reallocMem (ptr, n);
return ((Awk*)data)->reallocMem (ptr, n);
}
void Awk::freeMem (void* custom, void* ptr)
void Awk::freeMem (void* data, void* ptr)
{
((Awk*)custom)->freeMem (ptr);
((Awk*)data)->freeMem (ptr);
}
Awk::bool_t Awk::isUpper (void* custom, cint_t c)
{
return ((Awk*)custom)->isUpper (c);
}
Awk::bool_t Awk::isLower (void* custom, cint_t c)
{
return ((Awk*)custom)->isLower (c);
}
Awk::bool_t Awk::isAlpha (void* custom, cint_t c)
{
return ((Awk*)custom)->isAlpha (c);
}
Awk::bool_t Awk::isDigit (void* custom, cint_t c)
{
return ((Awk*)custom)->isDigit (c);
}
Awk::bool_t Awk::isXdigit (void* custom, cint_t c)
{
return ((Awk*)custom)->isXdigit (c);
}
Awk::bool_t Awk::isAlnum (void* custom, cint_t c)
{
return ((Awk*)custom)->isAlnum (c);
}
Awk::bool_t Awk::isSpace (void* custom, cint_t c)
{
return ((Awk*)custom)->isSpace (c);
}
Awk::bool_t Awk::isPrint (void* custom, cint_t c)
{
return ((Awk*)custom)->isPrint (c);
}
Awk::bool_t Awk::isGraph (void* custom, cint_t c)
Awk::bool_t Awk::isType (void* data, cint_t c, int type)
{
return ((Awk*)custom)->isGraph (c);
return ((Awk*)data)->isType (c, (Awk::ccls_type_t)type);
}
Awk::bool_t Awk::isCntrl (void* custom, cint_t c)
Awk::cint_t Awk::transCase (void* data, cint_t c, int type)
{
return ((Awk*)custom)->isCntrl (c);
return ((Awk*)data)->transCase (c, (Awk::ccls_type_t)type);
}
Awk::bool_t Awk::isPunct (void* custom, cint_t c)
Awk::real_t Awk::pow (void* data, real_t x, real_t y)
{
return ((Awk*)custom)->isPunct (c);
}
Awk::cint_t Awk::toUpper (void* custom, cint_t c)
{
return ((Awk*)custom)->toUpper (c);
}
Awk::cint_t Awk::toLower (void* custom, cint_t c)
{
return ((Awk*)custom)->toLower (c);
}
Awk::real_t Awk::pow (void* custom, real_t x, real_t y)
{
return ((Awk*)custom)->pow (x, y);
return ((Awk*)data)->pow (x, y);
}
int Awk::sprintf (void* custom, char_t* buf, size_t size,
int Awk::sprintf (void* data, char_t* buf, size_t size,
const char_t* fmt, ...)
{
va_list ap;
va_start (ap, fmt);
int n = ((Awk*)custom)->vsprintf (buf, size, fmt, ap);
int n = ((Awk*)data)->vsprintf (buf, size, fmt, ap);
va_end (ap);
return n;
}
void Awk::dprintf (void* custom, const char_t* fmt, ...)
void Awk::dprintf (void* data, const char_t* fmt, ...)
{
va_list ap;
va_start (ap, fmt);
((Awk*)custom)->vdprintf (fmt, ap);
((Awk*)data)->vdprintf (fmt, ap);
va_end (ap);
}

View File

@ -1,5 +1,5 @@
/*
* $Id: StdAwk.cpp 152 2008-03-21 11:57:29Z baconevi $
* $Id: StdAwk.cpp 341 2008-08-20 10:58:19Z baconevi $
*
* {License}
*/
@ -11,7 +11,6 @@
#include <ase/awk/StdAwk.hpp>
#include <ase/cmn/str.h>
#include <ase/utl/stdio.h>
#include <ase/utl/ctype.h>
#include <stdlib.h>
#include <math.h>
@ -218,7 +217,7 @@ int StdAwk::system (Run& run, Return& ret, const Argument* args, size_t nargs,
#elif defined(ASE_CHAR_IS_MCHAR)
return ret.set ((long_t)::system(ptr));
#else
char* mbs = (char*)ase_awk_malloc (awk, l*5+1);
char* mbs = (char*) ase_awk_alloc (awk, l*5+1);
if (mbs == ASE_NULL) return -1;
::size_t mbl = ::wcstombs (mbs, ptr, l*5);
@ -435,70 +434,15 @@ void StdAwk::freeMem (void* ptr)
::free (ptr);
}
// character class primitives
StdAwk::bool_t StdAwk::isUpper (cint_t c)
{
return ase_isupper (c);
}
StdAwk::bool_t StdAwk::isLower (cint_t c)
// character handling primitive
Awk::bool_t StdAwk::isType (cint_t c, ccls_type_t type)
{
return ase_islower (c);
return ase_ccls_is (c, type);
}
StdAwk::bool_t StdAwk::isAlpha (cint_t c)
{
return ase_isalpha (c);
}
StdAwk::bool_t StdAwk::isDigit (cint_t c)
Awk::cint_t StdAwk::transCase (cint_t c, ccls_type_t type)
{
return ase_isdigit (c);
}
StdAwk::bool_t StdAwk::isXdigit (cint_t c)
{
return ase_isxdigit (c);
}
StdAwk::bool_t StdAwk::isAlnum (cint_t c)
{
return ase_isalnum (c);
}
StdAwk::bool_t StdAwk::isSpace (cint_t c)
{
return ase_isspace (c);
}
StdAwk::bool_t StdAwk::isPrint (cint_t c)
{
return ase_isprint (c);
}
StdAwk::bool_t StdAwk::isGraph (cint_t c)
{
return ase_isgraph (c);
}
StdAwk::bool_t StdAwk::isCntrl (cint_t c)
{
return ase_iscntrl (c);
}
StdAwk::bool_t StdAwk::isPunct (cint_t c)
{
return ase_ispunct (c);
}
StdAwk::cint_t StdAwk::toUpper (cint_t c)
{
return ase_toupper (c);
}
StdAwk::cint_t StdAwk::toLower (cint_t c)
{
return ase_tolower (c);
return ase_ccls_to (c, type);
}
// miscellaneous primitive

View File

@ -4,7 +4,6 @@
#include "awk.h"
#include <ase/utl/stdio.h>
#include <ase/utl/helper.h>
#include <math.h>
typedef struct ext_t
@ -46,7 +45,7 @@ ase_awk_t* ase_awk_openstd (void)
ext_t* ext;
awk = ase_awk_open (ASE_NULL, ASE_SIZEOF(ext_t), ASE_NULL);
ase_awk_setccls (awk, ASE_GETCCLS());
ase_awk_setccls (awk, ASE_CCLS_GETDFL());
ext = (ext_t*) ase_awk_getextension (awk);
ext->prmfns.pow = custom_awk_pow;

View File

@ -10,13 +10,13 @@
#include <ctype.h>
static ase_bool_t ccls_is (void* data, ase_cint_t c, ase_ccls_type_t type)
ase_bool_t ase_ccls_is (ase_cint_t c, int 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)
ase_cint_t ase_ccls_to (ase_cint_t c, int type)
{
ASE_ASSERTX (type >= ASE_CCLS_UPPER && type <= ASE_CCLS_LOWER,
"The character type should be one of ASE_CCLS_UPPER and ASE_CCLS_LOWER");
@ -30,7 +30,7 @@ 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, int type)
ase_bool_t ase_ccls_is (ase_cint_t c, int type)
{
static const char* name[] =
{
@ -69,7 +69,7 @@ static ase_bool_t ccls_is (void* data, ase_cint_t c, int type)
return iswctype (c, desc[type]);
}
static ase_cint_t ccls_to (void* data, ase_cint_t c, int type)
ase_cint_t ase_ccls_to (ase_cint_t c, int type)
{
static const char* name[] =
{
@ -94,6 +94,16 @@ static ase_cint_t ccls_to (void* data, ase_cint_t c, int type)
#error unsupported character type
#endif
static ase_bool_t ccls_is (void* data, ase_cint_t c, int type)
{
return ase_ccls_is (c, type);
}
static ase_cint_t ccls_to (void* data, ase_cint_t c, int type)
{
return ase_ccls_to (c, type);
}
static ase_ccls_t ccls =
{
ccls_is,

View File

@ -9,4 +9,63 @@
#include <ase/cmn/chr.h>
#ifdef USE_STDC
#if defined(ASE_CHAR_IS_MCHAR)
#include <ctype.h>
#define ASE_ISUPPER(c) isupper(c)
#define ASE_ISLOWER(c) islower(c)
#define ASE_ISALPHA(c) isalpha(c)
#define ASE_ISDIGIT(c) isdigit(c)
#define ASE_ISXDIGIT(c) isxdigit(c)
#define ASE_ISALNUM(c) isalnum(c)
#define ASE_ISSPACE(c) isspace(c)
#define ASE_ISPRINT(c) isprint(c)
#define ASE_ISGRAPH(c) isgraph(c)
#define ASE_ISCNTRL(c) iscntrl(c)
#define ASE_ISPUNCT(c) ispunct(c)
#define ASE_TOUPPER(c) toupper(c)
#define ASE_TOLOWER(c) tolower(c)
#elif defined(ASE_CHAR_IS_WCHAR)
#include <ctype.h>
#include <wctype.h>
#define ASE_ISUPPER(c) iswupper(c)
#define ASE_ISLOWER(c) iswlower(c)
#define ASE_ISALPHA(c) iswalpha(c)
#define ASE_ISDIGIT(c) iswdigit(c)
#define ASE_ISXDIGIT(c) iswxdigit(c)
#define ASE_ISALNUM(c) iswalnum(c)
#define ASE_ISSPACE(c) iswspace(c)
#define ASE_ISPRINT(c) iswprint(c)
#define ASE_ISGRAPH(c) iswgraph(c)
#define ASE_ISCNTRL(c) iswcntrl(c)
#define ASE_ISPUNCT(c) iswpunct(c)
#define ASE_TOUPPER(c) towupper(c)
#define ASE_TOLOWER(c) towlower(c)
#else
#error Unsupported character type
#endif
#else
#define ASE_ISUPPER(c) (ase_ccls_is(c,ASE_CCLS_UPPER))
#define ASE_ISLOWER(c) (ase_ccls_is(c,ASE_CCLS_LOWER))
#define ASE_ISALPHA(c) (ase_ccls_is(c,ASE_CCLS_ALPHA))
#define ASE_ISDIGIT(c) (ase_ccls_is(c,ASE_CCLS_DIGIT))
#define ASE_ISXDIGIT(c) (ase_ccls_is(c,ASE_CCLS_XDIGIT))
#define ASE_ISALNUM(c) (ase_ccls_is(c,ASE_CCLS_ALNUM))
#define ASE_ISSPACE(c) (ase_ccls_is(c,ASE_CCLS_SPACE))
#define ASE_ISPRINT(c) (ase_ccls_is(c,ASE_CCLS_PRINT))
#define ASE_ISGRAPH(c) (ase_ccls_is(c,ASE_CCLS_GRAPH))
#define ASE_ISCNTRL(c) (ase_ccls_is(c,ASE_CCLS_CNTRL))
#define ASE_ISPUNCT(c) (ase_ccls_is(c,ASE_CCLS_PUNCT))
#define ASE_TOUPPER(c) (ase_ccls_to(c,ASE_CCLS_UPPER))
#define ASE_TOLOWER(c) (ase_ccls_to(c,ASE_CCLS_LOWER))
#endif
#endif

View File

@ -1,19 +1,19 @@
/*
* $Id: http.c 332 2008-08-18 11:21:48Z baconevi $
* $Id: http.c 341 2008-08-20 10:58:19Z baconevi $
*
* {License}
*/
#include <ase/utl/http.h>
#include <ase/utl/ctype.h>
#include "../cmn/mem.h"
#include "../cmn/chr.h"
static int is_http_space (ase_char_t c)
{
return ase_isspace(c) && c != ASE_T('\r') && c != ASE_T('\n');
return ASE_ISSPACE(c) && c != ASE_T('\r') && c != ASE_T('\n');
}
#define is_http_ctl(c) ase_iscntrl(c)
#define is_http_ctl(c) ASE_ISCNTRL(c)
static int is_http_separator (ase_char_t c)
{
@ -40,7 +40,7 @@ static int is_http_separator (ase_char_t c)
static int is_http_token (ase_char_t c)
{
return ase_isprint(c) && !is_http_ctl(c) && !is_http_separator(c);
return ASE_ISPRINT(c) && !is_http_ctl(c) && !is_http_separator(c);
}
static int digit_to_num (ase_char_t c)
@ -59,10 +59,10 @@ ase_char_t* ase_parsehttpreq (ase_char_t* buf, ase_http_req_t* req)
while (is_http_space(*p)) p++;
/* the method should start with an alphabet */
if (!ase_isalpha(*p)) return ASE_NULL;
if (!ASE_ISALPHA(*p)) return ASE_NULL;
/* scan the method */
req->method = p; while (ase_isalpha(*p)) p++;
req->method = p; while (ASE_ISALPHA(*p)) p++;
/* the method should be followed by a space */
if (!is_http_space(*p)) return ASE_NULL;
@ -78,9 +78,9 @@ ase_char_t* ase_parsehttpreq (ase_char_t* buf, ase_http_req_t* req)
req->args.ptr = ASE_NULL;
x = p;
while (ase_isprint(*p) && !ase_isspace(*p))
while (ASE_ISPRINT(*p) && !ASE_ISSPACE(*p))
{
if (*p == ASE_T('%') && ase_isxdigit(*(p+1)) && ase_isxdigit(*(p+2)))
if (*p == ASE_T('%') && ASE_ISXDIGIT(*(p+1)) && ASE_ISXDIGIT(*(p+2)))
{
*x++ = (digit_to_num(*(p+1)) << 4) + digit_to_num(*(p+2));
p += 3;
@ -120,15 +120,15 @@ ase_char_t* ase_parsehttpreq (ase_char_t* buf, ase_http_req_t* req)
(p[3] == ASE_T('P') || p[3] == ASE_T('p')) &&
p[4] == ASE_T('/') && p[6] == ASE_T('.'))
{
if (!ase_isdigit(p[5])) return ASE_NULL;
if (!ase_isdigit(p[7])) return ASE_NULL;
if (!ASE_ISDIGIT(p[5])) return ASE_NULL;
if (!ASE_ISDIGIT(p[7])) return ASE_NULL;
req->vers.major = p[5] - ASE_T('0');
req->vers.minor = p[7] - ASE_T('0');
p += 8;
}
else return ASE_NULL;
while (ase_isspace(*p))
while (ASE_ISSPACE(*p))
{
if (*p++ == ASE_T('\n')) goto ok;
}
@ -147,7 +147,7 @@ ase_char_t* ase_parsehttphdr (ase_char_t* buf, ase_http_hdr_t* hdr)
ase_char_t* p = buf, * last;
/* ignore leading spaces including CR and NL */
while (ase_isspace(*p)) p++;
while (ASE_ISSPACE(*p)) p++;
if (*p == ASE_T('\0'))
{
@ -172,13 +172,13 @@ ase_char_t* ase_parsehttphdr (ase_char_t* buf, ase_http_hdr_t* hdr)
do { p++; } while (is_http_space(*p));
hdr->value.ptr = last = p;
while (ase_isprint(*p))
while (ASE_ISPRINT(*p))
{
if (!ase_isspace(*p++)) last = p;
if (!ASE_ISSPACE(*p++)) last = p;
}
hdr->value.len = last - hdr->value.ptr;
while (ase_isspace(*p))
while (ASE_ISSPACE(*p))
{
if (*p++ == ASE_T('\n')) goto ok;
}

View File

@ -55,8 +55,7 @@ am__installdirs = "$(DESTDIR)$(libdir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libaseutl_la_LIBADD =
am_libaseutl_la_OBJECTS = helper.lo assert.lo ctype.lo getopt.lo \
http.lo main.lo stdio.lo
am_libaseutl_la_OBJECTS = assert.lo getopt.lo http.lo main.lo stdio.lo
libaseutl_la_OBJECTS = $(am_libaseutl_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include/ase
depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
@ -194,7 +193,7 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
AM_CFLAGS = -I$(top_builddir)/include
lib_LTLIBRARIES = libaseutl.la
libaseutl_la_SOURCES = helper.c assert.c ctype.c getopt.c http.c main.c stdio.c
libaseutl_la_SOURCES = assert.c getopt.c http.c main.c stdio.c
libaseutl_la_LDFLAGS = -version-info 1:0:0
all: all-am
@ -266,9 +265,7 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assert.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctype.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helper.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio.Plo@am__quote@

View File

@ -1,11 +1,11 @@
/*
* $Id: stdio.c 149 2008-03-20 09:49:53Z baconevi $
* $Id: stdio.c 341 2008-08-20 10:58:19Z baconevi $
*
* {License}
*/
#include <ase/utl/stdio.h>
#include <ase/utl/ctype.h>
#include "../cmn/chr.h"
#include <wchar.h>
#include <stdlib.h>
@ -209,7 +209,7 @@ static ase_char_t* __adjust_format (const ase_char_t* format)
}
else
{
while (ase_isdigit(ch))
while (ASE_ISDIGIT(ch))
{
ADDC (buf, ch);
ch = *fp++;
@ -229,7 +229,7 @@ static ase_char_t* __adjust_format (const ase_char_t* format)
}
else
{
while (ase_isdigit(ch))
while (ASE_ISDIGIT(ch))
{
ADDC (buf, ch);
ch = *fp++;
@ -267,7 +267,7 @@ static ase_char_t* __adjust_format (const ase_char_t* format)
#ifdef ASE_CHAR_IS_MCHAR
ADDC (buf, 'l');
#endif
ADDC (buf, ase_tolower(ch));
ADDC (buf, ASE_TOLOWER(ch));
#endif
}
else if (ch == ASE_T('d') || ch == ASE_T('i') ||