*** empty log message ***

This commit is contained in:
2006-03-31 16:35:37 +00:00
parent c4a54c070c
commit 3079f4aac4
14 changed files with 244 additions and 228 deletions

View File

@ -1,9 +1,9 @@
CC = cl
#CFLAGS = /nologo /MT /W3 /GR- /D_WIN32_WINNT=0x0400 -I..\..\..
CFLAGS = /nologo /MT /W3 /GR- /D_WIN32_WINNT=0x0400 -I..\..\.. -D__STAND_ALONE -DXP_CHAR_IS_WCHAR
CFLAGS = /nologo /MT /W3 /GR- /D_WIN32_WINNT=0x0400 -I..\..\..
LDFLAGS = /libpath:..\..\bas /libpath:..\..\awk
#LIBS = xpbas.lib xpawk.lib
LIBS = xpawk.lib
LIBS = xpbas.lib xpawk.lib
#LIBS = xpawk.lib
all: awk

View File

@ -1,4 +1,10 @@
/*
* $Id: awk.c,v 1.14 2006-03-31 16:35:37 bacon Exp $
*/
#include <xp/awk/awk.h>
#include <xp/bas/stdio.h>
#include <wchar.h>
#ifdef __STAND_ALONE
@ -62,7 +68,7 @@ int xp_main (int argc, xp_char_t* argv[])
int xp_main (int argc, char* argv[])
#endif
{
xp_awk_t awk;
xp_awk_t* awk;
#ifdef __linux
mtrace ();
@ -75,35 +81,37 @@ int xp_main (int argc, char* argv[])
}
#endif
if (xp_awk_open(&awk) == XP_NULL) {
if ((awk = xp_awk_open()) == XP_NULL) {
xp_printf (XP_TEXT("Error: cannot open awk\n"));
return -1;
}
if (xp_awk_attsrc(&awk, process_source, XP_NULL) == -1) {
xp_awk_close (&awk);
if (xp_awk_attsrc(awk, process_source, XP_NULL) == -1) {
xp_awk_close (awk);
xp_printf (XP_TEXT("error: cannot attach source\n"));
return -1;
}
awk.opt.parse = XP_AWK_EXPLICIT | XP_AWK_UNIQUE | XP_AWK_SHADING | XP_AWK_IMPLICIT;
xp_awk_setparseopt (awk,
XP_AWK_EXPLICIT | XP_AWK_UNIQUE |
XP_AWK_SHADING | XP_AWK_IMPLICIT);
if (xp_awk_parse(&awk) == -1) {
if (xp_awk_parse(awk) == -1) {
xp_printf (
XP_TEXT("error: cannot parse program - [%d] %s\n"),
xp_awk_geterrnum(&awk), xp_awk_geterrstr(&awk));
xp_awk_close (&awk);
xp_awk_geterrnum(awk), xp_awk_geterrstr(awk));
xp_awk_close (awk);
return -1;
}
if (xp_awk_run(&awk) == -1) {
if (xp_awk_run(awk) == -1) {
xp_printf (
XP_TEXT("error: cannot run program - [%d] %s\n"),
xp_awk_geterrnum(&awk), xp_awk_geterrstr(&awk));
xp_awk_close (&awk);
xp_awk_geterrnum(awk), xp_awk_geterrstr(awk));
xp_awk_close (awk);
}
xp_awk_close (&awk);
xp_awk_close (awk);
#ifdef __linux
muntrace ();