This commit is contained in:
hyung-hwan 2008-06-10 00:24:10 +00:00
parent 49380746f7
commit 6eead095a5
10 changed files with 106 additions and 106 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: awk.c 192 2008-06-06 10:33:44Z baconevi $
* $Id: awk.c 197 2008-06-09 06:24:10Z baconevi $
*
* {License}
*/
@ -166,7 +166,7 @@ ase_awk_t* ase_awk_open (const ase_awk_prmfns_t* prmfns, void* custom_data)
awk->option = 0;
awk->errnum = ASE_AWK_ENOERR;
awk->errlin = 0;
awk->stopall = ase_false;
awk->stopall = ASE_FALSE;
awk->parse.nlocals_max = 0;
@ -304,7 +304,7 @@ int ase_awk_close (ase_awk_t* awk)
int ase_awk_clear (ase_awk_t* awk)
{
awk->stopall = ase_false;
awk->stopall = ASE_FALSE;
ase_memset (&awk->src.ios, 0, ASE_SIZEOF(awk->src.ios));
awk->src.lex.curc = ASE_CHAR_EOF;
@ -397,7 +397,7 @@ void* ase_awk_getcustomdata (ase_awk_t* awk)
void ase_awk_stopall (ase_awk_t* awk)
{
awk->stopall = ase_true;
awk->stopall = ASE_TRUE;
}
int ase_awk_getword (ase_awk_t* awk,

View File

@ -1,5 +1,5 @@
/*
* $Id: extio.c 192 2008-06-06 10:33:44Z baconevi $
* $Id: extio.c 197 2008-06-09 06:24:10Z baconevi $
*
* {License}
*/
@ -140,8 +140,8 @@ int ase_awk_readextio (
p->in.buf[0] = ASE_T('\0');
p->in.pos = 0;
p->in.len = 0;
p->in.eof = ase_false;
p->in.eos = ase_false;
p->in.eof = ASE_FALSE;
p->in.eos = ASE_FALSE;
ase_awk_setrunerrnum (run, ASE_AWK_ENOERR);
@ -172,7 +172,7 @@ int ase_awk_readextio (
* entire pattern-block matching and exeuction. */
if (x == 0)
{
p->in.eos = ase_true;
p->in.eos = ASE_TRUE;
return 0;
}
}
@ -245,7 +245,7 @@ int ase_awk_readextio (
if (n == 0)
{
p->in.eof = ase_true;
p->in.eof = ASE_TRUE;
if (ASE_STR_LEN(buf) == 0) ret = 0;
else if (rs_len >= 2)
@ -494,8 +494,8 @@ int ase_awk_writeextio_str (
p->next = ASE_NULL;
p->custom_data = run->extio.custom_data;
p->out.eof = ase_false;
p->out.eos = ase_false;
p->out.eof = ASE_FALSE;
p->out.eos = ASE_FALSE;
ase_awk_setrunerrnum (run, ASE_AWK_ENOERR);
n = handler (ASE_AWK_IO_OPEN, p, ASE_NULL, 0);
@ -521,7 +521,7 @@ int ase_awk_writeextio_str (
* entire pattern-block matching and exeuction. */
if (n == 0)
{
p->out.eos = ase_true;
p->out.eos = ASE_TRUE;
return 0;
}
}
@ -553,7 +553,7 @@ int ase_awk_writeextio_str (
if (n == 0)
{
p->out.eof = ase_true;
p->out.eof = ASE_TRUE;
return 0;
}
@ -571,7 +571,7 @@ int ase_awk_flushextio (
ase_awk_io_t handler;
int extio_type, /*extio_mode,*/ extio_mask;
ase_ssize_t n;
ase_bool_t ok = ase_false;
ase_bool_t ok = ASE_FALSE;
ASE_ASSERT (out_type >= 0 && out_type <= ASE_COUNTOF(out_type_map));
ASE_ASSERT (out_type >= 0 && out_type <= ASE_COUNTOF(out_mode_map));
@ -606,7 +606,7 @@ int ase_awk_flushextio (
return -1;
}
ok = ase_true;
ok = ASE_TRUE;
}
p = p->next;
@ -680,14 +680,14 @@ int ase_awk_nextextio_read (
/* the next stream cannot be opened.
* set the eos flags so that the next call to nextextio_read
* will return 0 without executing the handler */
p->in.eos = ase_true;
p->in.eos = ASE_TRUE;
return 0;
}
else
{
/* as the next stream has been opened successfully,
* the eof flag should be cleared if set */
p->in.eof = ase_false;
p->in.eof = ASE_FALSE;
/* also the previous input buffer must be reset */
p->in.pos = 0;
@ -758,14 +758,14 @@ int ase_awk_nextextio_write (
/* the next stream cannot be opened.
* set the eos flags so that the next call to nextextio_write
* will return 0 without executing the handler */
p->out.eos = ase_true;
p->out.eos = ASE_TRUE;
return 0;
}
else
{
/* as the next stream has been opened successfully,
* the eof flag should be cleared if set */
p->out.eof = ase_false;
p->out.eof = ASE_FALSE;
return 1;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: parse.c 192 2008-06-06 10:33:44Z baconevi $
* $Id: parse.c 197 2008-06-09 06:24:10Z baconevi $
*
* {License}
*/
@ -703,7 +703,7 @@ static ase_awk_t* parse_progunit (ase_awk_t* awk)
awk->parse.id.block = PARSE_ACTION_BLOCK;
if (parse_pattern_block (
awk, ASE_NULL, ase_false) == ASE_NULL) return ASE_NULL;
awk, ASE_NULL, ASE_FALSE) == ASE_NULL) return ASE_NULL;
}
else
{
@ -756,7 +756,7 @@ static ase_awk_t* parse_progunit (ase_awk_t* awk)
awk->parse.id.block = PARSE_ACTION_BLOCK;
if (parse_pattern_block (
awk, ptn, ase_true) == ASE_NULL)
awk, ptn, ASE_TRUE) == ASE_NULL)
{
ase_awk_clrpt (awk, ptn);
return ASE_NULL;
@ -795,7 +795,7 @@ static ase_awk_t* parse_progunit (ase_awk_t* awk)
awk->parse.id.block = PARSE_ACTION_BLOCK;
if (parse_pattern_block (
awk, ptn, ase_false) == ASE_NULL)
awk, ptn, ASE_FALSE) == ASE_NULL)
{
ase_awk_clrpt (awk, ptn);
return ASE_NULL;
@ -1047,7 +1047,7 @@ static ase_awk_nde_t* parse_function (ase_awk_t* awk)
awk->tree.cur_afn.len = name_len;
/* actual function body */
body = awk->parse.parse_block (awk, awk->token.prev.line, ase_true);
body = awk->parse.parse_block (awk, awk->token.prev.line, ASE_TRUE);
/* clear the current function name remembered */
awk->tree.cur_afn.ptr = ASE_NULL;
@ -1111,7 +1111,7 @@ static ase_awk_nde_t* parse_begin (ase_awk_t* awk)
ASE_ASSERT (MATCH(awk,TOKEN_LBRACE));
if (get_token(awk) == -1) return ASE_NULL;
nde = awk->parse.parse_block (awk, awk->token.prev.line, ase_true);
nde = awk->parse.parse_block (awk, awk->token.prev.line, ASE_TRUE);
if (nde == ASE_NULL) return ASE_NULL;
if (awk->tree.begin == ASE_NULL)
@ -1135,7 +1135,7 @@ static ase_awk_nde_t* parse_end (ase_awk_t* awk)
ASE_ASSERT (MATCH(awk,TOKEN_LBRACE));
if (get_token(awk) == -1) return ASE_NULL;
nde = awk->parse.parse_block (awk, awk->token.prev.line, ase_true);
nde = awk->parse.parse_block (awk, awk->token.prev.line, ASE_TRUE);
if (nde == ASE_NULL) return ASE_NULL;
if (awk->tree.end == ASE_NULL)
@ -1163,7 +1163,7 @@ static ase_awk_chain_t* parse_pattern_block (
{
ASE_ASSERT (MATCH(awk,TOKEN_LBRACE));
if (get_token(awk) == -1) return ASE_NULL;
nde = awk->parse.parse_block (awk, line, ase_true);
nde = awk->parse.parse_block (awk, line, ASE_TRUE);
if (nde == ASE_NULL) return ASE_NULL;
}
@ -1633,7 +1633,7 @@ static ase_awk_t* collect_locals (
#if 0
if (awk->option & ASE_AWK_UNIQUEFN)
{
ase_bool_t iscur = ase_false;
ase_bool_t iscur = ASE_FALSE;
#endif
/* check if it conflict with a builtin function name
@ -1787,7 +1787,7 @@ static ase_awk_nde_t* parse_statement (ase_awk_t* awk, ase_size_t line)
{
if (get_token(awk) == -1) return ASE_NULL;
nde = awk->parse.parse_block (
awk, awk->token.prev.line, ase_false);
awk, awk->token.prev.line, ASE_FALSE);
}
else
{
@ -2088,14 +2088,14 @@ static ase_awk_nde_t* parse_binary_expr (
while (1)
{
const binmap_t* p = binmap;
ase_bool_t matched = ase_false;
ase_bool_t matched = ASE_FALSE;
while (p->token != TOKEN_EOF)
{
if (MATCH(awk,p->token))
{
opcode = p->binop;
matched = ase_true;
matched = ASE_TRUE;
break;
}
p++;
@ -3271,7 +3271,7 @@ static ase_awk_nde_t* parse_primary_ident (ase_awk_t* awk, ase_size_t line)
if (awk->option & ASE_AWK_UNIQUEFN)
{
#endif
ase_bool_t iscur = ase_false;
ase_bool_t iscur = ASE_FALSE;
/* the name should not conflict with a function name */
/* check if it is a builtin function */
@ -3453,7 +3453,7 @@ static ase_awk_nde_t* parse_hashidx (
if (awk->option & ASE_AWK_UNIQUEFN)
{
#endif
ase_bool_t iscur = ase_false;
ase_bool_t iscur = ASE_FALSE;
/* check if it is a builtin function */
if (ase_awk_getbfn (awk, name, name_len) != ASE_NULL)
@ -5072,7 +5072,7 @@ static int get_charstr (ase_awk_t* awk)
* has been called */
ADD_TOKEN_CHAR (awk, awk->src.lex.curc);
}
return get_string (awk, ASE_T('\"'), ASE_T('\\'), ase_false);
return get_string (awk, ASE_T('\"'), ASE_T('\\'), ASE_FALSE);
}
static int get_rexstr (ase_awk_t* awk)
@ -5087,7 +5087,7 @@ static int get_rexstr (ase_awk_t* awk)
else
{
ADD_TOKEN_CHAR (awk, awk->src.lex.curc);
return get_string (awk, ASE_T('/'), ASE_T('\\'), ase_true);
return get_string (awk, ASE_T('/'), ASE_T('\\'), ASE_TRUE);
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: rec.c 192 2008-06-06 10:33:44Z baconevi $
* $Id: rec.c 197 2008-06-09 06:24:10Z baconevi $
*
* {License}
*/
@ -22,15 +22,15 @@ int ase_awk_setrec (
if (str == ASE_STR_BUF(&run->inrec.line) &&
len == ASE_STR_LEN(&run->inrec.line))
{
if (ase_awk_clrrec (run, ase_true) == -1) return -1;
if (ase_awk_clrrec (run, ASE_TRUE) == -1) return -1;
}
else
{
if (ase_awk_clrrec (run, ase_false) == -1) return -1;
if (ase_awk_clrrec (run, ASE_FALSE) == -1) return -1;
if (ase_str_ncpy (&run->inrec.line, str, len) == (ase_size_t)-1)
{
ase_awk_clrrec (run, ase_false);
ase_awk_clrrec (run, ASE_FALSE);
ase_awk_setrunerror (
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
return -1;
@ -40,7 +40,7 @@ int ase_awk_setrec (
v = ase_awk_makestrval (run, str, len);
if (v == ASE_NULL)
{
ase_awk_clrrec (run, ase_false);
ase_awk_clrrec (run, ASE_FALSE);
return -1;
}
@ -52,7 +52,7 @@ int ase_awk_setrec (
if (split_record (run) == -1)
{
ase_awk_clrrec (run, ase_false);
ase_awk_clrrec (run, ASE_FALSE);
return -1;
}
}
@ -60,7 +60,7 @@ int ase_awk_setrec (
{
if (recomp_record_fields (run, idx, str, len) == -1)
{
ase_awk_clrrec (run, ase_false);
ase_awk_clrrec (run, ASE_FALSE);
return -1;
}
@ -70,7 +70,7 @@ int ase_awk_setrec (
ASE_STR_LEN(&run->inrec.line));
if (v == ASE_NULL)
{
ase_awk_clrrec (run, ase_false);
ase_awk_clrrec (run, ASE_FALSE);
return -1;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: run.c 192 2008-06-06 10:33:44Z baconevi $
* $Id: run.c 197 2008-06-09 06:24:10Z baconevi $
*
* {License}
*/
@ -927,7 +927,7 @@ static void deinit_run (ase_awk_run_t* run)
/* destroy input record. ase_awk_clrrec should be called
* before the run stack has been destroyed because it may try
* to change the value to ASE_AWK_GLOBAL_NF. */
ase_awk_clrrec (run, ase_false);
ase_awk_clrrec (run, ASE_FALSE);
if (run->inrec.flds != ASE_NULL)
{
ASE_AWK_FREE (run->awk, run->inrec.flds);
@ -955,19 +955,19 @@ static void deinit_run (ase_awk_run_t* run)
while (run->fcache_count > 0)
{
ase_awk_val_ref_t* tmp = run->fcache[--run->fcache_count];
ase_awk_freeval (run, (ase_awk_val_t*)tmp, ase_false);
ase_awk_freeval (run, (ase_awk_val_t*)tmp, ASE_FALSE);
}
/*while (run->scache32_count > 0)
{
ase_awk_val_str_t* tmp = run->scache32[--run->scache32_count];
ase_awk_freeval (run, (ase_awk_val_t*)tmp, ase_false);
ase_awk_freeval (run, (ase_awk_val_t*)tmp, ASE_FALSE);
}
while (run->scache64_count > 0)
{
ase_awk_val_str_t* tmp = run->scache64[--run->scache64_count];
ase_awk_freeval (run, (ase_awk_val_t*)tmp, ase_false);
ase_awk_freeval (run, (ase_awk_val_t*)tmp, ASE_FALSE);
}*/
ase_awk_freevalchunk (run, run->vmgr.ichunk);
@ -1577,7 +1577,7 @@ static int run_pattern_blocks (ase_awk_run_t* run)
run->inrec.buf_pos = 0;
run->inrec.buf_len = 0;
run->inrec.eof = ase_false;
run->inrec.eof = ASE_FALSE;
/* run each pattern block */
while (run->exit_level < EXIT_GLOBAL)
@ -5101,7 +5101,7 @@ static ase_awk_val_t* eval_incpst (ase_awk_run_t* run, ase_awk_nde_t* nde)
if (res2 == ASE_NULL)
{
ase_awk_refdownval (run, left);
ase_awk_freeval (run, res, ase_true);
ase_awk_freeval (run, res, ASE_TRUE);
/* adjust error line */
run->errlin = nde->line;
return ASE_NULL;
@ -5123,7 +5123,7 @@ static ase_awk_val_t* eval_incpst (ase_awk_run_t* run, ase_awk_nde_t* nde)
if (res2 == ASE_NULL)
{
ase_awk_refdownval (run, left);
ase_awk_freeval (run, res, ase_true);
ase_awk_freeval (run, res, ASE_TRUE);
/* adjust error line */
run->errlin = nde->line;
return ASE_NULL;
@ -5163,7 +5163,7 @@ static ase_awk_val_t* eval_incpst (ase_awk_run_t* run, ase_awk_nde_t* nde)
if (res2 == ASE_NULL)
{
ase_awk_refdownval (run, left);
ase_awk_freeval (run, res, ase_true);
ase_awk_freeval (run, res, ASE_TRUE);
/* adjust error line */
run->errlin = nde->line;
return ASE_NULL;
@ -5185,7 +5185,7 @@ static ase_awk_val_t* eval_incpst (ase_awk_run_t* run, ase_awk_nde_t* nde)
if (res2 == ASE_NULL)
{
ase_awk_refdownval (run, left);
ase_awk_freeval (run, res, ase_true);
ase_awk_freeval (run, res, ASE_TRUE);
/* adjust error line */
run->errlin = nde->line;
return ASE_NULL;
@ -5211,7 +5211,7 @@ static ase_awk_val_t* eval_incpst (ase_awk_run_t* run, ase_awk_nde_t* nde)
if (res2 == ASE_NULL)
{
ase_awk_refdownval (run, left);
ase_awk_freeval (run, res, ase_true);
ase_awk_freeval (run, res, ASE_TRUE);
/* adjust error line */
run->errlin = nde->line;
return ASE_NULL;
@ -5233,7 +5233,7 @@ static ase_awk_val_t* eval_incpst (ase_awk_run_t* run, ase_awk_nde_t* nde)
if (res2 == ASE_NULL)
{
ase_awk_refdownval (run, left);
ase_awk_freeval (run, res, ase_true);
ase_awk_freeval (run, res, ASE_TRUE);
/* adjust error line */
run->errlin = nde->line;
return ASE_NULL;
@ -5273,7 +5273,7 @@ static ase_awk_val_t* eval_incpst (ase_awk_run_t* run, ase_awk_nde_t* nde)
if (res2 == ASE_NULL)
{
ase_awk_refdownval (run, left);
ase_awk_freeval (run, res, ase_true);
ase_awk_freeval (run, res, ASE_TRUE);
/* adjust error line */
run->errlin = nde->line;
return ASE_NULL;
@ -5295,7 +5295,7 @@ static ase_awk_val_t* eval_incpst (ase_awk_run_t* run, ase_awk_nde_t* nde)
if (res2 == ASE_NULL)
{
ase_awk_refdownval (run, left);
ase_awk_freeval (run, res, ase_true);
ase_awk_freeval (run, res, ASE_TRUE);
/* adjust error line */
run->errlin = nde->line;
return ASE_NULL;
@ -6318,13 +6318,13 @@ static int read_record (ase_awk_run_t* run)
{
ase_ssize_t n;
if (ase_awk_clrrec (run, ase_false) == -1) return -1;
if (ase_awk_clrrec (run, ASE_FALSE) == -1) return -1;
n = ase_awk_readextio (
run, ASE_AWK_IN_CONSOLE, ASE_T(""), &run->inrec.line);
if (n <= -1)
{
ase_awk_clrrec (run, ase_false);
ase_awk_clrrec (run, ASE_FALSE);
return -1;
}
@ -6602,7 +6602,7 @@ ase_char_t* ase_awk_format (
for (i = 0; i < fmt_len; i++)
{
ase_long_t width = -1, prec = -1;
ase_bool_t minus = ase_false;
ase_bool_t minus = ASE_FALSE;
if (ASE_STR_LEN(fbu) == 0)
{
@ -6616,7 +6616,7 @@ ase_char_t* ase_awk_format (
fmt[i] == ASE_T('0') || fmt[i] == ASE_T('+') ||
fmt[i] == ASE_T('-')))
{
if (fmt[i] == ASE_T('-')) minus = ase_true;
if (fmt[i] == ASE_T('-')) minus = ASE_TRUE;
FMT_CHAR (fmt[i]); i++;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: tab.c 192 2008-06-06 10:33:44Z baconevi $
* $Id: tab.c 197 2008-06-09 06:24:10Z baconevi $
*
* {License}
*/
@ -13,9 +13,9 @@ ase_awk_tab_t* ase_awk_tab_open (ase_awk_tab_t* tab, ase_awk_t* awk)
tab = (ase_awk_tab_t*) ASE_AWK_MALLOC (
awk, ASE_SIZEOF(ase_awk_tab_t));
if (tab == ASE_NULL) return ASE_NULL;
tab->__dynamic = ase_true;
tab->__dynamic = ASE_TRUE;
}
else tab->__dynamic = ase_false;
else tab->__dynamic = ASE_FALSE;
tab->awk = awk;
tab->buf = ASE_NULL;

View File

@ -1,5 +1,5 @@
/*
* $Id: val.c 192 2008-06-06 10:33:44Z baconevi $
* $Id: val.c 197 2008-06-09 06:24:10Z baconevi $
*
* {License}
*/
@ -613,7 +613,7 @@ void ase_awk_refdownval (ase_awk_run_t* run, ase_awk_val_t* val)
val->ref--;
if (val->ref <= 0)
{
ase_awk_freeval(run, val, ase_true);
ase_awk_freeval(run, val, ASE_TRUE);
}
}
@ -638,12 +638,12 @@ void ase_awk_freevalchunk (ase_awk_run_t* run, ase_awk_val_chunk_t* chunk)
ase_bool_t ase_awk_valtobool (ase_awk_run_t* run, ase_awk_val_t* val)
{
if (val == ASE_NULL) return ase_false;
if (val == ASE_NULL) return ASE_FALSE;
switch (val->type)
{
case ASE_AWK_VAL_NIL:
return ase_false;
return ASE_FALSE;
case ASE_AWK_VAL_INT:
return ((ase_awk_val_int_t*)val)->val != 0;
case ASE_AWK_VAL_REAL:
@ -653,15 +653,15 @@ ase_bool_t ase_awk_valtobool (ase_awk_run_t* run, ase_awk_val_t* val)
case ASE_AWK_VAL_REX: /* TODO: is this correct? */
return ((ase_awk_val_rex_t*)val)->len > 0;
case ASE_AWK_VAL_MAP:
return ase_false; /* TODO: is this correct? */
return ASE_FALSE; /* TODO: is this correct? */
case ASE_AWK_VAL_REF:
return ase_false; /* TODO: is this correct? */
return ASE_FALSE; /* TODO: is this correct? */
}
ASE_ASSERTX (
!"should never happen - invalid value type",
"the type of a value should be one of ASE_AWK_VAL_XXX's defined in val.h");
return ase_false;
return ASE_FALSE;
}
ase_char_t* ase_awk_valtostr (

View File

@ -1,5 +1,5 @@
/*
* $Id: rex.c 154 2008-03-21 13:02:20Z baconevi $
* $Id: rex.c 197 2008-06-09 06:24:10Z baconevi $
*
* {License}
*/
@ -293,7 +293,7 @@ void* ase_buildrex (
builder.ptn.curc.type = CT_EOF;
builder.ptn.curc.value = ASE_T('\0');
builder.ptn.curc.escaped = ase_false;
builder.ptn.curc.escaped = ASE_FALSE;
builder.depth.max = depth;
builder.depth.cur = 0;
@ -356,7 +356,7 @@ int ase_matchrex (
matcher.depth.cur = 0;
matcher.ignorecase = (option & ASE_REX_IGNORECASE)? 1: 0;
mat.matched = ase_false;
mat.matched = ASE_FALSE;
/* TODO: should it allow an offset here??? */
mat.match_ptr = str + offset;
@ -420,7 +420,7 @@ ase_bool_t ase_isemptyrex (void* code)
* | | branch header |
* | NB(1) | EL(16) | NA(1) | BL(8) | */
return (rhdr->nb == 1 &&
rhdr->el == ASE_SIZEOF(ase_size_t)*4)? ase_true: ase_false;
rhdr->el == ASE_SIZEOF(ase_size_t)*4)? ASE_TRUE: ASE_FALSE;
}
static int build_pattern (builder_t* builder)
@ -684,7 +684,7 @@ static int build_charset (builder_t* builder, code_t* cmd)
c2 = c1;
if (builder->ptn.curc.type == CT_NORMAL &&
builder->ptn.curc.value == ASE_T('-') &&
builder->ptn.curc.escaped == ase_false)
builder->ptn.curc.escaped == ASE_FALSE)
{
NEXT_CHAR (builder, LEVEL_CHARSET);
@ -926,13 +926,13 @@ static int next_char (builder_t* builder, int level)
{
builder->ptn.curc.type = CT_EOF;
builder->ptn.curc.value = ASE_T('\0');
builder->ptn.curc.escaped = ase_false;
builder->ptn.curc.escaped = ASE_FALSE;
return 0;
}
builder->ptn.curc.type = CT_NORMAL;
builder->ptn.curc.value = *builder->ptn.curp++;
builder->ptn.curc.escaped = ase_false;
builder->ptn.curc.escaped = ASE_FALSE;
if (builder->ptn.curc.value == ASE_T('\\'))
{
@ -1034,7 +1034,7 @@ static int next_char (builder_t* builder, int level)
#endif
builder->ptn.curc.value = c;
builder->ptn.curc.escaped = ase_true;
builder->ptn.curc.escaped = ASE_TRUE;
return 0;
}
@ -1130,14 +1130,14 @@ static ase_bool_t __begin_with (
while (str < end)
{
if (*what == ASE_T('\0')) return ase_true;
if (*what != *str) return ase_false;
if (*what == ASE_T('\0')) return ASE_TRUE;
if (*what != *str) return ASE_FALSE;
str++; what++;
}
if (*what == ASE_T('\0')) return ase_true;
return ase_false;
if (*what == ASE_T('\0')) return ASE_TRUE;
return ASE_FALSE;
}
static const ase_byte_t* match_pattern (
@ -1157,7 +1157,7 @@ static const ase_byte_t* match_pattern (
(unsigned int)rhdr->nb, (unsigned int)rhdr->el);
#endif
mat->matched = ase_false;
mat->matched = ASE_FALSE;
mat->match_len = 0;
for (i = 0; i < rhdr->nb; i++)
@ -1169,7 +1169,7 @@ static const ase_byte_t* match_pattern (
if (mat2.matched)
{
mat->matched = ase_true;
mat->matched = ASE_TRUE;
mat->match_len = mat2.match_len;
break;
}
@ -1219,7 +1219,7 @@ static const ase_byte_t* match_branch_body0 (
/* match_t mat2;*/
ase_size_t match_len = 0;
mat->matched = ase_false;
mat->matched = ASE_FALSE;
mat->match_len = 0;
/* TODO: is mat2 necessary here ? */
@ -1246,11 +1246,11 @@ static const ase_byte_t* match_branch_body0 (
if (!mat2.matched)
{
mat->matched = ase_false;
mat->matched = ASE_FALSE;
break; /* stop matching */
}
mat->matched = ase_true;
mat->matched = ASE_TRUE;
mat->match_len += mat2.match_len;
mat2.match_ptr = &mat2.match_ptr[mat2.match_len];
@ -1326,7 +1326,7 @@ static const ase_byte_t* match_any_char (
lbound = cp->lbound;
ubound = cp->ubound;
mat->matched = ase_false;
mat->matched = ASE_FALSE;
mat->match_len = 0;
/* merge the same consecutive codes */
@ -1417,7 +1417,7 @@ static const ase_byte_t* match_ord_char (
cc, (unsigned int)lbound, (unsigned int)ubound);
#endif
mat->matched = ase_false;
mat->matched = ASE_FALSE;
mat->match_len = 0;
/* find the longest match */
@ -1486,7 +1486,7 @@ static const ase_byte_t* match_charset (
(unsigned int)cp->lbound, (unsigned int)cp->ubound);
#endif
mat->matched = ase_false;
mat->matched = ASE_FALSE;
mat->match_len = 0;
while (si < cp->ubound)
@ -1530,7 +1530,7 @@ static const ase_byte_t* match_group (
cp = (const code_t*)p; p += ASE_SIZEOF(*cp);
ASE_ASSERT (cp->cmd == CMD_GROUP);
mat->matched = ase_false;
mat->matched = ASE_FALSE;
mat->match_len = 0;
/*
@ -1591,7 +1591,7 @@ static const ase_byte_t* match_group (
mat2.match_ptr += mat2.match_len;
mat2.match_len = 0;
mat2.matched = ase_false;
mat2.matched = ASE_FALSE;
si++;
}
@ -1604,7 +1604,7 @@ static const ase_byte_t* match_group (
{
if (cp->lbound == cp->ubound || p >= mat->branch_end)
{
mat->matched = ase_true;
mat->matched = ASE_TRUE;
mat->match_len = grp_len[si];
}
else
@ -1634,7 +1634,7 @@ static const ase_byte_t* match_group (
if (mat2.matched)
{
mat->matched = ase_true;
mat->matched = ASE_TRUE;
mat->match_len = grp_len[si] + mat2.match_len;
p = tmp;
break;
@ -1664,7 +1664,7 @@ static const ase_byte_t* match_occurrences (
/* if the match for fixed occurrences was
* requested or no atoms remain unchecked in
* the branch, the match is returned. */
mat->matched = ase_true;
mat->matched = ASE_TRUE;
mat->match_len = si;
}
else
@ -1729,7 +1729,7 @@ static const ase_byte_t* match_occurrences (
if (mat2.matched)
{
mat->matched = ase_true;
mat->matched = ASE_TRUE;
mat->match_len = si + mat2.match_len;
p = tmp;
break;
@ -1764,7 +1764,7 @@ static ase_bool_t __test_charset (
ase_dprintf (
ASE_T("match_charset: <one> %c %c\n"), c, c1);
#endif
if (c == c1) return ase_true;
if (c == c1) return ASE_TRUE;
}
else if (c0 == CHARSET_RANGE)
{
@ -1781,7 +1781,7 @@ static ase_bool_t __test_charset (
ase_dprintf (
ASE_T("match_charset: <range> %c %c-%c\n"), c, c1, c2);
#endif
if (c >= c1 && c <= c2) return ase_true;
if (c >= c1 && c <= c2) return ASE_TRUE;
}
else if (c0 == CHARSET_CLASS)
{
@ -1792,7 +1792,7 @@ static ase_bool_t __test_charset (
c, __char_class[c1].name);
#endif
if (__char_class[c1].func (
matcher->ccls, c)) return ase_true;
matcher->ccls, c)) return ASE_TRUE;
}
else
{
@ -1803,7 +1803,7 @@ static ase_bool_t __test_charset (
p += ASE_SIZEOF(c1);
}
return ase_false;
return ASE_FALSE;
}
static ase_bool_t cc_isalnum (ase_ccls_t* ccls, ase_char_t c)

View File

@ -1,5 +1,5 @@
/*
* $Id: str_bas.c 159 2008-04-01 08:37:30Z baconevi $
* $Id: str_bas.c 197 2008-06-09 06:24:10Z baconevi $
*
* {License}
*/
@ -305,7 +305,7 @@ ase_char_t* ase_strxnstr (
const ase_char_t* x = str;
const ase_char_t* y = sub;
while (ase_true)
while (1)
{
if (y >= subp) return (ase_char_t*)str;
if (*x != *y) break;

View File

@ -1,5 +1,5 @@
/*
* $Id: str_dyn.c 141 2008-03-18 04:09:04Z baconevi $
* $Id: str_dyn.c 197 2008-06-09 06:24:10Z baconevi $
*
* {License}
*/
@ -14,9 +14,9 @@ ase_str_t* ase_str_open (ase_str_t* str, ase_size_t capa, ase_mmgr_t* mmgr)
str = (ase_str_t*)
ASE_MALLOC (mmgr, ASE_SIZEOF(ase_str_t));
if (str == ASE_NULL) return ASE_NULL;
str->__dynamic = ase_true;
str->__dynamic = ASE_TRUE;
}
else str->__dynamic = ase_false;
else str->__dynamic = ASE_FALSE;
str->mmgr = mmgr;
str->buf = (ase_char_t*) ASE_MALLOC (