Recovered from cvs revision 2007-10-28 06:12:00

This commit is contained in:
2007-10-29 00:11:00 +00:00
parent d60e97954b
commit 1fb4e03c11
4 changed files with 69 additions and 48 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: extio.c,v 1.6 2007/10/25 14:43:17 bacon Exp $
* $Id: extio.c,v 1.7 2007/10/26 12:49:24 bacon Exp $
*
* {License}
*/
@ -74,8 +74,6 @@ static int out_mask_map[] =
MASK_WRITE
};
#include <windows.h>
#include <tchar.h>
int ase_awk_readextio (
ase_awk_run_t* run, int in_type,
const ase_char_t* name, ase_str_t* buf)
@ -394,8 +392,8 @@ int ase_awk_readextio (
rs->type != ASE_AWK_VAL_STR) ASE_AWK_FREE (run->awk, rs_ptr);
ase_awk_refdownval (run, rs);
/* increment NR */
if (ret != -1 && ret != 0)
/* increment NR for console input */
if (extio_type == ASE_AWK_EXTIO_CONSOLE && ret != -1 && ret != 0)
{
ase_awk_val_t* nr;
ase_long_t lv;
@ -411,14 +409,6 @@ int ase_awk_readextio (
{
if (n == 1) lv = (ase_long_t)rv;
// TODO---> WRONG: NR SHOULD BE UPDATED FOR CONSOLE INPUT...
// { print "NR=" NR; a=getline<"awk.c"; print a; }
{
wchar_t x[100];
_sntprintf (x, 100, _T("ddd %d\n"), (int)lv);
OutputDebugStringW (x);
}
nr = ase_awk_makeintval (run, lv + 1);
if (nr == ASE_NULL) ret = -1;
else

View File

@ -1,5 +1,5 @@
/*
* $Id: parse.c,v 1.23 2007/10/25 14:43:17 bacon Exp $
* $Id: parse.c,v 1.24 2007/10/26 12:49:24 bacon Exp $
*
* {License}
*/
@ -298,11 +298,13 @@ static global_t gtab[] =
/* ignore case in string comparison */
{ ASE_T("IGNORECASE"), 10, 0 },
/* number of fields in current input record */
/* number of fields in current input record
* NF is also updated if you assign a value to $0. so it is not
* associated with ASE_AWK_PABLOCK */
{ ASE_T("NF"), 2, 0 },
/* input record number */
{ ASE_T("NR"), 2, 0 },
{ ASE_T("NR"), 2, ASE_AWK_PABLOCK },
/* current output file name */
{ ASE_T("OFILENAME"), 9, ASE_AWK_PABLOCK | ASE_AWK_NEXTOFILE },