*** empty log message ***
This commit is contained in:
parent
d7957127ea
commit
7066e20309
@ -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 <xp/awk/awk_i.h>
|
#include <xp/awk/awk_i.h>
|
||||||
@ -84,6 +84,10 @@ xp_awk_t* xp_awk_open (void)
|
|||||||
awk->lex.line = 1;
|
awk->lex.line = 1;
|
||||||
awk->lex.column = 1;
|
awk->lex.column = 1;
|
||||||
|
|
||||||
|
awk->extio.pipe = XP_NULL;
|
||||||
|
awk->extio.coproc = XP_NULL;
|
||||||
|
awk->extio.file = XP_NULL;
|
||||||
|
|
||||||
return awk;
|
return awk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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_
|
#ifndef _XP_AWK_AWKI_H_
|
||||||
@ -112,6 +112,13 @@ struct xp_awk_t
|
|||||||
xp_size_t column;
|
xp_size_t column;
|
||||||
} lex;
|
} lex;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
xp_awk_io_t pipe;
|
||||||
|
xp_awk_io_t coproc;
|
||||||
|
xp_awk_io_t file;
|
||||||
|
} extio;
|
||||||
|
|
||||||
/* token */
|
/* token */
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
@ -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 <xp/awk/awk_i.h>
|
#include <xp/awk/awk_i.h>
|
||||||
@ -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)
|
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)
|
if (p->handle == NULL)
|
||||||
{
|
{
|
||||||
/* this is treated as pipe open error.
|
/* this is treated as pipe open error.
|
||||||
* the return value of getline should be -1
|
* the return value of getline should be -1
|
||||||
|
* set ERRNO as well....
|
||||||
*/
|
*/
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -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 <xp/awk/awk.h>
|
#include <xp/awk/awk.h>
|
||||||
@ -152,7 +152,7 @@ static int __main (int argc, xp_char_t* argv[])
|
|||||||
|
|
||||||
xp_awk_setparseopt (awk,
|
xp_awk_setparseopt (awk,
|
||||||
XP_AWK_EXPLICIT | XP_AWK_UNIQUE |
|
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)
|
if (argc == 2)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user