*** empty log message ***

This commit is contained in:
2007-01-07 07:30:40 +00:00
parent d535f5cd2a
commit e1d050a3bb
9 changed files with 183 additions and 115 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: awk.c,v 1.103 2007-01-06 15:45:50 bacon Exp $
* $Id: awk.c,v 1.104 2007-01-07 07:30:39 bacon Exp $
*/
#if defined(__BORLANDC__)
@ -253,12 +253,12 @@ int ase_awk_clear (ase_awk_t* awk)
return 0;
}
int ase_awk_getopt (ase_awk_t* awk)
int ase_awk_getoption (ase_awk_t* awk)
{
return awk->option;
}
void ase_awk_setopt (ase_awk_t* awk, int opt)
void ase_awk_setoption (ase_awk_t* awk, int opt)
{
awk->option = opt;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: awk.h,v 1.181 2007-01-06 15:45:50 bacon Exp $
* $Id: awk.h,v 1.182 2007-01-07 07:30:39 bacon Exp $
*/
#ifndef _ASE_AWK_AWK_H_
@ -419,12 +419,12 @@ void ase_awk_seterror (
ase_awk_t* run, int errnum,
ase_size_t errlin, const ase_char_t* errmsg);
int ase_awk_getopt (ase_awk_t* awk);
void ase_awk_setopt (ase_awk_t* awk, int opt);
int ase_awk_getoption (ase_awk_t* awk);
void ase_awk_setoption (ase_awk_t* awk, int opt);
ase_size_t ase_awk_getmaxdepth (ase_awk_t* awk, int type);
void ase_awk_setmaxdepth (ase_awk_t* awk, int types, ase_size_t depth);
int ase_awk_parse (ase_awk_t* awk, ase_awk_srcios_t* srcios);
/*

View File

@ -1,5 +1,5 @@
/*
* $Id: func.c,v 1.88 2007-01-05 13:38:58 bacon Exp $
* $Id: func.c,v 1.89 2007-01-07 07:30:39 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -408,7 +408,7 @@ static int __bfn_index (
ptr = ase_awk_strxnstr (str0, len0, str1, len1);
idx = (ptr == ASE_NULL)? -1: (ase_long_t)(ptr - str0);
if (ase_awk_getopt(run->awk) & ASE_AWK_STRIDXONE) idx = idx + 1;
if (ase_awk_getoption(run->awk) & ASE_AWK_STRIDXONE) idx = idx + 1;
if (a0->type != ASE_AWK_VAL_STR) ASE_AWK_FREE (run->awk, str0);
if (a1->type != ASE_AWK_VAL_STR) ASE_AWK_FREE (run->awk, str1);
@ -510,7 +510,7 @@ static int __bfn_substr (
if (n == 1) lcount = (ase_long_t)rcount;
}
if (ase_awk_getopt(run->awk) & ASE_AWK_STRIDXONE) lindex = lindex - 1;
if (ase_awk_getoption(run->awk) & ASE_AWK_STRIDXONE) lindex = lindex - 1;
if (lindex >= len) lindex = len;
else if (lindex < 0) lindex = 0;
@ -684,7 +684,7 @@ static int __bfn_split (
ase_awk_refupval (run, *a1_ref);
p = str; str_left = str_len;
sta = (ase_awk_getopt(run->awk) & ASE_AWK_STRIDXONE)? 1: 0;
sta = (ase_awk_getoption(run->awk) & ASE_AWK_STRIDXONE)? 1: 0;
num = sta;
while (p != ASE_NULL)
@ -1240,7 +1240,7 @@ static int __bfn_match (
if (n == -1) return -1;
idx = (n == 0)? -1: (ase_long_t)(mat_ptr - str0);
if (ase_awk_getopt(run->awk) & ASE_AWK_STRIDXONE) idx = idx + 1;
if (ase_awk_getoption(run->awk) & ASE_AWK_STRIDXONE) idx = idx + 1;
a0 = ase_awk_makeintval (run, idx);
if (a0 == ASE_NULL)

View File

@ -1,5 +1,5 @@
/*
* $Id: jni.c,v 1.47 2007-01-06 15:45:50 bacon Exp $
* $Id: jni.c,v 1.48 2007-01-07 07:30:40 bacon Exp $
*/
#include <stdio.h>
@ -238,7 +238,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_open (JNIEnv* env, jobject obj)
opt = ASE_AWK_EXPLICIT | ASE_AWK_UNIQUEFN | ASE_AWK_SHADING |
ASE_AWK_IMPLICIT | ASE_AWK_SHIFT | ASE_AWK_IDIV |
ASE_AWK_EXTIO | ASE_AWK_BLOCKLESS | ASE_AWK_NEXTOFILE;
ase_awk_setopt (awk, opt);
ase_awk_setoption (awk, opt);
}
JNIEXPORT void JNICALL Java_ase_awk_Awk_close (JNIEnv* env, jobject obj)

View File

@ -1,5 +1,5 @@
/*
* $Id: parse.c,v 1.238 2007-01-06 15:45:14 bacon Exp $
* $Id: parse.c,v 1.239 2007-01-07 07:26:16 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -342,6 +342,16 @@ static struct __bvent __bvtab[] =
} \
} while (0)
ase_size_t ase_awk_getmaxdepth (ase_awk_t* awk, int type)
{
return (type == ASE_AWK_DEPTH_BLOCK_PARSE)? awk->parse.depth.max.block:
(type == ASE_AWK_DEPTH_BLOCK_RUN)? awk->run.depth.max.block:
(type == ASE_AWK_DEPTH_EXPR_PARSE)? awk->parse.depth.max.expr:
(type == ASE_AWK_DEPTH_EXPR_RUN)? awk->run.depth.max.expr:
(type == ASE_AWK_DEPTH_REX_BUILD)? awk->rex.depth.max.build:
(type == ASE_AWK_DEPTH_REX_MATCH)? awk->rex.depth.max.match: 0;
}
void ase_awk_setmaxdepth (ase_awk_t* awk, int types, ase_size_t depth)
{
if (types & ASE_AWK_DEPTH_BLOCK_PARSE)