*** 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="aseawk.exe">test\awk\aseawk.bdsproj</Projects>
<Projects Name="Targets">aseawk.lib aseawk.exe</Projects> <Projects Name="Targets">aseawk.lib aseawk.exe</Projects>
</Projects> </Projects>
<Dependencies/> <Dependencies>
<Dependency GUID="{F0848980-053C-44B1-B7A0-4C834C1EB585}">
<Dependency GUID="{EDEF16CC-0C39-4E6B-A3CC-3DBF585BBD77}"/>
</Dependency>
</Dependencies>
</Default.Personality> </Default.Personality>
</BorlandProject> </BorlandProject>

View File

@ -14,7 +14,7 @@
</Source> </Source>
<BCBPROJECT> <BCBPROJECT>
<project version="10.0"> <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="count" value="1"/>
<property category="build.config" name="excludedefaultforzero" value="0"/> <property category="build.config" name="excludedefaultforzero" value="0"/>
<property category="build.config.0" name="builddir" value="Debug"/> <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="str.c" CONTAINERID="CCompiler" LOCALCOMMAND="" UNITNAME="str" FORMNAME="" DESIGNCLASS=""/>
<FILE FILENAME="tab.c" CONTAINERID="CCompiler" LOCALCOMMAND="" UNITNAME="tab" 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="tree.c" CONTAINERID="CCompiler" LOCALCOMMAND="" UNITNAME="tree" FORMNAME="" DESIGNCLASS=""/>
<FILE FILENAME="val.c" CONTAINERID="CCompiler" LOCALCOMMAND="" UNITNAME="val" FORMNAME="" DESIGNCLASS=""/>
</FILELIST> </FILELIST>
<IDEOPTIONS> <IDEOPTIONS>
<VersionInfo> <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_ #ifndef _ASE_AWK_AWKI_H_
@ -25,6 +25,12 @@ typedef struct ase_awk_tree_t ase_awk_tree_t;
#pragma warning (disable: 4996) #pragma warning (disable: 4996)
#endif #endif
/* TODO: remove this */
#ifdef _WIN32
#include <tchar.h>
#define xp_printf _tprintf
#endif
#define ASE_AWK_MAX_GLOBALS 9999 #define ASE_AWK_MAX_GLOBALS 9999
#define ASE_AWK_MAX_LOCALS 9999 #define ASE_AWK_MAX_LOCALS 9999
#define ASE_AWK_MAX_PARAMS 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> #include <ase/awk/awk.h>
@ -615,11 +615,7 @@ static void __awk_free (void* ptr, void* custom_data)
#endif #endif
} }
#if defined(__STAND_ALONE) && !defined(_WIN32)
static int __main (int argc, char* argv[])
#else
static int __main (int argc, ase_char_t* argv[]) static int __main (int argc, ase_char_t* argv[])
#endif
{ {
ase_awk_t* awk; ase_awk_t* awk;
ase_awk_srcios_t srcios; ase_awk_srcios_t srcios;
@ -647,11 +643,7 @@ static int __main (int argc, ase_char_t* argv[])
for (i = 1; i < argc; i++) 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) if (ase_awk_strcmp(argv[i], ASE_T("-m")) == 0)
#endif
{ {
opt |= ASE_AWK_RUNMAIN; opt |= ASE_AWK_RUNMAIN;
} }
@ -745,13 +737,13 @@ static int __main (int argc, ase_char_t* argv[])
if (ase_awk_parse (awk, &srcios) == -1) if (ase_awk_parse (awk, &srcios) == -1)
{ {
int errnum = ase_awk_geterrnum(awk); int errnum = ase_awk_geterrnum(awk);
#if defined(__STAND_ALONE) && !defined(_WIN32) && defined(ASE_CHAR_IS_WCHAR) #if !defined(_WIN32) && defined(ASE_CHAR_IS_WCHAR)
xp_printf ( wprintf (
ASE_T("ERROR: cannot parse program - line %u [%d] %ls\n"), ASE_T("ERROR: cannot parse program - line %u [%d] %ls\n"),
(unsigned int)ase_awk_getsrcline(awk), (unsigned int)ase_awk_getsrcline(awk),
errnum, ase_awk_geterrstr(errnum)); errnum, ase_awk_geterrstr(errnum));
#else #else
xp_printf ( _tprintf (
ASE_T("ERROR: cannot parse program - line %u [%d] %s\n"), ASE_T("ERROR: cannot parse program - line %u [%d] %s\n"),
(unsigned int)ase_awk_getsrcline(awk), (unsigned int)ase_awk_getsrcline(awk),
errnum, ase_awk_geterrstr(errnum)); 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) if (ase_awk_run (awk, &runios, &runcbs, runarg) == -1)
{ {
int errnum = ase_awk_geterrnum(awk); int errnum = ase_awk_geterrnum(awk);
#if defined(__STAND_ALONE) && !defined(_WIN32) && defined(ASE_CHAR_IS_WCHAR) #if !defined(_WIN32) && defined(ASE_CHAR_IS_WCHAR)
xp_printf ( wprintf (
ASE_T("error: cannot run program - [%d] %ls\n"), ASE_T("error: cannot run program - [%d] %ls\n"),
errnum, ase_awk_geterrstr(errnum)); errnum, ase_awk_geterrstr(errnum));
#else #else
xp_printf ( _tprintf (
ASE_T("error: cannot run program - [%d] %s\n"), ASE_T("error: cannot run program - [%d] %s\n"),
errnum, ase_awk_geterrstr(errnum)); errnum, ase_awk_geterrstr(errnum));
#endif #endif
@ -939,9 +931,9 @@ typedef struct _PEB {
*/ */
void* __declspec(naked) get_current_teb (void) void* /*__declspec(naked)*/ get_current_teb (void)
{ {
_asm _asm
{ {
mov eax, fs:[0x18] mov eax, fs:[0x18]
} }
@ -960,7 +952,7 @@ int is_debugger_present (void)
} }
int __declspec(naked) is_debugger_present2 (void) int /*__declspec(naked)*/ is_debugger_present2 (void)
{ {
_asm _asm
{ {
@ -974,8 +966,6 @@ int __declspec(naked) is_debugger_present2 (void)
#if defined(_WIN32) #if defined(_WIN32)
int _tmain (int argc, ase_char_t* argv[]) int _tmain (int argc, ase_char_t* argv[])
#elif defined(__STAND_ALONE)
int main (int argc, char* argv[])
#else #else
int xp_main (int argc, ase_char_t* argv[]) int xp_main (int argc, ase_char_t* argv[])
#endif #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); _CrtSetDbgFlag (_CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_ALWAYS_DF);
#endif*/ #endif*/
#ifdef _WIN32 #if defined(_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 (IsDebuggerPresent ()) if (IsDebuggerPresent ())
{ {
xp_printf (ASE_T("Running application in a debugger....\n")); _tprintf (_T("Running application in a debugger....\n"));
} }
if (is_debugger_present ()) 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 ()) 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 #endif
@ -1019,9 +998,11 @@ else xp_printf (ASE_T("%d, %s\n"), n, buf);
#if defined(__linux) && defined(_DEBUG) #if defined(__linux) && defined(_DEBUG)
muntrace (); muntrace ();
#endif #endif
#if defined(_WIN32) && defined(_MSC_VER) && defined(_DEBUG) #if defined(_WIN32) && defined(_DEBUG)
#if defined(_MSC_VER)
_CrtDumpMemoryLeaks (); _CrtDumpMemoryLeaks ();
wprintf (L"Press ENTER to quit\n"); #endif
_tprintf (_T("Press ENTER to quit\n"));
getchar (); getchar ();
#endif #endif