*** empty log message ***

This commit is contained in:
hyung-hwan 2006-11-29 02:54:17 +00:00
parent 2567f24c66
commit 8ddf723afa
21 changed files with 268 additions and 282 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: awk.c,v 1.93 2006-11-28 04:30:21 bacon Exp $
* $Id: awk.c,v 1.94 2006-11-29 02:54:14 bacon Exp $
*/
#if defined(__BORLANDC__)
@ -42,23 +42,23 @@ ase_awk_t* ase_awk_open (const ase_awk_syscas_t* syscas)
if (syscas->pow == ASE_NULL) return ASE_NULL;
#if defined(_WIN32) && defined(_DEBUG)
awk = (ase_awk_t*) malloc (ase_sizeof(ase_awk_t));
awk = (ase_awk_t*) malloc (ASE_SIZEOF(ase_awk_t));
#else
awk = (ase_awk_t*) syscas->malloc (
ase_sizeof(ase_awk_t), syscas->custom_data);
ASE_SIZEOF(ase_awk_t), syscas->custom_data);
#endif
if (awk == ASE_NULL) return ASE_NULL;
/* it uses the built-in ase_awk_memset because awk is not
* fully initialized yet */
ase_awk_memset (awk, 0, ase_sizeof(ase_awk_t));
ase_awk_memset (awk, 0, ASE_SIZEOF(ase_awk_t));
if (syscas->memcpy == ASE_NULL)
{
ase_awk_memcpy (&awk->syscas, syscas, ase_sizeof(awk->syscas));
ase_awk_memcpy (&awk->syscas, syscas, ASE_SIZEOF(awk->syscas));
awk->syscas.memcpy = ase_awk_memcpy;
}
else syscas->memcpy (&awk->syscas, syscas, ase_sizeof(awk->syscas));
else syscas->memcpy (&awk->syscas, syscas, ASE_SIZEOF(awk->syscas));
if (syscas->memset == ASE_NULL) awk->syscas.memset = ase_awk_memset;
if (ase_awk_str_open (&awk->token.name, 128, awk) == ASE_NULL)
@ -179,7 +179,7 @@ int ase_awk_clear (ase_awk_t* awk)
awk->bfn.user
*/
ASE_AWK_MEMSET (awk, &awk->src.ios, 0, ase_sizeof(awk->src.ios));
ASE_AWK_MEMSET (awk, &awk->src.ios, 0, ASE_SIZEOF(awk->src.ios));
awk->src.lex.curc = ASE_CHAR_EOF;
awk->src.lex.ungotc_count = 0;
awk->src.lex.line = 1;

View File

@ -1,5 +1,5 @@
/*
* $Id: err.c,v 1.54 2006-11-29 02:39:09 bacon Exp $
* $Id: err.c,v 1.55 2006-11-29 02:54:15 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -123,7 +123,7 @@ const ase_char_t* ase_awk_geterrstr (int errnum)
ASE_T("garbage after the regular expression")
};
if (errnum >= 0 && errnum < ase_countof(__errstr))
if (errnum >= 0 && errnum < ASE_COUNTOF(__errstr))
{
return __errstr[errnum];
}

View File

@ -1,5 +1,5 @@
/*
* $Id: extio.c,v 1.64 2006-11-23 14:27:51 bacon Exp $
* $Id: extio.c,v 1.65 2006-11-29 02:54:15 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -85,11 +85,11 @@ int ase_awk_readextio (
ase_size_t line_len = 0;
ASE_AWK_ASSERT (run->awk,
in_type >= 0 && in_type <= ase_countof(__in_type_map));
in_type >= 0 && in_type <= ASE_COUNTOF(__in_type_map));
ASE_AWK_ASSERT (run->awk,
in_type >= 0 && in_type <= ase_countof(__in_mode_map));
in_type >= 0 && in_type <= ASE_COUNTOF(__in_mode_map));
ASE_AWK_ASSERT (run->awk,
in_type >= 0 && in_type <= ase_countof(__in_mask_map));
in_type >= 0 && in_type <= ASE_COUNTOF(__in_mask_map));
/* translate the in_type into the relevant extio type and mode */
extio_type = __in_type_map[in_type];
@ -114,7 +114,7 @@ int ase_awk_readextio (
if (p == ASE_NULL)
{
p = (ase_awk_extio_t*) ASE_AWK_MALLOC (
run->awk, ase_sizeof(ase_awk_extio_t));
run->awk, ASE_SIZEOF(ase_awk_extio_t));
if (p == ASE_NULL)
{
run->errnum = ASE_AWK_ENOMEM;
@ -225,7 +225,7 @@ int ase_awk_readextio (
}
n = handler (ASE_AWK_IO_READ, p,
p->in.buf, ase_countof(p->in.buf));
p->in.buf, ASE_COUNTOF(p->in.buf));
if (n == -1)
{
/* handler error. getline should return -1 */
@ -410,11 +410,11 @@ int ase_awk_writeextio_str (
int extio_type, extio_mode, extio_mask, n;
ASE_AWK_ASSERT (run->awk,
out_type >= 0 && out_type <= ase_countof(__out_type_map));
out_type >= 0 && out_type <= ASE_COUNTOF(__out_type_map));
ASE_AWK_ASSERT (run->awk,
out_type >= 0 && out_type <= ase_countof(__out_mode_map));
out_type >= 0 && out_type <= ASE_COUNTOF(__out_mode_map));
ASE_AWK_ASSERT (run->awk,
out_type >= 0 && out_type <= ase_countof(__out_mask_map));
out_type >= 0 && out_type <= ASE_COUNTOF(__out_mask_map));
/* translate the out_type into the relevant extio type and mode */
extio_type = __out_type_map[out_type];
@ -451,7 +451,7 @@ int ase_awk_writeextio_str (
if (p == ASE_NULL)
{
p = (ase_awk_extio_t*) ASE_AWK_MALLOC (
run->awk, ase_sizeof(ase_awk_extio_t));
run->awk, ASE_SIZEOF(ase_awk_extio_t));
if (p == ASE_NULL)
{
run->errnum = ASE_AWK_ENOMEM;
@ -557,11 +557,11 @@ int ase_awk_flushextio (
ase_bool_t ok = ase_false;
ASE_AWK_ASSERT (run->awk,
out_type >= 0 && out_type <= ase_countof(__out_type_map));
out_type >= 0 && out_type <= ASE_COUNTOF(__out_type_map));
ASE_AWK_ASSERT (run->awk,
out_type >= 0 && out_type <= ase_countof(__out_mode_map));
out_type >= 0 && out_type <= ASE_COUNTOF(__out_mode_map));
ASE_AWK_ASSERT (run->awk,
out_type >= 0 && out_type <= ase_countof(__out_mask_map));
out_type >= 0 && out_type <= ASE_COUNTOF(__out_mask_map));
/* translate the out_type into the relevant extio type and mode */
extio_type = __out_type_map[out_type];
@ -620,11 +620,11 @@ int ase_awk_nextextio_read (
int extio_type, /*extio_mode,*/ extio_mask, n;
ASE_AWK_ASSERT (run->awk,
in_type >= 0 && in_type <= ase_countof(__in_type_map));
in_type >= 0 && in_type <= ASE_COUNTOF(__in_type_map));
ASE_AWK_ASSERT (run->awk,
in_type >= 0 && in_type <= ase_countof(__in_mode_map));
in_type >= 0 && in_type <= ASE_COUNTOF(__in_mode_map));
ASE_AWK_ASSERT (run->awk,
in_type >= 0 && in_type <= ase_countof(__in_mask_map));
in_type >= 0 && in_type <= ASE_COUNTOF(__in_mask_map));
/* translate the in_type into the relevant extio type and mode */
extio_type = __in_type_map[in_type];
@ -698,11 +698,11 @@ int ase_awk_nextextio_write (
int extio_type, /*extio_mode,*/ extio_mask, n;
ASE_AWK_ASSERT (run->awk,
out_type >= 0 && out_type <= ase_countof(__out_type_map));
out_type >= 0 && out_type <= ASE_COUNTOF(__out_type_map));
ASE_AWK_ASSERT (run->awk,
out_type >= 0 && out_type <= ase_countof(__out_mode_map));
out_type >= 0 && out_type <= ASE_COUNTOF(__out_mode_map));
ASE_AWK_ASSERT (run->awk,
out_type >= 0 && out_type <= ase_countof(__out_mask_map));
out_type >= 0 && out_type <= ASE_COUNTOF(__out_mask_map));
/* translate the out_type into the relevant extio type and mode */
extio_type = __out_type_map[out_type];
@ -773,11 +773,11 @@ int ase_awk_closeextio_read (
int extio_type, /*extio_mode,*/ extio_mask;
ASE_AWK_ASSERT (run->awk,
in_type >= 0 && in_type <= ase_countof(__in_type_map));
in_type >= 0 && in_type <= ASE_COUNTOF(__in_type_map));
ASE_AWK_ASSERT (run->awk,
in_type >= 0 && in_type <= ase_countof(__in_mode_map));
in_type >= 0 && in_type <= ASE_COUNTOF(__in_mode_map));
ASE_AWK_ASSERT (run->awk,
in_type >= 0 && in_type <= ase_countof(__in_mask_map));
in_type >= 0 && in_type <= ASE_COUNTOF(__in_mask_map));
/* translate the in_type into the relevant extio type and mode */
extio_type = __in_type_map[in_type];
@ -836,11 +836,11 @@ int ase_awk_closeextio_write (
int extio_type, /*extio_mode,*/ extio_mask;
ASE_AWK_ASSERT (run->awk,
out_type >= 0 && out_type <= ase_countof(__out_type_map));
out_type >= 0 && out_type <= ASE_COUNTOF(__out_type_map));
ASE_AWK_ASSERT (run->awk,
out_type >= 0 && out_type <= ase_countof(__out_mode_map));
out_type >= 0 && out_type <= ASE_COUNTOF(__out_mode_map));
ASE_AWK_ASSERT (run->awk,
out_type >= 0 && out_type <= ase_countof(__out_mask_map));
out_type >= 0 && out_type <= ASE_COUNTOF(__out_mask_map));
/* translate the out_type into the relevant extio type and mode */
extio_type = __out_type_map[out_type];

View File

@ -1,5 +1,5 @@
/*
* $Id: func.c,v 1.81 2006-11-29 02:39:09 bacon Exp $
* $Id: func.c,v 1.82 2006-11-29 02:54:15 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -55,7 +55,7 @@ void* ase_awk_addbfn (
return ASE_NULL;
}
p = (ase_awk_bfn_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_bfn_t));
p = (ase_awk_bfn_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_bfn_t));
if (p == ASE_NULL)
{
awk->errnum = ASE_AWK_ENOMEM;
@ -538,7 +538,7 @@ static int __bfn_split (
ase_char_t* str, * str_free, * p, * tok;
ase_size_t str_len, str_left, tok_len;
ase_long_t sta, num;
ase_char_t key[ase_sizeof(ase_long_t)*8+2];
ase_char_t key[ASE_SIZEOF(ase_long_t)*8+2];
ase_size_t key_len;
ase_char_t* fs_ptr, * fs_free;
ase_size_t fs_len;
@ -736,7 +736,7 @@ static int __bfn_split (
/* put it into the map */
key_len = ase_awk_longtostr (
num, 10, ASE_NULL, key, ase_countof(key));
num, 10, ASE_NULL, key, ASE_COUNTOF(key));
ASE_AWK_ASSERT (run->awk, key_len != (ase_size_t)-1);
/* don't forget to update the reference count when you

View File

@ -1,5 +1,5 @@
/*
* $Id: map.c,v 1.31 2006-11-13 15:08:53 bacon Exp $
* $Id: map.c,v 1.32 2006-11-29 02:54:15 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -24,7 +24,7 @@ ase_awk_map_t* ase_awk_map_open (
if (map == ASE_NULL)
{
map = (ase_awk_map_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_map_t));
awk, ASE_SIZEOF(ase_awk_map_t));
if (map == ASE_NULL) return ASE_NULL;
map->__dynamic = ase_true;
}
@ -32,7 +32,7 @@ ase_awk_map_t* ase_awk_map_open (
map->awk = awk;
map->buck = (ase_awk_pair_t**)
ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_pair_t*) * capa);
ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_pair_t*) * capa);
if (map->buck == ASE_NULL)
{
if (map->__dynamic) ASE_AWK_FREE (awk, map);
@ -138,7 +138,7 @@ int ase_awk_map_putx (
}
pair = (ase_awk_pair_t*) ASE_AWK_MALLOC (
map->awk, ase_sizeof(ase_awk_pair_t));
map->awk, ASE_SIZEOF(ase_awk_pair_t));
if (pair == ASE_NULL) return -1; /* error */
/*pair->key = key;*/
@ -271,7 +271,7 @@ static ase_size_t __hash (const ase_char_t* key, ase_size_t key_len)
while (key < end)
{
ase_byte_t* bp = (ase_byte_t*)key;
for (i = 0; i < ase_sizeof(*key); i++) n = n * 31 + *bp++;
for (i = 0; i < ASE_SIZEOF(*key); i++) n = n * 31 + *bp++;
key++;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: misc.c,v 1.42 2006-11-28 11:26:47 bacon Exp $
* $Id: misc.c,v 1.43 2006-11-29 02:54:15 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -620,7 +620,7 @@ ase_char_t* ase_awk_strdup (ase_awk_t* awk, const ase_char_t* str)
ase_char_t* tmp;
tmp = (ase_char_t*) ASE_AWK_MALLOC (
awk, (ase_awk_strlen(str) + 1) * ase_sizeof(ase_char_t));
awk, (ase_awk_strlen(str) + 1) * ASE_SIZEOF(ase_char_t));
if (tmp == ASE_NULL) return ASE_NULL;
ase_awk_strcpy (tmp, str);
@ -633,7 +633,7 @@ ase_char_t* ase_awk_strxdup (
ase_char_t* tmp;
tmp = (ase_char_t*) ASE_AWK_MALLOC (
awk, (len + 1) * ase_sizeof(ase_char_t));
awk, (len + 1) * ASE_SIZEOF(ase_char_t));
if (tmp == ASE_NULL) return ASE_NULL;
ase_awk_strncpy (tmp, str, len);
@ -648,7 +648,7 @@ ase_char_t* ase_awk_strxdup2 (
ase_char_t* tmp;
tmp = (ase_char_t*) ASE_AWK_MALLOC (
awk, (len1 + len2 + 1) * ase_sizeof(ase_char_t));
awk, (len1 + len2 + 1) * ASE_SIZEOF(ase_char_t));
if (tmp == ASE_NULL) return ASE_NULL;
ase_awk_strncpy (tmp, str1, len1);

View File

@ -1,5 +1,5 @@
/*
* $Id: parse.c,v 1.213 2006-11-28 04:30:21 bacon Exp $
* $Id: parse.c,v 1.214 2006-11-29 02:54:15 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -349,7 +349,7 @@ int ase_awk_parse (ase_awk_t* awk, ase_awk_srcios_t* srcios)
ASE_AWK_ASSERT (awk, awk->parse.depth.cur.expr == 0);
ase_awk_clear (awk);
ASE_AWK_MEMCPY (awk, &awk->src.ios, srcios, ase_sizeof(awk->src.ios));
ASE_AWK_MEMCPY (awk, &awk->src.ios, srcios, ASE_SIZEOF(awk->src.ios));
n = __parse (awk);
@ -809,7 +809,7 @@ static ase_awk_nde_t* __parse_function (ase_awk_t* awk)
/* parameter names are not required anymore. clear them */
ase_awk_tab_clear (&awk->parse.params);
afn = (ase_awk_afn_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_afn_t));
afn = (ase_awk_afn_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_afn_t));
if (afn == ASE_NULL)
{
ASE_AWK_FREE (awk, name_dup);
@ -884,7 +884,7 @@ static ase_awk_chain_t* __parse_pattern_block (
if (nde == ASE_NULL) return ASE_NULL;
}
chain = (ase_awk_chain_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_chain_t));
chain = (ase_awk_chain_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_chain_t));
if (chain == ASE_NULL)
{
ase_awk_clrpt (awk, nde);
@ -992,7 +992,7 @@ static ase_awk_nde_t* __parse_block (ase_awk_t* awk, ase_bool_t is_top)
curr = nde;
}
block = (ase_awk_nde_blk_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_blk_t));
block = (ase_awk_nde_blk_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_blk_t));
if (block == ASE_NULL)
{
ase_awk_tab_remove (
@ -1227,7 +1227,7 @@ static ase_awk_nde_t* __parse_statement (ase_awk_t* awk)
if (MATCH(awk,TOKEN_SEMICOLON))
{
/* null statement */
nde = (ase_awk_nde_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_t));
nde = (ase_awk_nde_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_t));
if (nde == ASE_NULL) PANIC (awk, ASE_AWK_ENOMEM);
nde->type = ASE_AWK_NDE_NULL;
@ -1429,7 +1429,7 @@ static ase_awk_nde_t* __parse_expression0 (ase_awk_t* awk)
return ASE_NULL;
}
nde = (ase_awk_nde_ass_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_ass_t));
nde = (ase_awk_nde_ass_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_ass_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, x);
@ -1478,7 +1478,7 @@ static ase_awk_nde_t* __parse_basic_expr (ase_awk_t* awk)
}
tmp = (ase_awk_nde_cnd_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_cnd_t));
awk, ASE_SIZEOF(ase_awk_nde_cnd_t));
if (tmp == ASE_NULL)
{
ase_awk_clrpt (awk, nde);
@ -1603,7 +1603,7 @@ static ase_awk_nde_t* __parse_binary_expr (
skip_constant_folding:
#endif
nde = (ase_awk_nde_exp_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_exp_t));
awk, ASE_SIZEOF(ase_awk_nde_exp_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, right);
@ -1688,7 +1688,7 @@ static ase_awk_nde_t* __parse_in (ase_awk_t* awk)
}
nde = (ase_awk_nde_exp_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_exp_t));
awk, ASE_SIZEOF(ase_awk_nde_exp_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, right);
@ -1788,7 +1788,7 @@ static ase_awk_nde_t* __parse_bitwise_or_with_extio (ase_awk_t* awk)
}
nde = (ase_awk_nde_getline_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_getline_t));
awk, ASE_SIZEOF(ase_awk_nde_getline_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, left);
@ -1823,7 +1823,7 @@ static ase_awk_nde_t* __parse_bitwise_or_with_extio (ase_awk_t* awk)
/* TODO: do constant folding */
nde = (ase_awk_nde_exp_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_exp_t));
awk, ASE_SIZEOF(ase_awk_nde_exp_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, right);
@ -1926,7 +1926,7 @@ static ase_awk_nde_t* __parse_concat (ase_awk_t* awk)
}
nde = (ase_awk_nde_exp_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_exp_t));
awk, ASE_SIZEOF(ase_awk_nde_exp_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, left);
@ -2000,7 +2000,7 @@ static ase_awk_nde_t* __parse_unary (ase_awk_t* awk)
if (left == ASE_NULL) return ASE_NULL;
nde = (ase_awk_nde_exp_t*)
ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_exp_t));
ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_exp_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, left);
@ -2054,7 +2054,7 @@ static ase_awk_nde_t* __parse_unary_exp (ase_awk_t* awk)
if (left == ASE_NULL) return ASE_NULL;
nde = (ase_awk_nde_exp_t*)
ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_exp_t));
ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_exp_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, left);
@ -2112,7 +2112,7 @@ static ase_awk_nde_t* __parse_increment (ase_awk_t* awk)
if (__get_token(awk) == -1) return ASE_NULL;
}
nde = (ase_awk_nde_exp_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_exp_t));
nde = (ase_awk_nde_exp_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_exp_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, left);
@ -2139,7 +2139,7 @@ static ase_awk_nde_t* __parse_primary (ase_awk_t* awk)
ase_awk_nde_int_t* nde;
nde = (ase_awk_nde_int_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_int_t));
awk, ASE_SIZEOF(ase_awk_nde_int_t));
if (nde == ASE_NULL) PANIC (awk, ASE_AWK_ENOMEM);
nde->type = ASE_AWK_NDE_INT;
@ -2175,7 +2175,7 @@ static ase_awk_nde_t* __parse_primary (ase_awk_t* awk)
ase_awk_nde_real_t* nde;
nde = (ase_awk_nde_real_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_real_t));
awk, ASE_SIZEOF(ase_awk_nde_real_t));
if (nde == ASE_NULL) PANIC (awk, ASE_AWK_ENOMEM);
nde->type = ASE_AWK_NDE_REAL;
@ -2211,7 +2211,7 @@ static ase_awk_nde_t* __parse_primary (ase_awk_t* awk)
ase_awk_nde_str_t* nde;
nde = (ase_awk_nde_str_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_str_t));
awk, ASE_SIZEOF(ase_awk_nde_str_t));
if (nde == ASE_NULL) PANIC (awk, ASE_AWK_ENOMEM);
nde->type = ASE_AWK_NDE_STR;
@ -2247,7 +2247,7 @@ static ase_awk_nde_t* __parse_primary (ase_awk_t* awk)
ASE_AWK_ASSERT (awk, MATCH(awk,TOKEN_REX));
nde = (ase_awk_nde_rex_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_rex_t));
awk, ASE_SIZEOF(ase_awk_nde_rex_t));
if (nde == ASE_NULL) PANIC (awk, ASE_AWK_ENOMEM);
nde->type = ASE_AWK_NDE_REX;
@ -2297,7 +2297,7 @@ static ase_awk_nde_t* __parse_primary (ase_awk_t* awk)
if (prim == ASE_NULL) return ASE_NULL;
nde = (ase_awk_nde_pos_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_pos_t));
awk, ASE_SIZEOF(ase_awk_nde_pos_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, prim);
@ -2382,7 +2382,7 @@ static ase_awk_nde_t* __parse_primary (ase_awk_t* awk)
}
tmp = (ase_awk_nde_grp_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_grp_t));
awk, ASE_SIZEOF(ase_awk_nde_grp_t));
if (tmp == ASE_NULL)
{
ase_awk_clrpt (awk, nde);
@ -2434,7 +2434,7 @@ static ase_awk_nde_t* __parse_primary (ase_awk_t* awk)
}
nde = (ase_awk_nde_getline_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_getline_t));
awk, ASE_SIZEOF(ase_awk_nde_getline_t));
if (nde == ASE_NULL)
{
if (var != ASE_NULL) ase_awk_clrpt (awk, var);
@ -2524,7 +2524,7 @@ static ase_awk_nde_t* __parse_primary_ident (ase_awk_t* awk)
ase_size_t idxa;
nde = (ase_awk_nde_var_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_var_t));
awk, ASE_SIZEOF(ase_awk_nde_var_t));
if (nde == ASE_NULL)
{
ASE_AWK_FREE (awk, name_dup);
@ -2654,7 +2654,7 @@ static ase_awk_nde_t* __parse_hashidx (
}
nde = (ase_awk_nde_var_t*)
ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_var_t));
ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_var_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, idx);
@ -2791,7 +2791,7 @@ static ase_awk_nde_t* __parse_fncall (
}
call = (ase_awk_nde_call_t*)
ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_call_t));
ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_call_t));
if (call == ASE_NULL)
{
if (head != ASE_NULL) ase_awk_clrpt (awk, head);
@ -2878,7 +2878,7 @@ static ase_awk_nde_t* __parse_if (ase_awk_t* awk)
}
else else_part = ASE_NULL;
nde = (ase_awk_nde_if_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_if_t));
nde = (ase_awk_nde_if_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_if_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, else_part);
@ -2926,7 +2926,7 @@ static ase_awk_nde_t* __parse_while (ase_awk_t* awk)
return ASE_NULL;
}
nde = (ase_awk_nde_while_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_while_t));
nde = (ase_awk_nde_while_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_while_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, body);
@ -2989,7 +2989,7 @@ static ase_awk_nde_t* __parse_for (ase_awk_t* awk)
}
nde2 = (ase_awk_nde_foreach_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_foreach_t));
awk, ASE_SIZEOF(ase_awk_nde_foreach_t));
if (nde2 == ASE_NULL)
{
ase_awk_clrpt (awk, init);
@ -3080,7 +3080,7 @@ static ase_awk_nde_t* __parse_for (ase_awk_t* awk)
return ASE_NULL;
}
nde = (ase_awk_nde_for_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_for_t));
nde = (ase_awk_nde_for_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_for_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, init);
@ -3153,7 +3153,7 @@ static ase_awk_nde_t* __parse_dowhile (ase_awk_t* awk)
return ASE_NULL;
}
nde = (ase_awk_nde_while_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_while_t));
nde = (ase_awk_nde_while_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_while_t));
if (nde == ASE_NULL)
{
ase_awk_clrpt (awk, body);
@ -3175,7 +3175,7 @@ static ase_awk_nde_t* __parse_break (ase_awk_t* awk)
if (awk->parse.depth.cur.loop <= 0) PANIC (awk, ASE_AWK_EBREAK);
nde = (ase_awk_nde_break_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_break_t));
nde = (ase_awk_nde_break_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_break_t));
if (nde == ASE_NULL) PANIC (awk, ASE_AWK_ENOMEM);
nde->type = ASE_AWK_NDE_BREAK;
nde->next = ASE_NULL;
@ -3190,7 +3190,7 @@ static ase_awk_nde_t* __parse_continue (ase_awk_t* awk)
if (awk->parse.depth.cur.loop <= 0) PANIC (awk, ASE_AWK_ECONTINUE);
nde = (ase_awk_nde_continue_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_continue_t));
awk, ASE_SIZEOF(ase_awk_nde_continue_t));
if (nde == ASE_NULL) PANIC (awk, ASE_AWK_ENOMEM);
nde->type = ASE_AWK_NDE_CONTINUE;
nde->next = ASE_NULL;
@ -3204,7 +3204,7 @@ static ase_awk_nde_t* __parse_return (ase_awk_t* awk)
ase_awk_nde_t* val;
nde = (ase_awk_nde_return_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_return_t));
awk, ASE_SIZEOF(ase_awk_nde_return_t));
if (nde == ASE_NULL) PANIC (awk, ASE_AWK_ENOMEM);
nde->type = ASE_AWK_NDE_RETURN;
nde->next = ASE_NULL;
@ -3233,7 +3233,7 @@ static ase_awk_nde_t* __parse_exit (ase_awk_t* awk)
ase_awk_nde_exit_t* nde;
ase_awk_nde_t* val;
nde = (ase_awk_nde_exit_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_exit_t));
nde = (ase_awk_nde_exit_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_exit_t));
if (nde == ASE_NULL) PANIC (awk, ASE_AWK_ENOMEM);
nde->type = ASE_AWK_NDE_EXIT;
nde->next = ASE_NULL;
@ -3275,7 +3275,7 @@ static ase_awk_nde_t* __parse_delete (ase_awk_t* awk)
}
nde = (ase_awk_nde_delete_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_delete_t));
awk, ASE_SIZEOF(ase_awk_nde_delete_t));
if (nde == ASE_NULL) PANIC (awk, ASE_AWK_ENOMEM);
nde->type = ASE_AWK_NDE_DELETE;
@ -3406,7 +3406,7 @@ static ase_awk_nde_t* __parse_print (ase_awk_t* awk, int type)
}
nde = (ase_awk_nde_print_t*)
ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_print_t));
ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_print_t));
if (nde == ASE_NULL)
{
if (args != ASE_NULL) ase_awk_clrpt (awk, args);
@ -3446,7 +3446,7 @@ static ase_awk_nde_t* __parse_next (ase_awk_t* awk)
PANIC (awk, ASE_AWK_ENEXT);
}
nde = (ase_awk_nde_next_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_nde_next_t));
nde = (ase_awk_nde_next_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_nde_next_t));
if (nde == ASE_NULL) PANIC (awk, ASE_AWK_ENOMEM);
nde->type = ASE_AWK_NDE_NEXT;
nde->next = ASE_NULL;
@ -3465,7 +3465,7 @@ static ase_awk_nde_t* __parse_nextfile (ase_awk_t* awk, int out)
}
nde = (ase_awk_nde_nextfile_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_nde_nextfile_t));
awk, ASE_SIZEOF(ase_awk_nde_nextfile_t));
if (nde == ASE_NULL) PANIC (awk, ASE_AWK_ENOMEM);
nde->type = ASE_AWK_NDE_NEXTFILE;
nde->next = ASE_NULL;
@ -4134,14 +4134,14 @@ static int __get_string (
continue;
}
#ifdef ASE_CHAR_IS_WCHAR
else if (c == ASE_T('u') && ase_sizeof(ase_char_t) >= 2)
else if (c == ASE_T('u') && ASE_SIZEOF(ase_char_t) >= 2)
{
escaped = 4;
digit_count = 0;
c_acc = 0;
continue;
}
else if (c == ASE_T('U') && ase_sizeof(ase_char_t) >= 4)
else if (c == ASE_T('U') && ASE_SIZEOF(ase_char_t) >= 4)
{
escaped = 8;
digit_count = 0;
@ -4178,7 +4178,7 @@ static int __get_char (ase_awk_t* awk)
{
n = awk->src.ios.in (
ASE_AWK_IO_READ, awk->src.ios.custom_data,
awk->src.shared.buf, ase_countof(awk->src.shared.buf));
awk->src.shared.buf, ASE_COUNTOF(awk->src.shared.buf));
if (n == -1)
{
awk->errnum = ASE_AWK_ESRCINREAD;
@ -4209,7 +4209,7 @@ static int __get_char (ase_awk_t* awk)
static int __unget_char (ase_awk_t* awk, ase_cint_t c)
{
if (awk->src.lex.ungotc_count >= ase_countof(awk->src.lex.ungotc))
if (awk->src.lex.ungotc_count >= ASE_COUNTOF(awk->src.lex.ungotc))
{
awk->errnum = ASE_AWK_ELXUNG;
return -1;
@ -4375,7 +4375,7 @@ struct __deparse_func_t
static int __deparse (ase_awk_t* awk)
{
ase_awk_chain_t* chain;
ase_char_t tmp[ase_sizeof(ase_size_t)*8 + 32];
ase_char_t tmp[ASE_SIZEOF(ase_size_t)*8 + 32];
struct __deparse_func_t df;
int n = 0, op;
@ -4423,7 +4423,7 @@ static int __deparse (ase_awk_t* awk)
for (i = awk->tree.nbglobals; i < awk->tree.nglobals - 1; i++)
{
len = ase_awk_longtostr ((ase_long_t)i,
10, ASE_T("__global"), tmp, ase_countof(tmp));
10, ASE_T("__global"), tmp, ASE_COUNTOF(tmp));
ASE_AWK_ASSERT (awk, len != (ase_size_t)-1);
if (ase_awk_putsrcstrx (awk, tmp, len) == -1)
EXIT_DEPARSE (ASE_AWK_ESRCOUTWRITE);
@ -4441,7 +4441,7 @@ static int __deparse (ase_awk_t* awk)
}
len = ase_awk_longtostr ((ase_long_t)i,
10, ASE_T("__global"), tmp, ase_countof(tmp));
10, ASE_T("__global"), tmp, ASE_COUNTOF(tmp));
ASE_AWK_ASSERT (awk, len != (ase_size_t)-1);
if (ase_awk_putsrcstrx (awk, tmp, len) == -1)
EXIT_DEPARSE (ASE_AWK_ESRCOUTWRITE);
@ -4460,7 +4460,7 @@ static int __deparse (ase_awk_t* awk)
df.awk = awk;
df.tmp = tmp;
df.tmp_len = ase_countof(tmp);
df.tmp_len = ASE_COUNTOF(tmp);
if (ase_awk_map_walk (&awk->tree.afns, __deparse_func, &df) == -1)
{
@ -4569,7 +4569,7 @@ static int __deparse_func (ase_awk_pair_t* pair, void* arg)
static int __put_char (ase_awk_t* awk, ase_char_t c)
{
awk->src.shared.buf[awk->src.shared.buf_len++] = c;
if (awk->src.shared.buf_len >= ase_countof(awk->src.shared.buf))
if (awk->src.shared.buf_len >= ASE_COUNTOF(awk->src.shared.buf))
{
if (__flush (awk) == -1) return -1;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: rec.c,v 1.7 2006-11-16 11:53:16 bacon Exp $
* $Id: rec.c,v 1.8 2006-11-29 02:54:16 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -164,7 +164,7 @@ static int __split_record (ase_awk_run_t* run)
if (nflds > run->inrec.maxflds)
{
void* tmp = ASE_AWK_MALLOC (
run->awk, ase_sizeof(*run->inrec.flds) * nflds);
run->awk, ASE_SIZEOF(*run->inrec.flds) * nflds);
if (tmp == ASE_NULL)
{
if (fs_free != ASE_NULL) ASE_AWK_FREE (run->awk, fs_free);
@ -305,7 +305,7 @@ static int __recomp_record_fields (
{
tmp = ASE_AWK_REALLOC (
run->awk, run->inrec.flds,
ase_sizeof(*run->inrec.flds) * max);
ASE_SIZEOF(*run->inrec.flds) * max);
if (tmp == ASE_NULL)
{
run->errnum = ASE_AWK_ENOMEM;
@ -315,7 +315,7 @@ static int __recomp_record_fields (
else
{
tmp = ASE_AWK_MALLOC (
run->awk, ase_sizeof(*run->inrec.flds) * max);
run->awk, ASE_SIZEOF(*run->inrec.flds) * max);
if (tmp == ASE_NULL)
{
run->errnum = ASE_AWK_ENOMEM;
@ -324,7 +324,7 @@ static int __recomp_record_fields (
if (run->inrec.flds != ASE_NULL)
{
ASE_AWK_MEMCPY (run->awk, tmp, run->inrec.flds,
ase_sizeof(*run->inrec.flds) * run->inrec.maxflds);
ASE_SIZEOF(*run->inrec.flds) * run->inrec.maxflds);
ASE_AWK_FREE (run->awk, run->inrec.flds);
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: rex.c,v 1.47 2006-11-26 16:32:05 bacon Exp $
* $Id: rex.c,v 1.48 2006-11-29 02:54:16 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -162,14 +162,14 @@ static ase_size_t __get_code (__builder_t* builder, ase_size_t pos)
{
ase_size_t code;
ASE_AWK_MEMCPY (builder->awk,
&code, &builder->code.buf[pos], ase_sizeof(code));
&code, &builder->code.buf[pos], ASE_SIZEOF(code));
return code;
}
static void __set_code (__builder_t* builder, ase_size_t pos, ase_size_t code)
{
ASE_AWK_MEMCPY (builder->awk,
&builder->code.buf[pos], &code, ase_sizeof(code));
&builder->code.buf[pos], &code, ASE_SIZEOF(code));
}
#endif
@ -393,15 +393,15 @@ ase_bool_t ase_awk_isemptyrex (ase_awk_t* awk, void* code)
ASE_AWK_ASSERT (awk, p != ASE_NULL);
nb = *(ase_size_t*)p; p += ase_sizeof(nb);
el = *(ase_size_t*)p; p += ase_sizeof(el);
nb = *(ase_size_t*)p; p += ASE_SIZEOF(nb);
el = *(ase_size_t*)p; p += ASE_SIZEOF(el);
/* an empty regular expression look like:
* | expression |
* | header | branch |
* | | branch header |
* | NB(1) | EL(16) | NA(1) | BL(8) | */
return (nb == 1 && el == ase_sizeof(ase_size_t)*4)? ase_true: ase_false;
return (nb == 1 && el == ASE_SIZEOF(ase_size_t)*4)? ase_true: ase_false;
}
static int __build_pattern (__builder_t* builder)
@ -433,10 +433,10 @@ static int __build_pattern0 (__builder_t* builder)
/* secure space for header and set the header fields to zero */
pos_nb = builder->code.size;
ADD_CODE (builder, &zero, ase_sizeof(zero));
ADD_CODE (builder, &zero, ASE_SIZEOF(zero));
pos_el = builder->code.size;
ADD_CODE (builder, &zero, ase_sizeof(zero));
ADD_CODE (builder, &zero, ASE_SIZEOF(zero));
/* handle the first branch */
n = __build_branch (builder);
@ -488,10 +488,10 @@ static int __build_branch (__builder_t* builder)
old_size = builder->code.size;
pos_na = builder->code.size;
ADD_CODE (builder, &zero, ase_sizeof(zero));
ADD_CODE (builder, &zero, ASE_SIZEOF(zero));
pos_bl = builder->code.size;
ADD_CODE (builder, &zero, ase_sizeof(zero));
ADD_CODE (builder, &zero, ASE_SIZEOF(zero));
while (1)
{
@ -541,7 +541,7 @@ static int __build_atom (__builder_t* builder)
tmp.negate = 0;
tmp.lbound = 1;
tmp.ubound = 1;
ADD_CODE (builder, &tmp, ase_sizeof(tmp));
ADD_CODE (builder, &tmp, ASE_SIZEOF(tmp));
NEXT_CHAR (builder, LEVEL_TOP);
@ -561,7 +561,7 @@ static int __build_atom (__builder_t* builder)
tmp.negate = 0;
tmp.lbound = 1;
tmp.ubound = 1;
ADD_CODE (builder, &tmp, ase_sizeof(tmp));
ADD_CODE (builder, &tmp, ASE_SIZEOF(tmp));
}
else if (builder->ptn.curc.value == ASE_T('$'))
{
@ -569,7 +569,7 @@ static int __build_atom (__builder_t* builder)
tmp.negate = 0;
tmp.lbound = 1;
tmp.ubound = 1;
ADD_CODE (builder, &tmp, ase_sizeof(tmp));
ADD_CODE (builder, &tmp, ASE_SIZEOF(tmp));
}
else if (builder->ptn.curc.value == ASE_T('.'))
{
@ -577,7 +577,7 @@ static int __build_atom (__builder_t* builder)
tmp.negate = 0;
tmp.lbound = 1;
tmp.ubound = 1;
ADD_CODE (builder, &tmp, ase_sizeof(tmp));
ADD_CODE (builder, &tmp, ASE_SIZEOF(tmp));
}
else if (builder->ptn.curc.value == ASE_T('['))
{
@ -589,7 +589,7 @@ static int __build_atom (__builder_t* builder)
tmp.negate = 0;
tmp.lbound = 1;
tmp.ubound = 1;
ADD_CODE (builder, &tmp, ase_sizeof(tmp));
ADD_CODE (builder, &tmp, ASE_SIZEOF(tmp));
NEXT_CHAR (builder, LEVEL_CHARSET);
@ -619,9 +619,9 @@ static int __build_atom (__builder_t* builder)
tmp.negate = 0;
tmp.lbound = 1;
tmp.ubound = 1;
ADD_CODE (builder, &tmp, ase_sizeof(tmp));
ADD_CODE (builder, &tmp, ASE_SIZEOF(tmp));
ADD_CODE (builder, &builder->ptn.curc.value, ase_sizeof(builder->ptn.curc.value));
ADD_CODE (builder, &builder->ptn.curc.value, ASE_SIZEOF(builder->ptn.curc.value));
NEXT_CHAR (builder, LEVEL_TOP);
return 1;
@ -637,10 +637,10 @@ static int __build_charset (__builder_t* builder, struct __code_t* cmd)
old_size = builder->code.size;
pos_csc = builder->code.size;
ADD_CODE (builder, &zero, ase_sizeof(zero));
ADD_CODE (builder, &zero, ASE_SIZEOF(zero));
pos_csl = builder->code.size;
ADD_CODE (builder, &zero, ase_sizeof(zero));
ADD_CODE (builder, &zero, ASE_SIZEOF(zero));
if (builder->ptn.curc.type == CT_NORMAL &&
builder->ptn.curc.value == ASE_T('^'))
@ -697,22 +697,22 @@ static int __build_charset (__builder_t* builder, struct __code_t* cmd)
if (c1 == c2)
{
c0 = CHARSET_ONE;
ADD_CODE (builder, &c0, ase_sizeof(c0));
ADD_CODE (builder, &c1, ase_sizeof(c1));
ADD_CODE (builder, &c0, ASE_SIZEOF(c0));
ADD_CODE (builder, &c1, ASE_SIZEOF(c1));
}
else
{
c0 = CHARSET_RANGE;
ADD_CODE (builder, &c0, ase_sizeof(c0));
ADD_CODE (builder, &c1, ase_sizeof(c1));
ADD_CODE (builder, &c2, ase_sizeof(c2));
ADD_CODE (builder, &c0, ASE_SIZEOF(c0));
ADD_CODE (builder, &c1, ASE_SIZEOF(c1));
ADD_CODE (builder, &c2, ASE_SIZEOF(c2));
}
}
else if (cc == 1)
{
c0 = CHARSET_CLASS;
ADD_CODE (builder, &c0, ase_sizeof(c0));
ADD_CODE (builder, &c1, ase_sizeof(c1));
ADD_CODE (builder, &c0, ASE_SIZEOF(c0));
ADD_CODE (builder, &c1, ASE_SIZEOF(c1));
}
else
{
@ -1019,8 +1019,8 @@ static const ase_byte_t* __match_pattern (
ase_size_t nb, el, i;
p = base;
nb = *(ase_size_t*)p; p += ase_sizeof(nb);
el = *(ase_size_t*)p; p += ase_sizeof(el);
nb = *(ase_size_t*)p; p += ASE_SIZEOF(nb);
el = *(ase_size_t*)p; p += ASE_SIZEOF(el);
#ifdef BUILD_REX
xp_printf (ASE_T("__match_pattern: NB = %u, EL = %u\n"), (unsigned)nb, (unsigned)el);
@ -1057,10 +1057,10 @@ static const ase_byte_t* __match_branch (
* |NA(ase_size_t)|BL(ase_size_t)|ATOMS.........|
*/
mat->branch = base;
mat->branch_end = base + *((ase_size_t*)(base+ase_sizeof(ase_size_t)));
mat->branch_end = base + *((ase_size_t*)(base+ASE_SIZEOF(ase_size_t)));
return __match_branch_body (
matcher, base+ase_sizeof(ase_size_t)*2, mat);
matcher, base+ASE_SIZEOF(ase_size_t)*2, mat);
}
static const ase_byte_t* __match_branch_body (
@ -1145,7 +1145,7 @@ static const ase_byte_t* __match_atom (
ASE_AWK_ASSERT (matcher->awk,
((struct __code_t*)base)->cmd >= 0 &&
((struct __code_t*)base)->cmd < ase_countof(matchers));
((struct __code_t*)base)->cmd < ASE_COUNTOF(matchers));
return matchers[((struct __code_t*)base)->cmd] (matcher, base, mat);
}
@ -1156,7 +1156,7 @@ static const ase_byte_t* __match_bol (
const ase_byte_t* p = base;
const struct __code_t* cp;
cp = (const struct __code_t*)p; p += ase_sizeof(*cp);
cp = (const struct __code_t*)p; p += ASE_SIZEOF(*cp);
ASE_AWK_ASSERT (matcher->awk, cp->cmd == CMD_BOL);
mat->matched = (mat->match_ptr == matcher->match.str.ptr ||
@ -1172,7 +1172,7 @@ static const ase_byte_t* __match_eol (
const ase_byte_t* p = base;
const struct __code_t* cp;
cp = (const struct __code_t*)p; p += ase_sizeof(*cp);
cp = (const struct __code_t*)p; p += ASE_SIZEOF(*cp);
ASE_AWK_ASSERT (matcher->awk, cp->cmd == CMD_EOL);
mat->matched = (mat->match_ptr == matcher->match.str.end ||
@ -1189,7 +1189,7 @@ static const ase_byte_t* __match_any_char (
const struct __code_t* cp;
ase_size_t si = 0, lbound, ubound;
cp = (const struct __code_t*)p; p += ase_sizeof(*cp);
cp = (const struct __code_t*)p; p += ASE_SIZEOF(*cp);
ASE_AWK_ASSERT (matcher->awk, cp->cmd == CMD_ANY_CHAR);
lbound = cp->lbound;
@ -1205,7 +1205,7 @@ static const ase_byte_t* __match_any_char (
lbound += ((const struct __code_t*)p)->lbound;
ubound += ((const struct __code_t*)p)->ubound;
p += ase_sizeof(*cp);
p += ASE_SIZEOF(*cp);
}
#ifdef BUILD_REX
@ -1239,13 +1239,13 @@ static const ase_byte_t* __match_ord_char (
ase_size_t si = 0, lbound, ubound;
ase_char_t cc;
cp = (const struct __code_t*)p; p += ase_sizeof(*cp);
cp = (const struct __code_t*)p; p += ASE_SIZEOF(*cp);
ASE_AWK_ASSERT (matcher->awk, cp->cmd == CMD_ORD_CHAR);
lbound = cp->lbound;
ubound = cp->ubound;
cc = *(ase_char_t*)p; p += ase_sizeof(cc);
cc = *(ase_char_t*)p; p += ASE_SIZEOF(cc);
if (matcher->ignorecase) cc = ASE_AWK_TOUPPER(matcher->awk, cc);
/* merge the same consecutive codes
@ -1256,12 +1256,12 @@ static const ase_byte_t* __match_ord_char (
while (p < mat->branch_end &&
cp->cmd == ((const struct __code_t*)p)->cmd)
{
if (ASE_AWK_TOUPPER (matcher->awk, *(ase_char_t*)(p+ase_sizeof(*cp))) != cc) break;
if (ASE_AWK_TOUPPER (matcher->awk, *(ase_char_t*)(p+ASE_SIZEOF(*cp))) != cc) break;
lbound += ((const struct __code_t*)p)->lbound;
ubound += ((const struct __code_t*)p)->ubound;
p += ase_sizeof(*cp) + ase_sizeof(cc);
p += ASE_SIZEOF(*cp) + ASE_SIZEOF(cc);
}
}
else
@ -1269,12 +1269,12 @@ static const ase_byte_t* __match_ord_char (
while (p < mat->branch_end &&
cp->cmd == ((const struct __code_t*)p)->cmd)
{
if (*(ase_char_t*)(p+ase_sizeof(*cp)) != cc) break;
if (*(ase_char_t*)(p+ASE_SIZEOF(*cp)) != cc) break;
lbound += ((const struct __code_t*)p)->lbound;
ubound += ((const struct __code_t*)p)->ubound;
p += ase_sizeof(*cp) + ase_sizeof(cc);
p += ASE_SIZEOF(*cp) + ASE_SIZEOF(cc);
}
}
@ -1327,14 +1327,14 @@ static const ase_byte_t* __match_charset (
ase_bool_t n;
ase_char_t c;
cp = (const struct __code_t*)p; p += ase_sizeof(*cp);
cp = (const struct __code_t*)p; p += ASE_SIZEOF(*cp);
ASE_AWK_ASSERT (matcher->awk, cp->cmd == CMD_CHARSET);
lbound = cp->lbound;
ubound = cp->ubound;
csc = *(ase_size_t*)p; p += ase_sizeof(csc);
csl = *(ase_size_t*)p; p += ase_sizeof(csl);
csc = *(ase_size_t*)p; p += ASE_SIZEOF(csc);
csl = *(ase_size_t*)p; p += ASE_SIZEOF(csl);
mat->matched = ase_false;
mat->match_len = 0;
@ -1353,7 +1353,7 @@ static const ase_byte_t* __match_charset (
si++;
}
p = p + csl - (ase_sizeof(csc) + ase_sizeof(csl));
p = p + csl - (ASE_SIZEOF(csc) + ASE_SIZEOF(csl));
if (si >= lbound && si <= ubound)
{
@ -1371,7 +1371,7 @@ static const ase_byte_t* __match_group (
__match_t mat2;
ase_size_t si = 0, grp_len_static[16], * grp_len;
cp = (const struct __code_t*)p; p += ase_sizeof(*cp);
cp = (const struct __code_t*)p; p += ASE_SIZEOF(*cp);
ASE_AWK_ASSERT (matcher->awk, cp->cmd == CMD_GROUP);
mat->matched = ase_false;
@ -1401,14 +1401,14 @@ static const ase_byte_t* __match_group (
* abcabcabcxyz
*/
if (cp->ubound < ase_countof(grp_len_static))
if (cp->ubound < ASE_COUNTOF(grp_len_static))
{
grp_len = grp_len_static;
}
else
{
grp_len = (ase_size_t*) ASE_AWK_MALLOC (
matcher->awk, ase_sizeof(ase_size_t) * cp->ubound);
matcher->awk, ASE_SIZEOF(ase_size_t) * cp->ubound);
if (grp_len == ASE_NULL)
{
matcher->errnum = ASE_AWK_ENOMEM;
@ -1441,7 +1441,7 @@ static const ase_byte_t* __match_group (
}
/* increment p by the length of the subpattern */
p += *(ase_size_t*)(p+ase_sizeof(ase_size_t));
p += *(ase_size_t*)(p+ASE_SIZEOF(ase_size_t));
/* check the occurrences */
if (si >= cp->lbound && si <= cp->ubound)
@ -1594,7 +1594,7 @@ static ase_bool_t __test_charset (
ase_char_t c0, c1, c2;
c0 = *(const ase_char_t*)p;
p += ase_sizeof(c0);
p += ASE_SIZEOF(c0);
if (c0 == CHARSET_ONE)
{
c1 = *(const ase_char_t*)p;
@ -1605,7 +1605,7 @@ static ase_bool_t __test_charset (
else if (c0 == CHARSET_RANGE)
{
c1 = *(const ase_char_t*)p;
p += ase_sizeof(c1);
p += ASE_SIZEOF(c1);
c2 = *(const ase_char_t*)p;
if (matcher->ignorecase)
@ -1628,7 +1628,7 @@ static ase_bool_t __test_charset (
break;
}
p += ase_sizeof(c1);
p += ASE_SIZEOF(c1);
}
return ase_false;
@ -1706,8 +1706,8 @@ static const ase_byte_t* __print_pattern (const ase_byte_t* p)
{
ase_size_t nb, el, i;
nb = *(ase_size_t*)p; p += ase_sizeof(nb);
el = *(ase_size_t*)p; p += ase_sizeof(el);
nb = *(ase_size_t*)p; p += ASE_SIZEOF(nb);
el = *(ase_size_t*)p; p += ASE_SIZEOF(el);
#ifdef DEBUG_REX
xp_printf (ASE_T("__print_pattern: NB = %u, EL = %u\n"), (unsigned int)nb, (unsigned int)el);
#endif
@ -1725,8 +1725,8 @@ static const ase_byte_t* __print_branch (const ase_byte_t* p)
{
ase_size_t na, bl, i;
na = *(ase_size_t*)p; p += ase_sizeof(na);
bl = *(ase_size_t*)p; p += ase_sizeof(bl);
na = *(ase_size_t*)p; p += ASE_SIZEOF(na);
bl = *(ase_size_t*)p; p += ASE_SIZEOF(bl);
#ifdef DEBUG_REX
xp_printf (ASE_T("__print_branch: NA = %u, BL = %u\n"), (unsigned int) na, (unsigned int)bl);
#endif
@ -1746,41 +1746,41 @@ static const ase_byte_t* __print_atom (const ase_byte_t* p)
if (cp->cmd == CMD_BOL)
{
xp_printf (ASE_T("^"));
p += ase_sizeof(*cp);
p += ASE_SIZEOF(*cp);
}
else if (cp->cmd == CMD_EOL)
{
xp_printf (ASE_T("$"));
p += ase_sizeof(*cp);
p += ASE_SIZEOF(*cp);
}
else if (cp->cmd == CMD_ANY_CHAR)
{
xp_printf (ASE_T("."));
p += ase_sizeof(*cp);
p += ASE_SIZEOF(*cp);
}
else if (cp->cmd == CMD_ORD_CHAR)
{
p += ase_sizeof(*cp);
p += ASE_SIZEOF(*cp);
xp_printf (ASE_T("%c"), *(ase_char_t*)p);
p += ase_sizeof(ase_char_t);
p += ASE_SIZEOF(ase_char_t);
}
else if (cp->cmd == CMD_CHARSET)
{
ase_size_t csc, csl, i;
p += ase_sizeof(*cp);
p += ASE_SIZEOF(*cp);
xp_printf (ASE_T("["));
if (cp->negate) xp_printf (ASE_T("^"));
csc = *(ase_size_t*)p; p += ase_sizeof(csc);
csl = *(ase_size_t*)p; p += ase_sizeof(csl);
csc = *(ase_size_t*)p; p += ASE_SIZEOF(csc);
csl = *(ase_size_t*)p; p += ASE_SIZEOF(csl);
for (i = 0; i < csc; i++)
{
ase_char_t c0, c1, c2;
c0 = *(ase_char_t*)p;
p += ase_sizeof(c0);
p += ASE_SIZEOF(c0);
if (c0 == CHARSET_ONE)
{
@ -1790,7 +1790,7 @@ static const ase_byte_t* __print_atom (const ase_byte_t* p)
else if (c0 == CHARSET_RANGE)
{
c1 = *(ase_char_t*)p;
p += ase_sizeof(c1);
p += ASE_SIZEOF(c1);
c2 = *(ase_char_t*)p;
xp_printf (ASE_T("%c-%c"), c1, c2);
}
@ -1804,14 +1804,14 @@ static const ase_byte_t* __print_atom (const ase_byte_t* p)
xp_printf (ASE_T("should never happen - invalid charset code\n"));
}
p += ase_sizeof(c1);
p += ASE_SIZEOF(c1);
}
xp_printf (ASE_T("]"));
}
else if (cp->cmd == CMD_GROUP)
{
p += ase_sizeof(*cp);
p += ASE_SIZEOF(*cp);
xp_printf (ASE_T("("));
p = __print_pattern (p);
xp_printf (ASE_T(")"));

View File

@ -1,5 +1,5 @@
/*
* $Id: rex.h,v 1.23 2006-11-19 11:55:16 bacon Exp $
* $Id: rex.h,v 1.24 2006-11-29 02:54:16 bacon Exp $
**/
#ifndef _ASE_AWK_REX_H_
@ -40,7 +40,7 @@
#define ASE_AWK_REX_NA(code) (*(ase_size_t*)(code))
#define ASE_AWK_REX_LEN(code) \
(*(ase_size_t*)((ase_byte_t*)(code)+ase_sizeof(ase_size_t)))
(*(ase_size_t*)((ase_byte_t*)(code)+ASE_SIZEOF(ase_size_t)))
enum ase_awk_rex_opt_t
{

View File

@ -1,5 +1,5 @@
/*
* $Id: run.c,v 1.287 2006-11-28 11:21:40 bacon Exp $
* $Id: run.c,v 1.288 2006-11-29 02:54:16 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -559,14 +559,14 @@ int ase_awk_run (ase_awk_t* awk,
awk->errnum = ASE_AWK_ENOERR;
run = (ase_awk_run_t*) ASE_AWK_MALLOC (awk, ase_sizeof(ase_awk_run_t));
run = (ase_awk_run_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_run_t));
if (run == ASE_NULL)
{
awk->errnum = ASE_AWK_ENOMEM;
return -1;
}
ASE_AWK_MEMSET (awk, run, 0, ase_sizeof(ase_awk_run_t));
ASE_AWK_MEMSET (awk, run, 0, ASE_SIZEOF(ase_awk_run_t));
__add_run (awk, run);
@ -754,7 +754,7 @@ static int __init_run (
}
run->format.tmp.ptr = (ase_char_t*)
ASE_AWK_MALLOC (run->awk, 4096*ase_sizeof(ase_char_t*));
ASE_AWK_MALLOC (run->awk, 4096*ASE_SIZEOF(ase_char_t*));
if (run->format.tmp.ptr == ASE_NULL)
{
ase_awk_map_close (&run->named);
@ -770,7 +770,7 @@ static int __init_run (
if (run->awk->tree.chain_size > 0)
{
run->pattern_range_state = (ase_byte_t*) ASE_AWK_MALLOC (
run->awk, run->awk->tree.chain_size*ase_sizeof(ase_byte_t));
run->awk, run->awk->tree.chain_size*ASE_SIZEOF(ase_byte_t));
if (run->pattern_range_state == ASE_NULL)
{
ASE_AWK_FREE (run->awk, run->format.tmp.ptr);
@ -783,7 +783,7 @@ static int __init_run (
}
ASE_AWK_MEMSET (run->awk, run->pattern_range_state, 0,
run->awk->tree.chain_size * ase_sizeof(ase_byte_t));
run->awk->tree.chain_size * ASE_SIZEOF(ase_byte_t));
}
else run->pattern_range_state = ASE_NULL;
@ -922,7 +922,7 @@ static int __build_runarg (ase_awk_run_t* run, ase_awk_runarg_t* runarg)
ase_awk_val_t* v_argc;
ase_awk_val_t* v_argv;
ase_awk_val_t* v_tmp;
ase_char_t key[ase_sizeof(ase_long_t)*8+2];
ase_char_t key[ASE_SIZEOF(ase_long_t)*8+2];
ase_size_t key_len;
v_argv = ase_awk_makemapval (run);
@ -947,7 +947,7 @@ static int __build_runarg (ase_awk_run_t* run, ase_awk_runarg_t* runarg)
}
key_len = ase_awk_longtostr (
argc, 10, ASE_NULL, key, ase_countof(key));
argc, 10, ASE_NULL, key, ASE_COUNTOF(key));
ASE_AWK_ASSERT (run->awk, key_len != (ase_size_t)-1);
/* increment reference count of v_tmp in advance as if
@ -1056,7 +1056,7 @@ static int __set_globals_to_default (ase_awk_run_t* run)
ase_awk_val_t* tmp;
ase_size_t i, j;
for (i = 0; i < ase_countof(gtab); i++)
for (i = 0; i < ASE_COUNTOF(gtab); i++)
{
if (gtab[i].str == ASE_NULL || gtab[i].str[0] == ASE_T('\0'))
{
@ -2662,7 +2662,7 @@ static ase_awk_val_t* __eval_expression0 (ase_awk_run_t* run, ase_awk_nde_t* nde
};
ASE_AWK_ASSERT (run->awk, nde->type >= ASE_AWK_NDE_GRP &&
(nde->type - ASE_AWK_NDE_GRP) < ase_countof(__eval_func));
(nde->type - ASE_AWK_NDE_GRP) < ASE_COUNTOF(__eval_func));
return __eval_func[nde->type-ASE_AWK_NDE_GRP] (run, nde);
}
@ -3082,7 +3082,7 @@ static ase_awk_val_t* __eval_binary (ase_awk_run_t* run, ase_awk_nde_t* nde)
ase_awk_refupval (run, right);
ASE_AWK_ASSERT (run->awk, exp->opcode >= 0 &&
exp->opcode < ase_countof(__binop_func));
exp->opcode < ASE_COUNTOF(__binop_func));
ASE_AWK_ASSERT (run->awk, __binop_func[exp->opcode] != ASE_NULL);
res = __binop_func[exp->opcode] (run, left, right);
@ -4702,8 +4702,8 @@ static ase_awk_val_t* __eval_call (
* ---------------------
*/
ASE_AWK_ASSERT (run->awk, ase_sizeof(void*) >= ase_sizeof(run->stack_top));
ASE_AWK_ASSERT (run->awk, ase_sizeof(void*) >= ase_sizeof(run->stack_base));
ASE_AWK_ASSERT (run->awk, ASE_SIZEOF(void*) >= ASE_SIZEOF(run->stack_top));
ASE_AWK_ASSERT (run->awk, ASE_SIZEOF(void*) >= ASE_SIZEOF(run->stack_base));
saved_stack_top = run->stack_top;
@ -5373,18 +5373,18 @@ static int __raw_push (ase_awk_run_t* run, void* val)
if (run->awk->syscas.realloc != ASE_NULL)
{
tmp = (void**) ASE_AWK_REALLOC (
run->awk, run->stack, n * ase_sizeof(void*));
run->awk, run->stack, n * ASE_SIZEOF(void*));
if (tmp == ASE_NULL) return -1;
}
else
{
tmp = (void**) ASE_AWK_MALLOC (
run->awk, n * ase_sizeof(void*));
run->awk, n * ASE_SIZEOF(void*));
if (tmp == ASE_NULL) return -1;
if (run->stack != ASE_NULL)
{
ASE_AWK_MEMCPY (run->awk, tmp, run->stack,
run->stack_limit * ase_sizeof(void*));
run->stack_limit * ASE_SIZEOF(void*));
ASE_AWK_FREE (run->awk, run->stack);
}
}
@ -5646,7 +5646,7 @@ ase_char_t* ase_awk_format (
} \
(buf)->len += (buf)->inc; \
(buf)->ptr = (ase_char_t*)ASE_AWK_MALLOC ( \
run->awk, (buf)->len * ase_sizeof(ase_char_t)); \
run->awk, (buf)->len * ASE_SIZEOF(ase_char_t)); \
if ((buf)->ptr == ASE_NULL) (buf)->len = 0; \
} while (0)

View File

@ -1,5 +1,5 @@
/*
* $Id: str.c,v 1.11 2006-10-24 04:10:12 bacon Exp $
* $Id: str.c,v 1.12 2006-11-29 02:54:16 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -10,7 +10,7 @@ ase_awk_str_t* ase_awk_str_open (
if (str == ASE_NULL)
{
str = (ase_awk_str_t*)
ASE_AWK_MALLOC (awk, sizeof(ase_awk_str_t));
ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_str_t));
if (str == ASE_NULL) return ASE_NULL;
str->__dynamic = ase_true;
}
@ -18,7 +18,7 @@ ase_awk_str_t* ase_awk_str_open (
str->awk = awk;
str->buf = (ase_char_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_char_t) * (capa + 1));
awk, ASE_SIZEOF(ase_char_t) * (capa + 1));
if (str->buf == ASE_NULL)
{
if (str->__dynamic) ASE_AWK_FREE (awk, str);
@ -77,7 +77,7 @@ ase_size_t ase_awk_str_ncpy (
if (len > str->capa)
{
buf = (ase_char_t*) ASE_AWK_MALLOC (
str->awk, ase_sizeof(ase_char_t) * (len + 1));
str->awk, ASE_SIZEOF(ase_char_t) * (len + 1));
if (buf == ASE_NULL) return (ase_size_t)-1;
ASE_AWK_FREE (str->awk, str->buf);
@ -113,18 +113,18 @@ ase_size_t ase_awk_str_ncat (
{
tmp = (ase_char_t*) ASE_AWK_REALLOC (
str->awk, str->buf,
ase_sizeof(ase_char_t) * (capa + 1));
ASE_SIZEOF(ase_char_t) * (capa + 1));
if (tmp == ASE_NULL) return (ase_size_t)-1;
}
else
{
tmp = (ase_char_t*) ASE_AWK_MALLOC (
str->awk, ase_sizeof(ase_char_t) * (capa + 1));
str->awk, ASE_SIZEOF(ase_char_t) * (capa + 1));
if (tmp == ASE_NULL) return (ase_size_t)-1;
if (str->buf != ASE_NULL)
{
ASE_AWK_MEMCPY (str->awk, tmp, str->buf,
ase_sizeof(ase_char_t) * (str->capa + 1));
ASE_SIZEOF(ase_char_t) * (str->capa + 1));
ASE_AWK_FREE (str->awk, str->buf);
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: tab.c,v 1.24 2006-10-26 09:27:15 bacon Exp $
* $Id: tab.c,v 1.25 2006-11-29 02:54:16 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -9,7 +9,7 @@ ase_awk_tab_t* ase_awk_tab_open (ase_awk_tab_t* tab, ase_awk_t* awk)
if (tab == ASE_NULL)
{
tab = (ase_awk_tab_t*) ASE_AWK_MALLOC (
awk, ase_sizeof(ase_awk_tab_t));
awk, ASE_SIZEOF(ase_awk_tab_t));
if (tab == ASE_NULL) return ASE_NULL;
tab->__dynamic = ase_true;
}
@ -61,13 +61,13 @@ ase_awk_tab_t* ase_awk_tab_setcapa (ase_awk_tab_t* tab, ase_size_t capa)
if (tab->awk->syscas.realloc != ASE_NULL)
{
tmp = ASE_AWK_REALLOC (tab->awk,
tab->buf, ase_sizeof(*tab->buf) * capa);
tab->buf, ASE_SIZEOF(*tab->buf) * capa);
if (tmp == ASE_NULL) return ASE_NULL;
}
else
{
tmp = ASE_AWK_MALLOC (
tab->awk, ase_sizeof(*tab->buf) * capa);
tab->awk, ASE_SIZEOF(*tab->buf) * capa);
if (tmp == ASE_NULL) return ASE_NULL;
if (tab->buf != ASE_NULL)
{
@ -75,7 +75,7 @@ ase_awk_tab_t* ase_awk_tab_setcapa (ase_awk_tab_t* tab, ase_size_t capa)
x = (capa > tab->capa)? tab->capa: capa;
ASE_AWK_MEMCPY (
tab->awk, tmp, tab->buf,
ase_sizeof(*tab->buf) * x);
ASE_SIZEOF(*tab->buf) * x);
ASE_AWK_FREE (tab->awk, tab->buf);
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: tree.c,v 1.91 2006-11-27 15:10:35 bacon Exp $
* $Id: tree.c,v 1.92 2006-11-29 02:54:16 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -226,12 +226,12 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
{
if (((ase_awk_nde_int_t*)nde)->str == ASE_NULL)
{
ase_char_t tmp[ase_sizeof(ase_long_t)*8+2];
ase_char_t tmp[ASE_SIZEOF(ase_long_t)*8+2];
ase_size_t n;
n = ase_awk_longtostr (
((ase_awk_nde_int_t*)nde)->val,
10, ASE_NULL, tmp, ase_countof(tmp));
10, ASE_NULL, tmp, ASE_COUNTOF(tmp));
PUT_SRCSTRX (awk, tmp, n);
}
@ -251,11 +251,11 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
ase_char_t tmp[256];
#if (ASE_SIZEOF_LONG_DOUBLE != 0)
awk->syscas.sprintf (
tmp, ase_countof(tmp), ASE_T("%Lf"),
tmp, ASE_COUNTOF(tmp), ASE_T("%Lf"),
(long double)((ase_awk_nde_real_t*)nde)->val);
#elif (ASE_SIZEOF_DOUBLE != 0)
awk->syscas.sprintf (
tmp, ase_countof(tmp), ASE_T("%f"),
tmp, ASE_COUNTOF(tmp), ASE_T("%f"),
(double)((ase_awk_nde_real_t*)nde)->val);
#else
#error unsupported floating-point data type
@ -314,13 +314,13 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
case ASE_AWK_NDE_ARG:
{
ase_char_t tmp[ase_sizeof(ase_long_t)*8+2];
ase_char_t tmp[ASE_SIZEOF(ase_long_t)*8+2];
ase_size_t n;
ase_awk_nde_var_t* px = (ase_awk_nde_var_t*)nde;
ASE_AWK_ASSERT (awk, px->id.idxa != (ase_size_t)-1);
n = ase_awk_longtostr (
px->id.idxa, 10, ASE_NULL, tmp, ase_countof(tmp));
px->id.idxa, 10, ASE_NULL, tmp, ASE_COUNTOF(tmp));
PUT_SRCSTR (awk, ASE_T("__param"));
PUT_SRCSTRX (awk, tmp, n);
@ -331,7 +331,7 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
case ASE_AWK_NDE_ARGIDX:
{
ase_char_t tmp[ase_sizeof(ase_long_t)*8+2];
ase_char_t tmp[ASE_SIZEOF(ase_long_t)*8+2];
ase_size_t n;
ase_awk_nde_var_t* px = (ase_awk_nde_var_t*)nde;
ASE_AWK_ASSERT (awk, px->id.idxa != (ase_size_t)-1);
@ -339,7 +339,7 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
PUT_SRCSTR (awk, ASE_T("__param"));
n = ase_awk_longtostr (
px->id.idxa, 10, ASE_NULL, tmp, ase_countof(tmp));
px->id.idxa, 10, ASE_NULL, tmp, ASE_COUNTOF(tmp));
PUT_SRCSTRX (awk, tmp, n);
PUT_SRCSTR (awk, ASE_T("["));
PRINT_EXPRESSION_LIST (awk, px->idx);
@ -372,7 +372,7 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
case ASE_AWK_NDE_GLOBAL:
{
ase_char_t tmp[ase_sizeof(ase_long_t)*8+2];
ase_char_t tmp[ASE_SIZEOF(ase_long_t)*8+2];
ase_size_t n;
ase_awk_nde_var_t* px = (ase_awk_nde_var_t*)nde;
@ -381,7 +381,7 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
PUT_SRCSTR (awk, ASE_T("__global"));
n = ase_awk_longtostr (
px->id.idxa, 10,
ASE_NULL, tmp, ase_countof(tmp));
ASE_NULL, tmp, ASE_COUNTOF(tmp));
PUT_SRCSTRX (awk, tmp, n);
/*PUT_SRCSTRX (awk, px->id.name, px->id.name_len);*/
}
@ -395,7 +395,7 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
case ASE_AWK_NDE_GLOBALIDX:
{
ase_char_t tmp[ase_sizeof(ase_long_t)*8+2];
ase_char_t tmp[ASE_SIZEOF(ase_long_t)*8+2];
ase_size_t n;
ase_awk_nde_var_t* px = (ase_awk_nde_var_t*)nde;
@ -404,7 +404,7 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
PUT_SRCSTR (awk, ASE_T("__global"));
n = ase_awk_longtostr (
px->id.idxa, 10,
ASE_NULL, tmp, ase_countof(tmp));
ASE_NULL, tmp, ASE_COUNTOF(tmp));
PUT_SRCSTRX (awk, tmp, n);
/*PUT_SRCSTRX (awk, px->id.name, px->id.name_len);*/
PUT_SRCSTR (awk, ASE_T("["));
@ -422,7 +422,7 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
case ASE_AWK_NDE_LOCAL:
{
ase_char_t tmp[ase_sizeof(ase_long_t)*8+2];
ase_char_t tmp[ASE_SIZEOF(ase_long_t)*8+2];
ase_size_t n;
ase_awk_nde_var_t* px = (ase_awk_nde_var_t*)nde;
@ -431,7 +431,7 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
PUT_SRCSTR (awk, ASE_T("__local"));
n = ase_awk_longtostr (
px->id.idxa, 10,
ASE_NULL, tmp, ase_countof(tmp));
ASE_NULL, tmp, ASE_COUNTOF(tmp));
PUT_SRCSTRX (awk, tmp, n);
}
else
@ -444,7 +444,7 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
case ASE_AWK_NDE_LOCALIDX:
{
ase_char_t tmp[ase_sizeof(ase_long_t)*8+2];
ase_char_t tmp[ASE_SIZEOF(ase_long_t)*8+2];
ase_size_t n;
ase_awk_nde_var_t* px = (ase_awk_nde_var_t*)nde;
@ -453,7 +453,7 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
PUT_SRCSTR (awk, ASE_T("__local"));
n = ase_awk_longtostr (
px->id.idxa, 10,
ASE_NULL, tmp, ase_countof(tmp));
ASE_NULL, tmp, ASE_COUNTOF(tmp));
PUT_SRCSTRX (awk, tmp, n);
PUT_SRCSTR (awk, ASE_T("["));
}
@ -570,7 +570,7 @@ static int __print_statements (ase_awk_t* awk, ase_awk_nde_t* tree, int depth)
case ASE_AWK_NDE_BLK:
{
ase_char_t tmp[ase_sizeof(ase_long_t)*8+2];
ase_char_t tmp[ASE_SIZEOF(ase_long_t)*8+2];
ase_size_t n;
ase_awk_nde_blk_t* px = (ase_awk_nde_blk_t*)p;
@ -586,14 +586,14 @@ static int __print_statements (ase_awk_t* awk, ase_awk_nde_t* tree, int depth)
{
PUT_SRCSTR (awk, ASE_T("__local"));
n = ase_awk_longtostr (
i, 10, ASE_NULL, tmp, ase_countof(tmp));
i, 10, ASE_NULL, tmp, ASE_COUNTOF(tmp));
PUT_SRCSTRX (awk, tmp, n);
PUT_SRCSTR (awk, ASE_T(", "));
}
PUT_SRCSTR (awk, ASE_T("__local"));
n = ase_awk_longtostr (
i, 10, ASE_NULL, tmp, ase_countof(tmp));
i, 10, ASE_NULL, tmp, ASE_COUNTOF(tmp));
PUT_SRCSTRX (awk, tmp, n);
PUT_SRCSTR (awk, ASE_T(";\n"));
}

View File

@ -1,5 +1,5 @@
/*
* $Id: err.c,v 1.7 2006-10-30 03:34:40 bacon Exp $
* $Id: err.c,v 1.8 2006-11-29 02:54:17 bacon Exp $
*/
#include <ase/lsp/lsp_i.h>
@ -35,7 +35,7 @@ const ase_char_t* ase_lsp_geterrstr (int errnum)
ASE_T("divide by zero")
};
if (errnum >= 0 && errnum < ase_countof(__errstr))
if (errnum >= 0 && errnum < ASE_COUNTOF(__errstr))
{
return __errstr[errnum];
}

View File

@ -1,5 +1,5 @@
/*
* $Id: lsp.c,v 1.17 2006-11-02 11:10:12 bacon Exp $
* $Id: lsp.c,v 1.18 2006-11-29 02:54:17 bacon Exp $
*/
#if defined(__BORLANDC__)
@ -43,23 +43,23 @@ ase_lsp_t* ase_lsp_open (
syscas->abort == ASE_NULL) return ASE_NULL;
#if defined(_WIN32) && defined(_DEBUG)
lsp = (ase_lsp_t*) malloc (ase_sizeof(ase_lsp_t));
lsp = (ase_lsp_t*) malloc (ASE_SIZEOF(ase_lsp_t));
#else
lsp = (ase_lsp_t*) syscas->malloc (
ase_sizeof(ase_lsp_t), syscas->custom_data);
ASE_SIZEOF(ase_lsp_t), syscas->custom_data);
#endif
if (lsp == ASE_NULL) return ASE_NULL;
/* it uses the built-in ase_lsp_memset because lsp is not
* fully initialized yet */
ase_lsp_memset (lsp, 0, ase_sizeof(ase_lsp_t));
ase_lsp_memset (lsp, 0, ASE_SIZEOF(ase_lsp_t));
if (syscas->memcpy == ASE_NULL)
{
ase_lsp_memcpy (&lsp->syscas, syscas, ase_sizeof(lsp->syscas));
ase_lsp_memcpy (&lsp->syscas, syscas, ASE_SIZEOF(lsp->syscas));
lsp->syscas.memcpy = ase_lsp_memcpy;
}
else syscas->memcpy (&lsp->syscas, syscas, ase_sizeof(lsp->syscas));
else syscas->memcpy (&lsp->syscas, syscas, ASE_SIZEOF(lsp->syscas));
if (syscas->memset == ASE_NULL) lsp->syscas.memset = ase_lsp_memset;
if (ase_lsp_name_open(&lsp->token.name, 0, lsp) == ASE_NULL)

View File

@ -1,5 +1,5 @@
/*
* $Id: mem.c,v 1.24 2006-11-02 11:10:12 bacon Exp $
* $Id: mem.c,v 1.25 2006-11-29 02:54:17 bacon Exp $
*/
#include <ase/lsp/lsp_i.h>
@ -11,10 +11,10 @@ ase_lsp_mem_t* ase_lsp_openmem (
ase_size_t i;
/* allocate memory */
mem = (ase_lsp_mem_t*) ASE_LSP_MALLOC (lsp, ase_sizeof(ase_lsp_mem_t));
mem = (ase_lsp_mem_t*) ASE_LSP_MALLOC (lsp, ASE_SIZEOF(ase_lsp_mem_t));
if (mem == ASE_NULL) return ASE_NULL;
ASE_LSP_MEMSET (lsp, mem, 0, ase_sizeof(ase_lsp_mem_t));
ASE_LSP_MEMSET (lsp, mem, 0, ASE_SIZEOF(ase_lsp_mem_t));
mem->lsp = lsp;
/* create a new root environment frame */
@ -360,7 +360,7 @@ ase_lsp_obj_t* ase_lsp_makenil (ase_lsp_mem_t* mem)
{
if (mem->nil != ASE_NULL) return mem->nil;
mem->nil = ase_lsp_alloc (
mem, ASE_LSP_OBJ_NIL, ase_sizeof(ase_lsp_obj_nil_t));
mem, ASE_LSP_OBJ_NIL, ASE_SIZEOF(ase_lsp_obj_nil_t));
return mem->nil;
}
@ -368,7 +368,7 @@ ase_lsp_obj_t* ase_lsp_maketrue (ase_lsp_mem_t* mem)
{
if (mem->t != ASE_NULL) return mem->t;
mem->t = ase_lsp_alloc (
mem, ASE_LSP_OBJ_TRUE, ase_sizeof(ase_lsp_obj_true_t));
mem, ASE_LSP_OBJ_TRUE, ASE_SIZEOF(ase_lsp_obj_true_t));
return mem->t;
}
@ -377,7 +377,7 @@ ase_lsp_obj_t* ase_lsp_makeintobj (ase_lsp_mem_t* mem, ase_long_t value)
ase_lsp_obj_t* obj;
obj = ase_lsp_alloc (mem,
ASE_LSP_OBJ_INT, ase_sizeof(ase_lsp_obj_int_t));
ASE_LSP_OBJ_INT, ASE_SIZEOF(ase_lsp_obj_int_t));
if (obj == ASE_NULL) return ASE_NULL;
ASE_LSP_IVAL(obj) = value;
@ -390,7 +390,7 @@ ase_lsp_obj_t* ase_lsp_makerealobj (ase_lsp_mem_t* mem, ase_real_t value)
ase_lsp_obj_t* obj;
obj = ase_lsp_alloc (mem,
ASE_LSP_OBJ_REAL, ase_sizeof(ase_lsp_obj_real_t));
ASE_LSP_OBJ_REAL, ASE_SIZEOF(ase_lsp_obj_real_t));
if (obj == ASE_NULL) return ASE_NULL;
ASE_LSP_RVAL(obj) = value;
@ -416,7 +416,7 @@ ase_lsp_obj_t* ase_lsp_makesym (
// no such symbol found. create a new one
obj = ase_lsp_alloc (mem, ASE_LSP_OBJ_SYM,
ase_sizeof(ase_lsp_obj_sym_t)+(len + 1)*ase_sizeof(ase_char_t));
ASE_SIZEOF(ase_lsp_obj_sym_t)+(len + 1)*ASE_SIZEOF(ase_char_t));
if (obj == ASE_NULL) return ASE_NULL;
// fill in the symbol buffer
@ -432,7 +432,7 @@ ase_lsp_obj_t* ase_lsp_makestr (
// allocate memory for the string
obj = ase_lsp_alloc (mem, ASE_LSP_OBJ_STR,
ase_sizeof(ase_lsp_obj_str_t)+(len + 1)*ase_sizeof(ase_char_t));
ASE_SIZEOF(ase_lsp_obj_str_t)+(len + 1)*ASE_SIZEOF(ase_char_t));
if (obj == ASE_NULL) return ASE_NULL;
// fill in the string buffer
@ -446,7 +446,7 @@ ase_lsp_obj_t* ase_lsp_makecons (
{
ase_lsp_obj_t* obj;
obj = ase_lsp_alloc (mem, ASE_LSP_OBJ_CONS, ase_sizeof(ase_lsp_obj_cons_t));
obj = ase_lsp_alloc (mem, ASE_LSP_OBJ_CONS, ASE_SIZEOF(ase_lsp_obj_cons_t));
if (obj == ASE_NULL) return ASE_NULL;
ASE_LSP_CAR(obj) = car;
@ -460,7 +460,7 @@ ase_lsp_obj_t* ase_lsp_makefunc (
{
ase_lsp_obj_t* obj;
obj = ase_lsp_alloc (mem, ASE_LSP_OBJ_FUNC, ase_sizeof(ase_lsp_obj_func_t));
obj = ase_lsp_alloc (mem, ASE_LSP_OBJ_FUNC, ASE_SIZEOF(ase_lsp_obj_func_t));
if (obj == ASE_NULL) return ASE_NULL;
ASE_LSP_FFORMAL(obj) = formal;
@ -475,7 +475,7 @@ ase_lsp_obj_t* ase_lsp_makemacro (
ase_lsp_obj_t* obj;
obj = ase_lsp_alloc (mem,
ASE_LSP_OBJ_MACRO, ase_sizeof(ase_lsp_obj_macro_t));
ASE_LSP_OBJ_MACRO, ASE_SIZEOF(ase_lsp_obj_macro_t));
if (obj == ASE_NULL) return ASE_NULL;
ASE_LSP_MFORMAL(obj) = formal;
@ -490,7 +490,7 @@ ase_lsp_obj_t* ase_lsp_makeprim (ase_lsp_mem_t* mem,
ase_lsp_obj_t* obj;
obj = ase_lsp_alloc (
mem, ASE_LSP_OBJ_PRIM, ase_sizeof(ase_lsp_obj_prim_t));
mem, ASE_LSP_OBJ_PRIM, ASE_SIZEOF(ase_lsp_obj_prim_t));
if (obj == ASE_NULL) return ASE_NULL;
ASE_LSP_PIMPL(obj) = impl;

View File

@ -1,5 +1,5 @@
/*
* $Id: misc.c,v 1.5 2006-10-30 14:31:37 bacon Exp $
* $Id: misc.c,v 1.6 2006-11-29 02:54:17 bacon Exp $
*/
#include <ase/lsp/lsp_i.h>
@ -605,7 +605,7 @@ ase_char_t* ase_lsp_strdup (ase_lsp_t* lsp, const ase_char_t* str)
ase_char_t* tmp;
tmp = (ase_char_t*) ASE_LSP_MALLOC (
lsp, (ase_lsp_strlen(str) + 1) * ase_sizeof(ase_char_t));
lsp, (ase_lsp_strlen(str) + 1) * ASE_SIZEOF(ase_char_t));
if (tmp == ASE_NULL) return ASE_NULL;
ase_lsp_strcpy (tmp, str);
@ -617,7 +617,7 @@ ase_char_t* ase_lsp_strxdup (ase_lsp_t* lsp, const ase_char_t* str, ase_size_t l
ase_char_t* tmp;
tmp = (ase_char_t*) ASE_LSP_MALLOC (
lsp, (len + 1) * ase_sizeof(ase_char_t));
lsp, (len + 1) * ASE_SIZEOF(ase_char_t));
if (tmp == ASE_NULL) return ASE_NULL;
ase_lsp_strncpy (tmp, str, len);
@ -632,7 +632,7 @@ ase_char_t* ase_lsp_strxdup2 (
ase_char_t* tmp;
tmp = (ase_char_t*) ASE_LSP_MALLOC (
lsp, (len1 + len2 + 1) * ase_sizeof(ase_char_t));
lsp, (len1 + len2 + 1) * ASE_SIZEOF(ase_char_t));
if (tmp == ASE_NULL) return ASE_NULL;
ase_lsp_strncpy (tmp, str1, len1);

View File

@ -1,5 +1,5 @@
/*
* $Id: name.c,v 1.11 2006-11-02 10:12:01 bacon Exp $
* $Id: name.c,v 1.12 2006-11-29 02:54:17 bacon Exp $
*/
#include <ase/lsp/lsp_i.h>
@ -7,25 +7,25 @@
ase_lsp_name_t* ase_lsp_name_open (
ase_lsp_name_t* name, ase_size_t capa, ase_lsp_t* lsp)
{
if (capa == 0) capa = ase_countof(name->static_buf) - 1;
if (capa == 0) capa = ASE_COUNTOF(name->static_buf) - 1;
if (name == ASE_NULL)
{
name = (ase_lsp_name_t*)
ASE_LSP_MALLOC (lsp, ase_sizeof(ase_lsp_name_t));
ASE_LSP_MALLOC (lsp, ASE_SIZEOF(ase_lsp_name_t));
if (name == ASE_NULL) return ASE_NULL;
name->__dynamic = ase_true;
}
else name->__dynamic = ase_false;
if (capa < ase_countof(name->static_buf))
if (capa < ASE_COUNTOF(name->static_buf))
{
name->buf = name->static_buf;
}
else
{
name->buf = (ase_char_t*)
ASE_LSP_MALLOC (lsp, (capa+1)*ase_sizeof(ase_char_t));
ASE_LSP_MALLOC (lsp, (capa+1)*ASE_SIZEOF(ase_char_t));
if (name->buf == ASE_NULL)
{
if (name->__dynamic) ASE_LSP_FREE (lsp, name);
@ -43,7 +43,7 @@ ase_lsp_name_t* ase_lsp_name_open (
void ase_lsp_name_close (ase_lsp_name_t* name)
{
if (name->capa >= ase_countof(name->static_buf))
if (name->capa >= ASE_COUNTOF(name->static_buf))
{
ASE_LSP_ASSERT (name->lsp, name->buf != name->static_buf);
ASE_LSP_FREE (name->lsp, name->buf);
@ -58,25 +58,25 @@ int ase_lsp_name_addc (ase_lsp_name_t* name, ase_cint_t c)
/* double the capacity */
ase_size_t new_capa = name->capa * 2;
if (new_capa >= ase_countof(name->static_buf))
if (new_capa >= ASE_COUNTOF(name->static_buf))
{
ase_char_t* space;
if (name->capa < ase_countof(name->static_buf))
if (name->capa < ASE_COUNTOF(name->static_buf))
{
space = (ase_char_t*) ASE_LSP_MALLOC (
name->lsp, (new_capa+1)*ase_sizeof(ase_char_t));
name->lsp, (new_capa+1)*ASE_SIZEOF(ase_char_t));
if (space == ASE_NULL) return -1;
/* don't need to copy up to the terminating null */
ASE_LSP_MEMCPY (name->lsp, space, name->buf,
name->capa*ase_sizeof(ase_char_t));
name->capa*ASE_SIZEOF(ase_char_t));
}
else
{
space = (ase_char_t*) ASE_LSP_REALLOC (
name->lsp, name->buf,
(new_capa+1)*ase_sizeof(ase_char_t));
(new_capa+1)*ASE_SIZEOF(ase_char_t));
if (space == ASE_NULL) return -1;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: print.c,v 1.18 2006-10-30 03:49:06 bacon Exp $
* $Id: print.c,v 1.19 2006-11-29 02:54:17 bacon Exp $
*/
#include <ase/lsp/lsp_i.h>
@ -43,22 +43,22 @@ static int __print (ase_lsp_t* lsp, const ase_lsp_obj_t* obj, ase_bool_t prt_con
case ASE_LSP_OBJ_INT:
#if defined(__BORLANDC__) || defined(_MSC_VER)
lsp->syscas.sprintf (
buf, ase_countof(buf),
buf, ASE_COUNTOF(buf),
ASE_T("%I64d"), (__int64)ASE_LSP_IVAL(obj));
#elif defined(vax) || defined(__vax) || defined(_SCO_DS)
lsp->syscas.sprintf (
buf, ase_countof(buf),
buf, ASE_COUNTOF(buf),
ASE_T("%ld"), (long)ASE_LSP_IVAL(obj));
#else
lsp->syscas.sprintf (
buf, ase_countof(buf),
buf, ASE_COUNTOF(buf),
ASE_T("%lld"), (long long)ASE_LSP_IVAL(obj));
#endif
OUTPUT_STR (lsp, buf);
break;
case ASE_LSP_OBJ_REAL:
lsp->syscas.sprintf (buf, ase_countof(buf),
lsp->syscas.sprintf (buf, ASE_COUNTOF(buf),
ASE_T("%Lf"), (long double)ASE_LSP_RVAL(obj));
OUTPUT_STR (lsp, buf);
@ -117,7 +117,7 @@ static int __print (ase_lsp_t* lsp, const ase_lsp_obj_t* obj, ase_bool_t prt_con
break;
default:
lsp->syscas.sprintf (buf, ase_countof(buf),
lsp->syscas.sprintf (buf, ASE_COUNTOF(buf),
ASE_T("unknown object type: %d"), ASE_LSP_TYPE(obj));
OUTPUT_STR (lsp, buf);
}

View File

@ -1,5 +1,5 @@
/*
* $Id: macros.h,v 1.41 2006-11-29 02:39:09 bacon Exp $
* $Id: macros.h,v 1.42 2006-11-29 02:54:14 bacon Exp $
*/
#ifndef _ASE_MACROS_H_
@ -15,26 +15,20 @@
#endif
#define ASE_CHAR_EOF ((ase_cint_t)-1)
#define ASE_UNREFERENCED(x) ((x) = (x))
#define ASE_UNUSED(x) ((x) = (x))
#define ASE_SIZEOF(n) (sizeof(n))
#define ASE_COUNTOF(n) (sizeof(n) / sizeof(n[0]))
#define ASE_SIZEOF(n) (sizeof(n))
#define ASE_COUNTOF(n) (sizeof(n)/sizeof(n[0]))
#define ASE_OFFSETOF(type,member) ((ase_size_t)&((type*)0)->member)
#if defined(_WIN32) && defined(ASE_CHAR_IS_WCHAR) && !defined(__LCC__)
#define ase_main wmain
#elif defined(ASE_CHAR_IS_MCHAR)
#define ase_main main
#endif
#define ASE_TYPE_IS_SIGNED(type) (((type)0) > ((type)-1))
#define ASE_TYPE_IS_UNSIGNED(type) (((type)0) < ((type)-1))
#define ASE_TYPE_MAX(type) \
((ASE_TYPE_IS_SIGNED(type)? (type)~((type)1 << (ase_sizeof(type) * 8 - 1)): (type)(~(type)0)))
((ASE_TYPE_IS_SIGNED(type)? (type)~((type)1 << (ASE_SIZEOF(type) * 8 - 1)): (type)(~(type)0)))
#define ASE_TYPE_MIN(type) \
((ASE_TYPE_IS_SIGNED(type)? (type)((type)1 << (ase_sizeof(type) * 8 - 1)): (type)0))
((ASE_TYPE_IS_SIGNED(type)? (type)((type)1 << (ASE_SIZEOF(type) * 8 - 1)): (type)0))
#define ASE_NUM_IS_POWOF2(x) (((x) & ((x) - 1)) == 0)
#define ASE_IS_POWOF2(x) (((x) & ((x) - 1)) == 0)
#define ASE_SWAP(x,y,original_type,casting_type) \
do { \
x = (original_type)((casting_type)(x) ^ (casting_type)(y)); \
@ -64,13 +58,6 @@
#define ASE_MS(str) ((const ase_mchar_t*)str)
#define ASE_MT(txt) (txt)
/* TODO: if the compiler doesn't have the built-in wchar_t support
* ASE_WCHAR & ASE_WTEXT must be defined differently.
#define ASE_WCHAR(ch) ((ase_wchar_t)ch)
#define ASE_WTEXT(txt) don't know yet... may have to call a function?
*/
/* new short form */
#define ASE_WC(ch) ((ase_wchar_t)L ## ch)
#define ASE_WS(str) ((const ase_wchar_t*)L ## str)
#define ASE_WT(txt) (L ## txt)
@ -80,7 +67,6 @@
#define ASE_S(str) ASE_MS(str)
#define ASE_T(txt) ASE_MT(txt)
#else
/* new short form */
#define ASE_C(ch) ASE_WC(ch)
#define ASE_S(str) ASE_WS(str)
#define ASE_T(txt) ASE_WT(txt)