*** empty log message ***

This commit is contained in:
hyung-hwan 2006-12-24 15:14:09 +00:00
parent eaf49fce98
commit 3628069938
2 changed files with 19 additions and 10 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: run.c,v 1.306 2006-12-23 06:33:47 bacon Exp $
* $Id: run.c,v 1.307 2006-12-24 15:14:08 bacon Exp $
*/
#include <ase/awk/awk_i.h>
@ -657,6 +657,9 @@ int ase_awk_run (ase_awk_t* awk,
}
}
/* uninitialize the run object */
__deinit_run (run);
/* the run loop ended. execute the end callback if it exists */
if (runcbs != ASE_NULL && runcbs->on_end != ASE_NULL)
{
@ -669,8 +672,7 @@ int ase_awk_run (ase_awk_t* awk,
n = 0;
}
/* uninitialize the run object */
__deinit_run (run);
/* unregister the run object */
__del_run (awk, run);
ASE_AWK_FREE (awk, run);
@ -2539,7 +2541,9 @@ static int __run_delete (ase_awk_run_t* run, ase_awk_nde_delete_t* nde)
ASE_AWK_ASSERTX (run->awk,
!"should never happen - wrong target for delete",
"the delete statement cannot be called with other nodes than the variables such as a named variable, a named indexed variable, etc");
ase_awk_setrunerror (run, ASE_AWK_EINTERNAL, var->line, "delete statement called with a wrong target");
ase_awk_setrunerror (
run, ASE_AWK_EINTERNAL, var->line,
ASE_T("delete statement called with a wrong target"));
return -1;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: awk.c,v 1.146 2006-12-23 06:33:47 bacon Exp $
* $Id: awk.c,v 1.147 2006-12-24 15:14:09 bacon Exp $
*/
#include <ase/awk/awk.h>
@ -10,6 +10,8 @@
#include <math.h>
#include <limits.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#if defined(_WIN32)
#include <windows.h>
@ -18,18 +20,20 @@
#pragma warning (disable: 4296)
#elif defined(ASE_CHAR_IS_MCHAR)
#include <ctype.h>
#include <stdlib.h>
#include <locale.h>
#else
#include <wchar.h>
#include <wctype.h>
#include <locale.h>
#include "printf.c"
/*
#include <xp/bas/stdio.h>
#include <xp/bas/stdlib.h>
#include <xp/bas/string.h>
#include <xp/bas/memory.h>
#include <xp/bas/sysapi.h>
*/
#endif
#if defined(_WIN32) && defined(_MSC_VER) && defined(_DEBUG)
@ -281,6 +285,7 @@ static ase_ssize_t process_extio_pipe (
else if (epa->mode == ASE_AWK_EXTIO_PIPE_WRITE)
mode = ASE_T("w");
else return -1; /* TODO: any way to set the error number? */
awk_dprintf (ASE_T("opening %s of type %d (pipe)\n"), epa->name, epa->type);
handle = awk_popen (epa->name, mode);
if (handle == NULL) return -1;
@ -290,7 +295,6 @@ static ase_ssize_t process_extio_pipe (
case ASE_AWK_IO_CLOSE:
{
fflush ((FILE*)epa->handle);
awk_dprintf (ASE_T("closing %s of type (pipe) %d\n"), epa->name, epa->type);
fclose ((FILE*)epa->handle);
epa->handle = NULL;
@ -299,8 +303,7 @@ static ase_ssize_t process_extio_pipe (
case ASE_AWK_IO_READ:
{
if (awk_fgets (data, size, (FILE*)epa->handle) == ASE_NULL)
return 0;
if (awk_fgets (data, size, (FILE*)epa->handle) == ASE_NULL) return 0;
return ase_awk_strlen(data);
}
@ -310,7 +313,9 @@ static ase_ssize_t process_extio_pipe (
/* TODO: how to return error or 0 */
for (i = 0; i < size; i++)
{
awk_fputc (data[i], (FILE*)epa->handle);
int n;
n = awk_fputc (data[i], (FILE*)epa->handle);
//if (n == -1) wprintf (L"errno = %d, %d\n", errno, EINVAL);
}
return size;
}