replaced popen and stdio functions with qse_pcp_t functions in StdAwk.cpp

This commit is contained in:
2009-01-17 08:57:27 +00:00
parent 07d8efa7c2
commit 6aac3f59cf
5 changed files with 85 additions and 87 deletions

View File

@ -71,6 +71,16 @@ void Awk::Extio::setHandle (void* handle)
extio->handle = handle;
}
Awk::Awk* Awk::Extio::getAwk ()
{
return (Awk::Awk*)extio->data;
}
const Awk::Awk* Awk::Extio::getAwk () const
{
return (const Awk::Awk*)extio->data;
}
const Awk::extio_t* Awk::Extio::getRawExtio () const
{
return extio;
@ -81,6 +91,11 @@ const Awk::run_t* Awk::Extio::getRawRun () const
return extio->run;
}
const Awk::awk_t* Awk::Extio::getRawAwk () const
{
return qse_awk_getrunawk (extio->run);
}
//////////////////////////////////////////////////////////////////
// Awk::Pipe
//////////////////////////////////////////////////////////////////
@ -119,7 +134,7 @@ Awk::Console::~Console ()
{
if (filename != QSE_NULL)
{
qse_awk_free (qse_awk_getrunawk(extio->run), filename);
qse_awk_free ((qse_awk_t*)getRawAwk(), filename);
}
}
@ -1326,10 +1341,10 @@ int Awk::run (const char_t* main, const char_t** args, size_t nargs)
// make sure that the run field is set in Awk::onRunStart.
Run runctx (this);
runios.pipe = pipeHandler;
runios.file = fileHandler;
runios.console = consoleHandler;
runios.data = this;
runios.pipe = pipeHandler;
runios.file = fileHandler;
runios.console = consoleHandler;
runios.data = this;
QSE_MEMSET (&runcbs, 0, QSE_SIZEOF(runcbs));
runcbs.on_start = onRunStart;