diff --git a/ase/awk/awk.c b/ase/awk/awk.c index 2e969d00..7c7300b1 100644 --- a/ase/awk/awk.c +++ b/ase/awk/awk.c @@ -1,5 +1,5 @@ /* - * $Id: awk.c,v 1.50 2006-05-13 16:33:06 bacon Exp $ + * $Id: awk.c,v 1.51 2006-06-18 13:43:28 bacon Exp $ */ #include @@ -84,6 +84,10 @@ xp_awk_t* xp_awk_open (void) awk->lex.line = 1; awk->lex.column = 1; + awk->extio.pipe = XP_NULL; + awk->extio.coproc = XP_NULL; + awk->extio.file = XP_NULL; + return awk; } diff --git a/ase/awk/awk_i.h b/ase/awk/awk_i.h index f022a131..3ebf259f 100644 --- a/ase/awk/awk_i.h +++ b/ase/awk/awk_i.h @@ -1,5 +1,5 @@ /* - * $Id: awk_i.h,v 1.14 2006-06-16 14:31:42 bacon Exp $ + * $Id: awk_i.h,v 1.15 2006-06-18 13:43:28 bacon Exp $ */ #ifndef _XP_AWK_AWKI_H_ @@ -112,6 +112,13 @@ struct xp_awk_t xp_size_t column; } lex; + struct + { + xp_awk_io_t pipe; + xp_awk_io_t coproc; + xp_awk_io_t file; + } extio; + /* token */ struct { diff --git a/ase/awk/extio.c b/ase/awk/extio.c index aceeb474..2469cb14 100644 --- a/ase/awk/extio.c +++ b/ase/awk/extio.c @@ -1,5 +1,5 @@ /* - * $Id: extio.c,v 1.2 2006-06-16 11:24:32 bacon Exp $ + * $Id: extio.c,v 1.3 2006-06-18 13:43:28 bacon Exp $ */ #include @@ -48,11 +48,15 @@ int xp_awk_readcmd (xp_awk_run_t* run, const xp_char_t* cmd, int* errnum) if (p->handle == XP_NULL) { - p->handle = (void*) _tpopen (p->name, XP_T("r")); + xp_awk_io_t pipe_io = run->awk.extio.pipe; + + //p->handle = (void*) _tpopen (p->name, XP_T("r")); + p->handle = pipe_io (XP_AWK_INPUT_OPEN, p->name, XP_NULL, 0); if (p->handle == NULL) { /* this is treated as pipe open error. * the return value of getline should be -1 + * set ERRNO as well.... */ return -1; } diff --git a/ase/test/awk/awk.c b/ase/test/awk/awk.c index f1477637..eccc06e4 100644 --- a/ase/test/awk/awk.c +++ b/ase/test/awk/awk.c @@ -1,5 +1,5 @@ /* - * $Id: awk.c,v 1.35 2006-06-13 04:26:24 bacon Exp $ + * $Id: awk.c,v 1.36 2006-06-18 13:43:28 bacon Exp $ */ #include @@ -152,7 +152,7 @@ static int __main (int argc, xp_char_t* argv[]) xp_awk_setparseopt (awk, XP_AWK_EXPLICIT | XP_AWK_UNIQUE | - XP_AWK_SHADING | XP_AWK_IMPLICIT | XP_AWK_SHIFT); + XP_AWK_SHADING | XP_AWK_IMPLICIT | XP_AWK_SHIFT | XP_AWK_EXTIO); if (argc == 2) {