*** empty log message ***

This commit is contained in:
hyung-hwan 2006-10-27 10:28:53 +00:00
parent d3de9c9aa5
commit da1ab71172
5 changed files with 37 additions and 269 deletions

View File

@ -13,6 +13,10 @@
<Projects Name="aseawk.exe">test\awk\aseawk.bdsproj</Projects>
<Projects Name="Targets">aseawk.lib aseawk.exe</Projects>
</Projects>
<Dependencies/>
<Dependencies>
<Dependency GUID="{F0848980-053C-44B1-B7A0-4C834C1EB585}">
<Dependency GUID="{EDEF16CC-0C39-4E6B-A3CC-3DBF585BBD77}"/>
</Dependency>
</Dependencies>
</Default.Personality>
</BorlandProject>

View File

@ -14,7 +14,7 @@
</Source>
<BCBPROJECT>
<project version="10.0">
<property category="build.config" name="active" value="1"/>
<property category="build.config" name="active" value="0"/>
<property category="build.config" name="count" value="1"/>
<property category="build.config" name="excludedefaultforzero" value="0"/>
<property category="build.config.0" name="builddir" value="Debug"/>
@ -200,6 +200,7 @@
<FILE FILENAME="str.c" CONTAINERID="CCompiler" LOCALCOMMAND="" UNITNAME="str" FORMNAME="" DESIGNCLASS=""/>
<FILE FILENAME="tab.c" CONTAINERID="CCompiler" LOCALCOMMAND="" UNITNAME="tab" FORMNAME="" DESIGNCLASS=""/>
<FILE FILENAME="tree.c" CONTAINERID="CCompiler" LOCALCOMMAND="" UNITNAME="tree" FORMNAME="" DESIGNCLASS=""/>
<FILE FILENAME="val.c" CONTAINERID="CCompiler" LOCALCOMMAND="" UNITNAME="val" FORMNAME="" DESIGNCLASS=""/>
</FILELIST>
<IDEOPTIONS>
<VersionInfo>

View File

@ -1,5 +1,5 @@
/*
* $Id: awk_i.h,v 1.74 2006-10-26 08:17:37 bacon Exp $
* $Id: awk_i.h,v 1.75 2006-10-27 10:28:52 bacon Exp $
*/
#ifndef _ASE_AWK_AWKI_H_
@ -25,6 +25,12 @@ typedef struct ase_awk_tree_t ase_awk_tree_t;
#pragma warning (disable: 4996)
#endif
/* TODO: remove this */
#ifdef _WIN32
#include <tchar.h>
#define xp_printf _tprintf
#endif
#define ASE_AWK_MAX_GLOBALS 9999
#define ASE_AWK_MAX_LOCALS 9999
#define ASE_AWK_MAX_PARAMS 9999

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*
* $Id: awk.c,v 1.104 2006-10-27 09:19:21 bacon Exp $
* $Id: awk.c,v 1.105 2006-10-27 10:28:53 bacon Exp $
*/
#include <ase/awk/awk.h>
@ -615,11 +615,7 @@ static void __awk_free (void* ptr, void* custom_data)
#endif
}
#if defined(__STAND_ALONE) && !defined(_WIN32)
static int __main (int argc, char* argv[])
#else
static int __main (int argc, ase_char_t* argv[])
#endif
{
ase_awk_t* awk;
ase_awk_srcios_t srcios;
@ -647,11 +643,7 @@ static int __main (int argc, ase_char_t* argv[])
for (i = 1; i < argc; i++)
{
#if defined(__STAND_ALONE) && !defined(_WIN32)
if (strcmp(argv[i], "-m") == 0)
#else
if (ase_awk_strcmp(argv[i], ASE_T("-m")) == 0)
#endif
{
opt |= ASE_AWK_RUNMAIN;
}
@ -745,13 +737,13 @@ static int __main (int argc, ase_char_t* argv[])
if (ase_awk_parse (awk, &srcios) == -1)
{
int errnum = ase_awk_geterrnum(awk);
#if defined(__STAND_ALONE) && !defined(_WIN32) && defined(ASE_CHAR_IS_WCHAR)
xp_printf (
#if !defined(_WIN32) && defined(ASE_CHAR_IS_WCHAR)
wprintf (
ASE_T("ERROR: cannot parse program - line %u [%d] %ls\n"),
(unsigned int)ase_awk_getsrcline(awk),
errnum, ase_awk_geterrstr(errnum));
#else
xp_printf (
_tprintf (
ASE_T("ERROR: cannot parse program - line %u [%d] %s\n"),
(unsigned int)ase_awk_getsrcline(awk),
errnum, ase_awk_geterrstr(errnum));
@ -787,12 +779,12 @@ static int __main (int argc, ase_char_t* argv[])
if (ase_awk_run (awk, &runios, &runcbs, runarg) == -1)
{
int errnum = ase_awk_geterrnum(awk);
#if defined(__STAND_ALONE) && !defined(_WIN32) && defined(ASE_CHAR_IS_WCHAR)
xp_printf (
#if !defined(_WIN32) && defined(ASE_CHAR_IS_WCHAR)
wprintf (
ASE_T("error: cannot run program - [%d] %ls\n"),
errnum, ase_awk_geterrstr(errnum));
#else
xp_printf (
_tprintf (
ASE_T("error: cannot run program - [%d] %s\n"),
errnum, ase_awk_geterrstr(errnum));
#endif
@ -939,7 +931,7 @@ typedef struct _PEB {
*/
void* __declspec(naked) get_current_teb (void)
void* /*__declspec(naked)*/ get_current_teb (void)
{
_asm
{
@ -960,7 +952,7 @@ int is_debugger_present (void)
}
int __declspec(naked) is_debugger_present2 (void)
int /*__declspec(naked)*/ is_debugger_present2 (void)
{
_asm
{
@ -974,8 +966,6 @@ int __declspec(naked) is_debugger_present2 (void)
#if defined(_WIN32)
int _tmain (int argc, ase_char_t* argv[])
#elif defined(__STAND_ALONE)
int main (int argc, char* argv[])
#else
int xp_main (int argc, ase_char_t* argv[])
#endif
@ -988,29 +978,18 @@ int xp_main (int argc, ase_char_t* argv[])
_CrtSetDbgFlag (_CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_ALWAYS_DF);
#endif*/
#ifdef _WIN32
{
ase_char_t buf[ase_sizeof(ase_long_t)*8+2+2];
ase_size_t n;
n = ase_awk_longtostr (-0x7FFFFFFFFFFFFFFFi64, 16, ASE_T("0x"), buf, ase_countof(buf));
if (n == (ase_size_t)-1)
{
xp_printf (ASE_T("cannot convert...\n"));
}
else xp_printf (ASE_T("%d, %s\n"), n, buf);
}
#if defined(_WIN32)
if (IsDebuggerPresent ())
{
xp_printf (ASE_T("Running application in a debugger....\n"));
_tprintf (_T("Running application in a debugger....\n"));
}
if (is_debugger_present ())
{
xp_printf (ASE_T("Running application in a debugger by is_debugger_present...\n"));
_tprintf (_T("Running application in a debugger by is_debugger_present...\n"));
}
if (is_debugger_present2 ())
{
xp_printf (ASE_T("Running application in a debugger by is_debugger_present2...\n"));
_tprintf (_T("Running application in a debugger by is_debugger_present2...\n"));
}
#endif
@ -1019,9 +998,11 @@ else xp_printf (ASE_T("%d, %s\n"), n, buf);
#if defined(__linux) && defined(_DEBUG)
muntrace ();
#endif
#if defined(_WIN32) && defined(_MSC_VER) && defined(_DEBUG)
#if defined(_WIN32) && defined(_DEBUG)
#if defined(_MSC_VER)
_CrtDumpMemoryLeaks ();
wprintf (L"Press ENTER to quit\n");
#endif
_tprintf (_T("Press ENTER to quit\n"));
getchar ();
#endif