This commit is contained in:
nephacks
2025-06-04 03:22:50 +02:00
parent f234f23848
commit f12416cffd
14243 changed files with 6446499 additions and 26 deletions

View File

@@ -0,0 +1,41 @@
Squirrel 2.2.3 stable
--------------------------------------------------------
What is in this distribution?
squirrel
static library implementing the compiler and interpreter of the language
sqstdlib
the standard utility libraries
sq
stand alone interpreter
doc
The manual
etc
a minimalistic embedding sample
samples
samples programs
HOW TO COMPILE
---------------------------------------------------------
GCC USERS
.........................................................
There is a very simple makefile that compiles all libraries and exes
from the root of the project run 'make'
for 32 bits systems
$ make
for 64 bits systems
$ make sq64
VISUAL C++ USERS
.........................................................
Open squirrel.dsw from the root project directory and build(dho!)

View File

@@ -0,0 +1,29 @@
Copyright (c) 2003-2009 Alberto Demichelis
This software is provided 'as-is', without any
express or implied warranty. In no event will the
authors be held liable for any damages arising from
the use of this software.
Permission is granted to anyone to use this software
for any purpose, including commercial applications,
and to alter it and redistribute it freely, subject
to the following restrictions:
1. The origin of this software must not be
misrepresented; you must not claim that
you wrote the original software. If you
use this software in a product, an
acknowledgment in the product
documentation would be appreciated but is
not required.
2. Altered source versions must be plainly
marked as such, and must not be
misrepresented as being the original
software.
3. This notice may not be removed or
altered from any source distribution.
-----------------------------------------------------
END OF COPYRIGHT

View File

@@ -0,0 +1,253 @@
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
<FileVersion major="1" minor="1"/>
<Project>
<Option title="DXSquirrel"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option compiler="0"/>
<Build>
<Target title="Debug">
<Option output="Debug\DXSquirrelD.exe"/>
<Option working_dir="."/>
<Option object_output="Debug"/>
<Option deps_output=".deps"/>
<Option external_deps="..\lib\libsquirrelD.a;..\lib\libsqstdlibD.a;..\lib\libsqplusD.a;"/>
<Option type="0"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="0"/>
<Compiler>
<Add option="-W"/>
<Add option="-O0"/>
<Add option="-DWIN32"/>
<Add option="-D_DEBUG"/>
<Add option="-D_WINDOWS"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add directory="..\include"/>
<Add directory="..\sqplus"/>
</Compiler>
<Linker>
<Add library="..\lib\libsqplusD.a"/>
<Add library="D:\DX9\Lib\x86\d3dx9.lib"/>
<Add library="D:\DX9\Lib\x86\d3d9.lib"/>
<Add library="..\lib\libsquirrelD.a"/>
<Add library="..\lib\libsqstdlibD.a"/>
<Add library="D:\DX9\Lib\x86\dxguid.lib"/>
<Add directory="..\lib"/>
<Add directory="D:\DX9\Lib\x86"/>
</Linker>
</Target>
<Target title="Release">
<Option output="Release\DXSquirrel.exe"/>
<Option working_dir="."/>
<Option object_output="Release"/>
<Option deps_output=".deps"/>
<Option external_deps="..\lib\libsquirrel.a;..\lib\libsqstdlib.a;..\lib\libsqplus.a;"/>
<Option type="0"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="0"/>
<Compiler>
<Add option="-W"/>
<Add option="-g"/>
<Add option="-DWIN32"/>
<Add option="-DNDEBUG"/>
<Add option="-D_WINDOWS"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add directory="..\include"/>
<Add directory="..\sqplus"/>
</Compiler>
<Linker>
<Add library="D:\DX9\Lib\x86\d3d9.lib"/>
<Add library="D:\DX9\Lib\x86\d3dx9.lib"/>
<Add library="..\lib\libsqplus.a"/>
<Add library="..\lib\libsquirrel.a"/>
<Add library="..\lib\libsqstdlib.a"/>
<Add directory="..\lib"/>
<Add directory="D:\DX9\Lib\x86"/>
</Linker>
</Target>
<Target title="Debug - Unicode">
<Option output="Debug - Unicode\DXSquirrel.exe"/>
<Option working_dir="."/>
<Option object_output="Debug - Unicode"/>
<Option deps_output=".deps"/>
<Option external_deps="..\lib\libsquirrelDU.a;..\lib\libsqstdlibDU.a;..\lib\libsqplusDU.a;"/>
<Option type="0"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="0"/>
<Compiler>
<Add option="-W"/>
<Add option="-O0"/>
<Add option="-DWIN32"/>
<Add option="-D_DEBUG"/>
<Add option="-D_WINDOWS"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add directory="..\include"/>
<Add directory="..\sqplus"/>
</Compiler>
<Linker>
<Add library="D:\DX9\Lib\x86\d3d9.lib"/>
<Add library="D:\DX9\Lib\x86\d3dx9.lib"/>
<Add library="..\lib\libsqplusDU.a"/>
<Add library="..\lib\libsquirrelDU.a"/>
<Add library="..\lib\libsqstdlibDU.a"/>
<Add directory="..\lib"/>
<Add directory="D:\DX9\Lib\x86"/>
</Linker>
</Target>
<Target title="Release - Unicode">
<Option output="Release - Unicode\DXSquirrel.exe"/>
<Option working_dir="."/>
<Option object_output="Release - Unicode"/>
<Option deps_output=".deps"/>
<Option external_deps="..\lib\libsquirrelU.a;..\lib\libsqstdlibU.a;..\lib\libsqplusU.a;"/>
<Option type="0"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="0"/>
<Compiler>
<Add option="-W"/>
<Add option="-g"/>
<Add option="-DWIN32"/>
<Add option="-DNDEBUG"/>
<Add option="-D_WINDOWS"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add directory="..\include"/>
<Add directory="..\sqplus"/>
</Compiler>
<Linker>
<Add library="D:\DX9\Lib\x86\d3d9.lib"/>
<Add library="D:\DX9\Lib\x86\d3dx9.lib"/>
<Add library="..\lib\libsqplusU.a"/>
<Add library="..\lib\libsquirrelU.a"/>
<Add library="..\lib\libsqstdlibU.a"/>
<Add directory="..\lib"/>
<Add directory="D:\DX9\Lib\x86"/>
</Linker>
</Target>
</Build>
<Compiler>
<Add directory="D:\DX9\Include"/>
</Compiler>
<Unit filename="DXSquirrel.cpp">
<Option compilerVar="CPP"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="DXSquirrel.h">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="DXSquirrel.ico">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="DXSquirrel.rc">
<Option compilerVar="WINDRES"/>
<Option objectName="DXSquirrel.res"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="DXSquirrel_Binds.cpp">
<Option compilerVar="CPP"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="DXSquirrel_Binds.h">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="DXSquirrel_DX.cpp">
<Option compilerVar="CPP"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="DXSquirrel_Device.cpp">
<Option compilerVar="CPP"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="DXSquirrel_Math.cpp">
<Option compilerVar="CPP"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="DXSquirrel_Mesh.cpp">
<Option compilerVar="CPP"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="Resource.h">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="dxsquirrel.nut">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="small.ico">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="stdafx.cpp">
<Option compilerVar="CPP"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="stdafx.h">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
</Project>
</CodeBlocks_project_file>

View File

@@ -0,0 +1,41 @@
#include "stdafx.h"
#include <Windows.h>
#include <mmsystem.h>
#include <strsafe.h>
#pragma comment(lib,"d3d9.lib")
#pragma comment(lib,"d3dx9.lib")
#include "sqplus.h"
LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) {
switch( msg ) {
case WM_CLOSE:
PostQuitMessage( 0 );
return 0;
}
return DefWindowProc( hWnd, msg, wParam, lParam );
}
BOOL DXSquirrel_Initialize();
void DXSquirrel_Shutdown();
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT ) {
if(!DXSquirrel_Initialize()) {
MessageBox(NULL,_SC("Error initilizing the app"),_SC("DXSquirrel"),MB_OK);
return -1;
}
try {
SquirrelObject main = SquirrelVM::CompileScript(_SC("dxsquirrel.nut"));
SquirrelVM::RunScript(main);
}
catch(SquirrelError &e) {
MessageBox(NULL,e.desc,_SC("DXSquirrel"),MB_OK);
return -2;
}
DXSquirrel_Shutdown();
return 0;
}

View File

@@ -0,0 +1,3 @@
#pragma once
#include "resource.h"

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -0,0 +1,128 @@
//Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1
#pragma code_page(1252)
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_DXSQUIRREL ICON "DXSquirrel.ico"
IDI_SMALL ICON "small.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDC_DXSQUIRREL MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "E&xit", IDM_EXIT
END
POPUP "&Help"
BEGIN
MENUITEM "&About ...", IDM_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDC_DXSQUIRREL ACCELERATORS
BEGIN
"?", IDM_ABOUT, ASCII, ALT
"/", IDM_ABOUT, ASCII, ALT
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG 22, 17, 230, 75
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "About"
FONT 8, "System"
BEGIN
ICON IDI_DXSQUIRREL,IDC_MYICON,14,9,16,16
LTEXT "DXSquirrel Version 1.0",IDC_STATIC,49,10,119,8,SS_NOPREFIX
LTEXT "Copyright (C) 2005",IDC_STATIC,49,20,119,8
DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDC_DXSQUIRREL "DXSQUIRREL"
IDS_APP_TITLE "DXSquirrel"
END
#endif
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,452 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="DXSquirrel"
ProjectGUID="{63D317C8-DF36-49A8-BA6A-EE52C752685E}"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/DXSquirrelD.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib"
IgnoreDefaultLibraryNames="LIBC"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/DXSquirrel.pdb"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/DXSquirrel.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/DXSquirrel.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib"
IgnoreDefaultLibraryNames="LIBC"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/DXSquirrel.pdb"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/DXSquirrel.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\DXSquirrel.cpp"
>
</File>
<File
RelativePath=".\DXSquirrel_Binds.cpp"
>
</File>
<File
RelativePath=".\DXSquirrel_Device.cpp"
>
</File>
<File
RelativePath=".\DXSquirrel_DX.cpp"
>
</File>
<File
RelativePath=".\DXSquirrel_Math.cpp"
>
</File>
<File
RelativePath=".\DXSquirrel_Mesh.cpp"
>
</File>
<File
RelativePath=".\stdafx.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug - Unicode|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release - Unicode|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\DXSquirrel.h"
>
</File>
<File
RelativePath=".\DXSquirrel_Binds.h"
>
</File>
<File
RelativePath=".\Resource.h"
>
</File>
<File
RelativePath=".\stdafx.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\DXSquirrel.ico"
>
</File>
<File
RelativePath=".\DXSquirrel.rc"
>
</File>
<File
RelativePath=".\small.ico"
>
</File>
</Filter>
<File
RelativePath=".\dxsquirrel.nut"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,302 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="DXSquirrel"
ProjectGUID="{63D317C8-DF36-49A8-BA6A-EE52C752685E}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/DXSquirrelD.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib"
IgnoreDefaultLibraryNames="LIBC"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/DXSquirrel.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/DXSquirrel.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="TRUE"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/DXSquirrel.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib"
IgnoreDefaultLibraryNames="LIBC"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/DXSquirrel.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/DXSquirrel.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="TRUE"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\DXSquirrel.cpp">
</File>
<File
RelativePath=".\DXSquirrel_Binds.cpp">
</File>
<File
RelativePath=".\DXSquirrel_Device.cpp">
</File>
<File
RelativePath=".\DXSquirrel_DX.cpp">
</File>
<File
RelativePath=".\DXSquirrel_Math.cpp">
</File>
<File
RelativePath=".\DXSquirrel_Mesh.cpp">
</File>
<File
RelativePath=".\stdafx.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug - Unicode|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release - Unicode|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath=".\DXSquirrel.h">
</File>
<File
RelativePath=".\DXSquirrel_Binds.h">
</File>
<File
RelativePath=".\Resource.h">
</File>
<File
RelativePath=".\stdafx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
<File
RelativePath=".\DXSquirrel.ico">
</File>
<File
RelativePath=".\DXSquirrel.rc">
</File>
<File
RelativePath=".\small.ico">
</File>
</Filter>
<File
RelativePath=".\dxsquirrel.nut">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,35 @@
#include "stdafx.h"
#include "sqplus.h"
#include "DXSquirrel_Binds.h"
WNDCLASSEX gWC;
LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
IDirect3D9 * gpD3D = NULL;
BOOL DXSquirrel_Initialize()
{
WNDCLASSEX t = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,
GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
_T("DXSquirrel"), NULL };
gWC = t;
RegisterClassEx( &gWC );
SquirrelVM::Init();
if( NULL == ( gpD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) )
return FALSE;
//initializes classes
_INIT_STATIC_NAMESPACE(DX);
_INIT_CLASS(Device);
_INIT_CLASS(Vector3);
_INIT_CLASS(Matrix);
_INIT_CLASS(BaseMesh);
_INIT_CLASS(Mesh);
//
return TRUE;
}
void DXSquirrel_Shutdown()
{
if(gpD3D) {
gpD3D->Release();
}
}

View File

@@ -0,0 +1,11 @@
#ifndef _DXSQUIRREL_BINDS_H_
#define _DXSQUIRREL_BINDS_H_
_DECL_STATIC_NAMESPACE(DX);
_DECL_CLASS(Device);
_DECL_CLASS(Vector3);
_DECL_CLASS(Matrix);
_DECL_CLASS(BaseMesh);
_DECL_CLASS(Mesh);
#endif //_DXSQUIRREL_BINDS_H_

View File

@@ -0,0 +1,230 @@
#include "stdafx.h"
#include "sqplus.h"
#include "DXSquirrel_Binds.h"
//updates the message loop
_MEMBER_FUNCTION_IMPL(DX,Update)
{
StackHandler sa(v);
MSG msg;
ZeroMemory( &msg, sizeof(msg) );
while( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )
{
if(msg.message == WM_QUIT)
{
return sa.Return(false);
}
TranslateMessage( &msg );
DispatchMessage( &msg );
}
return sa.Return(true);
}
//
_BEGIN_NAMESPACE(DX)
_MEMBER_FUNCTION(DX,Update,0,0)
_BEGIN_NAMESPACE_CONSTANTS(DX)
//D3DDEVTYPE
_CONSTANT(D3DDEVTYPE_HAL,OT_INTEGER,D3DDEVTYPE_HAL)
_CONSTANT(D3DDEVTYPE_REF,OT_INTEGER,D3DDEVTYPE_REF)
_CONSTANT(D3DDEVTYPE_SW,OT_INTEGER,D3DDEVTYPE_SW)
//SWAPEFFECT
_CONSTANT(D3DSWAPEFFECT_DISCARD,OT_INTEGER,D3DSWAPEFFECT_DISCARD)
_CONSTANT(D3DSWAPEFFECT_FLIP,OT_INTEGER,D3DSWAPEFFECT_FLIP)
_CONSTANT(D3DSWAPEFFECT_COPY,OT_INTEGER,D3DSWAPEFFECT_COPY)
//D3DCREATE
_CONSTANT(D3DCREATE_ADAPTERGROUP_DEVICE,OT_INTEGER,D3DCREATE_ADAPTERGROUP_DEVICE)
_CONSTANT(D3DCREATE_DISABLE_DRIVER_MANAGEMENT,OT_INTEGER,D3DCREATE_DISABLE_DRIVER_MANAGEMENT)
_CONSTANT(D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX,OT_INTEGER,D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX)
_CONSTANT(D3DCREATE_FPU_PRESERVE,OT_INTEGER,D3DCREATE_FPU_PRESERVE)
_CONSTANT(D3DCREATE_HARDWARE_VERTEXPROCESSING,OT_INTEGER,D3DCREATE_HARDWARE_VERTEXPROCESSING)
_CONSTANT(D3DCREATE_MIXED_VERTEXPROCESSING,OT_INTEGER,D3DCREATE_MIXED_VERTEXPROCESSING)
_CONSTANT(D3DCREATE_MULTITHREADED,OT_INTEGER,D3DCREATE_MULTITHREADED)
_CONSTANT(D3DCREATE_NOWINDOWCHANGES,OT_INTEGER,D3DCREATE_NOWINDOWCHANGES)
_CONSTANT(D3DCREATE_PUREDEVICE,OT_INTEGER,D3DCREATE_PUREDEVICE)
_CONSTANT(D3DCREATE_SOFTWARE_VERTEXPROCESSING,OT_INTEGER,D3DCREATE_SOFTWARE_VERTEXPROCESSING)
//D3DFMT
_CONSTANT(D3DFMT_UNKNOWN,OT_INTEGER,D3DFMT_UNKNOWN)
_CONSTANT(D3DFMT_R8G8B8,OT_INTEGER,D3DFMT_R8G8B8)
_CONSTANT(D3DFMT_A8R8G8B8,OT_INTEGER,D3DFMT_A8R8G8B8)
_CONSTANT(D3DFMT_X8R8G8B8,OT_INTEGER,D3DFMT_X8R8G8B8)
_CONSTANT(D3DFMT_R5G6B5,OT_INTEGER,D3DFMT_R5G6B5)
_CONSTANT(D3DFMT_X1R5G5B5,OT_INTEGER,D3DFMT_X1R5G5B5)
_CONSTANT(D3DFMT_A1R5G5B5,OT_INTEGER,D3DFMT_A1R5G5B5)
_CONSTANT(D3DFMT_A4R4G4B4,OT_INTEGER,D3DFMT_A4R4G4B4)
_CONSTANT(D3DFMT_R3G3B2,OT_INTEGER,D3DFMT_R3G3B2)
_CONSTANT(D3DFMT_A8,OT_INTEGER,D3DFMT_A8)
_CONSTANT(D3DFMT_A8R3G3B2,OT_INTEGER,D3DFMT_A8R3G3B2)
_CONSTANT(D3DFMT_X4R4G4B4,OT_INTEGER,D3DFMT_X4R4G4B4)
_CONSTANT(D3DFMT_A2B10G10R10,OT_INTEGER,D3DFMT_A2B10G10R10)
_CONSTANT(D3DFMT_A8B8G8R8,OT_INTEGER,D3DFMT_A8B8G8R8)
_CONSTANT(D3DFMT_X8B8G8R8,OT_INTEGER,D3DFMT_X8B8G8R8)
_CONSTANT(D3DFMT_G16R16,OT_INTEGER,D3DFMT_G16R16)
_CONSTANT(D3DFMT_A2R10G10B10,OT_INTEGER,D3DFMT_A2R10G10B10)
_CONSTANT(D3DFMT_A16B16G16R16,OT_INTEGER,D3DFMT_A16B16G16R16)
_CONSTANT(D3DFMT_A8P8,OT_INTEGER,D3DFMT_A8P8)
_CONSTANT(D3DFMT_P8,OT_INTEGER,D3DFMT_P8)
_CONSTANT(D3DFMT_L8,OT_INTEGER,D3DFMT_L8)
_CONSTANT(D3DFMT_A8L8,OT_INTEGER,D3DFMT_A8L8)
_CONSTANT(D3DFMT_A4L4,OT_INTEGER,D3DFMT_A4L4)
_CONSTANT(D3DFMT_V8U8,OT_INTEGER,D3DFMT_V8U8)
_CONSTANT(D3DFMT_L6V5U5,OT_INTEGER,D3DFMT_L6V5U5)
_CONSTANT(D3DFMT_X8L8V8U8,OT_INTEGER,D3DFMT_X8L8V8U8)
_CONSTANT(D3DFMT_Q8W8V8U8,OT_INTEGER,D3DFMT_Q8W8V8U8)
_CONSTANT(D3DFMT_V16U16,OT_INTEGER,D3DFMT_V16U16)
_CONSTANT(D3DFMT_A2W10V10U10,OT_INTEGER,D3DFMT_A2W10V10U10)
_CONSTANT(D3DFMT_UYVY,OT_INTEGER,D3DFMT_UYVY)
_CONSTANT(D3DFMT_R8G8_B8G8,OT_INTEGER,D3DFMT_R8G8_B8G8)
_CONSTANT(D3DFMT_YUY2,OT_INTEGER,D3DFMT_YUY2)
_CONSTANT(D3DFMT_G8R8_G8B8,OT_INTEGER,D3DFMT_G8R8_G8B8)
_CONSTANT(D3DFMT_DXT1,OT_INTEGER,D3DFMT_DXT1)
_CONSTANT(D3DFMT_DXT2,OT_INTEGER,D3DFMT_DXT2)
_CONSTANT(D3DFMT_DXT3,OT_INTEGER,D3DFMT_DXT3)
_CONSTANT(D3DFMT_DXT4,OT_INTEGER,D3DFMT_DXT4)
_CONSTANT(D3DFMT_DXT5,OT_INTEGER,D3DFMT_DXT5)
_CONSTANT(D3DFMT_D16_LOCKABLE,OT_INTEGER,D3DFMT_D16_LOCKABLE)
_CONSTANT(D3DFMT_D32,OT_INTEGER,D3DFMT_D32)
_CONSTANT(D3DFMT_D15S1,OT_INTEGER,D3DFMT_D15S1)
_CONSTANT(D3DFMT_D24S8,OT_INTEGER,D3DFMT_D24S8)
_CONSTANT(D3DFMT_D24X8,OT_INTEGER,D3DFMT_D24X8)
_CONSTANT(D3DFMT_D24X4S4,OT_INTEGER,D3DFMT_D24X4S4)
_CONSTANT(D3DFMT_D16,OT_INTEGER,D3DFMT_D16)
_CONSTANT(D3DFMT_D32F_LOCKABLE,OT_INTEGER,D3DFMT_D32F_LOCKABLE)
_CONSTANT(D3DFMT_D24FS8,OT_INTEGER,D3DFMT_D24FS8)
_CONSTANT(D3DFMT_L16,OT_INTEGER,D3DFMT_L16)
_CONSTANT(D3DFMT_VERTEXDATA,OT_INTEGER,D3DFMT_VERTEXDATA)
_CONSTANT(D3DFMT_INDEX16,OT_INTEGER,D3DFMT_INDEX16)
_CONSTANT(D3DFMT_INDEX32,OT_INTEGER,D3DFMT_INDEX32)
_CONSTANT(D3DFMT_Q16W16V16U16,OT_INTEGER,D3DFMT_Q16W16V16U16)
_CONSTANT(D3DFMT_MULTI2_ARGB8,OT_INTEGER,D3DFMT_MULTI2_ARGB8)
_CONSTANT(D3DFMT_R16F,OT_INTEGER,D3DFMT_R16F)
_CONSTANT(D3DFMT_G16R16F,OT_INTEGER,D3DFMT_G16R16F)
_CONSTANT(D3DFMT_A16B16G16R16F,OT_INTEGER,D3DFMT_A16B16G16R16F)
_CONSTANT(D3DFMT_R32F,OT_INTEGER,D3DFMT_R32F)
_CONSTANT(D3DFMT_G32R32F,OT_INTEGER,D3DFMT_G32R32F)
_CONSTANT(D3DFMT_A32B32G32R32F,OT_INTEGER,D3DFMT_A32B32G32R32F)
_CONSTANT(D3DFMT_CxV8U8,OT_INTEGER,D3DFMT_CxV8U8)
//D3DCLEAR
_CONSTANT(D3DCLEAR_STENCIL,OT_INTEGER,D3DCLEAR_STENCIL)
_CONSTANT(D3DCLEAR_TARGET,OT_INTEGER,D3DCLEAR_TARGET)
_CONSTANT(D3DCLEAR_ZBUFFER,OT_INTEGER,D3DCLEAR_ZBUFFER)
//D3DTS
_CONSTANT(D3DTS_WORLD,OT_INTEGER,D3DTS_WORLD)
_CONSTANT(D3DTS_VIEW,OT_INTEGER,D3DTS_VIEW)
_CONSTANT(D3DTS_PROJECTION,OT_INTEGER,D3DTS_PROJECTION)
_CONSTANT(D3DTS_TEXTURE0,OT_INTEGER,D3DTS_TEXTURE0)
_CONSTANT(D3DTS_TEXTURE1,OT_INTEGER,D3DTS_TEXTURE1)
_CONSTANT(D3DTS_TEXTURE2,OT_INTEGER,D3DTS_TEXTURE2)
_CONSTANT(D3DTS_TEXTURE3,OT_INTEGER,D3DTS_TEXTURE3)
_CONSTANT(D3DTS_TEXTURE4,OT_INTEGER,D3DTS_TEXTURE4)
_CONSTANT(D3DTS_TEXTURE5,OT_INTEGER,D3DTS_TEXTURE5)
_CONSTANT(D3DTS_TEXTURE6,OT_INTEGER,D3DTS_TEXTURE6)
_CONSTANT(D3DTS_TEXTURE7,OT_INTEGER,D3DTS_TEXTURE7)
//
_CONSTANT(D3DX_PI,OT_INTEGER,D3DX_PI)
//RS
_CONSTANT(D3DRS_ZENABLE,OT_INTEGER,D3DRS_ZENABLE)
_CONSTANT(D3DRS_FILLMODE,OT_INTEGER,D3DRS_FILLMODE)
_CONSTANT(D3DRS_SHADEMODE,OT_INTEGER,D3DRS_SHADEMODE)
_CONSTANT(D3DRS_ZWRITEENABLE,OT_INTEGER,D3DRS_ZWRITEENABLE)
_CONSTANT(D3DRS_ALPHATESTENABLE,OT_INTEGER,D3DRS_ALPHATESTENABLE)
_CONSTANT(D3DRS_LASTPIXEL,OT_INTEGER,D3DRS_LASTPIXEL)
_CONSTANT(D3DRS_SRCBLEND,OT_INTEGER,D3DRS_SRCBLEND)
_CONSTANT(D3DRS_DESTBLEND,OT_INTEGER,D3DRS_DESTBLEND)
_CONSTANT(D3DRS_CULLMODE,OT_INTEGER,D3DRS_CULLMODE)
_CONSTANT(D3DRS_ZFUNC,OT_INTEGER,D3DRS_ZFUNC)
_CONSTANT(D3DRS_ALPHAREF,OT_INTEGER,D3DRS_ALPHAREF)
_CONSTANT(D3DRS_ALPHAFUNC,OT_INTEGER,D3DRS_ALPHAFUNC)
_CONSTANT(D3DRS_DITHERENABLE,OT_INTEGER,D3DRS_DITHERENABLE)
_CONSTANT(D3DRS_ALPHABLENDENABLE,OT_INTEGER,D3DRS_ALPHABLENDENABLE)
_CONSTANT(D3DRS_FOGENABLE,OT_INTEGER,D3DRS_FOGENABLE)
_CONSTANT(D3DRS_SPECULARENABLE,OT_INTEGER,D3DRS_SPECULARENABLE)
_CONSTANT(D3DRS_FOGCOLOR,OT_INTEGER,D3DRS_FOGCOLOR)
_CONSTANT(D3DRS_FOGTABLEMODE,OT_INTEGER,D3DRS_FOGTABLEMODE)
_CONSTANT(D3DRS_FOGSTART,OT_INTEGER,D3DRS_FOGSTART)
_CONSTANT(D3DRS_FOGEND,OT_INTEGER,D3DRS_FOGEND)
_CONSTANT(D3DRS_FOGDENSITY,OT_INTEGER,D3DRS_FOGDENSITY)
_CONSTANT(D3DRS_RANGEFOGENABLE,OT_INTEGER,D3DRS_RANGEFOGENABLE)
_CONSTANT(D3DRS_STENCILENABLE,OT_INTEGER,D3DRS_STENCILENABLE)
_CONSTANT(D3DRS_STENCILFAIL,OT_INTEGER,D3DRS_STENCILFAIL)
_CONSTANT(D3DRS_STENCILZFAIL,OT_INTEGER,D3DRS_STENCILZFAIL)
_CONSTANT(D3DRS_STENCILPASS,OT_INTEGER,D3DRS_STENCILPASS)
_CONSTANT(D3DRS_STENCILFUNC,OT_INTEGER,D3DRS_STENCILFUNC)
_CONSTANT(D3DRS_STENCILREF,OT_INTEGER,D3DRS_STENCILREF)
_CONSTANT(D3DRS_STENCILMASK,OT_INTEGER,D3DRS_STENCILMASK)
_CONSTANT(D3DRS_STENCILWRITEMASK,OT_INTEGER,D3DRS_STENCILWRITEMASK)
_CONSTANT(D3DRS_TEXTUREFACTOR,OT_INTEGER,D3DRS_TEXTUREFACTOR)
_CONSTANT(D3DRS_WRAP0,OT_INTEGER,D3DRS_WRAP0)
_CONSTANT(D3DRS_WRAP1,OT_INTEGER,D3DRS_WRAP1)
_CONSTANT(D3DRS_WRAP2,OT_INTEGER,D3DRS_WRAP2)
_CONSTANT(D3DRS_WRAP3,OT_INTEGER,D3DRS_WRAP3)
_CONSTANT(D3DRS_WRAP4,OT_INTEGER,D3DRS_WRAP4)
_CONSTANT(D3DRS_WRAP5,OT_INTEGER,D3DRS_WRAP5)
_CONSTANT(D3DRS_WRAP6,OT_INTEGER,D3DRS_WRAP6)
_CONSTANT(D3DRS_WRAP7,OT_INTEGER,D3DRS_WRAP7)
_CONSTANT(D3DRS_CLIPPING,OT_INTEGER,D3DRS_CLIPPING)
_CONSTANT(D3DRS_LIGHTING,OT_INTEGER,D3DRS_LIGHTING)
_CONSTANT(D3DRS_AMBIENT,OT_INTEGER,D3DRS_AMBIENT)
_CONSTANT(D3DRS_FOGVERTEXMODE,OT_INTEGER,D3DRS_FOGVERTEXMODE)
_CONSTANT(D3DRS_COLORVERTEX,OT_INTEGER,D3DRS_COLORVERTEX)
_CONSTANT(D3DRS_LOCALVIEWER,OT_INTEGER,D3DRS_LOCALVIEWER)
_CONSTANT(D3DRS_NORMALIZENORMALS,OT_INTEGER,D3DRS_NORMALIZENORMALS)
_CONSTANT(D3DRS_DIFFUSEMATERIALSOURCE,OT_INTEGER,D3DRS_DIFFUSEMATERIALSOURCE)
_CONSTANT(D3DRS_SPECULARMATERIALSOURCE,OT_INTEGER,D3DRS_SPECULARMATERIALSOURCE)
_CONSTANT(D3DRS_AMBIENTMATERIALSOURCE,OT_INTEGER,D3DRS_AMBIENTMATERIALSOURCE)
_CONSTANT(D3DRS_EMISSIVEMATERIALSOURCE,OT_INTEGER,D3DRS_EMISSIVEMATERIALSOURCE)
_CONSTANT(D3DRS_VERTEXBLEND,OT_INTEGER,D3DRS_VERTEXBLEND)
_CONSTANT(D3DRS_CLIPPLANEENABLE,OT_INTEGER,D3DRS_CLIPPLANEENABLE)
_CONSTANT(D3DRS_POINTSIZE,OT_INTEGER,D3DRS_POINTSIZE)
_CONSTANT(D3DRS_POINTSIZE_MIN,OT_INTEGER,D3DRS_POINTSIZE_MIN)
_CONSTANT(D3DRS_POINTSPRITEENABLE,OT_INTEGER,D3DRS_POINTSPRITEENABLE)
_CONSTANT(D3DRS_POINTSCALEENABLE,OT_INTEGER,D3DRS_POINTSCALEENABLE)
_CONSTANT(D3DRS_POINTSCALE_A,OT_INTEGER,D3DRS_POINTSCALE_A)
_CONSTANT(D3DRS_POINTSCALE_B,OT_INTEGER,D3DRS_POINTSCALE_B)
_CONSTANT(D3DRS_POINTSCALE_C,OT_INTEGER,D3DRS_POINTSCALE_C)
_CONSTANT(D3DRS_MULTISAMPLEANTIALIAS,OT_INTEGER,D3DRS_MULTISAMPLEANTIALIAS)
_CONSTANT(D3DRS_MULTISAMPLEMASK,OT_INTEGER,D3DRS_MULTISAMPLEMASK)
_CONSTANT(D3DRS_PATCHEDGESTYLE,OT_INTEGER,D3DRS_PATCHEDGESTYLE)
_CONSTANT(D3DRS_DEBUGMONITORTOKEN,OT_INTEGER,D3DRS_DEBUGMONITORTOKEN)
_CONSTANT(D3DRS_POINTSIZE_MAX,OT_INTEGER,D3DRS_POINTSIZE_MAX)
_CONSTANT(D3DRS_INDEXEDVERTEXBLENDENABLE,OT_INTEGER,D3DRS_INDEXEDVERTEXBLENDENABLE)
_CONSTANT(D3DRS_COLORWRITEENABLE,OT_INTEGER,D3DRS_COLORWRITEENABLE)
_CONSTANT(D3DRS_TWEENFACTOR,OT_INTEGER,D3DRS_TWEENFACTOR)
_CONSTANT(D3DRS_BLENDOP,OT_INTEGER,D3DRS_BLENDOP)
_CONSTANT(D3DRS_POSITIONDEGREE,OT_INTEGER,D3DRS_POSITIONDEGREE)
_CONSTANT(D3DRS_NORMALDEGREE,OT_INTEGER,D3DRS_NORMALDEGREE)
_CONSTANT(D3DRS_SCISSORTESTENABLE,OT_INTEGER,D3DRS_SCISSORTESTENABLE)
_CONSTANT(D3DRS_SLOPESCALEDEPTHBIAS,OT_INTEGER,D3DRS_SLOPESCALEDEPTHBIAS)
_CONSTANT(D3DRS_ANTIALIASEDLINEENABLE,OT_INTEGER,D3DRS_ANTIALIASEDLINEENABLE)
_CONSTANT(D3DRS_MINTESSELLATIONLEVEL,OT_INTEGER,D3DRS_MINTESSELLATIONLEVEL)
_CONSTANT(D3DRS_MAXTESSELLATIONLEVEL,OT_INTEGER,D3DRS_MAXTESSELLATIONLEVEL)
_CONSTANT(D3DRS_ADAPTIVETESS_X,OT_INTEGER,D3DRS_ADAPTIVETESS_X)
_CONSTANT(D3DRS_ADAPTIVETESS_Y,OT_INTEGER,D3DRS_ADAPTIVETESS_Y)
_CONSTANT(D3DRS_ADAPTIVETESS_Z,OT_INTEGER,D3DRS_ADAPTIVETESS_Z)
_CONSTANT(D3DRS_ADAPTIVETESS_W,OT_INTEGER,D3DRS_ADAPTIVETESS_W)
_CONSTANT(D3DRS_ENABLEADAPTIVETESSELLATION,OT_INTEGER,D3DRS_ENABLEADAPTIVETESSELLATION)
_CONSTANT(D3DRS_TWOSIDEDSTENCILMODE,OT_INTEGER,D3DRS_TWOSIDEDSTENCILMODE)
_CONSTANT(D3DRS_CCW_STENCILFAIL,OT_INTEGER,D3DRS_CCW_STENCILFAIL)
_CONSTANT(D3DRS_CCW_STENCILZFAIL,OT_INTEGER,D3DRS_CCW_STENCILZFAIL)
_CONSTANT(D3DRS_CCW_STENCILPASS,OT_INTEGER,D3DRS_CCW_STENCILPASS)
_CONSTANT(D3DRS_CCW_STENCILFUNC,OT_INTEGER,D3DRS_CCW_STENCILFUNC)
_CONSTANT(D3DRS_COLORWRITEENABLE1,OT_INTEGER,D3DRS_COLORWRITEENABLE1)
_CONSTANT(D3DRS_COLORWRITEENABLE2,OT_INTEGER,D3DRS_COLORWRITEENABLE2)
_CONSTANT(D3DRS_COLORWRITEENABLE3,OT_INTEGER,D3DRS_COLORWRITEENABLE3)
_CONSTANT(D3DRS_BLENDFACTOR,OT_INTEGER,D3DRS_BLENDFACTOR)
_CONSTANT(D3DRS_SRGBWRITEENABLE,OT_INTEGER,D3DRS_SRGBWRITEENABLE)
_CONSTANT(D3DRS_DEPTHBIAS,OT_INTEGER,D3DRS_DEPTHBIAS)
_CONSTANT(D3DRS_WRAP8,OT_INTEGER,D3DRS_WRAP8)
_CONSTANT(D3DRS_WRAP9,OT_INTEGER,D3DRS_WRAP9)
_CONSTANT(D3DRS_WRAP10,OT_INTEGER,D3DRS_WRAP10)
_CONSTANT(D3DRS_WRAP11,OT_INTEGER,D3DRS_WRAP11)
_CONSTANT(D3DRS_WRAP12,OT_INTEGER,D3DRS_WRAP12)
_CONSTANT(D3DRS_WRAP13,OT_INTEGER,D3DRS_WRAP13)
_CONSTANT(D3DRS_WRAP14,OT_INTEGER,D3DRS_WRAP14)
_CONSTANT(D3DRS_WRAP15,OT_INTEGER,D3DRS_WRAP15)
_CONSTANT(D3DRS_SEPARATEALPHABLENDENABLE,OT_INTEGER,D3DRS_SEPARATEALPHABLENDENABLE)
_CONSTANT(D3DRS_SRCBLENDALPHA,OT_INTEGER,D3DRS_SRCBLENDALPHA)
_CONSTANT(D3DRS_DESTBLENDALPHA,OT_INTEGER,D3DRS_DESTBLENDALPHA)
_CONSTANT(D3DRS_BLENDOPALPHA,OT_INTEGER,D3DRS_BLENDOPALPHA)
_CONSTANT(D3DRS_FORCE_DWORD,OT_INTEGER,D3DRS_FORCE_DWORD)
_END_NAMESPACE(DX,NULL)

View File

@@ -0,0 +1,151 @@
#include "stdafx.h"
#include "sqplusWin32.h"
#include "DXSquirrel_Binds.h"
extern WNDCLASSEX gWC;
extern IDirect3D9 * gpD3D;
_MEMBER_FUNCTION_IMPL(Device,constructor)
{
StackHandler sa(v);
//PARSES the params
SquirrelObject params = sa.GetObjectHandle(2);
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory( &d3dpp, sizeof(d3dpp) );
//defaults
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
d3dpp.EnableAutoDepthStencil = TRUE;
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
d3dpp.BackBufferWidth = 640;
d3dpp.BackBufferHeight = 480;
//windowed
if(params.Exists(_T("Windowed"))) {
d3dpp.Windowed = params.GetBool(_T("Windowed"))? TRUE : FALSE;
}
if(params.Exists(_T("SwapEffect"))) {
d3dpp.SwapEffect = (D3DSWAPEFFECT)params.GetInt(_T("SwapEffect"));
}
if(params.Exists(_T("BackBufferFormat"))) {
d3dpp.BackBufferFormat = (D3DFORMAT)params.GetInt(_T("BackBufferFormat"));
}
if(params.Exists(_T("EnableAutoDepthStencil"))) {
d3dpp.EnableAutoDepthStencil = params.GetBool(_T("EnableAutoDepthStencil"))? TRUE : FALSE;
}
if(params.Exists(_T("AutoDepthStencilFormat"))) {
d3dpp.AutoDepthStencilFormat = (D3DFORMAT)params.GetInt(_T("AutoDepthStencilFormat"));
}
if(params.Exists(_T("BackBufferWidth"))) {
d3dpp.BackBufferWidth = params.GetInt(_T("BackBufferWidth"));
}
if(params.Exists(_T("BackBufferHeight"))) {
d3dpp.BackBufferHeight = params.GetInt(_T("BackBufferHeight"));
}
//create the window
HWND hWnd = CreateWindow( _T("DXSquirrel"), _T("DXSquirrel"),
0, CW_USEDEFAULT, CW_USEDEFAULT, d3dpp.BackBufferWidth, d3dpp.BackBufferHeight,
NULL, NULL, gWC.hInstance, NULL );
if(!hWnd) return sa.ThrowError(_T("Error creating the window"));
EnableWindow(hWnd,TRUE);
ShowWindow(hWnd,SW_SHOW);
//d3dpp.hDeviceWindow = hWnd;
//PARSES the params
IDirect3DDevice9 *pDev;
HRESULT hr;
if(FAILED(hr = gpD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp, &pDev))) {
return sa.ThrowError(_T("Error initializing the device"));
}
return construct_RefCounted(pDev);
}
_MEMBER_FUNCTION_IMPL(Device,BeginScene)
{
StackHandler sa(v);
_CHECK_SELF(IDirect3DDevice9,Device);
if(FAILED(self->BeginScene())) {
return sa.ThrowError(_T("BeginScene failed"));
}
return 0;
}
_MEMBER_FUNCTION_IMPL(Device,EndScene)
{
StackHandler sa(v);
_CHECK_SELF(IDirect3DDevice9,Device);
if(FAILED(self->EndScene())) {
return sa.ThrowError(_T("EndScene failed"));
}
return 0;
}
//params (this,flags,[color],[z],[stencil])
_MEMBER_FUNCTION_IMPL(Device,Clear)
{
StackHandler sa(v);
_CHECK_SELF(IDirect3DDevice9,Device);
FLOAT z = 1.0f;
DWORD color = 0xFF000000;
DWORD stencil = 0;
INT params = sa.GetParamCount();
if(params > 2) {
color = (DWORD)sa.GetInt(3);
}
if(params > 3) {
z = sa.GetFloat(4);
}
if(params > 4) {
stencil = (DWORD)sa.GetInt(4);
}
HRESULT hr;
if(FAILED(hr = self->Clear(0,NULL,(DWORD)sa.GetInt(2),color,z,stencil)))
{
return sa.ThrowError(_T("Clear failed"));
}
return 0;
}
_MEMBER_FUNCTION_IMPL(Device,Present)
{
StackHandler sa(v);
_CHECK_SELF(IDirect3DDevice9,Device);
self->Present(NULL,NULL,NULL,NULL);
return 0;
}
_MEMBER_FUNCTION_IMPL(Device,SetTransform)
{
StackHandler sa(v);
_CHECK_SELF(IDirect3DDevice9,Device);
_CHECK_INST_PARAM(mat,3,D3DXMATRIX,Matrix);
self->SetTransform((D3DTRANSFORMSTATETYPE)sa.GetInt(2),mat);
return 0;
}
_MEMBER_FUNCTION_IMPL(Device,SetRenderState)
{
StackHandler sa(v);
_CHECK_SELF(IDirect3DDevice9,Device);
self->SetRenderState((D3DRENDERSTATETYPE)sa.GetInt(2),(DWORD)sa.GetInt(3));
return 0;
}
_BEGIN_CLASS(Device)
_MEMBER_FUNCTION(Device,constructor,2,_T("xt"))
_MEMBER_FUNCTION(Device,BeginScene,0,NULL)
_MEMBER_FUNCTION(Device,EndScene,0,NULL)
_MEMBER_FUNCTION(Device,Present,0,NULL)
_MEMBER_FUNCTION(Device,Clear,-2,_T("xnnnn"))
_MEMBER_FUNCTION(Device,SetTransform,3,_T("xnx"))
_MEMBER_FUNCTION(Device,SetRenderState,3,_T("xnn|b"))
_END_CLASS(Device)

View File

@@ -0,0 +1,532 @@
#include "stdafx.h"
#include "sqplus.h"
#include "DXSquirrel_Binds.h"
_IMPL_NATIVE_CONSTRUCTION(Vector3,D3DXVECTOR3);
_MEMBER_FUNCTION_IMPL(Vector3,constructor)
{
D3DXVECTOR3 temp;
D3DXVECTOR3 *newv = NULL;
StackHandler sa(v);
int nparams = sa.GetParamCount();
switch(nparams) {
case 1:
temp.x = 0;
temp.y = 0;
temp.z = 0;
break;
case 2:
if(sa.GetType(2) == OT_INSTANCE) {
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
if(vec) temp = *vec;
else return sa.ThrowError(_T("Vector3() invalid instance type"));
}
break;
case 4:
temp.x = sa.GetFloat(2);
temp.y = sa.GetFloat(3);
temp.z = sa.GetFloat(4);
break;
default:
return sa.ThrowError(_T("Vector3() wrong parameters"));
}
newv = new D3DXVECTOR3(temp);
return construct_Vector3(newv);
}
_MEMBER_FUNCTION_IMPL(Vector3,_set)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
const SQChar *s = sa.GetString(2);
int index = s?s[0]:sa.GetInt(2);
switch(index) {
case 0: case 'x': case 'r':
return sa.Return(self->x = sa.GetFloat(3));
break;
case 1: case 'y': case 'g':
return sa.Return(self->y = sa.GetFloat(3));
break;
case 2: case 'z': case 'b':
return sa.Return(self->z = sa.GetFloat(3));
break;
}
return SQ_ERROR;
}
_MEMBER_FUNCTION_IMPL(Vector3,_get)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
const SQChar *s = sa.GetString(2);
if(s && (s[1] != 0))
return SQ_ERROR;
int index = s && (s[1] == 0)?s[0]:sa.GetInt(2);
switch(index) {
case 0: case 'x': case 'r': return sa.Return(self->x); break;
case 1: case 'y': case 'g': return sa.Return(self->y); break;
case 2: case 'z': case 'b': return sa.Return(self->z); break;
}
return SQ_ERROR;
}
_MEMBER_FUNCTION_IMPL(Vector3,_nexti)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
int index = -1;
if(sa.GetType(2) == OT_NULL) {
index = -1;
}else {
const SQChar *s = sa.GetString(2);
if(s && (s[1] != 0))
return SQ_ERROR;
index = s && (s[1] == 0)?s[0]:sa.GetInt(2);
}
switch(index) {
case 0xFFFFFFFF: return sa.Return(_T("x"));
case 0: case 'x': case 'r': return sa.Return(_T("y"));
case 1: case 'y': case 'g': return sa.Return(_T("z"));
case 2: case 'z': case 'b': return sa.Return();
}
return sa.Return(_T("invalid index"));
}
_MEMBER_FUNCTION_IMPL(Vector3,_cmp)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
if((*self) == (*vec))
return sa.Return(0);
if((*self) < (*vec))
return sa.Return(-1);
return sa.Return(1);
}
_MEMBER_FUNCTION_IMPL(Vector3,_add)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
D3DXVECTOR3 tv = (*self)+(*vec);
SquirrelObject so = new_Vector3(tv);
return sa.Return(so);
}
_MEMBER_FUNCTION_IMPL(Vector3,_sub)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
D3DXVECTOR3 tv = (*self)-(*vec);
SquirrelObject so = new_Vector3(tv);
return sa.Return(so);
}
_MEMBER_FUNCTION_IMPL(Vector3,_mul)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
D3DXVECTOR3 tv = (*self)*sa.GetFloat(2);
SquirrelObject so = new_Vector3(tv);
return sa.Return(so);
}
_MEMBER_FUNCTION_IMPL(Vector3,_div)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
D3DXVECTOR3 tv = (*self)/sa.GetFloat(2);
SquirrelObject so = new_Vector3(tv);
return sa.Return(so);
}
_MEMBER_FUNCTION_IMPL(Vector3,DotProduct)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
return sa.Return(D3DXVec3Dot(self,vec));
}
_MEMBER_FUNCTION_IMPL(Vector3,CrossProduct)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
D3DXVECTOR3 ret;
D3DXVec3Cross(&ret,self,vec);
SquirrelObject so = new_Vector3(ret);
return sa.Return(so);
}
_MEMBER_FUNCTION_IMPL(Vector3,SquareDistance)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
D3DXVECTOR3 tmp = *self - *vec;
return sa.Return(D3DXVec3LengthSq(&tmp));
}
_MEMBER_FUNCTION_IMPL(Vector3,Distance)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
D3DXVECTOR3 tmp = *self - *vec;
return sa.Return(D3DXVec3Length(&tmp));
}
_MEMBER_FUNCTION_IMPL(Vector3,Length)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
return sa.Return(D3DXVec3Length(self));
}
_MEMBER_FUNCTION_IMPL(Vector3,SquareLength)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
return sa.Return(D3DXVec3LengthSq(self));
}
_MEMBER_FUNCTION_IMPL(Vector3,Normalize)
{
_CHECK_SELF(D3DXVECTOR3,Vector3);
D3DXVec3Normalize(self,self);
return 0;
}
_MEMBER_FUNCTION_IMPL(Vector3,GetNormalized)
{
StackHandler sa(v);
_CHECK_SELF(D3DXVECTOR3,Vector3);
D3DXVECTOR3 tmp;
D3DXVec3Normalize(&tmp,self);
SquirrelObject so = new_Vector3(tmp);
return sa.Return(so);
}
_BEGIN_CLASS(Vector3)
_MEMBER_FUNCTION(Vector3,constructor,-1,_T(".n|xnn"))
_MEMBER_FUNCTION(Vector3,_set,3,_T("xs|n"))
_MEMBER_FUNCTION(Vector3,_get,2,_T("xs|n"))
_MEMBER_FUNCTION(Vector3,_add,2,_T("xx"))
_MEMBER_FUNCTION(Vector3,_sub,2,_T("xx"))
_MEMBER_FUNCTION(Vector3,_mul,2,_T("xn"))
_MEMBER_FUNCTION(Vector3,_div,2,_T("xn"))
_MEMBER_FUNCTION(Vector3,_nexti,2,_T("x"))
_MEMBER_FUNCTION(Vector3,_cmp,2,_T("xx"))
_MEMBER_FUNCTION(Vector3,DotProduct,2,_T("xx"))
_MEMBER_FUNCTION(Vector3,CrossProduct,2,_T("xx"))
_MEMBER_FUNCTION(Vector3,SquareDistance,2,_T("xx"))
_MEMBER_FUNCTION(Vector3,Distance,2,_T("xx"))
_MEMBER_FUNCTION(Vector3,Length,1,_T("x"))
_MEMBER_FUNCTION(Vector3,SquareLength,1,_T("x"))
_MEMBER_FUNCTION(Vector3,Normalize,1,_T("x"))
_MEMBER_FUNCTION(Vector3,GetNormalized,1,_T("x"))
_END_CLASS(Vector3)
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
_IMPL_NATIVE_CONSTRUCTION(Matrix,D3DXMATRIX);
_MEMBER_FUNCTION_IMPL(Matrix,constructor)
{
D3DXMATRIX temp;
D3DXMATRIX *newm = NULL;
StackHandler sa(v);
switch(sa.GetParamCount()) {
case 1:
D3DXMatrixIdentity(&temp);
break;
case 2:
if(sa.GetType(2) == OT_INSTANCE) {
_CHECK_INST_PARAM(mat,2,D3DXMATRIX,Matrix);
if(mat) temp = *mat;
else return sa.ThrowError(_T("Matrix() invalid instance type"));
}
else {
SquirrelObject arr = sa.GetObjectHandle(2);
if(arr.Len() != 16) {
return sa.ThrowError(_T("Matrix(array) need a 16 elements array"));
}
FLOAT *fp = (FLOAT*)&temp.m;
SquirrelObject idx,val;
if(arr.BeginIteration()) {
while(arr.Next(idx,val)) {
fp[idx.ToInteger()] = val.ToFloat();
}
arr.EndIteration();
}
}
break;
default:
return sa.ThrowError(_T("Matrix() wrong number of parameters"));
break;
}
newm = new D3DXMATRIX(temp);
return construct_Matrix(newm);
}
_MEMBER_FUNCTION_IMPL(Matrix,_set)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
int index = sa.GetInt(2);
if(index < 0 && index > 4*4)
return SQ_ERROR;
((FLOAT *)self->m)[index] = sa.GetFloat(2);
return SQ_OK;
}
_MEMBER_FUNCTION_IMPL(Matrix,_get)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
int index = sa.GetInt(2);
if(index < 0 && index > 4*4)
return SQ_ERROR;
return sa.Return(((FLOAT *)self->m)[index]);
}
_MEMBER_FUNCTION_IMPL(Matrix,_add)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
_CHECK_INST_PARAM(mat,2,D3DXMATRIX,Matrix);
D3DXMATRIX tm = (*self)+(*mat);
SquirrelObject so = new_Matrix(tm);
return sa.Return(so);
}
_MEMBER_FUNCTION_IMPL(Matrix,_sub)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
_CHECK_INST_PARAM(mat,2,D3DXMATRIX,Matrix);
D3DXMATRIX tm = (*self)-(*mat);
SquirrelObject so = new_Matrix(tm);
return sa.Return(so);
}
_MEMBER_FUNCTION_IMPL(Matrix,_mul)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
int t = sa.GetType(2);
if(t == OT_INSTANCE) {
_CHECK_INST_PARAM(mat,2,D3DXMATRIX,Matrix);
D3DXMATRIX tm = (*self)*(*mat);
SquirrelObject so = new_Matrix(tm);
return sa.Return(so);
}
D3DXMATRIX tm = (*self)*sa.GetFloat(2);
SquirrelObject so = new_Matrix(tm);
return sa.Return(so);
}
_MEMBER_FUNCTION_IMPL(Matrix,_div)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
D3DXMATRIX tm = (*self)/sa.GetFloat(2);
SquirrelObject so = new_Matrix(tm);
return sa.Return(so);
}
_MEMBER_FUNCTION_IMPL(Matrix,CreateIdentity)
{
_CHECK_SELF(D3DXMATRIX,Matrix);
D3DXMatrixIdentity(self);
return 0;
}
_MEMBER_FUNCTION_IMPL(Matrix,CreateRotationAxis)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
D3DXMatrixRotationAxis(self,vec,sa.GetFloat(3));
return 0;
}
_MEMBER_FUNCTION_IMPL(Matrix,CreateRotationAngles)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
D3DXMatrixRotationAxis(self,vec,sa.GetFloat(3));
return 0;
}
_MEMBER_FUNCTION_IMPL(Matrix,CreateScalingMatrix)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
D3DXMatrixScaling(self,sa.GetFloat(2),sa.GetFloat(3),sa.GetFloat(4));
return 0;
}
_MEMBER_FUNCTION_IMPL(Matrix,CreateTranslationMatrix)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
D3DXMatrixTranslation(self,sa.GetFloat(2),sa.GetFloat(3),sa.GetFloat(4));
return 0;
}
_MEMBER_FUNCTION_IMPL(Matrix,CreateLookAtMatrix)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
_CHECK_INST_PARAM(eye,2,D3DXVECTOR3,Vector3);
_CHECK_INST_PARAM(at,3,D3DXVECTOR3,Vector3);
_CHECK_INST_PARAM(up,4,D3DXVECTOR3,Vector3);
D3DXMatrixLookAtLH(self,eye,at,up);
return 0;
}
_MEMBER_FUNCTION_IMPL(Matrix,CreatePerspectiveFovMatrix)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
D3DXMatrixPerspectiveFovLH(self,sa.GetFloat(2),sa.GetFloat(3),sa.GetFloat(4),sa.GetFloat(5));
return 0;
}
_MEMBER_FUNCTION_IMPL(Matrix,RotateAngles)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
D3DXMatrixRotationYawPitchRoll(self,vec->y,vec->x,vec->z);
return 0;
}
_MEMBER_FUNCTION_IMPL(Matrix,RotateAxis)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
D3DXMatrixRotationAxis(self,vec,sa.GetFloat(3));
return 0;
}
_MEMBER_FUNCTION_IMPL(Matrix,Translate)
{
_CHECK_SELF(D3DXMATRIX,Matrix);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
D3DXMATRIX temp;
D3DXMatrixTranslation(&temp,vec->x,vec->y,vec->z);
D3DXMatrixMultiply(self,&temp,self);
return 0;
}
_MEMBER_FUNCTION_IMPL(Matrix,Scale)
{
_CHECK_SELF(D3DXMATRIX,Matrix);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
D3DXMATRIX temp;
D3DXMatrixScaling(&temp,vec->x,vec->y,vec->z);
D3DXMatrixMultiply(self,&temp,self);
return 0;
}
_MEMBER_FUNCTION_IMPL(Matrix,GetInverse)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
D3DXMATRIX temp;
D3DXMatrixInverse(&temp,NULL,self);
SquirrelObject so = new_Matrix(temp);
return sa.Return(so);
}
_MEMBER_FUNCTION_IMPL(Matrix,GetTransposed)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
D3DXMATRIX temp;
D3DXMatrixTranspose(&temp,self);
SquirrelObject so = new_Matrix(temp);
return sa.Return(so);
}
_MEMBER_FUNCTION_IMPL(Matrix,GetInverseTransposed)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
D3DXMATRIX temp;
D3DXMatrixInverse(&temp,NULL,self);
D3DXMatrixTranspose(&temp,&temp);
SquirrelObject so = new_Matrix(temp);
return sa.Return(so);
}
_MEMBER_FUNCTION_IMPL(Matrix,Invert)
{
_CHECK_SELF(D3DXMATRIX,Matrix);
D3DXMatrixInverse(self,NULL,self);
return 0;
}
_MEMBER_FUNCTION_IMPL(Matrix,TransformCoord)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
D3DXVECTOR3 ret;
D3DXVec3TransformCoord(&ret,vec,self);
SquirrelObject so = new_Vector3(ret);
return sa.Return(so);
}
_MEMBER_FUNCTION_IMPL(Matrix,TransformNormal)
{
StackHandler sa(v);
_CHECK_SELF(D3DXMATRIX,Matrix);
_CHECK_INST_PARAM(vec,2,D3DXVECTOR3,Vector3);
D3DXVECTOR3 ret;
D3DXVec3TransformNormal(&ret,vec,self);
SquirrelObject so = new_Vector3(ret);
return sa.Return(so);
}
_BEGIN_CLASS(Matrix)
_MEMBER_FUNCTION(Matrix,constructor,-1,_T(".a|x"))
_MEMBER_FUNCTION(Matrix,_set,2,_T("xn"))
_MEMBER_FUNCTION(Matrix,_get,2,_T("xn"))
_MEMBER_FUNCTION(Matrix,_add,2,_T("xx"))
_MEMBER_FUNCTION(Matrix,_sub,2,_T("xx"))
_MEMBER_FUNCTION(Matrix,_mul,2,_T("xx|n"))
_MEMBER_FUNCTION(Matrix,_div,2,_T("xn"))
_MEMBER_FUNCTION(Matrix,CreateIdentity,1,_T("x"))
_MEMBER_FUNCTION(Matrix,CreateRotationAxis,3,_T("xxn"))
_MEMBER_FUNCTION(Matrix,CreateRotationAngles,2,_T("xx"))
_MEMBER_FUNCTION(Matrix,CreateScalingMatrix,4,_T("xnnn"))
_MEMBER_FUNCTION(Matrix,CreateTranslationMatrix,4,_T("xnnn"))
_MEMBER_FUNCTION(Matrix,CreateLookAtMatrix,4,_T("xxxx"))
_MEMBER_FUNCTION(Matrix,CreatePerspectiveFovMatrix,5,_T("xnnnn"))
_MEMBER_FUNCTION(Matrix,RotateAngles,2,_T("xx"))
_MEMBER_FUNCTION(Matrix,RotateAxis,3,_T("xxn"))
_MEMBER_FUNCTION(Matrix,Translate,2,_T("xx"))
_MEMBER_FUNCTION(Matrix,Scale,2,_T("xx"))
_MEMBER_FUNCTION(Matrix,GetInverse,1,_T("x"))
_MEMBER_FUNCTION(Matrix,GetTransposed,1,_T("x"))
_MEMBER_FUNCTION(Matrix,GetInverseTransposed,1,_T("x"))
_MEMBER_FUNCTION(Matrix,Invert,1,_T("x"))
_MEMBER_FUNCTION(Matrix,TransformCoord,2,_T("xx"))
_MEMBER_FUNCTION(Matrix,TransformNormal,2,_T("xx"))
_END_CLASS(Matrix)

View File

@@ -0,0 +1,37 @@
#include "stdafx.h"
#include "sqplusWin32.h"
#include "DXSquirrel_Binds.h"
_MEMBER_FUNCTION_IMPL(BaseMesh,constructor)
{
StackHandler sa(v);
return sa.ThrowError(_T("BaseMesh cannot be constructed directly"));
}
_MEMBER_FUNCTION_IMPL(BaseMesh,DrawSubset)
{
StackHandler sa(v);
_CHECK_SELF(ID3DXBaseMesh,BaseMesh)
self->DrawSubset(sa.GetInt(2));
return 0;
}
_BEGIN_CLASS(BaseMesh)
_MEMBER_FUNCTION(BaseMesh,constructor,NULL,NULL)
_MEMBER_FUNCTION(BaseMesh,DrawSubset,2,_T("xn"))
_END_CLASS(BaseMesh)
_MEMBER_FUNCTION_IMPL(Mesh,constructor)
{
_CHECK_INST_PARAM(dev,2,IDirect3DDevice9,Device);
ID3DXMesh *pMesh;
if( FAILED(D3DXCreateTeapot(dev,&pMesh,NULL))) {
MessageBox(NULL, _T("Could not create the mesh"), _T("Meshes.exe"), MB_OK);
return E_FAIL;
}
return construct_RefCounted(pMesh);
}
_BEGIN_CLASS(Mesh)
_MEMBER_FUNCTION(Mesh,constructor,2,_T("xx"))
_END_CLASS_INHERITANCE(Mesh,BaseMesh)

View File

@@ -0,0 +1,53 @@
========================================================================
WIN32 APPLICATION : DXSquirrel Project Overview
========================================================================
AppWizard has created this DXSquirrel application for you.
This file contains a summary of what you will find in each of the files that
make up your DXSquirrel application.
DXSquirrel.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
DXSquirrel.cpp
This is the main application source file.
/////////////////////////////////////////////////////////////////////////////
AppWizard has created the following resources:
DXSquirrel.rc
This is a listing of all of the Microsoft Windows resources that the
program uses. It includes the icons, bitmaps, and cursors that are stored
in the RES subdirectory. This file can be directly edited in Microsoft
Visual C++.
Resource.h
This is the standard header file, which defines new resource IDs.
Microsoft Visual C++ reads and updates this file.
DXSquirrel.ico
This is an icon file, which is used as the application's icon (32x32).
This icon is included by the main resource file DXSquirrel.rc.
small.ico
This is an icon file, which contains a smaller version (16x16)
of the application's icon. This icon is included by the main resource
file DXSquirrel.rc.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named DXSquirrel.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,29 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by DXSquirrel.rc
//
#define IDS_APP_TITLE 103
#define IDR_MAINFRAME 128
#define IDD_DXSQUIRREL_DIALOG 102
#define IDD_ABOUTBOX 103
#define IDM_ABOUT 104
#define IDM_EXIT 105
#define IDI_DXSQUIRREL 107
#define IDI_SMALL 108
#define IDC_DXSQUIRREL 109
#define IDC_MYICON 2
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 130
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif

View File

@@ -0,0 +1,44 @@
local presentparams = {
Windowed = true,
SwapEffect = DX.D3DSWAPEFFECT_DISCARD,
BackBufferFormat = DX.D3DFMT_A8R8G8B8,
EnableAutoDepthStencil = true,
AutoDepthStencilFormat = DX.D3DFMT_D16,
BackBufferWidth = 800,
BackBufferHeight = 600
}
local dev = Device(presentparams);
//INIT the mesh
local mesh = Mesh(dev);
local perspective = Matrix();
local view = Matrix();
local world = Matrix();
local eye = Vector3( 0.0, 3.0,-5.0 );
local lookat = Vector3( 0.0, 0.0, 0.0 );
local upVec = Vector3( 0.0, 1.0, 0.0 );
view.CreateLookAtMatrix(eye,lookat,upVec);
perspective.CreatePerspectiveFovMatrix(DX.D3DX_PI/4, 640.0/480, 1.0, 100.0)
dev.SetTransform(DX.D3DTS_VIEW,view);
dev.SetTransform(DX.D3DTS_PROJECTION,perspective);
dev.SetRenderState(DX.D3DRS_ZENABLE,true);
dev.SetRenderState(DX.D3DRS_AMBIENT,0xFFFFFFFF);
//MAIN LOOP
local rot = Vector3(0,0,0);
while(DX.Update()) {
dev.Clear(DX.D3DCLEAR_TARGET|DX.D3DCLEAR_ZBUFFER,0xFF0000FF);
dev.BeginScene();
rot.y += 0.1;
world.RotateAngles(rot);
dev.SetTransform(DX.D3DTS_WORLD,world);
mesh.DrawSubset(0);
//
dev.EndScene();
dev.Present();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// DXSquirrel.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file

View File

@@ -0,0 +1,20 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
#include <d3dx9.h>
// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include "squirrel.h"

View File

@@ -0,0 +1,341 @@
***version 2.2.3 stable***
-added sq_getfunctioninfo
-added compile time flag SQUSEDOUBLE to use double precision floats
-added global slot _floatsize_ int the base lib to recognize single precision and double precision builds
-sq_wakeupvm can now resume the vm with an exception
-added sqstd_format
-generators can now be instantiated by calling sq_call() or closure.call()
-fixed a bug in sqstd_printcallstack(thx takayuki_h)
-fixed modulo by zero(thx jup)
-fixed negative enums and constants
-fixed generator crash bug if invoked as tail call (thx Mr.Accident)
-fixed some minor bug
***2008-09-24 ***
***version 2.2.2 stable***
-fixed some behaviour inconsistencies in thread.call() and thread.wakeup() (thx Mr.Accident)
-fixed coroutine error propagation
-fixed lingering return value from native function (thx Tom Leonard)
-fixed a bug if array.sort() is given a bad sort function (thx Tom Leonard)
-fixed some minor api bug
-added sq_arrayremove() and sq_arrayinsert()
***2008-05-16 ***
***version 2.2.1 stable***
-fixed a tailcall bug
***2008-02-17 ***
***version 2.2 stable ***
-added _newslot metamethod in classes
-added enums added constants
-added sq_pushconsttable, sq_setconsttable
-added default param
-added octal literals(thx Dinosaur)
-fixed debug hook, 'calls' and 'returns' are properly notified in the same number.
-fixed a coroutine bug
***2007-07-29 ***
***version 2.1.2 stable***
-new behaviour for generators iteration using foreach
now when a generator is iterated by foreach the value returned by a 'return val' statement
will terminate the iteration but will not be returned as foreach iteration
-added sq_setclassudsize()
-added sq_clear()
-added table.clear(), array.clear()
-fixed sq_cmp() (thx jyuill)
-fixed minor bugs
***2006-08-21 ***
***version 2.1.1 stable***
-vm refactoring
-optimized internal function memory layout
-new global symbol _version_ (is the version string)
-code size optimization for float literals(on 32bits float builts)
-now the raw ref API(sq_addref etc...) is fully reentrant.
-fixed a bug in sq_getdelegate() now pushes null if the object doesn't have a delegate(thx MatzeB)
-improved C reference performances in NO_GARBAGE_COLLECTOR builds
-sq_getlocal() now enumerates also outer values.
-fixed regexp library for GCC users.
***2006-03-19 ***
***version 2.1 stable***
-added static class fields, new keyword static
-added 64bits architecture support
-added global slot _intsize_ int the base lib to recognize 32bits and 64bits builds
-added functions with fixed environment, closure.bindenv() built-in function
-all types except userdata and null implement the tostring() method
-string concatenation now invokes metamethod _tostring
-new metamethods for class objects _newmember and _inherited
-sq_call() sq_resume() sq_wakeupvm() have a new signature
-new C referencing implementation(scales more with the amount of references)
-refactored hash table
-new api functions sq_newslot(),sq_tobool(),sq_getbase(), sq_instanceof(), sq_bindenv()
-the api func sq_createslot was deprecated but still supported in form of C macro on top of sq_newslot
-sq_setreleasehook() now also works for classes
-stream.readstr() and stream.writestr() have been deprecated(this affects file and blob)
-fixed squirrel.h undeclared api calls
-fixed few minor bugs
-SQChar is now defined as wchar_t
-removed warning when building with -Wall -pedantic for GCC users
-added new std io function writeclosuretofile()
-added new std string functions strip(),rstrip(),lstrip() and split()
-regular expressions operators (+,*) now have more POSIX greedyness behaviour
-class constructors are now invoked as normal functions
***2005-10-02 ***
***version 2.0.5 stable***
-fixed some 64bits incompatibilities (thx sarge)
-fixed minor bug in the stdlib format() function (thx Rick)
-fixed a bug in dofile() that was preventing to compile empty files
-added new API sq_poptop() & sq_getfreevariable()
-some performance improvements
***2005-08-14 ***
***version 2.0.4 stable***
-weak references and related API calls
-added sq_objtobool()
-class instances memory policies improved(1 mem allocation for the whole instance)
-typetags are now declared as SQUserPointer instead of unsigned int
-first pass for 64bits compatibility
-fixed minor bug in the stdio stream
-fixed a bug in format()
-fixed bug in string.tointeger() and string.tofloat()
***2005-06-24 ***
***version 2.0.3 stable***
-dofile() and loadfile() in the iolib now can decode ASCII, UTF8 files UCS2 big-endian and little-endian
-sq_setparamscheck() : now typemesk can check for null
-added string escape sequence \xhhhh
-fixed some C++ standard incompatibilities
***2005-05-15 ***
***version 2.0.2 stable***
-performances improvements (expecially for GCC users)
-removed all dependencies from C++ exception handling
-various bugfixes
***2005-04-12 ***
***version 2.0.1 stable***
-various bugfixes
-sq_setparamscheck() now allows spaces in the typemask
***2005-04-03 ***
***version 2.0 stable***
-added API sq_gettypetag()
-added built-in function to the bool type(tointeger, tostring etc...)
***2005-02-27 ***
***version 2.0 release candidate 1(RC 1)***
-added API sq_reseterror()
-modified sq_release()
-now class instances can be cloned
-various bufixes
***2005-01-26 ***
***version 2.0 beta 1***
-added bool type
-class properties can be redefined in a derived class
-added ops *= /= and %=
-new syntax for class attributes declaration </ and /> instead of ( and )
-increased the max number of literals per function from 65535 to 16777215
-now free variables have proper lexical scoping
-added API sq_createinstance(), sq_pushbool(), sq_getbool()
-added built-in function type()
-added built-in function obj.rawin(key) in table,class and instance
-sq_rawget() and sq_rawset() now work also on classes and instances
-the VM no longer uses C++ exception handling (more suitable for embedded devices)
-various bufixes
***2004-12-21 ***
***version 2.0 alpha 2***
-globals scoping changed, now if :: is omitted the VM automatically falls back on the root table
-various bufixes
-added class level attributes
***2004-12-12 ***
***version 2.0 alpha 1***
-codebase branch from version 1.x
-added classes
-added functions with variable number of parameters(vargc & vargv and the ...)
-0 and 0.0 are now considered 'false' by all conditional statements(if,while,for,?,do-while)
-added new api functions sq_newclass() sq_setinstanceup() sq_getinstanceup() sq_getattributes() sq_setattributes()
-modified api sq_settypetag()
***2004-11-01 ***
***version 1.0 stable***
-fixed some minor bug
-improoved operator 'delete' performances
-added scientific notation for float numbers( eg. 2.e16 or 2.e-2)
***2004-08-30 ***
***version 1.0 release candidate 2(RC 2)***
-fixed bug in the vm(thx Pierre Renaux)
-fixed bug in the optimizer(thx Pierre Renaux)
-fixed some bug in the documentation(thx JD)
-added new api functions for raw object handling
-removed nested multiline comments
-reduced memory footprint in C references
***2004-08-23 ***
***version 1.0 release candidate 1(RC 1)***
-fixed division by zero
-the 'in' operator and obj.rawget() do not query the default delegate anymore
-added function sq_getprintfunc()
-added new standard library 'auxlib'(implements default error handlers)
***2004-07-12 ***
***version 1.0 beta 4***
-fixed a bug in the integer.tochar() built-in method
-fixed unary minus operator
-fixed bug in dofile()
-fixed inconsistency between != and == operators(on float/integer comparison)
-added javascript style unsigned right shift operator '>>>'
-added array(size) constructor built-in function
-array.resize(size,[fill]) built-in function accepts an optional 'fill' value
-improved debug API, added sq_getclosureinfo() and sq_setnativeclosurename()
***2004-05-23 ***
***version 1.0 beta 3***
-minor vm bug fixes
-string allocation is now faster
-tables and array memory usage is now less conservative(they shrink)
-added regular expression routines in the standard library
-The 'c' expression now accepts only 1 character(thx irbrian)
-multiline strings <[ ]> have been substituted with C# style verbatim strings (eg. @"string")
-added new keyword 'parent' for accessing the delegate of tables and unserdata
-The metamethod '_clone' has been renamed '_cloned'
-the _delslot metamethod's behaviour and prototype have been changed
-new default function in the integer and float object 'tochar()'
-the built-in function chcode2string has been removed
-the default method [table].getdelegate() has been removed
-new api sq_rawdeleteslot()
-new table built-in method rawdelete(key)
-the dynamic mudule loading has been removed from the standard distribution
-some optimizations in the VM
***2004-04-21 ***
***version 1.0 beta 2***
-minor compiler/parser bug fixes
-sq_newclosure has a different prototype, the "paramscheck" of paramter has been moved to the new function sq_setparamscheck()
-sq_setparamscheck allows to add automatic parameters type checking in native closures
-sq_compile() lost the lineinfo parameter
-new api sq_enabledebuginfo() globally sets compiler's debug info generation
-added consistency check on bytecode serialization
-fixed += operator, now works on strings like +
-added global slot in the base lib _charsize_ to recognize unicode builds from ascii builds runtime
-added registry table
-new api call sq_pushregistrytable()
-added type tag to the userdata type sq_settypetag()
-sq_getuserdata now queries the userdata typetag
-the built in function collect_garbage() as been renamed collectgarbage() for consistency reasons
-new standard libraries(sqlibs are now obsolete)
***2004-02-20 ***
***version 1.0 beta 1***
-fixed a bug in the compiler (thanks Martin Kofler)
-fixed bug in the switch case statement
-fixed the _unm metamethod
-fixed minor bugs in the API
-fixed automatic stack resizing
-first beta version
first pass code clean up in the VM and base lib
first pass code coverege test has been done on VM and built-in lib
-new VM creation API sq_open() sq_close() (sq_newvm and sq_releasevm are now obsolete)
-new api allows to specifiy a "print" function to output text(sq_printfunc)
-added some small optimizations
-new cooperative multi-threading capabilities in the base library(coroutines), VMs are now a built in type("thread")
-new built in functions have been added for manipulating the new "thread" type
-friend virtual machines share the same root table, error handler and debug hook by default
-new compile time options
***2004-01-19 ***
***version 0.9 alpha***
-fixed a garbage collection bug
-fixed some API bugs(thanks to Joshua Jensen)
-fixed tail calls (in the version 0.8 the tail call optimization was erroneously disabled)
-new function parameters semantic, now passing a wrong number of parameters generates an exception
-native closures have now a built in parameter number checking
-sq_rawget and sq_rawset now work also on arrays
-sq_getsize now woks also on userdata
-the userdata release hook prototype is changed(now passes the size of the userdata)
-the lexer reader function now returns an integer instead of a char that allows better error checking on the input(thx Joshua Jensen)
-faster compiler
-try/catch blocks do not cause any runtime memory allocation anymore
***2003-12-06 ***
***version 0.8 alpha***
-fixed a bug that was preventing to have callable userdata throught the metamethod _call
-fixed a garbage collection bug
-fixed == operator now can compare correctly different types
-new built in method getstackinfos(level)
-improoved line informations precision for the debug hook
-new api call sq_compilebuffer()
-new built-in api function compilestring()
-new syntactic sugar for function declarations inside tables
-the debug API has been finalized
***2003-11-17 ***
***version 0.7 alpha***
-fixed critical bug SQInteger the tail call system
-fixed bug in the continue statement code generation
-fixed func call param issue(thanks to Rewoonenco Andrew)
-added _delslot metamethod(thanks to Rewoonenco Andrew)
-new multiline string expression ( delimited by <[ and ]> )
-normal strings ("") do not allow embedded new line anymore
-reduced vm memory footprint(C refs are shared between friend VMs)
-new api method sq_deleteslot()
-new debug hook event 'r' is triggered when a function returns
***2003-11-04 ***
***version 0.6 alpha***
-fixed switch statement(was executing the default case after a break)
-sq_call() doesn't pop the closure (just the params)
-the vm execution can be suspended from the C API anytime (micro-threads)
-new api calls sq_suspendvm() sq_wakeupvm() sq_getvmstate() and sq_reservestack()
***2003-10-13 ***
***version 0.5 alpha***
-fixed some minor bug
-tested with non ASCII identifiers in unicode mode(I've tried chinese chars)
-added built-in function string.find()
-the built-in function array.sort() optionally accepts a cmp(a,b) function
-the debug hook function now has a new prototype debug_hook(event_type,sourcefile,line,functionname)
-fixed some debug info imprecision
***2003-10-01 ***
***version 0.4 alpha***
-faster VM
-sq_call will pop arguments and closure also in case of failure
-fixed a bug in sq_remove
-now the VM detects delegation cycles(and throws an exception)
-new operators ++ and --
-new operator ',' comma operator
-fixed some expression precedence issue
-fixed bug in sq_arraypop
***2003-09-15 ***
***version 0.3 alpha***
-fixed a bug in array::insert()
-optional Unicode core(define SQUNICODE or _UNICODE on Win32)
-sq_compiler uses a new reader function SQLEXREADFUNC
-the debug hook passes 'l' instead of 'line' for line callbacks
and 'c' instead of 'call' for call callbacks
-new array.extend() bulit-in function
-new API sq_clone()
***2003-09-10 ***
***version 0.2 pre-alpha***
-new completely reentrant VM (sq_open and sq_close are now obsolete)
-sq_newvm() has a new prototype
-allocators are now global and linked in the VM
-_newslot meta method added
-rawset creates a slot if doesn't exists
-the compiler error callback pass the vm handle(thanks Pierre Renaux)
-sq_setforeignptr() sq_getforeingptr() are now public
-sq_resume() now is possible to resume generators from C
-sq_getlasterror() retrieve the last thrown error
-improved docs
***2003-09-06 ***
***version 0.1 pre-alpha***
first release

View File

@@ -0,0 +1,18 @@
SQUIRREL=.
MAKE=make
sq32:
cd squirrel; $(MAKE)
cd sqstdlib; $(MAKE)
cd sq; $(MAKE)
sqprof:
cd squirrel; $(MAKE) sqprof
cd sqstdlib; $(MAKE) sqprof
cd sq; $(MAKE) sqprof
sq64:
cd squirrel; $(MAKE) sq64
cd sqstdlib; $(MAKE) sq64
cd sq; $(MAKE) sq64

View File

@@ -0,0 +1,22 @@
The programming language SQUIRREL 2.2.3 stable
--------------------------------------------------
The project has been compiled and run on Windows(Windows XP/2000 on Intel x86 Windows XP Pro on AMD x64) and
Linux(Slackware 9.0 on Intel x86, Fedora Core 4 on AMD x64).
Has been tested with the following compilers:
MS Visual C++ 6.0,7.0,7.1 and 8.0 (32 and 64bits)
MinGW gcc 3.2 (mingw special 20020817-1)
Cygnus gcc 3.2
Linux gcc 3.2.3
Linux gcc 4.0.0 (x86 64bits)
Feedback and suggestions are appreciated
project page - http://www.squirrel-lang.org
community forums - http://www.squirrel-lang.org/Forums
wiki - http://wiki.squirrel-lang.org
author - alberto@demichelis.net
END OF README

View File

@@ -0,0 +1,16 @@
10/08/05
To build and test the minimalSqPlus/ example:
Open Squirrel.sln and build for Debug and Release.
Open the minimalSqPlus/minimalSqPlus.sln and build (Debug or Release), then run.
Alternatively, after building testSqPlus2 in Squirrel.sln, set minimalSqPlus as
the Startup Project, then build and run (dependencies are not set for minimalSqPlus
to illustrate building with pre-compiled libs).
See testSqPlus2/testSqPlus2.cpp for many examples (in the Squirrel.sln solution).
testSqPlus/testSqPlus.cpp is included to show how the old version using macros was used (it is no longer updated).
John

View File

@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
<FileVersion major="1" minor="1"/>
<Project>
<Option title=""/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option default_target="-1"/>
<Option compiler="0"/>
<Build>
</Build>
</Project>
</CodeBlocks_project_file>

Binary file not shown.

View File

@@ -0,0 +1,494 @@
%PDF-1.3
%<25><><EFBFBD><EFBFBD>
4 0 obj
<< /Type /Info
/Producer (FOP 0.20.5) >>
endobj
5 0 obj
<< /Length 196 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
GaqdY]+0EX&;B(lT41D@*+tSN;/4Ut;R\G?OEDk#&6F++6)>^%qht(5^"An`O:%O/^cqrFJZf5C'FZgXJMj2O1`/_b3XrfU>BYFS9hM,(@3_nF3gBoT9Bc3qXP4mt@uMS5.jO.p#ClaLCf.d3?VEJJ<[f`FTjmgRGAS)Ccn@nXebn8]oeWu"qgWh^iWC>m0t%~>
endstream
endobj
6 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 5 0 R
>>
endobj
7 0 obj
<< /Length 1032 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Gasao968i1&AJ$CE(_rr;`u\TDGNtK1[1kLh:`p3KHqH]*!CH`mu*-((.W6uT(0&.o'MVOh.MXI+(H"fnJYuh,!bfF7"P/f.#\3ITJY<\-jii&U@5SKShuXoniO49dM2/YRh4D)V6*SD;n]*>Y%oLMAVbt#oFkf.N5l'T"1[mbHe[m"]Ltb5Dg>*S&d(Z[C`:rl'b09+++Z$SDqFFH40_"A<]A/Art-QNPG01U=6;/UWrG.#,2^ZM^.E;WVq-(C$jTJk3uk.)]'Vq_N^QdDo.BZ6**>d*W4O5OMY/o$W&lcb#d'bWF=/Kbhg7qA%pVZOEP(DXpLI`sUf/WLPn+n"3oN(ZcqaCVE=QR1Gf^S8_NnM)\S#;blp\i1agl%]q,ps5?'9@g582-SVc-qn9mbJs,$E7'g*nL#=so:Y=@)[H&/DQ]!-2g2Sr[G'inY<lB.@-:pIq+#]ShO)(<WfGTd.!?<ak1>Y"eVaU[rhBW8g>L1#X*UbuiN2W(tu\\JID7K'9dtlZ0(o<>D6FW@SnF!+g*2X!#Pqeh83A[9U59+:+jIS<:0hrKS_M0b1+u.`l_55eED8/Z+c)QCq_Ks$[<'!O'6s!gV\K*5-nX(X71TcDeOLO"B)EG`"&ZpM8[t6P7fS_@RIJJ6]YXe3PU19QJ^k\lVYl";#Te`d12]At[%@]l=u=TjIq'E5Gcq(/\-uNcKFU[\/F1;`cU\7\DXMeJ7.bZsdD*C*!@)L'8O:T`Z"eQA0r`>pqBF"<&&:SN(Xnf'UP+cb[8.)<%*['SRURShGgs+,./IB>kiUR#<5h\Q^9dN!:2H#LkOfCDtFUTr-p6%jej'EFOU[qe*&Uo[XC%$P:a;b(6gJgM(,gLVGbMe+")*-1VY"'1eY)BY;c[f3EQG6@\ufcb%;uGCR;d\^?otfbREY^KEbR,`[gm:u/4`kSJlJD9;#G8P8TVFb&.JrZ3l/CnLa#NV#El=i7A-3)+at]KTka-i6>G^BDgQQ([eq*LN+fW*4ROgh2t.Rl-50g&1q"H]<^~>
endstream
endobj
8 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 7 0 R
>>
endobj
9 0 obj
<< /Length 71 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Garg^iGoCd.c`?]8EV`b1=.gR0K1`91K?+0ZOMGdU/Zh'Y!=Te%#&:?HH*JE!<E/X&V'~>
endstream
endobj
10 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 9 0 R
>>
endobj
11 0 obj
<< /Length 500 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Gb"/h4)]a*&:etR`JnDaMdI=@V@P+]qN/1d6QUtO9qeC?l-HOB8Xr1GUoFN2F^k/oR):!5dpWGA34n<<'k%F4/;PDZ-q*d'TGWM.N`2)J$2PAX6Tl@69b7(o.?[:Q+=sjiiC-o!VPl_*n-&U-VNsIlS&JuGB;NfU@Z_5%BUb;#QUJE0W1T%k>ak1qSt!klKQO7$h9>R6&eYfioViB3kt3uUd59gL.kd@GKrGhDZYU&F\m@<.'%5[1j,RQQGKeEW5^>5eB1:\31c"`I=#9MT%Cb0Dam9TGl$q.OlD;p1n':)d@HqE,^%fBI<S$9-S@cr*ZKkd>+X-5P38:Y+p95\Q^;:cXomD3IoRdC4RE?5-7K?$8oo>,qOA:j;VVqc,$(5gPR]Y%34Dd>M6MdNgRVkSAD#:SJC;0$JK(5u[NJ)t<oHV>sQ/\rgnD=.lDB,PW,n`V`Oep2c(>K,s]g"4eKHH_nFs`9O/La4cKPHc4>PNDk"5=c#SH~>
endstream
endobj
12 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 11 0 R
/Annots 13 0 R
>>
endobj
13 0 obj
[
14 0 R
16 0 R
18 0 R
20 0 R
22 0 R
24 0 R
26 0 R
]
endobj
14 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 120.0 655.001 187.48 645.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 15 0 R
/H /I
>>
endobj
16 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 144.0 644.001 183.43 634.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 17 0 R
/H /I
>>
endobj
18 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 144.0 633.001 242.31 623.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 19 0 R
/H /I
>>
endobj
20 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 144.0 622.001 230.65 612.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 21 0 R
/H /I
>>
endobj
22 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 120.0 611.001 189.14 601.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 23 0 R
/H /I
>>
endobj
24 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 144.0 600.001 183.43 590.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 25 0 R
/H /I
>>
endobj
26 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 120.0 589.001 142.77 579.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 27 0 R
/H /I
>>
endobj
28 0 obj
<< /Length 1965 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Gatm<>B?Pt'RnB3@(-Z']8csPhKBu]nRgV!g.>!3Th?_b6+1J^&:s5GSc8@)&0QODZIA(57H^=bqfFHR0:\fD:TB(*A6Gqn/<47TH)*tdr"R8k8<s\-7YYMIc<C'fEk1bhSBuh/MG4c;Q>@MgM1XHgZQa8+'q'!+b<kPmEde1E\tmE?)U-a/'O3=#6UQ`F1L&-SbR-LZn`;%hB[3Sf_:L\'a+tl.2es$6>6C&a1n54Ff.,Hn,)gTKUg?e+B[!&,+f-ID*(ne=\34NBj#["i':*>NKt`n/8W4Q=!.5ZPW\1$^J6+TRCD@]8/YUp\m,!In[ZRD%9PS`pF`@la<GWflgrfEGj3'QD?T<3(i<(I%E)&PGI*G`!/guRNA1&eM'>>er(^YfTcSW`LVe]Cq"nAd'"CL+iB^A0>7*Z:Aa-IO"L2t_*$cm%9=rSpH[Q%1O"OG(hUJfH(\o$2&pW19+/B\3OLfM?o+E-JSQ][rc9&bljbM0AnD9%XG,K/O,-kGq0%VN&'rPEb3$M1L64^ZTIZWqXdM)lenrTIB27k`]B!@=?$[Fsn.dTkBuAE$5/\15KP?8aB'PKfsM3@"=USt^!MdW*`7LmT#Rh=_NgoSmf-=,42MEH<iJ7AXu:T0hto9bqWg:_`E4NE?0l$YqSTQGk`-(FBj*/.)3J`;bI`<gO1JLfg]H$M>F8ME*l46u8DslKuMb<jmj^7oJ=M6:VgF?NQ#hjE)_rRf?.\4EDZsI?FrG(8?C]",;+5>UlLh#H0j&7HpE:_&aUC9.4VMXY6F"=:jTuZkVa",SIu?_K?cZIP3NNk$GP7lQE&Q<A:.G6?<`O#F&s;rZr&U<jSlP?bc*i1A5creI,/pRsQo!6d(2b@5j1YU)<_AOl[kMeGSFT(PX@ah6=fWA/Ht_N0?mI'3`F\n^a1'E+CT2#]4r1Oha-%#\cV*j?p1e(6:>"I]B1OIgRja'6ipQ?<H+6_3=5)F4%5f59G#.ZJC_aZG#_,$'up4D&VE1_0l&XBP^,Kn$oB%HfBhG8X#,m_Gb7[Y)_?5C@9@To1Yf[RPck[ehHf]2/?SWb>7,bp`5V-R]Jpuir1>WDgq(=b2cB9SHi'eJlbfM9T[WTJi1\>=:bi607+)u@Kpt>*Pu'8j8JEq[7LJ1,mjC3pN=<]4,9iFVC!6RRZ0.,Q8(YLDHr^JjrpXT,joW?gW&2=`c-rmh6pU!c2r?fMH*KG=B\orR<,+'05\::'\2F.ggb8d-d:doqo`jl7\/2s6Jg0hU>M;u)W&e1oNF;]glO8-E[;KeUY:gQP?iNDm'^%<?2?o`qC@VIl::W\rV"m:fsZNMN7@^gnTT28@22utN&7SYA`8s;\Gfk1'"`e!$EP(u$Fp*RbrPYM"nt=1e*PLGH!`dA.OBbr6u`/R^5N`>?EfWmW%96D\-P[qhAs+YTDO$j0J\X1#>4OrNOaX>V(5NaY%)"oa7)n)(0-&^XL<MJh*$_cmmf=u"/f&2ji`^:cd,BY9&M*4)/K+E=3@e*<*g\M*^"!Z0-ON82(p-f)Ue>P[&bIHpAXFFh)fM&4;g6@o:,8gUD[]*T1>E])I5I1?]XV8B0&&WQ/11Eic]Y:E([t3hQ*CC9sI]/C;%?@-Kc1(U0m'ocLg)hlJ*9MX0P]8#q'[VqD*1_Xe[EbbFqiG`p%YKpcG#%3HRUuTrJfV>o;J^GmU4$qPPd?Y"+]'rOF_U:>BSj<ZbEkYH'ZdVi^7e^OV_2\qX2[Q-7PJX`.7,65EW&q8MV4??V#Z-OqS%?maKM^nf2-c8</FCcA+Xm&eCMahuBJT!GXD.5Ea)3h.;/76hVnqWVED^78O&B)t\2V9Z!AfutW*oGcA@a8QW$*T7ogofUE]SI]jC8e&u;WB:[6T'HllS45rt<c!!L6/fV<S>0`j^KMM6WPKe_mU*pO*XWN+dc0KYkecS%KT&fUp[qiITW3-Zbb=m:3e^f<(D0ffdf~>
endstream
endobj
29 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 28 0 R
>>
endobj
30 0 obj
<< /Length 822 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Gas1]>u03/'RfGR0MI[.$/@MKj$XOk1c6?g.dc4fP6e0\j-4:).8C3\e,K67-H--nP_[3&\`]R]fb^4970nt_>p-G5$Pj`c>l>dqr'4UEf7OJ4nHA9M/>#)IZVnlBooC`8#NDW^HSpEtH8)!$pmYNRnfqmBkm&7<_gT[q>.iXaqZEW&6\KZZH+M5dX;"%M$8(FV[EP[&EMd`?361Q6d(eq!;r=\`SSYj"k&g=19To<5l(2_1,i)6O)Ld8]D.?dbjs--T/<]GY%q#qD2&KieLNYCMWBqKsAMmE:11-E<l>]U*.N^R,KiD75B4\2$&&Y&7OHS-`ji734*Jao.(p_0DT+sXZ!kgMK?LR+!E5n)d`.rutgk[Iu%d0UL3D>1eqW7cs_#'>=9E*,i6oW_F./(rq_]b(/C_mp"LdP+&GW^s5;8i9\%hbdfT%4(6^<W$E<iC;+kAjl\MnD`RVK2?>>hSF6)1`LVle#+X[-=/LeY/5C!1>t?h`R>5^6cP)^!oO2H6hi>KYXgoLCS48.3DPe<7U>D,noJ'TR0A+]BdDuZ:_$/;>7g`C&7cR*ad.`W9UigRtL*(4UO@MA]#Vt0s``2FMlF[PEF\DV3%F\YdQD>+#d2']]QgufbKX26Jj&!^+)a%,$K4V+Ud[9in?=%@2+G<@d[N0TRS^jl[?=]1TuQ!K_n%;(Y]i$(kZ6^>R$^'<j.5RoDWd4MQ3$[X#Fqm[Y`ll_0WALh.@D2KA4t/Mp?CM['q_Y&>Xhm^Kpf7,fi%,:1'Bcd*=d]!s=A34/oTTa`cLmq0bDG?d`Fc01euYig/@U7/m99iIp:~>
endstream
endobj
31 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 30 0 R
>>
endobj
32 0 obj
<< /Length 1571 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
GatTIgMYb(o\ElJ[jFAWLn_',;q!'tL)/%QmE7U+Zpi_;AC6MfBA(n'OsoikAfM%CJ;!+Tgi[MYj`GN_9cVJLED2neEoK-\$$KSHK:U(NXqSe]$N8&6DOeI;5-='MZJs@opS%p>Z($ElM2-iTa4m(,igq`)_=@akFoHBXJ$g2#'To'>37J]HaRt`tgLiFJ<i]D0_fdo.4LOl3Aju"(#fj[>2irq!VdRejE]:P!!`GPeM\(4`<2;A`%McC*1@Q6V7o3snRaS)4i];'uN<\fZYON.DL]i1m?hs?#8E[%G4QfW>BW,_?+:/TN2"dIOGP>0G^J1mq?iJFX'&u,DSkI))(.C+p]dO_=c>'cEDsm(t^ARc+^+.-?c#g6Q"$i-<I$M#PTZXYj,_3?2KIdXXkB;pH!!Pb@^D%kj4CQE".k.K88gTstrn_u6=9@:a$3PrC6&U=D[^+3$TTs)K3I<XacV$j!7-u[;C!L`.0$:)L(BqtjVI1>d!Ca$;(YLqt^+jS"$bBcHZHD(KVfh`>9Bq`M0]3q"*Z_9:Jaeb%4-VJh9@@:gUk'Jqh467_q7`ckgU?tc0mZ.BKYt/':"HuAb!>%[e*Y-!Xg+sm@'`)XV.;SW$$h3sW^l`^*q!@XcaQW'E`c*")7rFb=o[;R+(4)1__@j5*uh0_P?!aGCcYYfnJcB(m$d&ce-,qA&*8$sCrmn(e8Ja1L),h]@f^am;dFMtq/1jVlO3*Ml&`P7B3A3lVG0nsJB2EJ1XEA#lj]5-6*opsTPMn>>u/s%j^`OLmb!O704PgQ$uckV2giO8V!I$k*]'C?MoI8qB)f/*-!?*6l6H)(2AREZ,t)L@`EMa7?s8EhE,E(P$@q1]#I<EZ8ctp,S9"]`eo\Bf@ZC71M2hD?@Dqihj?&c2jbn[F+gu"f>`7c+TE`em9FY+=K>-*G692G&%HcfB3=Buc4/d-KYG!!IY&o\;Li;tk;!VO0_7%"<%?&hsK%ukX(VEVH%8tqe:QlD/oX-*KN2=@&r"03AWPJQe3B.gsYu$:KV^r";$+jPAB`'>gK;XA"g[>A?R[)g2NN`V/8bMJfngV123gcpOf[cA]lpLImO8'de_kWM[ie8ceO'2%6U"&?bjnk?+6I]a@7_;a4Y%0#RF)0qaWi^qO2q%/u*km,l*np.'(lu46d:;#(6@[3B)m,I_:od#+ZYk'RQ/Hf%*ia8(neCFpK+4UCJSh[)\RfX2JhK+d3Odbq(Fh(oN=#&WW&t,@?]W*uZ0oVA3<tnNK4ED06`:fBG`LCaJm91)09-;Fh4oi4X5IF\R,U,\;QJE6mjfG!&ep=hqS:[7PuTPfk8O^TnX.k,b$$s52s1(RePlMA4(55lbpK7;`2MRA>(GccWH4LGN-_a"5gYaYN>"EEH==#)p>od\+3^8M!$hP+gSrVX'B#rn\JCnPHG_&,)?5cOT7^8=W'2nXbEraqZLs$ASY![S_*Q[U<r$4WBAi0%9C/:$47NURc2?[ghR(%j2g]&D(%,qfh,_%($J5\;6&8t`KDiMB._8/6!eN?\^A\(cY;TZ*S`siVi<+\CJ,U"SnJA4W:s/~>
endstream
endobj
33 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 32 0 R
>>
endobj
34 0 obj
<< /Length 941 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
GatU1hf"u<&:Vr4_.+[3'SCsKHYTs3l[GdJbFY$!EkkMP`2:Og[/KYR`oK6K>A4``]!HhBh0hKESRo.f$P[h6n,k<oB7X./O;I*kH"`W0`FKk_..sm*pLF3mpA3qLlW&--rp7P>H]nT'eQ`mUC>o-`Z;2AhhEq`+;/e:B;>4$oLU"*b6rm9<?I8ARWi3:\qd@9Y2bD@;78gOYr2mEGb6W<h7*?0/S_+*lqu'.l/#tZ\60gnBMPTXJ<hQc7jFWXCQ'<fNQ>kI)h::\`B94:)@:^fkW1B"\TTP*c50gdT"O52Q2rOqE`@3BBLJ.a>g*'Ts`gL;3B"r&b>56S-L.d<W%?V1'@2B(o]$mbogSQ+9j;28i*gl5(!b*HD!Esq*=RI#k698.A;mVuB-Fe]).9<)V!b<pRNI14a-NdIhgL$W(68V2mQ.XK^_ZK.\7OOrdNK>l0+7Hd%^Zub>buY;*CT,`CD-C&P]E27"D9/nflgN1MlCL"?4''t+Yt[T+ja_@&cABm+EB:?Ih'Zgp,s8*-D]hqBo]?tg^%BJB?M`3@4]'KTZD#PjF(@l5>\FWO/RZt*Vj1Jd*+sbdf&>SNe1I4b/(XaBLQN6;UX^]0cgD+24"mEbO4>_Ve/8aWjZK"qpANCOQ8f1.n(>^4Q6c.Gg%F\_Et4q@hM?/dO.\,bM/tC0J?PQNNm5*`a2]">KC4Z7Yd90R5I!$S>jM_p\dWVq3R-qS:NV:mGD-b(VU/=[[n#Z/@>[QUY<&224,V&'="fN)e`,Bm'?DL5/H*Y!FeLd3ZgUFc@9ckdj-<P9DT#?j@KRNg:=lQh(ScO>h/mX_ZB)"/?+h[:]=p?\*#thc.Nc]=p`FS1L&(JRN5Kau1,5+U^l1m!<8/ikcTJ5D?^N0(Nq>X$e#2(U!WRnCELkQm#7:+!(\+7ClJ?@<@uH?JkRY5-16q~>
endstream
endobj
35 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 34 0 R
>>
endobj
36 0 obj
<< /Length 287 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
GasJM_/@+D%#44r$6MQC-Ae9M>`gpYgns0k9o.14H6=5F&:=>/Q>R*XTj4\os1ZFngl(D1JS'"a^m@C)7OX@4.EF><Y\o2]1[mJN)a/thp_q%3pdN4P7QsZOOZ\K)&iK?tlVH/`P,W^=me*+/bk9q<^MNJ%c*@[VS;cDmRhINNZf<]/p4d@lLR?]6E0o,;L-9qHX'".'e%jSrEE0u`DUrq9`B%%BBJ1oa[QJl@n(tM%A?=,X>F0)mWht;E]SO,5b#q412`=ou,c,oV3.-h`4ms=llYUJ~>
endstream
endobj
37 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 36 0 R
/Annots 38 0 R
>>
endobj
38 0 obj
[
]
endobj
41 0 obj
<<
/Title (\376\377\0\123\0\161\0\165\0\151\0\162\0\162\0\145\0\154\0\40\0\122\0\145\0\155\0\157\0\164\0\145\0\40\0\104\0\145\0\142\0\165\0\147\0\147\0\145\0\162\0\40\0\61\0\56\0\60)
/Parent 39 0 R
/Next 43 0 R
/A 40 0 R
>> endobj
43 0 obj
<<
/Title (\376\377\0\124\0\141\0\142\0\154\0\145\0\40\0\157\0\146\0\40\0\103\0\157\0\156\0\164\0\145\0\156\0\164\0\163)
/Parent 39 0 R
/Prev 41 0 R
/Next 44 0 R
/A 42 0 R
>> endobj
44 0 obj
<<
/Title (\376\377\0\103\0\150\0\141\0\160\0\164\0\145\0\162\0\240\0\61\0\56\0\240\0\124\0\150\0\145\0\40\0\104\0\145\0\142\0\165\0\147\0\147\0\145\0\162)
/Parent 39 0 R
/First 45 0 R
/Last 47 0 R
/Prev 43 0 R
/Next 48 0 R
/Count -3
/A 15 0 R
>> endobj
45 0 obj
<<
/Title (\376\377\0\117\0\166\0\145\0\162\0\166\0\151\0\145\0\167)
/Parent 44 0 R
/Next 46 0 R
/A 17 0 R
>> endobj
46 0 obj
<<
/Title (\376\377\0\111\0\156\0\164\0\145\0\147\0\162\0\141\0\164\0\151\0\156\0\147\0\40\0\164\0\150\0\145\0\40\0\144\0\145\0\142\0\165\0\147\0\147\0\145\0\162)
/Parent 44 0 R
/Prev 45 0 R
/Next 47 0 R
/A 19 0 R
>> endobj
47 0 obj
<<
/Title (\376\377\0\124\0\150\0\145\0\40\0\156\0\145\0\164\0\167\0\157\0\162\0\153\0\40\0\160\0\162\0\157\0\164\0\157\0\143\0\157\0\154)
/Parent 44 0 R
/Prev 46 0 R
/A 21 0 R
>> endobj
48 0 obj
<<
/Title (\376\377\0\103\0\150\0\141\0\160\0\164\0\145\0\162\0\240\0\62\0\56\0\240\0\101\0\120\0\111\0\40\0\122\0\145\0\146\0\145\0\162\0\145\0\156\0\143\0\145)
/Parent 39 0 R
/First 49 0 R
/Last 49 0 R
/Prev 44 0 R
/Next 50 0 R
/Count -1
/A 23 0 R
>> endobj
49 0 obj
<<
/Title (\376\377\0\104\0\145\0\142\0\165\0\147\0\147\0\145\0\162)
/Parent 48 0 R
/A 25 0 R
>> endobj
50 0 obj
<<
/Title (\376\377\0\111\0\156\0\144\0\145\0\170)
/Parent 39 0 R
/Prev 48 0 R
/A 27 0 R
>> endobj
51 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F3
/BaseFont /Helvetica-Bold
/Encoding /WinAnsiEncoding >>
endobj
52 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F5
/BaseFont /Times-Roman
/Encoding /WinAnsiEncoding >>
endobj
53 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F10
/BaseFont /Courier-Oblique
/Encoding /WinAnsiEncoding >>
endobj
54 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F6
/BaseFont /Times-Italic
/Encoding /WinAnsiEncoding >>
endobj
55 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F1
/BaseFont /Helvetica
/Encoding /WinAnsiEncoding >>
endobj
56 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F11
/BaseFont /Courier-Bold
/Encoding /WinAnsiEncoding >>
endobj
57 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F9
/BaseFont /Courier
/Encoding /WinAnsiEncoding >>
endobj
1 0 obj
<< /Type /Pages
/Count 9
/Kids [6 0 R 8 0 R 10 0 R 12 0 R 29 0 R 31 0 R 33 0 R 35 0 R 37 0 R ] >>
endobj
2 0 obj
<< /Type /Catalog
/Pages 1 0 R
/Outlines 39 0 R
/PageMode /UseOutlines
>>
endobj
3 0 obj
<<
/Font << /F3 51 0 R /F5 52 0 R /F10 53 0 R /F1 55 0 R /F6 54 0 R /F9 57 0 R /F11 56 0 R >>
/ProcSet [ /PDF /ImageC /Text ] >>
endobj
15 0 obj
<<
/S /GoTo
/D [29 0 R /XYZ 115.0 725.0 null]
>>
endobj
17 0 obj
<<
/S /GoTo
/D [29 0 R /XYZ 115.0 666.009 null]
>>
endobj
19 0 obj
<<
/S /GoTo
/D [29 0 R /XYZ 115.0 589.684 null]
>>
endobj
21 0 obj
<<
/S /GoTo
/D [31 0 R /XYZ 115.0 448.64 null]
>>
endobj
23 0 obj
<<
/S /GoTo
/D [33 0 R /XYZ 115.0 725.0 null]
>>
endobj
25 0 obj
<<
/S /GoTo
/D [33 0 R /XYZ 115.0 687.009 null]
>>
endobj
27 0 obj
<<
/S /GoTo
/D [37 0 R /XYZ 67.0 725.0 null]
>>
endobj
39 0 obj
<<
/First 41 0 R
/Last 50 0 R
>> endobj
40 0 obj
<<
/S /GoTo
/D [10 0 R /XYZ 115.0 725.0 null]
>>
endobj
42 0 obj
<<
/S /GoTo
/D [12 0 R /XYZ 115.0 715.0 null]
>>
endobj
xref
0 58
0000000000 65535 f
0000012880 00000 n
0000012993 00000 n
0000013085 00000 n
0000000015 00000 n
0000000071 00000 n
0000000358 00000 n
0000000464 00000 n
0000001588 00000 n
0000001694 00000 n
0000001855 00000 n
0000001962 00000 n
0000002554 00000 n
0000002677 00000 n
0000002746 00000 n
0000013232 00000 n
0000002882 00000 n
0000013297 00000 n
0000003018 00000 n
0000013364 00000 n
0000003154 00000 n
0000013431 00000 n
0000003290 00000 n
0000013497 00000 n
0000003426 00000 n
0000013562 00000 n
0000003562 00000 n
0000013629 00000 n
0000003698 00000 n
0000005756 00000 n
0000005864 00000 n
0000006778 00000 n
0000006886 00000 n
0000008550 00000 n
0000008658 00000 n
0000009691 00000 n
0000009799 00000 n
0000010178 00000 n
0000010301 00000 n
0000013693 00000 n
0000013744 00000 n
0000010321 00000 n
0000013809 00000 n
0000010565 00000 n
0000010761 00000 n
0000011032 00000 n
0000011162 00000 n
0000011400 00000 n
0000011600 00000 n
0000011877 00000 n
0000011993 00000 n
0000012105 00000 n
0000012218 00000 n
0000012328 00000 n
0000012443 00000 n
0000012554 00000 n
0000012662 00000 n
0000012774 00000 n
trailer
<<
/Size 58
/Root 2 0 R
/Info 4 0 R
>>
startxref
13874
%%EOF

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,63 @@
#include <stdarg.h>
#include <stdio.h>
#include <squirrel.h>
#include <sqstdio.h>
#include <sqstdaux.h>
#ifdef _MSC_VER
#pragma comment (lib ,"squirrel.lib")
#pragma comment (lib ,"sqstdlib.lib")
#endif
#ifdef SQUNICODE
#define scvprintf vwprintf
#else
#define scvprintf vprintf
#endif
void printfunc(HSQUIRRELVM v, const SQChar *s, ...)
{
va_list arglist;
va_start(arglist, s);
scvprintf(s, arglist);
va_end(arglist);
}
void call_foo(HSQUIRRELVM v, int n,float f,const SQChar *s)
{
SQInteger top = sq_gettop(v); //saves the stack size before the call
sq_pushroottable(v); //pushes the global table
sq_pushstring(v,_SC("foo"),-1);
if(SQ_SUCCEEDED(sq_get(v,-2))) { //gets the field 'foo' from the global table
sq_pushroottable(v); //push the 'this' (in this case is the global table)
sq_pushinteger(v,n);
sq_pushfloat(v,f);
sq_pushstring(v,s,-1);
sq_call(v,4,SQFalse,SQTrue); //calls the function
}
sq_settop(v,top); //restores the original stack size
}
int main(int argc, char* argv[])
{
HSQUIRRELVM v;
v = sq_open(1024); // creates a VM with initial stack size 1024
//sq_pushroottable(v); //push the root table were to register the lib function
//sqstd_register_iolib(v);
sqstd_seterrorhandlers(v); //registers the default error handlers
sq_setprintfunc(v, printfunc); //sets the print function
sq_pushroottable(v); //push the root table(were the globals of the script will be stored)
if(SQ_SUCCEEDED(sqstd_dofile(v, _SC("test.nut"), SQFalse, SQTrue))) // also prints syntax errors if any
{
call_foo(v,1,2.5,_SC("teststring"));
}
sq_pop(v,1); //pops the root table
sq_close(v);
return 0;
}

View File

@@ -0,0 +1,4 @@
function foo(i, f, s)
{
print("Called foo(), i="+i+", f="+f+", s='"+s+"'\n");
}

View File

@@ -0,0 +1,170 @@
#ifndef _SQ_DBGSERVER_H_
#define _SQ_DBGSERVER_H_
#define MAX_BP_PATH 512
#define MAX_MSG_LEN 2049
#if defined( _PS3 ) || defined( POSIX )
#include <ctype.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "tier0/threadtools.h"
typedef int SOCKET;
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
#endif
// Parts of squirrel do a #define of type, which leads to compile warnings/errors when STL files are included.
// -- at least in VS 2013. Luckily we can temporarily #undef it and avoid the problem.
// VALVE BUILD
#undef type
#include <set>
#include <string>
#include <vector>
// Redefine type
#define type SQ_TYPE
/*
see copyright notice in sqrdbg.h
*/
#if !defined( _X360 ) && !defined( _PS3 ) && !defined( POSIX )
#include <winsock.h>
#endif
typedef std::basic_string<SQChar> SQDBGString;
inline bool dbg_less(const SQChar *x,const SQChar *y)
{
int n = 0;
do {
int xl = *x == '\\' ? '/' : tolower(*x);
int yl = *y == '\\' ? '/' : tolower(*y);
int diff = xl - yl;
if(diff != 0)
return diff > 0?true:false;
x++; y++;
}while(*x != 0 && *y != 0);
return false;
}
struct BreakPoint{
BreakPoint(){_line=0;}
BreakPoint(int line, const SQChar *src){ _line = line; _src = src; }
BreakPoint(const BreakPoint& bp){ _line = bp._line; _src=bp._src; }
inline bool operator<(const BreakPoint& bp) const
{
if(_line<bp._line)
return true;
if(_line==bp._line){
return dbg_less(_src.c_str(),bp._src.c_str());
}
return false;
}
int _line;
SQDBGString _src;
};
struct Watch{
Watch() { _id = 0; }
Watch(int id,const SQChar *exp) { _id = id; _exp = exp; }
Watch(const Watch &w) { _id = w._id; _exp = w._exp; }
bool operator<(const Watch& w) const { return _id<w._id; }
bool operator==(const Watch& w) const { return _id == w._id; }
int _id;
SQDBGString _exp;
};
typedef std::set<BreakPoint> BreakPointSet;
typedef BreakPointSet::iterator BreakPointSetItor;
typedef std::set<Watch> WatchSet;
typedef WatchSet::iterator WatchSetItor;
typedef std::vector<SQChar> SQCharVec;
struct SQDbgServer{
public:
enum eDbgState{
eDBG_Running,
eDBG_StepOver,
eDBG_StepInto,
eDBG_StepReturn,
eDBG_Suspended,
eDBG_Disabled,
};
SQDbgServer(HSQUIRRELVM v);
~SQDbgServer();
bool Init();
bool IsConnected();
//returns true if a message has been received
bool WaitForClient();
bool ReadMsg();
void BusyWait();
void Hook(int type,int line,const SQChar *src,const SQChar *func);
void ParseMsg(const char *msg);
bool ParseBreakpoint(const char *msg,BreakPoint &out);
bool ParseWatch(const char *msg,Watch &out);
bool ParseRemoveWatch(const char *msg,int &id);
void Terminated();
//
void BreakExecution();
void Send(const SQChar *s,...);
void SendChunk(const SQChar *chunk);
void Break(int line,const SQChar *src,const SQChar *type,const SQChar *error=NULL);
void SerializeState();
//COMMANDS
void AddBreakpoint(BreakPoint &bp);
void AddWatch(Watch &w);
void RemoveWatch(int id);
void RemoveBreakpoint(BreakPoint &bp);
//
void SetErrorHandlers();
//XML RELATED STUFF///////////////////////
#define MAX_NESTING 10
struct XMLElementState {
SQChar name[256];
bool haschildren;
};
XMLElementState xmlstate[MAX_NESTING];
int _xmlcurrentement;
void BeginDocument() { _xmlcurrentement = -1; }
void BeginElement(const SQChar *name);
void Attribute(const SQChar *name, const SQChar *value);
void EndElement(const SQChar *name);
void EndDocument();
const SQChar *escape_xml(const SQChar *x);
//////////////////////////////////////////////
HSQUIRRELVM _v;
HSQOBJECT _debugroot;
eDbgState _state;
SOCKET _accept;
SOCKET _endpoint;
BreakPointSet _breakpoints;
WatchSet _watches;
int _recursionlevel;
int _maxrecursion;
int _nestedcalls;
bool _ready;
bool _autoupdate;
HSQOBJECT _serializefunc;
SQCharVec _scratchstring;
};
#ifdef _WIN32
#define sqdbg_closesocket(x) closesocket((x))
#else
#define sqdbg_closesocket(x) close((x))
#endif
#endif //_SQ_DBGSERVER_H_

View File

@@ -0,0 +1,52 @@
/*
Copyright (c) 2003-2005 Alberto Demichelis
This software is provided 'as-is', without any
express or implied warranty. In no event will the
authors be held liable for any damages arising from
the use of this software.
Permission is granted to anyone to use this software
for any purpose, including commercial applications,
and to alter it and redistribute it freely, subject
to the following restrictions:
1. The origin of this software must not be
misrepresented; you must not claim that
you wrote the original software. If you
use this software in a product, an
acknowledgment in the product
documentation would be appreciated but is
not required.
2. Altered source versions must be plainly
marked as such, and must not be
misrepresented as being the original
software.
3. This notice may not be removed or
altered from any source distribution.
*/
#ifndef _SQ_RDBG_H_
#define _SQ_RDBG_H_
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _GAMECONSOLE
#pragma comment(lib, "WSOCK32.LIB")
#endif
struct SQDbgServer;
typedef SQDbgServer* HSQREMOTEDBG;
HSQREMOTEDBG sq_rdbg_init(HSQUIRRELVM v,unsigned short port,SQBool autoupdate);
SQRESULT sq_rdbg_waitforconnections(HSQREMOTEDBG rdbg);
SQRESULT sq_rdbg_shutdown(HSQREMOTEDBG rdbg);
SQRESULT sq_rdbg_update(HSQREMOTEDBG rdbg);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif //_SQ_RDBG_H_

View File

@@ -0,0 +1,16 @@
/* see copyright notice in squirrel.h */
#ifndef _SQSTD_AUXLIB_H_
#define _SQSTD_AUXLIB_H_
#ifdef __cplusplus
extern "C" {
#endif
SQUIRREL_API void sqstd_seterrorhandlers(HSQUIRRELVM v);
SQUIRREL_API void sqstd_printcallstack(HSQUIRRELVM v);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /* _SQSTD_AUXLIB_H_ */

View File

@@ -0,0 +1,20 @@
/* see copyright notice in squirrel.h */
#ifndef _SQSTDBLOB_H_
#define _SQSTDBLOB_H_
#ifdef __cplusplus
extern "C" {
#endif
SQUIRREL_API SQUserPointer sqstd_createblob(HSQUIRRELVM v, SQInteger size);
SQUIRREL_API SQRESULT sqstd_getblob(HSQUIRRELVM v,SQInteger idx,SQUserPointer *ptr);
SQUIRREL_API SQInteger sqstd_getblobsize(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sqstd_register_bloblib(HSQUIRRELVM v);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*_SQSTDBLOB_H_*/

View File

@@ -0,0 +1,54 @@
/* see copyright notice in squirrel.h */
#ifndef _SQSTDIO_H_
#define _SQSTDIO_H_
#ifdef __cplusplus
#define SQSTD_STREAM_TYPE_TAG 0x80000000
struct SQStream {
virtual ~SQStream() {}
virtual SQInteger Read(void *buffer, SQInteger size) = 0;
virtual SQInteger Write(void *buffer, SQInteger size) = 0;
virtual SQInteger Flush() = 0;
virtual SQInteger Tell() = 0;
virtual SQInteger Len() = 0;
virtual SQInteger Seek(SQInteger offset, SQInteger origin) = 0;
virtual bool IsValid() = 0;
virtual bool EOS() = 0;
};
extern "C" {
#endif
#define SQ_SEEK_CUR 0
#define SQ_SEEK_END 1
#define SQ_SEEK_SET 2
typedef void* SQFILE;
SQUIRREL_API SQFILE sqstd_fopen(const SQChar *,const SQChar *);
SQUIRREL_API SQInteger sqstd_fread(SQUserPointer, SQInteger, SQInteger, SQFILE);
SQUIRREL_API SQInteger sqstd_fwrite(const SQUserPointer, SQInteger, SQInteger, SQFILE);
SQUIRREL_API SQInteger sqstd_fseek(SQFILE , SQInteger , SQInteger);
SQUIRREL_API SQInteger sqstd_ftell(SQFILE);
SQUIRREL_API SQInteger sqstd_fflush(SQFILE);
SQUIRREL_API SQInteger sqstd_fclose(SQFILE);
SQUIRREL_API SQInteger sqstd_feof(SQFILE);
SQUIRREL_API SQRESULT sqstd_createfile(HSQUIRRELVM v, SQFILE file,SQBool own);
SQUIRREL_API SQRESULT sqstd_getfile(HSQUIRRELVM v, SQInteger idx, SQFILE *file);
//compiler helpers
SQUIRREL_API SQRESULT sqstd_loadfile(HSQUIRRELVM v,const SQChar *filename,SQBool printerror);
SQUIRREL_API SQRESULT sqstd_dofile(HSQUIRRELVM v,const SQChar *filename,SQBool retval,SQBool printerror);
SQUIRREL_API SQRESULT sqstd_writeclosuretofile(HSQUIRRELVM v,const SQChar *filename);
SQUIRREL_API SQRESULT sqstd_register_iolib(HSQUIRRELVM v);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*_SQSTDIO_H_*/

View File

@@ -0,0 +1,15 @@
/* see copyright notice in squirrel.h */
#ifndef _SQSTD_MATH_H_
#define _SQSTD_MATH_H_
#ifdef __cplusplus
extern "C" {
#endif
SQUIRREL_API SQRESULT sqstd_register_mathlib(HSQUIRRELVM v);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*_SQSTD_MATH_H_*/

View File

@@ -0,0 +1,33 @@
/* see copyright notice in squirrel.h */
#ifndef _SQSTD_STRING_H_
#define _SQSTD_STRING_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef unsigned int SQRexBool;
typedef struct SQRex SQRex;
typedef struct {
const SQChar *begin;
SQInteger len;
} SQRexMatch;
SQUIRREL_API SQRex *sqstd_rex_compile(const SQChar *pattern,const SQChar **error);
SQUIRREL_API void sqstd_rex_free(SQRex *exp);
SQUIRREL_API SQBool sqstd_rex_match(SQRex* exp,const SQChar* text);
SQUIRREL_API SQBool sqstd_rex_search(SQRex* exp,const SQChar* text, const SQChar** out_begin, const SQChar** out_end);
SQUIRREL_API SQBool sqstd_rex_searchrange(SQRex* exp,const SQChar* text_begin,const SQChar* text_end,const SQChar** out_begin, const SQChar** out_end);
SQUIRREL_API SQInteger sqstd_rex_getsubexpcount(SQRex* exp);
SQUIRREL_API SQBool sqstd_rex_getsubexp(SQRex* exp, SQInteger n, SQRexMatch *subexp);
SQUIRREL_API SQRESULT sqstd_format(HSQUIRRELVM v,SQInteger nformatstringidx,SQInteger *outlen,SQChar **output);
SQUIRREL_API SQRESULT sqstd_register_stringlib(HSQUIRRELVM v);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*_SQSTD_STRING_H_*/

View File

@@ -0,0 +1,15 @@
/* see copyright notice in squirrel.h */
#ifndef _SQSTD_SYSTEMLIB_H_
#define _SQSTD_SYSTEMLIB_H_
#ifdef __cplusplus
extern "C" {
#endif
SQUIRREL_API SQInteger sqstd_register_systemlib(HSQUIRRELVM v);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /* _SQSTD_SYSTEMLIB_H_ */

View File

@@ -0,0 +1,469 @@
/*
Copyright (c) 2003-2009 Alberto Demichelis
This software is provided 'as-is', without any
express or implied warranty. In no event will the
authors be held liable for any damages arising from
the use of this software.
Permission is granted to anyone to use this software
for any purpose, including commercial applications,
and to alter it and redistribute it freely, subject
to the following restrictions:
1. The origin of this software must not be
misrepresented; you must not claim that
you wrote the original software. If you
use this software in a product, an
acknowledgment in the product
documentation would be appreciated but is
not required.
2. Altered source versions must be plainly
marked as such, and must not be
misrepresented as being the original
software.
3. This notice may not be removed or
altered from any source distribution.
*/
#ifndef _SQUIRREL_H_
#define _SQUIRREL_H_
#if defined(VSCRIPT_DLL_EXPORT) || defined(VSQUIRREL_TEST)
#include "platform.h"
#include "dbg.h"
#if defined(VSQUIRREL_TEST)
#define printf( fmt, ...) Msg( fmt, ##__VA_ARGS__ );
#else
#define printf( fmt, ...) DevMsg( fmt, ##__VA_ARGS__ );
#endif
#else
#define Assert assert
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef SQUIRREL_API
#define SQUIRREL_API extern
#endif
#ifdef PLATFORM_64BITS
#define _SQ64
#endif
#ifdef _SQ64
#define SQUSEDOUBLE
typedef int64 SQInteger;
typedef uint64 SQUnsignedInteger;
typedef uint64 SQHash; /*should be the same size of a pointer*/
typedef int SQInt32;
#else
typedef int SQInteger;
typedef int SQInt32; /*must be 32 bits(also on 64bits processors)*/
typedef unsigned int SQUnsignedInteger;
typedef unsigned int SQHash; /*should be the same size of a pointer*/
#endif
#ifdef SQUSEDOUBLE
typedef double SQFloat;
#else
typedef float SQFloat;
#endif
#if defined(SQUSEDOUBLE) && !defined(_SQ64)
#ifdef _MSC_VER
typedef __int64 SQRawObjectVal; //must be 64bits
#else
typedef long SQRawObjectVal; //must be 64bits
#endif
#define SQ_OBJECT_RAWINIT() { _unVal.raw = 0; }
#else
typedef SQUnsignedInteger SQRawObjectVal; //is 32 bits on 32 bits builds and 64 bits otherwise
#define SQ_OBJECT_RAWINIT()
#endif
typedef void* SQUserPointer;
typedef SQUnsignedInteger SQBool;
typedef SQInteger SQRESULT;
#define SQTrue (1)
#define SQFalse (0)
struct SQVM;
struct SQTable;
struct SQArray;
struct SQString;
struct SQClosure;
struct SQGenerator;
struct SQNativeClosure;
struct SQUserData;
struct SQFunctionProto;
struct SQRefCounted;
struct SQClass;
struct SQInstance;
struct SQDelegable;
#ifdef _UNICODE
#define SQUNICODE
#endif
#ifdef SQUNICODE
#if (defined(_MSC_VER) && _MSC_VER >= 1400) // 1400 = VS8
#if defined(wchar_t) //this is if the compiler considers wchar_t as native type
#define wchar_t unsigned short
#endif
#else
typedef unsigned short wchar_t;
#endif
typedef wchar_t SQChar;
#define _SC(a) L##a
#define scstrcmp wcscmp
#define scsprintf swprintf
#define scstrlen wcslen
#define scstrtod wcstod
#define scstrtol wcstol
#define scatoi _wtoi
#define scstrtoul wcstoul
#define scvsprintf vswprintf
#define scstrstr wcsstr
#define scisspace iswspace
#define scisdigit iswdigit
#define scisxdigit iswxdigit
#define scisalpha iswalpha
#define sciscntrl iswcntrl
#define scisalnum iswalnum
#define scprintf wprintf
#define MAX_CHAR 0xFFFF
#else
typedef char SQChar;
#define _SC(a) a
#define scstrcmp strcmp
#define scsprintf sprintf
#define scstrlen strlen
#define scstrtod strtod
#define scstrtol strtol
#define scatoi atoi
#define scstrtoul strtoul
#define scvsprintf vsprintf
#define scstrstr strstr
#define scisspace isspace
#define scisdigit isdigit
#define scisxdigit isxdigit
#define sciscntrl iscntrl
#define scisalpha isalpha
#define scisalnum isalnum
#define scprintf printf
#define MAX_CHAR 0xFF
#endif
#define SQUIRREL_VERSION _SC("Squirrel 2.2.3 stable")
#define SQUIRREL_COPYRIGHT _SC("Copyright (C) 2003-2009 Alberto Demichelis")
#define SQUIRREL_AUTHOR _SC("Alberto Demichelis")
#define SQ_VMSTATE_IDLE 0
#define SQ_VMSTATE_RUNNING 1
#define SQ_VMSTATE_SUSPENDED 2
#define SQUIRREL_EOB 0
#define SQ_BYTECODE_STREAM_TAG 0xFAFA
#define SQOBJECT_REF_COUNTED 0x08000000
#define SQOBJECT_NUMERIC 0x04000000
#define SQOBJECT_DELEGABLE 0x02000000
#define SQOBJECT_CANBEFALSE 0x01000000
#define SQ_MATCHTYPEMASKSTRING (-99999)
#define _RT_MASK 0x00FFFFFF
#define _RAW_TYPE(type) (type&_RT_MASK)
#define _RT_NULL 0x00000001
#define _RT_INTEGER 0x00000002
#define _RT_FLOAT 0x00000004
#define _RT_BOOL 0x00000008
#define _RT_STRING 0x00000010
#define _RT_TABLE 0x00000020
#define _RT_ARRAY 0x00000040
#define _RT_USERDATA 0x00000080
#define _RT_CLOSURE 0x00000100
#define _RT_NATIVECLOSURE 0x00000200
#define _RT_GENERATOR 0x00000400
#define _RT_USERPOINTER 0x00000800
#define _RT_THREAD 0x00001000
#define _RT_FUNCPROTO 0x00002000
#define _RT_CLASS 0x00004000
#define _RT_INSTANCE 0x00008000
#define _RT_WEAKREF 0x00010000
typedef enum tagSQObjectType{
OT_NULL = (_RT_NULL|SQOBJECT_CANBEFALSE),
OT_INTEGER = (_RT_INTEGER|SQOBJECT_NUMERIC|SQOBJECT_CANBEFALSE),
OT_FLOAT = (_RT_FLOAT|SQOBJECT_NUMERIC|SQOBJECT_CANBEFALSE),
OT_BOOL = (_RT_BOOL|SQOBJECT_CANBEFALSE),
OT_STRING = (_RT_STRING|SQOBJECT_REF_COUNTED),
OT_TABLE = (_RT_TABLE|SQOBJECT_REF_COUNTED|SQOBJECT_DELEGABLE),
OT_ARRAY = (_RT_ARRAY|SQOBJECT_REF_COUNTED),
OT_USERDATA = (_RT_USERDATA|SQOBJECT_REF_COUNTED|SQOBJECT_DELEGABLE),
OT_CLOSURE = (_RT_CLOSURE|SQOBJECT_REF_COUNTED),
OT_NATIVECLOSURE = (_RT_NATIVECLOSURE|SQOBJECT_REF_COUNTED),
OT_GENERATOR = (_RT_GENERATOR|SQOBJECT_REF_COUNTED),
OT_USERPOINTER = _RT_USERPOINTER,
OT_THREAD = (_RT_THREAD|SQOBJECT_REF_COUNTED) ,
OT_FUNCPROTO = (_RT_FUNCPROTO|SQOBJECT_REF_COUNTED), //internal usage only
OT_CLASS = (_RT_CLASS|SQOBJECT_REF_COUNTED),
OT_INSTANCE = (_RT_INSTANCE|SQOBJECT_REF_COUNTED|SQOBJECT_DELEGABLE),
OT_WEAKREF = (_RT_WEAKREF|SQOBJECT_REF_COUNTED)
}SQObjectType;
#define ISREFCOUNTED(t) (t&SQOBJECT_REF_COUNTED)
typedef union tagSQObjectValue
{
struct SQTable *pTable;
struct SQArray *pArray;
struct SQClosure *pClosure;
struct SQGenerator *pGenerator;
struct SQNativeClosure *pNativeClosure;
struct SQString *pString;
struct SQUserData *pUserData;
SQInteger nInteger;
SQFloat fFloat;
SQUserPointer pUserPointer;
struct SQFunctionProto *pFunctionProto;
struct SQRefCounted *pRefCounted;
struct SQDelegable *pDelegable;
struct SQVM *pThread;
struct SQClass *pClass;
struct SQInstance *pInstance;
struct SQWeakRef *pWeakRef;
SQRawObjectVal raw;
}SQObjectValue;
typedef struct tagSQObject
{
SQObjectType _type;
SQObjectValue _unVal;
}SQObject;
typedef struct tagSQStackInfos{
const SQChar* funcname;
const SQChar* source;
SQInteger line;
}SQStackInfos;
typedef struct SQVM* HSQUIRRELVM;
typedef SQObject HSQOBJECT;
typedef SQInteger (*SQFUNCTION)(HSQUIRRELVM);
typedef SQInteger (*SQRELEASEHOOK)(SQUserPointer,SQInteger size);
typedef void (*SQCOMPILERERROR)(HSQUIRRELVM,const SQChar * /*desc*/,const SQChar * /*source*/,SQInteger /*line*/,SQInteger /*column*/);
typedef void (*SQPRINTFUNCTION)(HSQUIRRELVM,const SQChar * ,...);
typedef SQInteger (*SQWRITEFUNC)(SQUserPointer,SQUserPointer,SQInteger);
typedef SQInteger (*SQREADFUNC)(SQUserPointer,SQUserPointer,SQInteger);
typedef SQInteger (*SQLEXREADFUNC)(SQUserPointer);
typedef struct tagSQRegFunction{
const SQChar *name;
SQFUNCTION f;
SQInteger nparamscheck;
const SQChar *typemask;
}SQRegFunction;
typedef struct tagSQFunctionInfo {
SQUserPointer funcid;
const SQChar *name;
const SQChar *source;
}SQFunctionInfo;
/*vm*/
SQUIRREL_API HSQUIRRELVM sq_open(SQInteger initialstacksize);
SQUIRREL_API HSQUIRRELVM sq_newthread(HSQUIRRELVM friendvm, SQInteger initialstacksize);
SQUIRREL_API void sq_seterrorhandler(HSQUIRRELVM v);
SQUIRREL_API void sq_close(HSQUIRRELVM v);
SQUIRREL_API void sq_setforeignptr(HSQUIRRELVM v,SQUserPointer p);
SQUIRREL_API SQUserPointer sq_getforeignptr(HSQUIRRELVM v);
SQUIRREL_API void sq_setprintfunc(HSQUIRRELVM v, SQPRINTFUNCTION printfunc);
SQUIRREL_API SQPRINTFUNCTION sq_getprintfunc(HSQUIRRELVM v);
SQUIRREL_API SQRESULT sq_suspendvm(HSQUIRRELVM v);
SQUIRREL_API SQRESULT sq_wakeupvm(HSQUIRRELVM v,SQBool resumedret,SQBool retval,SQBool raiseerror,SQBool throwerror);
SQUIRREL_API SQInteger sq_getvmstate(HSQUIRRELVM v);
/*compiler*/
SQUIRREL_API SQRESULT sq_compile(HSQUIRRELVM v,SQLEXREADFUNC read,SQUserPointer p,const SQChar *sourcename,SQBool raiseerror);
SQUIRREL_API SQRESULT sq_compilebuffer(HSQUIRRELVM v,const SQChar *s,SQInteger size,const SQChar *sourcename,SQBool raiseerror);
SQUIRREL_API void sq_enabledebuginfo(HSQUIRRELVM v, SQBool enable);
SQUIRREL_API void sq_notifyallexceptions(HSQUIRRELVM v, SQBool enable);
SQUIRREL_API void sq_setcompilererrorhandler(HSQUIRRELVM v,SQCOMPILERERROR f);
/*stack operations*/
SQUIRREL_API void sq_push(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API void sq_pop(HSQUIRRELVM v,SQInteger nelemstopop);
SQUIRREL_API void sq_poptop(HSQUIRRELVM v);
SQUIRREL_API void sq_remove(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQInteger sq_gettop(HSQUIRRELVM v);
SQUIRREL_API void sq_settop(HSQUIRRELVM v,SQInteger newtop);
SQUIRREL_API void sq_reservestack(HSQUIRRELVM v,SQInteger nsize);
SQUIRREL_API SQInteger sq_cmp(HSQUIRRELVM v);
SQUIRREL_API void sq_move(HSQUIRRELVM dest,HSQUIRRELVM src,SQInteger idx);
/*object creation handling*/
SQUIRREL_API SQUserPointer sq_newuserdata(HSQUIRRELVM v,SQUnsignedInteger size);
SQUIRREL_API void sq_newtable(HSQUIRRELVM v);
SQUIRREL_API void sq_newarray(HSQUIRRELVM v,SQInteger size);
SQUIRREL_API void sq_newclosure(HSQUIRRELVM v,SQFUNCTION func,SQUnsignedInteger nfreevars);
SQUIRREL_API SQRESULT sq_setparamscheck(HSQUIRRELVM v,SQInteger nparamscheck,const SQChar *typemask);
SQUIRREL_API SQRESULT sq_bindenv(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API void sq_pushstring(HSQUIRRELVM v,const SQChar *s,SQInteger len);
SQUIRREL_API void sq_pushfloat(HSQUIRRELVM v,SQFloat f);
SQUIRREL_API void sq_pushinteger(HSQUIRRELVM v,SQInteger n);
SQUIRREL_API void sq_pushbool(HSQUIRRELVM v,SQBool b);
SQUIRREL_API void sq_pushuserpointer(HSQUIRRELVM v,SQUserPointer p);
SQUIRREL_API void sq_pushnull(HSQUIRRELVM v);
SQUIRREL_API SQObjectType sq_gettype(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQInteger sq_getsize(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_getbase(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQBool sq_instanceof(HSQUIRRELVM v);
SQUIRREL_API void sq_tostring(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API void sq_tobool(HSQUIRRELVM v, SQInteger idx, SQBool *b);
SQUIRREL_API SQRESULT sq_getstring(HSQUIRRELVM v,SQInteger idx,const SQChar **c);
SQUIRREL_API SQRESULT sq_getinteger(HSQUIRRELVM v,SQInteger idx,SQInteger *i);
SQUIRREL_API SQRESULT sq_getfloat(HSQUIRRELVM v,SQInteger idx,SQFloat *f);
SQUIRREL_API SQRESULT sq_getbool(HSQUIRRELVM v,SQInteger idx,SQBool *b);
SQUIRREL_API SQRESULT sq_getthread(HSQUIRRELVM v,SQInteger idx,HSQUIRRELVM *thread);
SQUIRREL_API SQRESULT sq_getuserpointer(HSQUIRRELVM v,SQInteger idx,SQUserPointer *p);
SQUIRREL_API SQRESULT sq_getuserdata(HSQUIRRELVM v,SQInteger idx,SQUserPointer *p,SQUserPointer *typetag);
SQUIRREL_API SQRESULT sq_settypetag(HSQUIRRELVM v,SQInteger idx,SQUserPointer typetag);
SQUIRREL_API SQRESULT sq_gettypetag(HSQUIRRELVM v,SQInteger idx,SQUserPointer *typetag);
SQUIRREL_API void sq_setreleasehook(HSQUIRRELVM v,SQInteger idx,SQRELEASEHOOK hook);
SQUIRREL_API SQChar *sq_getscratchpad(HSQUIRRELVM v,SQInteger minsize);
SQUIRREL_API SQRESULT sq_getfunctioninfo(HSQUIRRELVM v,SQInteger idx,SQFunctionInfo *fi);
SQUIRREL_API SQRESULT sq_getclosureinfo(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger *nparams,SQUnsignedInteger *nfreevars);
SQUIRREL_API SQRESULT sq_setnativeclosurename(HSQUIRRELVM v,SQInteger idx,const SQChar *name);
SQUIRREL_API SQRESULT sq_setinstanceup(HSQUIRRELVM v, SQInteger idx, SQUserPointer p);
SQUIRREL_API SQRESULT sq_getinstanceup(HSQUIRRELVM v, SQInteger idx, SQUserPointer *p,SQUserPointer typetag);
SQUIRREL_API SQRESULT sq_setclassudsize(HSQUIRRELVM v, SQInteger idx, SQInteger udsize);
SQUIRREL_API SQRESULT sq_newclass(HSQUIRRELVM v,SQBool hasbase);
SQUIRREL_API SQRESULT sq_createinstance(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_setattributes(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_getattributes(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_getclass(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API void sq_weakref(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_getdefaultdelegate(HSQUIRRELVM v,SQObjectType t);
/*object manipulation*/
SQUIRREL_API void sq_pushroottable(HSQUIRRELVM v);
SQUIRREL_API void sq_pushregistrytable(HSQUIRRELVM v);
SQUIRREL_API void sq_pushconsttable(HSQUIRRELVM v);
SQUIRREL_API SQRESULT sq_setroottable(HSQUIRRELVM v);
SQUIRREL_API SQRESULT sq_setconsttable(HSQUIRRELVM v);
SQUIRREL_API SQRESULT sq_newslot(HSQUIRRELVM v, SQInteger idx, SQBool bstatic);
SQUIRREL_API SQRESULT sq_deleteslot(HSQUIRRELVM v,SQInteger idx,SQBool pushval);
SQUIRREL_API SQRESULT sq_set(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_get(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_rawget(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_rawset(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_rawdeleteslot(HSQUIRRELVM v,SQInteger idx,SQBool pushval);
SQUIRREL_API SQRESULT sq_arrayappend(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_arraypop(HSQUIRRELVM v,SQInteger idx,SQBool pushval);
SQUIRREL_API SQRESULT sq_arrayresize(HSQUIRRELVM v,SQInteger idx,SQInteger newsize);
SQUIRREL_API SQRESULT sq_arrayreverse(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_arrayremove(HSQUIRRELVM v,SQInteger idx,SQInteger itemidx);
SQUIRREL_API SQRESULT sq_arrayinsert(HSQUIRRELVM v,SQInteger idx,SQInteger destpos);
SQUIRREL_API SQRESULT sq_setdelegate(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_getdelegate(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_clone(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_setfreevariable(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger nval);
SQUIRREL_API SQRESULT sq_next(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_getweakrefval(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_clear(HSQUIRRELVM v,SQInteger idx);
/*calls*/
SQUIRREL_API SQRESULT sq_call(HSQUIRRELVM v,SQInteger params,SQBool retval,SQBool raiseerror);
SQUIRREL_API SQRESULT sq_resume(HSQUIRRELVM v,SQBool retval,SQBool raiseerror);
SQUIRREL_API const SQChar *sq_getlocal(HSQUIRRELVM v,SQUnsignedInteger level,SQUnsignedInteger idx);
SQUIRREL_API const SQChar *sq_getfreevariable(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger nval);
SQUIRREL_API SQRESULT sq_throwerror(HSQUIRRELVM v,const SQChar *err);
SQUIRREL_API void sq_reseterror(HSQUIRRELVM v);
SQUIRREL_API void sq_getlasterror(HSQUIRRELVM v);
/*raw object handling*/
SQUIRREL_API SQRESULT sq_getstackobj(HSQUIRRELVM v,SQInteger idx,HSQOBJECT *po);
SQUIRREL_API void sq_pushobject(HSQUIRRELVM v,HSQOBJECT obj);
SQUIRREL_API void sq_addref(HSQUIRRELVM v,HSQOBJECT *po);
SQUIRREL_API SQBool sq_release(HSQUIRRELVM v,HSQOBJECT *po);
SQUIRREL_API void sq_resetobject(HSQOBJECT *po);
SQUIRREL_API const SQChar *sq_objtostring(HSQOBJECT *o);
SQUIRREL_API SQBool sq_objtobool(HSQOBJECT *o);
SQUIRREL_API SQInteger sq_objtointeger(HSQOBJECT *o);
SQUIRREL_API SQFloat sq_objtofloat(HSQOBJECT *o);
SQUIRREL_API SQRESULT sq_getobjtypetag(HSQOBJECT *o,SQUserPointer * typetag);
/*GC*/
SQUIRREL_API SQInteger sq_collectgarbage(HSQUIRRELVM v);
/*serialization*/
SQUIRREL_API SQRESULT sq_writeclosure(HSQUIRRELVM vm,SQWRITEFUNC writef,SQUserPointer up);
SQUIRREL_API SQRESULT sq_readclosure(HSQUIRRELVM vm,SQREADFUNC readf,SQUserPointer up);
#if defined(VSCRIPT_DLL_EXPORT) || defined(VSQUIRREL_TEST)
#define sq_malloc malloc
#define sq_realloc(p,oldsize,size) realloc(p, size)
#define sq_free(p,size) free(p)
#else
/*mem allocation*/
SQUIRREL_API void *sq_malloc(SQUnsignedInteger size);
SQUIRREL_API void *sq_realloc(void* p,SQUnsignedInteger oldsize,SQUnsignedInteger newsize);
SQUIRREL_API void sq_free(void *p,SQUnsignedInteger size);
#endif
/*debug*/
SQUIRREL_API SQRESULT sq_stackinfos(HSQUIRRELVM v,SQInteger level,SQStackInfos *si);
SQUIRREL_API void sq_setdebughook(HSQUIRRELVM v);
/*UTILITY MACRO*/
#define sq_isnumeric(o) ((o)._type&SQOBJECT_NUMERIC)
#define sq_istable(o) ((o)._type==OT_TABLE)
#define sq_isarray(o) ((o)._type==OT_ARRAY)
#define sq_isfunction(o) ((o)._type==OT_FUNCPROTO)
#define sq_isclosure(o) ((o)._type==OT_CLOSURE)
#define sq_isgenerator(o) ((o)._type==OT_GENERATOR)
#define sq_isnativeclosure(o) ((o)._type==OT_NATIVECLOSURE)
#define sq_isstring(o) ((o)._type==OT_STRING)
#define sq_isinteger(o) ((o)._type==OT_INTEGER)
#define sq_isfloat(o) ((o)._type==OT_FLOAT)
#define sq_isuserpointer(o) ((o)._type==OT_USERPOINTER)
#define sq_isuserdata(o) ((o)._type==OT_USERDATA)
#define sq_isthread(o) ((o)._type==OT_THREAD)
#define sq_isnull(o) ((o)._type==OT_NULL)
#define sq_isclass(o) ((o)._type==OT_CLASS)
#define sq_isinstance(o) ((o)._type==OT_INSTANCE)
#define sq_isbool(o) ((o)._type==OT_BOOL)
#define sq_isweakref(o) ((o)._type==OT_WEAKREF)
#define sq_type(o) ((o)._type)
/* deprecated */
#define sq_createslot(v,n) sq_newslot(v,n,SQFalse)
#define SQ_OK (0)
#define SQ_ERROR (-1)
#define SQ_FAILED(res) (res<0)
#define SQ_SUCCEEDED(res) (res>=0)
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*_SQUIRREL_H_*/

View File

@@ -0,0 +1,18 @@
SQUIRREL= ..
OUT= ./minimalSqPlus
INCDIRS= -I$(SQUIRREL)/include -I. -I$(SQUIRREL)/sqlibs -I$(SQUIRREL)/sqplus
LIBDIR= -L$(SQUIRREL)/lib
#LIBS= -lsquirrel -lsqstdlib -lsqplus
LIBS= -lsqplus -lsquirrel -lsqstdlib
SRCS= minimalSqPlus.cpp
all: minimalSqPlus
FORCE: ;
minimalSqPlus: FORCE
# g++ -fno-rtti -o $(OUT) $(SRCS) $(INCDIRS) $(LIBDIR) $(LIBS)
g++ -O3 -Wall -o $(OUT) $(SRCS) $(INCDIRS) $(LIBDIR) $(LIBS)
#g++ -O3 -fno-rtti -Os -o $(OUT) $(SRCS) $(INCDIRS) $(LIBDIR) $(LIBS)

View File

@@ -0,0 +1,118 @@
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
<FileVersion major="1" minor="1"/>
<Project>
<Option title="minimalSqPlus"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option compiler="0"/>
<Build>
<Target title="Debug">
<Option output="Debug\minimalSqPlus.exe"/>
<Option working_dir="."/>
<Option object_output="Debug"/>
<Option deps_output=".deps"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-W"/>
<Add option="-O0"/>
<Add option="-DWIN32"/>
<Add option="-D_DEBUG"/>
<Add option="-D_CONSOLE"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add directory="..\include"/>
<Add directory="..\sqplus"/>
</Compiler>
<Linker>
<Add library="..\lib\libsqplusD.a"/>
<Add library="..\lib\libsquirrelD.a"/>
<Add library="..\lib\libsqstdlibD.a"/>
</Linker>
</Target>
<Target title="Release">
<Option output="Release\minimalSqPlus.exe"/>
<Option working_dir="."/>
<Option object_output="Release"/>
<Option deps_output=".deps"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-W"/>
<Add option="-g"/>
<Add option="-DWIN32"/>
<Add option="-DNDEBUG"/>
<Add option="-D_CONSOLE"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add directory="..\include"/>
<Add directory="..\sqplus"/>
</Compiler>
<Linker>
<Add library="..\lib\libsqplus.a"/>
<Add library="..\lib\libsquirrel.a"/>
<Add library="..\lib\libsqstdlib.a"/>
</Linker>
</Target>
<Target title="Debug - Unicode">
<Option output="Debug - Unicode\minimalSqPlus.exe"/>
<Option working_dir="."/>
<Option object_output="Debug - Unicode"/>
<Option deps_output=".deps"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-W"/>
<Add option="-O0"/>
<Add option="-DWIN32"/>
<Add option="-D_DEBUG"/>
<Add option="-D_CONSOLE"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add option="-D_CRT_NON_CONFORMING_SWPRINTFS"/>
<Add directory="..\include"/>
<Add directory="..\sqplus"/>
</Compiler>
<Linker>
<Add library="..\lib\libsqplusDU.a"/>
<Add library="..\lib\libsqstdlibDU.a"/>
<Add library="..\lib\libsquirrelDU.a"/>
</Linker>
</Target>
<Target title="Release - Unicode">
<Option output="Release - Unicode\minimalSqPlus.exe"/>
<Option working_dir="."/>
<Option object_output="Release - Unicode"/>
<Option deps_output=".deps"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-W"/>
<Add option="-g"/>
<Add option="-DWIN32"/>
<Add option="-DNDEBUG"/>
<Add option="-D_CONSOLE"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add option="-D_CRT_NON_CONFORMING_SWPRINTFS"/>
<Add directory="..\include"/>
<Add directory="..\sqplus"/>
</Compiler>
<Linker>
<Add library="..\lib\libsqplusU.a"/>
<Add library="..\lib\libsqstdlibU.a"/>
<Add library="..\lib\libsquirrelU.a"/>
</Linker>
</Target>
</Build>
<Unit filename="minimalSqPlus.cpp">
<Option compilerVar="CPP"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
</Project>
</CodeBlocks_project_file>

View File

@@ -0,0 +1,162 @@
// minimalSqPlus.cpp
// A minimal example and an example with a simple class.
// Example for use with the remote debugger is also shown.
// Created 10/08/05, John Schultz
// Free for any use.
#include <stdio.h>
#include <stdarg.h>
#include "sqplus.h"
using namespace SqPlus;
// Define MINIMAL_EXAMPLE for minimal HelloWorld example.
//#define MINIMAL_EXAMPLE
// Define USE_REMOTE_DEBUGGER to use the remote debugger. See the example and docs in the sqdbg directory for
// more information.
//#define USE_REMOTE_DEBUGGER // Remote debugger must be started after the program is launched.
#ifdef USE_REMOTE_DEBUGGER
#include "sqrdbg.h"
#endif
// The following pragmas can be used to link the correct library for Debug/Release builds
// without requiring the application to include the associated Squirrel projects.
// (The libraries must be created before compiling this example).
// Set SQ_REL_PATH as needed for your application.
#define SQ_REL_PATH "../"
#ifdef UNICODE
#define LIB "U.lib"
#else
#define LIB ".lib"
#endif
#ifdef _MSC_VER
#ifdef _DEBUG
#pragma comment(lib,SQ_REL_PATH "lib/squirrelD" LIB)
#pragma comment(lib,SQ_REL_PATH "lib/sqstdlibD" LIB)
#ifdef USE_REMOTE_DEBUGGER
#pragma comment(lib,SQ_REL_PATH "lib/sqdbglibD" LIB)
#endif
#pragma comment(lib,SQ_REL_PATH "lib/sqplusD" LIB)
#else // Release
#pragma comment(lib,SQ_REL_PATH "lib/squirrel" LIB)
#pragma comment(lib,SQ_REL_PATH "lib/sqstdlib" LIB)
#ifdef USE_REMOTE_DEBUGGER
#pragma comment(lib,SQ_REL_PATH "lib/sqdbglib" LIB)
#endif
#pragma comment(lib,SQ_REL_PATH "lib/sqplus" LIB)
#endif
#endif
#ifdef USE_REMOTE_DEBUGGER
void printSQDBGError(HSQUIRRELVM v) {
const SQChar *err;
sq_getlasterror(v);
if(SQ_SUCCEEDED(sq_getstring(v,-1,&err))) {
scprintf(_T("SQDBG error : %s"),err);
}else {
scprintf(_T("SQDBG error"),err);
} // if
sq_poptop(v);
} // printSQDBGError
#endif
static void printFunc(HSQUIRRELVM v,const SQChar * s,...) {
static SQChar temp[2048];
va_list vl;
va_start(vl,s);
scvsprintf( temp,s,vl);
SCPUTS(temp);
va_end(vl);
} // printFunc
class MyClass {
public:
int classVal;
// See examples in testSqPlus2.cpp for passing arguments to the constructor (including variable arguments).
MyClass() : classVal(123) {}
bool process(int iVal,const SQChar * sVal) {
scprintf(_T("classVal: %d, iVal: %d, sVal %s\n"),classVal,iVal,sVal);
classVal += iVal;
return iVal > 1;
} // process
};
#ifdef MINIMAL_EXAMPLE
int main(int argc,char * argv[]) {
SquirrelVM::Init();
SquirrelObject helloWorld = SquirrelVM::CompileBuffer(_T("print(\"Hello World\");"));
SquirrelVM::RunScript(helloWorld);
SquirrelVM::Shutdown();
scprintf(_T("Press RETURN to exit."));
getchar();
} // main
#else
int main(int argc,char * argv[]) {
SquirrelVM::Init();
// This example shows how to redirect print output to your own custom
// print function (the default handler prints to stdout).
sq_setprintfunc(SquirrelVM::GetVMPtr(),printFunc);
#ifdef USE_REMOTE_DEBUGGER
HSQREMOTEDBG rdbg = sq_rdbg_init(SquirrelVM::GetVMPtr(),1234,SQTrue);
if(rdbg) {
// Enable debug info generation (for the compiler).
sq_enabledebuginfo(SquirrelVM::GetVMPtr(),SQTrue);
scprintf(_T("Waiting for SQDBG connection..."));
// Suspends the app until the debugger client connects.
if(SQ_SUCCEEDED(sq_rdbg_waitforconnections(rdbg))) {
printf("SQDBG: connected.\n");
} // if
} else {
printSQDBGError(SquirrelVM::GetVMPtr());
return 0;
} // if
#endif
// See examples in testSqPlus2.cpp for script read-only vars, constants,
// enums, static/global functions, variable arguments, constructor arguments,
// passing/returning classes/structs by value or by address, etc.
SQClassDef<MyClass>(_T("MyClass")).
func(&MyClass::process,_T("process")).
var(&MyClass::classVal,_T("classVal"));
SquirrelObject helloSqPlus = SquirrelVM::CompileBuffer(_T("\
local myClass = MyClass(); \n\
local rVal = myClass.process(1,\"MyClass1\"); \n\
print(\"Returned: \"+(rVal ? \"true\" : \"false\")); \n\
rVal = myClass.process(2,\"MyClass2\"); \n\
print(\"Returned: \"+(rVal ? \"true\" : \"false\")); \n\
print(\"classVal: \"+myClass.classVal); \n\
"));
try {
SquirrelVM::RunScript(helloSqPlus);
} catch (SquirrelError & e) {
scprintf(_T("Error: %s, %s\n"),e.desc,_T("Squirrel::helloSqPlus"));
} // catch
#ifdef USE_REMOTE_DEBUGGER
if (rdbg) {
sq_rdbg_shutdown(rdbg);
} // if
#endif
SquirrelVM::Shutdown();
scprintf(_T("Press RETURN to exit."));
getchar();
return 0;
} // main
#endif
// minimalSqPlus.cpp

View File

@@ -0,0 +1,347 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="minimalSqPlus"
ProjectGUID="{C45BEE7F-0E5E-488B-B7C9-3F4A4385DD8B}"
RootNamespace="minimalSqPlus"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/minimalSqPlus.exe"
LinkIncremental="2"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/minimalSqPlus.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/minimalSqPlus.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/minimalSqPlus.exe"
LinkIncremental="2"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/minimalSqPlus.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/minimalSqPlus.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\minimalSqPlus.cpp"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,221 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="minimalSqPlus"
ProjectGUID="{C45BEE7F-0E5E-488B-B7C9-3F4A4385DD8B}"
RootNamespace="minimalSqPlus"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/minimalSqPlus.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/minimalSqPlus.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/minimalSqPlus.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/minimalSqPlus.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/minimalSqPlus.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../sqplus"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/minimalSqPlus.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\minimalSqPlus.cpp">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1 @@
This directory contains the Squirrel 2.1 distribution and the SqPlus binding sytem, acquired 1/18/2008

View File

@@ -0,0 +1,23 @@
/*
*
* Original Javascript version by David Hedbor(http://www.bagley.org/~doug/shootout/)
*
*/
function Ack(M, N) {
if (M == 0) return( N + 1 );
if (N == 0) return( Ack(M - 1, 1) );
return( Ack(M - 1, Ack(M, (N - 1))) );
}
local n;
if(ARGS.len()!=0) {
n = ARGS[0].tointeger();
if(n < 1) n = 1;
} else {
n = 1;
}
print("n="+n+"\n");
print("Ack(3,"+ n+ "):"+ Ack(3, n));

View File

@@ -0,0 +1,29 @@
/*
*
* Original Javascript version by David Hedbor(http://www.bagley.org/~doug/shootout/)
*
*/
local n, i, k;
if(ARGS.len()!=0) {
n = ARGS[0].tointeger();
if(n < 1) n = 1;
} else {
n = 1;
}
local x = []; x.resize(n);
local y = []; y.resize(n);
for (i = 0; i < n; i+=1) {
x[i] = i + 1;
y[i] = 0;
}
for (k = 0 ; k < n; k+=1) {
for (i = n-1; i >= 0; i-=1) {
y[i] = y[i]+ x[i];
}
}
print(y[0].tostring()+" "+y[n-1]);

View File

@@ -0,0 +1,49 @@
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
class BaseVector {
constructor(...)
{
if(vargc >= 3) {
x = vargv[0];
y = vargv[1];
z = vargv[2];
}
}
x = 0;
y = 0;
z = 0;
}
class Vector3 extends BaseVector {
function _add(other)
{
if(other instanceof this.getclass())
return ::Vector3(x+other.x,y+other.y,z+other.z);
else
throw "wrong parameter";
}
function Print()
{
::print(x+","+y+","+z+"\n");
}
}
local v0 = Vector3(1,2,3)
local v1 = Vector3(11,12,13)
local v2 = v0 + v1;
v2.Print();
FakeNamespace <- {
Utils = {}
}
class FakeNamespace.Utils.SuperClass {
constructor()
{
::print("FakeNamespace.Utils.SuperClass")
}
}
local testy = FakeNamespace.Utils.SuperClass();

View File

@@ -0,0 +1,35 @@
class Foo {
//constructor
constructor(a)
{
testy = ["stuff",1,2,3];
}
//attributes of PrintTesty
</ test = "freakin attribute"/>
function PrintTesty()
{
foreach(i,val in testy)
{
::print("idx = "+i+" = "+val+" \n");
}
}
//attributes of testy
</ flippy = 10 , second = [1,2,3] />
testy = null;
}
foreach(member,val in Foo)
{
::print(member+"\n");
local attr;
if((attr = Foo.getattributes(member)) != null) {
foreach(i,v in attr)
{
::print("\t"+i+" = "+(typeof v)+"\n");
}
}
else {
::print("\t<no attributes>\n")
}
}

View File

@@ -0,0 +1,25 @@
function coroutine_test(a,b)
{
::print(a+" "+b+"\n");
local ret = ::suspend("suspend 1");
::print("the coroutine says "+ret+"\n");
ret = ::suspend("suspend 2");
::print("the coroutine says "+ret+"\n");
ret = ::suspend("suspend 3");
::print("the coroutine says "+ret+"\n");
return "I'm done"
}
local coro = ::newthread(coroutine_test);
local susparam = coro.call("test","coroutine"); //starts the coroutine
local i = 1;
do
{
::print("suspend passed ["+susparam+"]\n")
susparam = coro.wakeup("ciao "+i);
++i;
}while(coro.getstatus()=="suspended")
::print("return passed ["+susparam+"]\n")

View File

@@ -0,0 +1,52 @@
PEntity <- {
name="noname"
pos={x=0,y=0,z=0}
type="entity"
//methamethod
_typeof=function()
{
return type;
}
}
function PEntity::PrintPos()
{
::print("x="+pos.x+" y="+pos.y+" z="+pos.z+"\n");
}
function PEntity::new(name,pos)
{
local newentity=clone ::PEntity;
if(name)
newentity.name=name;
if(pos)
newentity.pos=pos;
return newentity;
}
PPlayer <- {
model="warrior.mdl"
weapon="fist"
health=100
armor=0
//overrides the parent type
type="player"
}
function PPlayer::new(name,pos)
{
local newplayer=delegate ::PEntity.new(name,pos) : clone ::PPlayer;
return newplayer;
}
local player=PPlayer.new("godzilla",{x=10,y=20,z=30});
::print("PLAYER NAME"+player.name+"\n");
::print("ENTITY TYPE"+typeof player+"\n");
player.PrintPos();
player.pos.x=123;
player.PrintPos();

View File

@@ -0,0 +1,15 @@
/*
*
* Original Javascript version by David Hedbor(http://www.bagley.org/~doug/shootout/)
*
*/
function fib(n)
{
if (n < 2) return 1
return fib(n-2) + fib(n-1)
}
local n = ARGS.len()!=0?ARGS[0].tointeger():1
print(fib(n)+"\n")

View File

@@ -0,0 +1,33 @@
function min(x,y)
return x<y?x:y;
function max(x,y)
return x>y?x:y;
if(min(100,200)>max(50,20))
print("I'm useless statement just to show up the if/else\n");
else
print("squirrel!!\n");
print("\n")
function typy(obj)
{
switch(typeof obj)
{
case "integer":
case "float":
return "is a number";
case "table":
case "array":
return "is a container";
default:
return "is other stuff"
}
}
local a=1,b={},c=function(a,b){return a+b;}
print("a "+typy(a)+"\n");
print("b "+typy(b)+"\n");
print("c "+typy(c)+"\n");

View File

@@ -0,0 +1,42 @@
/*
*Random number function from The Great Computer Language shootout
*converted to a generator func
*/
function gen_random(max) {
local last=42
local IM = 139968;
local IA = 3877;
local IC = 29573;
for(;;){ //loops forever
yield (max * (last = (last * IA + IC) % IM) / IM);
}
}
local randtor=gen_random(100);
print("RAND NUMBERS \n")
for(local i=0;i<10;i+=1)
print(">"+resume randtor+"\n");
print("FIBONACCI \n")
function fiboz(n)
{
local prev=0;
local curr=1;
yield 1;
for(local i=0;i<n-1;i+=1)
{
local res=prev+curr;
prev=curr;
yield curr=res;
}
return prev+curr;
}
foreach(val in fiboz(10))
{
::print(">"+val+"\n");
}

View File

@@ -0,0 +1 @@
print("Hello World!")

View File

@@ -0,0 +1,40 @@
/*translation of the list test from The Great Computer Language Shootout
*/
function compare_arr(a1,a2)
{
foreach(i,val in a1)
if(val!=a2[i])return null;
return 1;
}
function test()
{
local size=10000
local l1=[]; l1.resize(size);
for(local i=0;i<size;i+=1) l1[i]=i;
local l2=clone l1;
local l3=[]
l2.reverse();
while(l2.len()>0)
l3.append(l2.pop());
while(l3.len()>0)
l2.append(l3.pop());
l1.reverse();
if(compare_arr(l1,l2))
return l1.len();
return null;
}
local n = ARGS.len()!=0?ARGS[0].tointeger():1
for(local i=0;i<n;i+=1)
if(!test())
{
print("failed");
return;
}
print("oki doki");

View File

@@ -0,0 +1,32 @@
local arr=["one","two","three"]
::print("FOREACH\n");
foreach(i,val in arr)
{
::print("index ["+i+"]="+val+"\n");
}
::print("FOR\n");
for(local i=0;i<arr.len();i+=1)
{
::print("index ["+i+"]="+arr[i]+"\n");
}
::print("WHILE\n");
local i=0;
while(i<arr.len())
{
::print("index ["+i+"]="+arr[i]+"\n");
i+=1;
}
::print("DO WHILE\n");
local i=0;
do
{
::print("index ["+i+"]="+arr[i]+"\n");
i+=1;
}while(i<arr.len());

View File

@@ -0,0 +1,44 @@
/*
*
* Original Javascript version by David Hedbor(http://www.bagley.org/~doug/shootout/)
*
*/
local SIZE=30;
function mkmatrix(rows, cols) {
local i, j, count = 1;
local m = []; m.resize(rows);
for (i = 0; i < rows; i+=1) {
m[i] = [];m[i].resize(cols)
for (j = 0; j < cols; j+=1) {
m[i][j] = count+=1;
}
}
return m;
}
function mmult(rows, cols, m1, m2, m3) {
local i, j, k, val;
for (i = 0; i < rows; i+=1) {
for (j = 0; j < cols; j+=1) {
val = 0;
for (k = 0; k < cols; k+=1) {
val += m1[i][k] * m2[k][j];
}
m3[i][j] = val;
}
}
return m3;
}
local n = ARGS.len()!=0?ARGS[0].tointeger():1
local m1 = mkmatrix(SIZE, SIZE);
local m2 = mkmatrix(SIZE, SIZE);
local mm = mkmatrix(SIZE, SIZE);
for (local i = 0; i < n; i+=1) {
mmult(SIZE, SIZE, m1, m2, mm);
}
print(mm[0][0]+" "+mm[2][3]+" "+mm[3][2]+" "+mm[4][4]);

View File

@@ -0,0 +1,115 @@
local base_vec={
function _add(n)
{
return {
x=x+n.x,
y=y+n.y,
z=z+n.z,
}
}
function _sub(n)
{
return {
x=x-n.x,
y=y-n.y,
z=z-n.z,
}
}
function _div(n)
{
return {
x=x/n.x,
y=y/n.y,
z=z/n.z,
}
}
function _mul(n)
{
return {
x=x*n.x,
y=y*n.y,
z=z*n.z,
}
}
function _modulo(n)
{
return {
x=x%n,
y=y%n,
z=z%n,
}
}
function _typeof() {return "vector";}
function _get(key)
{
if(key==100)
{
return test_field;
}
},
function _set(key,val)
{
::print("key = "+key+"\n");
::print("val = "+val+"\n")
if(key==100)
{
return test_field=val;
}
}
test_field="nothing"
}
function vector(_x,_y,_z):(base_vec)
{
return delegate base_vec : {x=_x,y=_y,z=_z }
}
////////////////////////////////////////////////////////////
local v1=vector(1.5,2.5,3.5);
local v2=vector(1.5,2.5,3.5);
local r=v1+v2;
foreach(i,val in r)
{
print(i+" = "+val+"\n");
}
r=v1*v2;
foreach(i,val in r)
{
print(i+" = "+val+"\n");
}
r=v1/v2;
foreach(i,val in r)
{
print(i+" = "+val+"\n");
}
r=v1-v2;
foreach(i,val in r)
{
print(i+" = "+val+"\n");
}
r=v1%2;
foreach(i,val in r)
{
print(i+" = "+val+"\n");
}
print(v1[100]+"\n");
v1[100]="set SUCCEEDED";
print(v1[100]+"\n");
if(typeof v1=="vector")
print("<SUCCEEDED>\n");
else
print("<FAILED>\n");

View File

@@ -0,0 +1,61 @@
/*translation of the methcall test from The Great Computer Language Shootout
*/
Toggle <- {
bool=null
}
function Toggle::value() {
return bool;
}
function Toggle::activate() {
bool = !bool;
return this;
}
function Toggle::new(startstate) {
local newo=clone this;
newo.bool = startstate;
return newo;
}
NthToggle <- {
count_max=null
count=0
}
function NthToggle::new(start_state,max_counter)
{
local newo=delegate ::Toggle.new(start_state) : clone this;
newo.count_max <- max_counter
return newo;
}
function NthToggle::activate ()
{
count+=1
if (count >= count_max) {
bool = !bool;
count = 0;
}
return this;
}
local n = ARGS.len()!=0?ARGS[0].tointeger():1
local val = 1;
local toggle = Toggle.new(val);
for (local i=0; i<n; i+=1) {
val = toggle.activate().value();
}
print(toggle.value() ? "true\n" : "false\n");
val = 1;
local ntoggle = NthToggle.new(val, 3);
for (local i=0; i<n; i+=1) {
val = ntoggle.activate().value();
}
print(ntoggle.value() ? "true\n" : "false\n");

View File

@@ -0,0 +1,24 @@
function state1()
{
::suspend("state1");
return state2();
}
function state2()
{
::suspend("state2");
return state3();
}
function state3()
{
::suspend("state3");
return state1();
}
local statethread = ::newthread(state1)
::print(statethread.call()+"\n");
for(local i = 0; i < 10000; i++)
::print(statethread.wakeup()+"\n");

View File

@@ -0,0 +1,21 @@
SQUIRREL= ..
OUT= $(SQUIRREL)/bin/sq
INCZ= -I$(SQUIRREL)/include -I. -I$(SQUIRREL)/sqlibs
LIBZ= -L$(SQUIRREL)/lib
LIB= -lsquirrel -lsqstdlib
OBJS= sq.o
SRCS= sq.c
sq32:
g++ -O2 -fno-rtti -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
sqprof:
g++ -O2 -pg -fno-rtti -pie -gstabs -g3 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
sq64:
g++ -O2 -fno-rtti -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)

View File

@@ -0,0 +1,324 @@
/* see copyright notice in squirrel.h */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#if defined(_MSC_VER) && defined(_DEBUG)
#include <crtdbg.h>
#include <conio.h>
#endif
#include <squirrel.h>
#include <sqstdblob.h>
#include <sqstdsystem.h>
#include <sqstdio.h>
#include <sqstdmath.h>
#include <sqstdstring.h>
#include <sqstdaux.h>
#ifdef SQUNICODE
#define scfprintf fwprintf
#define scfopen _wfopen
#define scvprintf vwprintf
#else
#define scfprintf fprintf
#define scfopen fopen
#define scvprintf vprintf
#endif
void PrintVersionInfos();
#if defined(_MSC_VER) && defined(_DEBUG)
int MemAllocHook( int allocType, void *userData, size_t size, int blockType,
long requestNumber, const unsigned char *filename, int lineNumber)
{
// if(requestNumber==585)_asm int 3;
return 1;
}
#endif
SQInteger quit(HSQUIRRELVM v)
{
int *done;
sq_getuserpointer(v,-1,(SQUserPointer*)&done);
*done=1;
return 0;
}
void printfunc(HSQUIRRELVM v,const SQChar *s,...)
{
va_list vl;
va_start(vl, s);
scvprintf( s, vl);
va_end(vl);
}
void PrintVersionInfos()
{
scfprintf(stdout,_SC("%s %s (%d bits)\n"),SQUIRREL_VERSION,SQUIRREL_COPYRIGHT,sizeof(SQInteger)*8);
if(sizeof(SQFloat) != sizeof(float)) {
scfprintf(stdout,_SC("[%d bits floats]\n"),sizeof(SQFloat)*8);
}
}
void PrintUsage()
{
scfprintf(stderr,_SC("usage: sq <options> <scriptpath [args]>.\n")
_SC("Available options are:\n")
_SC(" -c compiles the file to bytecode(default output 'out.cnut')\n")
_SC(" -o specifies output file for the -c option\n")
_SC(" -c compiles only\n")
_SC(" -d generates debug infos\n")
_SC(" -v displays version infos\n")
_SC(" -h prints help\n"));
}
#define _INTERACTIVE 0
#define _DONE 2
//<<FIXME>> this func is a mess
int getargs(HSQUIRRELVM v,int argc, char* argv[])
{
int i;
int compiles_only = 0;
static SQChar temp[500];
const SQChar *ret=NULL;
char * output = NULL;
int lineinfo=0;
if(argc>1)
{
int arg=1,exitloop=0;
while(arg < argc && !exitloop)
{
if(argv[arg][0]=='-')
{
switch(argv[arg][1])
{
case 'd': //DEBUG(debug infos)
sq_enabledebuginfo(v,1);
break;
case 'c':
compiles_only = 1;
break;
case 'o':
if(arg < argc) {
arg++;
output = argv[arg];
}
break;
case 'v':
PrintVersionInfos();
return _DONE;
case 'h':
PrintVersionInfos();
PrintUsage();
return _DONE;
default:
PrintVersionInfos();
scprintf(_SC("unknown prameter '-%c'\n"),argv[arg][1]);
PrintUsage();
return _DONE;
}
}else break;
arg++;
}
// src file
if(arg<argc) {
const SQChar *filename=NULL;
#ifdef SQUNICODE
mbstowcs(temp,argv[arg],strlen(argv[arg]));
filename=temp;
#else
filename=argv[arg];
#endif
arg++;
sq_pushroottable(v);
sq_pushstring(v,_SC("ARGS"),-1);
sq_newarray(v,0);
for(i=arg;i<argc;i++)
{
const SQChar *a;
#ifdef SQUNICODE
int alen=(int)strlen(argv[i]);
a=sq_getscratchpad(v,(int)(alen*sizeof(SQChar)));
mbstowcs(sq_getscratchpad(v,-1),argv[i],alen);
sq_getscratchpad(v,-1)[alen] = _SC('\0');
#else
a=argv[i];
#endif
sq_pushstring(v,a,-1);
sq_arrayappend(v,-2);
}
sq_createslot(v,-3);
sq_pop(v,1);
if(compiles_only) {
if(SQ_SUCCEEDED(sqstd_loadfile(v,filename,SQTrue))){
SQChar *outfile = _SC("out.cnut");
if(output) {
#ifdef SQUNICODE
int len = (int)(strlen(output)+1);
mbstowcs(sq_getscratchpad(v,len*sizeof(SQChar)),output,len);
outfile = sq_getscratchpad(v,-1);
#else
outfile = output;
#endif
}
if(SQ_SUCCEEDED(sqstd_writeclosuretofile(v,outfile)))
return _DONE;
}
}
else {
if(SQ_SUCCEEDED(sqstd_dofile(v,filename,SQFalse,SQTrue))) {
return _DONE;
}
}
//if this point is reached an error occured
{
const SQChar *err;
sq_getlasterror(v);
if(SQ_SUCCEEDED(sq_getstring(v,-1,&err))) {
scprintf(_SC("Error [%s]\n"),err);
return _DONE;
}
}
}
}
return _INTERACTIVE;
}
void Interactive(HSQUIRRELVM v)
{
#define MAXINPUT 1024
SQChar buffer[MAXINPUT];
SQInteger blocks =0;
SQInteger string=0;
SQInteger retval=0;
SQInteger done=0;
PrintVersionInfos();
sq_pushroottable(v);
sq_pushstring(v,_SC("quit"),-1);
sq_pushuserpointer(v,&done);
sq_newclosure(v,quit,1);
sq_setparamscheck(v,1,NULL);
sq_createslot(v,-3);
sq_pop(v,1);
while (!done)
{
SQInteger i = 0;
scprintf(_SC("\nsq>"));
for(;;) {
int c;
if(done)return;
c = getchar();
if (c == _SC('\n')) {
if (i>0 && buffer[i-1] == _SC('\\'))
{
buffer[i-1] = _SC('\n');
}
else if(blocks==0)break;
buffer[i++] = _SC('\n');
}
else if (c==_SC('}')) {blocks--; buffer[i++] = (SQChar)c;}
else if(c==_SC('{') && !string){
blocks++;
buffer[i++] = (SQChar)c;
}
else if(c==_SC('"') || c==_SC('\'')){
string=!string;
buffer[i++] = (SQChar)c;
}
else if (i >= MAXINPUT-1) {
scfprintf(stderr, _SC("sq : input line too long\n"));
break;
}
else{
buffer[i++] = (SQChar)c;
}
}
buffer[i] = _SC('\0');
if(buffer[0]==_SC('=')){
scsprintf(sq_getscratchpad(v,MAXINPUT),_SC("return (%s)"),&buffer[1]);
memcpy(buffer,sq_getscratchpad(v,-1),(scstrlen(sq_getscratchpad(v,-1))+1)*sizeof(SQChar));
retval=1;
}
i=scstrlen(buffer);
if(i>0){
SQInteger oldtop=sq_gettop(v);
if(SQ_SUCCEEDED(sq_compilebuffer(v,buffer,i,_SC("interactive console"),SQTrue))){
sq_pushroottable(v);
if(SQ_SUCCEEDED(sq_call(v,1,retval,SQTrue)) && retval){
scprintf(_SC("\n"));
sq_pushroottable(v);
sq_pushstring(v,_SC("print"),-1);
sq_get(v,-2);
sq_pushroottable(v);
sq_push(v,-4);
sq_call(v,2,SQFalse,SQTrue);
retval=0;
scprintf(_SC("\n"));
}
}
sq_settop(v,oldtop);
}
}
}
int main(int argc, char* argv[])
{
HSQUIRRELVM v;
const SQChar *filename=NULL;
#if defined(_MSC_VER) && defined(_DEBUG)
_CrtSetAllocHook(MemAllocHook);
#endif
v=sq_open(1024);
sq_setprintfunc(v,printfunc);
sq_pushroottable(v);
sqstd_register_bloblib(v);
sqstd_register_iolib(v);
sqstd_register_systemlib(v);
sqstd_register_mathlib(v);
sqstd_register_stringlib(v);
//aux library
//sets error handlers
sqstd_seterrorhandlers(v);
//gets arguments
switch(getargs(v,argc,argv))
{
case _INTERACTIVE:
Interactive(v);
break;
case _DONE:
default:
break;
}
sq_close(v);
#if defined(_MSC_VER) && defined(_DEBUG)
_getch();
_CrtMemDumpAllObjectsSince( NULL );
#endif
return 0;
}

View File

@@ -0,0 +1,129 @@
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
<FileVersion major="1" minor="1"/>
<Project>
<Option title="sq"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option compiler="0"/>
<Build>
<Target title="Release">
<Option output="..\bin\sq.exe"/>
<Option working_dir="."/>
<Option object_output="Release"/>
<Option deps_output=".deps"/>
<Option external_deps="..\lib\libsquirrel.a;..\lib\libsqstdlib.a;"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-DWIN32"/>
<Add option="-DNDEBUG"/>
<Add option="-D_CONSOLE"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add option="-W"/>
<Add option="-O2"/>
<Add directory="..\include"/>
<Add directory="..\sqstdlib"/>
</Compiler>
<Linker>
<Add library="..\lib\libsquirrel.a"/>
<Add library="..\lib\libsqstdlib.a"/>
<Add directory="..\lib"/>
</Linker>
</Target>
<Target title="Debug">
<Option output="..\bin\sqD.exe"/>
<Option working_dir="."/>
<Option object_output="Debug"/>
<Option deps_output=".deps"/>
<Option external_deps="..\lib\libsquirrelD.a;..\lib\libsqstdlibD.a;"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-DWIN32"/>
<Add option="-D_DEBUG"/>
<Add option="-D_CONSOLE"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add option="-W"/>
<Add option="-O0"/>
<Add directory="..\include"/>
<Add directory="..\sqstdlib"/>
</Compiler>
<Linker>
<Add library="..\lib\libsquirrelD.a"/>
<Add library="..\lib\libsqstdlibD.a"/>
<Add directory="..\lib"/>
</Linker>
</Target>
<Target title="Debug - Unicode">
<Option output="..\bin\sqDU.exe"/>
<Option working_dir="."/>
<Option object_output="Debug - Unicode"/>
<Option deps_output=".deps"/>
<Option external_deps="..\lib\libsquirrelDU.a;..\lib\libsqstdlibDU.a;"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-DWIN32"/>
<Add option="-D_DEBUG"/>
<Add option="-D_CONSOLE"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add option="-W"/>
<Add option="-O0"/>
<Add directory="..\include"/>
<Add directory="..\sqstdlib"/>
</Compiler>
<Linker>
<Add library="..\lib\libsquirrelDU.a"/>
<Add library="..\lib\libsqstdlibDU.a"/>
<Add directory="..\lib"/>
</Linker>
</Target>
<Target title="Release - Unicode">
<Option output="..\bin\sqU.exe"/>
<Option working_dir="."/>
<Option object_output="Release - Unicode"/>
<Option deps_output=".deps"/>
<Option external_deps="..\lib\libsquirrelU.a;..\lib\libsqstdlibU.a;"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-DWIN32"/>
<Add option="-DNDEBUG"/>
<Add option="-D_CONSOLE"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add option="-W"/>
<Add option="-O2"/>
<Add directory="..\include"/>
<Add directory="..\sqstdlib"/>
</Compiler>
<Linker>
<Add library="..\lib\libsquirrelU.a"/>
<Add library="..\lib\libsqstdlibU.a"/>
<Add directory="..\lib"/>
</Linker>
</Target>
</Build>
<Unit filename="..\etc\test.nut">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="Release"/>
<Option target="Debug"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="sq.c">
<Option compilerVar="CC"/>
<Option target="Release"/>
<Option target="Debug"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
</Project>
</CodeBlocks_project_file>

View File

@@ -0,0 +1,458 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="sq"
ProjectGUID="{984683B6-E68A-4CCB-89C9-2D89527144A6}"
RootNamespace="sq"
SccLocalPath=".."
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/sq.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\include,..\sqstdlib"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/sq.pch"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1040"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="../bin/sq.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="../lib"
ProgramDatabaseFile=".\Release/sq.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/sq.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\include,..\sqstdlib"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/sq.pch"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1040"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="../bin/sqD.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/sq.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/sq.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\include,..\sqstdlib"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/sq.pch"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1040"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="../bin/sqDU.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/sq.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/sq.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\include,..\sqstdlib"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/sq.pch"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1040"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="../bin/sqU.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="../lib"
ProgramDatabaseFile=".\Release/sq.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="sq.c"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
CompileAs="2"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
CompileAs="2"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug - Unicode|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
CompileAs="2"
/>
</FileConfiguration>
<FileConfiguration
Name="Release - Unicode|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
CompileAs="2"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
</Filter>
<File
RelativePath="..\etc\test.nut"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,317 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="sq"
RootNamespace="sq"
SccProjectName=""
SccLocalPath="..">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\include,..\sqstdlib"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/sq.pch"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="../bin/sq.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="../lib"
ProgramDatabaseFile=".\Release/sq.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/sq.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1040"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\include,..\sqstdlib"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/sq.pch"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="../bin/sqD.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/sq.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/sq.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1040"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="1">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\include,..\sqstdlib"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/sq.pch"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="../bin/sqDU.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/sq.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/sq.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1040"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="1">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\include,..\sqstdlib"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/sq.pch"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="../bin/sqU.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="../lib"
ProgramDatabaseFile=".\Release/sq.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/sq.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1040"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="sq.c">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Debug - Unicode|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release - Unicode|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
<File
RelativePath="..\etc\test.nut">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>sqdbgTest</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
<nature>org.squirrel_lang.sqdev.squirrelnature</nature>
</natures>
</projectDescription>

Binary file not shown.

View File

@@ -0,0 +1,494 @@
%PDF-1.3
%<25><><EFBFBD><EFBFBD>
4 0 obj
<< /Type /Info
/Producer (FOP 0.20.5) >>
endobj
5 0 obj
<< /Length 196 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
GaqdY]+0EX&;B(lT41D@*+tSN;/4Ut;R\G?OEDk#&6F++6)>^%qht(5^"An`O:%O/^cqrFJZf5C'FZgXJMj2O1`/_b3XrfU>BYFS9hM,(@3_nF3gBoT9Bc3qXP4mt@uMS5.jO.p#ClaLCf.d3?VEJJ<[f`FTjmgRGAS)Ccn@nXebn8]oeWu"qgWh^iWC>m0t%~>
endstream
endobj
6 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 5 0 R
>>
endobj
7 0 obj
<< /Length 1032 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Gasao968i1&AJ$CE(_rr;`u\TDGNtK1[1kLh:`p3KHqH]*!CH`mu*-((.W6uT(0&.o'MVOh.MXI+(H"fnJYuh,!bfF7"P/f.#\3ITJY<\-jii&U@5SKShuXoniO49dM2/YRh4D)V6*SD;n]*>Y%oLMAVbt#oFkf.N5l'T"1[mbHe[m"]Ltb5Dg>*S&d(Z[C`:rl'b09+++Z$SDqFFH40_"A<]A/Art-QNPG01U=6;/UWrG.#,2^ZM^.E;WVq-(C$jTJk3uk.)]'Vq_N^QdDo.BZ6**>d*W4O5OMY/o$W&lcb#d'bWF=/Kbhg7qA%pVZOEP(DXpLI`sUf/WLPn+n"3oN(ZcqaCVE=QR1Gf^S8_NnM)\S#;blp\i1agl%]q,ps5?'9@g582-SVc-qn9mbJs,$E7'g*nL#=so:Y=@)[H&/DQ]!-2g2Sr[G'inY<lB.@-:pIq+#]ShO)(<WfGTd.!?<ak1>Y"eVaU[rhBW8g>L1#X*UbuiN2W(tu\\JID7K'9dtlZ0(o<>D6FW@SnF!+g*2X!#Pqeh83A[9U59+:+jIS<:0hrKS_M0b1+u.`l_55eED8/Z+c)QCq_Ks$[<'!O'6s!gV\K*5-nX(X71TcDeOLO"B)EG`"&ZpM8[t6P7fS_@RIJJ6]YXe3PU19QJ^k\lVYl";#Te`d12]At[%@]l=u=TjIq'E5Gcq(/\-uNcKFU[\/F1;`cU\7\DXMeJ7.bZsdD*C*!@)L'8O:T`Z"eQA0r`>pqBF"<&&:SN(Xnf'UP+cb[8.)<%*['SRURShGgs+,./IB>kiUR#<5h\Q^9dN!:2H#LkOfCDtFUTr-p6%jej'EFOU[qe*&Uo[XC%$P:a;b(6gJgM(,gLVGbMe+")*-1VY"'1eY)BY;c[f3EQG6@\ufcb%;uGCR;d\^?otfbREY^KEbR,`[gm:u/4`kSJlJD9;#G8P8TVFb&.JrZ3l/CnLa#NV#El=i7A-3)+at]KTka-i6>G^BDgQQ([eq*LN+fW*4ROgh2t.Rl-50g&1q"H]<^~>
endstream
endobj
8 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 7 0 R
>>
endobj
9 0 obj
<< /Length 71 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Garg^iGoCd.c`?]8EV`b1=.gR0K1`91K?+0ZOMGdU/Zh'Y!=Te%#&:?HH*JE!<E/X&V'~>
endstream
endobj
10 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 9 0 R
>>
endobj
11 0 obj
<< /Length 500 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Gb"/h4)]a*&:etR`JnDaMdI=@V@P+]qN/1d6QUtO9qeC?l-HOB8Xr1GUoFN2F^k/oR):!5dpWGA34n<<'k%F4/;PDZ-q*d'TGWM.N`2)J$2PAX6Tl@69b7(o.?[:Q+=sjiiC-o!VPl_*n-&U-VNsIlS&JuGB;NfU@Z_5%BUb;#QUJE0W1T%k>ak1qSt!klKQO7$h9>R6&eYfioViB3kt3uUd59gL.kd@GKrGhDZYU&F\m@<.'%5[1j,RQQGKeEW5^>5eB1:\31c"`I=#9MT%Cb0Dam9TGl$q.OlD;p1n':)d@HqE,^%fBI<S$9-S@cr*ZKkd>+X-5P38:Y+p95\Q^;:cXomD3IoRdC4RE?5-7K?$8oo>,qOA:j;VVqc,$(5gPR]Y%34Dd>M6MdNgRVkSAD#:SJC;0$JK(5u[NJ)t<oHV>sQ/\rgnD=.lDB,PW,n`V`Oep2c(>K,s]g"4eKHH_nFs`9O/La4cKPHc4>PNDk"5=c#SH~>
endstream
endobj
12 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 11 0 R
/Annots 13 0 R
>>
endobj
13 0 obj
[
14 0 R
16 0 R
18 0 R
20 0 R
22 0 R
24 0 R
26 0 R
]
endobj
14 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 120.0 655.001 187.48 645.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 15 0 R
/H /I
>>
endobj
16 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 144.0 644.001 183.43 634.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 17 0 R
/H /I
>>
endobj
18 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 144.0 633.001 242.31 623.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 19 0 R
/H /I
>>
endobj
20 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 144.0 622.001 230.65 612.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 21 0 R
/H /I
>>
endobj
22 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 120.0 611.001 189.14 601.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 23 0 R
/H /I
>>
endobj
24 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 144.0 600.001 183.43 590.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 25 0 R
/H /I
>>
endobj
26 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 120.0 589.001 142.77 579.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 27 0 R
/H /I
>>
endobj
28 0 obj
<< /Length 1965 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Gatm<>B?Pt'RnB3@(-Z']8csPhKBu]nRgV!g.>!3Th?_b6+1J^&:s5GSc8@)&0QODZIA(57H^=bqfFHR0:\fD:TB(*A6Gqn/<47TH)*tdr"R8k8<s\-7YYMIc<C'fEk1bhSBuh/MG4c;Q>@MgM1XHgZQa8+'q'!+b<kPmEde1E\tmE?)U-a/'O3=#6UQ`F1L&-SbR-LZn`;%hB[3Sf_:L\'a+tl.2es$6>6C&a1n54Ff.,Hn,)gTKUg?e+B[!&,+f-ID*(ne=\34NBj#["i':*>NKt`n/8W4Q=!.5ZPW\1$^J6+TRCD@]8/YUp\m,!In[ZRD%9PS`pF`@la<GWflgrfEGj3'QD?T<3(i<(I%E)&PGI*G`!/guRNA1&eM'>>er(^YfTcSW`LVe]Cq"nAd'"CL+iB^A0>7*Z:Aa-IO"L2t_*$cm%9=rSpH[Q%1O"OG(hUJfH(\o$2&pW19+/B\3OLfM?o+E-JSQ][rc9&bljbM0AnD9%XG,K/O,-kGq0%VN&'rPEb3$M1L64^ZTIZWqXdM)lenrTIB27k`]B!@=?$[Fsn.dTkBuAE$5/\15KP?8aB'PKfsM3@"=USt^!MdW*`7LmT#Rh=_NgoSmf-=,42MEH<iJ7AXu:T0hto9bqWg:_`E4NE?0l$YqSTQGk`-(FBj*/.)3J`;bI`<gO1JLfg]H$M>F8ME*l46u8DslKuMb<jmj^7oJ=M6:VgF?NQ#hjE)_rRf?.\4EDZsI?FrG(8?C]",;+5>UlLh#H0j&7HpE:_&aUC9.4VMXY6F"=:jTuZkVa",SIu?_K?cZIP3NNk$GP7lQE&Q<A:.G6?<`O#F&s;rZr&U<jSlP?bc*i1A5creI,/pRsQo!6d(2b@5j1YU)<_AOl[kMeGSFT(PX@ah6=fWA/Ht_N0?mI'3`F\n^a1'E+CT2#]4r1Oha-%#\cV*j?p1e(6:>"I]B1OIgRja'6ipQ?<H+6_3=5)F4%5f59G#.ZJC_aZG#_,$'up4D&VE1_0l&XBP^,Kn$oB%HfBhG8X#,m_Gb7[Y)_?5C@9@To1Yf[RPck[ehHf]2/?SWb>7,bp`5V-R]Jpuir1>WDgq(=b2cB9SHi'eJlbfM9T[WTJi1\>=:bi607+)u@Kpt>*Pu'8j8JEq[7LJ1,mjC3pN=<]4,9iFVC!6RRZ0.,Q8(YLDHr^JjrpXT,joW?gW&2=`c-rmh6pU!c2r?fMH*KG=B\orR<,+'05\::'\2F.ggb8d-d:doqo`jl7\/2s6Jg0hU>M;u)W&e1oNF;]glO8-E[;KeUY:gQP?iNDm'^%<?2?o`qC@VIl::W\rV"m:fsZNMN7@^gnTT28@22utN&7SYA`8s;\Gfk1'"`e!$EP(u$Fp*RbrPYM"nt=1e*PLGH!`dA.OBbr6u`/R^5N`>?EfWmW%96D\-P[qhAs+YTDO$j0J\X1#>4OrNOaX>V(5NaY%)"oa7)n)(0-&^XL<MJh*$_cmmf=u"/f&2ji`^:cd,BY9&M*4)/K+E=3@e*<*g\M*^"!Z0-ON82(p-f)Ue>P[&bIHpAXFFh)fM&4;g6@o:,8gUD[]*T1>E])I5I1?]XV8B0&&WQ/11Eic]Y:E([t3hQ*CC9sI]/C;%?@-Kc1(U0m'ocLg)hlJ*9MX0P]8#q'[VqD*1_Xe[EbbFqiG`p%YKpcG#%3HRUuTrJfV>o;J^GmU4$qPPd?Y"+]'rOF_U:>BSj<ZbEkYH'ZdVi^7e^OV_2\qX2[Q-7PJX`.7,65EW&q8MV4??V#Z-OqS%?maKM^nf2-c8</FCcA+Xm&eCMahuBJT!GXD.5Ea)3h.;/76hVnqWVED^78O&B)t\2V9Z!AfutW*oGcA@a8QW$*T7ogofUE]SI]jC8e&u;WB:[6T'HllS45rt<c!!L6/fV<S>0`j^KMM6WPKe_mU*pO*XWN+dc0KYkecS%KT&fUp[qiITW3-Zbb=m:3e^f<(D0ffdf~>
endstream
endobj
29 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 28 0 R
>>
endobj
30 0 obj
<< /Length 822 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Gas1]>u03/'RfGR0MI[.$/@MKj$XOk1c6?g.dc4fP6e0\j-4:).8C3\e,K67-H--nP_[3&\`]R]fb^4970nt_>p-G5$Pj`c>l>dqr'4UEf7OJ4nHA9M/>#)IZVnlBooC`8#NDW^HSpEtH8)!$pmYNRnfqmBkm&7<_gT[q>.iXaqZEW&6\KZZH+M5dX;"%M$8(FV[EP[&EMd`?361Q6d(eq!;r=\`SSYj"k&g=19To<5l(2_1,i)6O)Ld8]D.?dbjs--T/<]GY%q#qD2&KieLNYCMWBqKsAMmE:11-E<l>]U*.N^R,KiD75B4\2$&&Y&7OHS-`ji734*Jao.(p_0DT+sXZ!kgMK?LR+!E5n)d`.rutgk[Iu%d0UL3D>1eqW7cs_#'>=9E*,i6oW_F./(rq_]b(/C_mp"LdP+&GW^s5;8i9\%hbdfT%4(6^<W$E<iC;+kAjl\MnD`RVK2?>>hSF6)1`LVle#+X[-=/LeY/5C!1>t?h`R>5^6cP)^!oO2H6hi>KYXgoLCS48.3DPe<7U>D,noJ'TR0A+]BdDuZ:_$/;>7g`C&7cR*ad.`W9UigRtL*(4UO@MA]#Vt0s``2FMlF[PEF\DV3%F\YdQD>+#d2']]QgufbKX26Jj&!^+)a%,$K4V+Ud[9in?=%@2+G<@d[N0TRS^jl[?=]1TuQ!K_n%;(Y]i$(kZ6^>R$^'<j.5RoDWd4MQ3$[X#Fqm[Y`ll_0WALh.@D2KA4t/Mp?CM['q_Y&>Xhm^Kpf7,fi%,:1'Bcd*=d]!s=A34/oTTa`cLmq0bDG?d`Fc01euYig/@U7/m99iIp:~>
endstream
endobj
31 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 30 0 R
>>
endobj
32 0 obj
<< /Length 1571 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
GatTIgMYb(o\ElJ[jFAWLn_',;q!'tL)/%QmE7U+Zpi_;AC6MfBA(n'OsoikAfM%CJ;!+Tgi[MYj`GN_9cVJLED2neEoK-\$$KSHK:U(NXqSe]$N8&6DOeI;5-='MZJs@opS%p>Z($ElM2-iTa4m(,igq`)_=@akFoHBXJ$g2#'To'>37J]HaRt`tgLiFJ<i]D0_fdo.4LOl3Aju"(#fj[>2irq!VdRejE]:P!!`GPeM\(4`<2;A`%McC*1@Q6V7o3snRaS)4i];'uN<\fZYON.DL]i1m?hs?#8E[%G4QfW>BW,_?+:/TN2"dIOGP>0G^J1mq?iJFX'&u,DSkI))(.C+p]dO_=c>'cEDsm(t^ARc+^+.-?c#g6Q"$i-<I$M#PTZXYj,_3?2KIdXXkB;pH!!Pb@^D%kj4CQE".k.K88gTstrn_u6=9@:a$3PrC6&U=D[^+3$TTs)K3I<XacV$j!7-u[;C!L`.0$:)L(BqtjVI1>d!Ca$;(YLqt^+jS"$bBcHZHD(KVfh`>9Bq`M0]3q"*Z_9:Jaeb%4-VJh9@@:gUk'Jqh467_q7`ckgU?tc0mZ.BKYt/':"HuAb!>%[e*Y-!Xg+sm@'`)XV.;SW$$h3sW^l`^*q!@XcaQW'E`c*")7rFb=o[;R+(4)1__@j5*uh0_P?!aGCcYYfnJcB(m$d&ce-,qA&*8$sCrmn(e8Ja1L),h]@f^am;dFMtq/1jVlO3*Ml&`P7B3A3lVG0nsJB2EJ1XEA#lj]5-6*opsTPMn>>u/s%j^`OLmb!O704PgQ$uckV2giO8V!I$k*]'C?MoI8qB)f/*-!?*6l6H)(2AREZ,t)L@`EMa7?s8EhE,E(P$@q1]#I<EZ8ctp,S9"]`eo\Bf@ZC71M2hD?@Dqihj?&c2jbn[F+gu"f>`7c+TE`em9FY+=K>-*G692G&%HcfB3=Buc4/d-KYG!!IY&o\;Li;tk;!VO0_7%"<%?&hsK%ukX(VEVH%8tqe:QlD/oX-*KN2=@&r"03AWPJQe3B.gsYu$:KV^r";$+jPAB`'>gK;XA"g[>A?R[)g2NN`V/8bMJfngV123gcpOf[cA]lpLImO8'de_kWM[ie8ceO'2%6U"&?bjnk?+6I]a@7_;a4Y%0#RF)0qaWi^qO2q%/u*km,l*np.'(lu46d:;#(6@[3B)m,I_:od#+ZYk'RQ/Hf%*ia8(neCFpK+4UCJSh[)\RfX2JhK+d3Odbq(Fh(oN=#&WW&t,@?]W*uZ0oVA3<tnNK4ED06`:fBG`LCaJm91)09-;Fh4oi4X5IF\R,U,\;QJE6mjfG!&ep=hqS:[7PuTPfk8O^TnX.k,b$$s52s1(RePlMA4(55lbpK7;`2MRA>(GccWH4LGN-_a"5gYaYN>"EEH==#)p>od\+3^8M!$hP+gSrVX'B#rn\JCnPHG_&,)?5cOT7^8=W'2nXbEraqZLs$ASY![S_*Q[U<r$4WBAi0%9C/:$47NURc2?[ghR(%j2g]&D(%,qfh,_%($J5\;6&8t`KDiMB._8/6!eN?\^A\(cY;TZ*S`siVi<+\CJ,U"SnJA4W:s/~>
endstream
endobj
33 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 32 0 R
>>
endobj
34 0 obj
<< /Length 941 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
GatU1hf"u<&:Vr4_.+[3'SCsKHYTs3l[GdJbFY$!EkkMP`2:Og[/KYR`oK6K>A4``]!HhBh0hKESRo.f$P[h6n,k<oB7X./O;I*kH"`W0`FKk_..sm*pLF3mpA3qLlW&--rp7P>H]nT'eQ`mUC>o-`Z;2AhhEq`+;/e:B;>4$oLU"*b6rm9<?I8ARWi3:\qd@9Y2bD@;78gOYr2mEGb6W<h7*?0/S_+*lqu'.l/#tZ\60gnBMPTXJ<hQc7jFWXCQ'<fNQ>kI)h::\`B94:)@:^fkW1B"\TTP*c50gdT"O52Q2rOqE`@3BBLJ.a>g*'Ts`gL;3B"r&b>56S-L.d<W%?V1'@2B(o]$mbogSQ+9j;28i*gl5(!b*HD!Esq*=RI#k698.A;mVuB-Fe]).9<)V!b<pRNI14a-NdIhgL$W(68V2mQ.XK^_ZK.\7OOrdNK>l0+7Hd%^Zub>buY;*CT,`CD-C&P]E27"D9/nflgN1MlCL"?4''t+Yt[T+ja_@&cABm+EB:?Ih'Zgp,s8*-D]hqBo]?tg^%BJB?M`3@4]'KTZD#PjF(@l5>\FWO/RZt*Vj1Jd*+sbdf&>SNe1I4b/(XaBLQN6;UX^]0cgD+24"mEbO4>_Ve/8aWjZK"qpANCOQ8f1.n(>^4Q6c.Gg%F\_Et4q@hM?/dO.\,bM/tC0J?PQNNm5*`a2]">KC4Z7Yd90R5I!$S>jM_p\dWVq3R-qS:NV:mGD-b(VU/=[[n#Z/@>[QUY<&224,V&'="fN)e`,Bm'?DL5/H*Y!FeLd3ZgUFc@9ckdj-<P9DT#?j@KRNg:=lQh(ScO>h/mX_ZB)"/?+h[:]=p?\*#thc.Nc]=p`FS1L&(JRN5Kau1,5+U^l1m!<8/ikcTJ5D?^N0(Nq>X$e#2(U!WRnCELkQm#7:+!(\+7ClJ?@<@uH?JkRY5-16q~>
endstream
endobj
35 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 34 0 R
>>
endobj
36 0 obj
<< /Length 287 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
GasJM_/@+D%#44r$6MQC-Ae9M>`gpYgns0k9o.14H6=5F&:=>/Q>R*XTj4\os1ZFngl(D1JS'"a^m@C)7OX@4.EF><Y\o2]1[mJN)a/thp_q%3pdN4P7QsZOOZ\K)&iK?tlVH/`P,W^=me*+/bk9q<^MNJ%c*@[VS;cDmRhINNZf<]/p4d@lLR?]6E0o,;L-9qHX'".'e%jSrEE0u`DUrq9`B%%BBJ1oa[QJl@n(tM%A?=,X>F0)mWht;E]SO,5b#q412`=ou,c,oV3.-h`4ms=llYUJ~>
endstream
endobj
37 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 36 0 R
/Annots 38 0 R
>>
endobj
38 0 obj
[
]
endobj
41 0 obj
<<
/Title (\376\377\0\123\0\161\0\165\0\151\0\162\0\162\0\145\0\154\0\40\0\122\0\145\0\155\0\157\0\164\0\145\0\40\0\104\0\145\0\142\0\165\0\147\0\147\0\145\0\162\0\40\0\61\0\56\0\60)
/Parent 39 0 R
/Next 43 0 R
/A 40 0 R
>> endobj
43 0 obj
<<
/Title (\376\377\0\124\0\141\0\142\0\154\0\145\0\40\0\157\0\146\0\40\0\103\0\157\0\156\0\164\0\145\0\156\0\164\0\163)
/Parent 39 0 R
/Prev 41 0 R
/Next 44 0 R
/A 42 0 R
>> endobj
44 0 obj
<<
/Title (\376\377\0\103\0\150\0\141\0\160\0\164\0\145\0\162\0\240\0\61\0\56\0\240\0\124\0\150\0\145\0\40\0\104\0\145\0\142\0\165\0\147\0\147\0\145\0\162)
/Parent 39 0 R
/First 45 0 R
/Last 47 0 R
/Prev 43 0 R
/Next 48 0 R
/Count -3
/A 15 0 R
>> endobj
45 0 obj
<<
/Title (\376\377\0\117\0\166\0\145\0\162\0\166\0\151\0\145\0\167)
/Parent 44 0 R
/Next 46 0 R
/A 17 0 R
>> endobj
46 0 obj
<<
/Title (\376\377\0\111\0\156\0\164\0\145\0\147\0\162\0\141\0\164\0\151\0\156\0\147\0\40\0\164\0\150\0\145\0\40\0\144\0\145\0\142\0\165\0\147\0\147\0\145\0\162)
/Parent 44 0 R
/Prev 45 0 R
/Next 47 0 R
/A 19 0 R
>> endobj
47 0 obj
<<
/Title (\376\377\0\124\0\150\0\145\0\40\0\156\0\145\0\164\0\167\0\157\0\162\0\153\0\40\0\160\0\162\0\157\0\164\0\157\0\143\0\157\0\154)
/Parent 44 0 R
/Prev 46 0 R
/A 21 0 R
>> endobj
48 0 obj
<<
/Title (\376\377\0\103\0\150\0\141\0\160\0\164\0\145\0\162\0\240\0\62\0\56\0\240\0\101\0\120\0\111\0\40\0\122\0\145\0\146\0\145\0\162\0\145\0\156\0\143\0\145)
/Parent 39 0 R
/First 49 0 R
/Last 49 0 R
/Prev 44 0 R
/Next 50 0 R
/Count -1
/A 23 0 R
>> endobj
49 0 obj
<<
/Title (\376\377\0\104\0\145\0\142\0\165\0\147\0\147\0\145\0\162)
/Parent 48 0 R
/A 25 0 R
>> endobj
50 0 obj
<<
/Title (\376\377\0\111\0\156\0\144\0\145\0\170)
/Parent 39 0 R
/Prev 48 0 R
/A 27 0 R
>> endobj
51 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F3
/BaseFont /Helvetica-Bold
/Encoding /WinAnsiEncoding >>
endobj
52 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F5
/BaseFont /Times-Roman
/Encoding /WinAnsiEncoding >>
endobj
53 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F10
/BaseFont /Courier-Oblique
/Encoding /WinAnsiEncoding >>
endobj
54 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F6
/BaseFont /Times-Italic
/Encoding /WinAnsiEncoding >>
endobj
55 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F1
/BaseFont /Helvetica
/Encoding /WinAnsiEncoding >>
endobj
56 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F11
/BaseFont /Courier-Bold
/Encoding /WinAnsiEncoding >>
endobj
57 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F9
/BaseFont /Courier
/Encoding /WinAnsiEncoding >>
endobj
1 0 obj
<< /Type /Pages
/Count 9
/Kids [6 0 R 8 0 R 10 0 R 12 0 R 29 0 R 31 0 R 33 0 R 35 0 R 37 0 R ] >>
endobj
2 0 obj
<< /Type /Catalog
/Pages 1 0 R
/Outlines 39 0 R
/PageMode /UseOutlines
>>
endobj
3 0 obj
<<
/Font << /F3 51 0 R /F5 52 0 R /F10 53 0 R /F1 55 0 R /F6 54 0 R /F9 57 0 R /F11 56 0 R >>
/ProcSet [ /PDF /ImageC /Text ] >>
endobj
15 0 obj
<<
/S /GoTo
/D [29 0 R /XYZ 115.0 725.0 null]
>>
endobj
17 0 obj
<<
/S /GoTo
/D [29 0 R /XYZ 115.0 666.009 null]
>>
endobj
19 0 obj
<<
/S /GoTo
/D [29 0 R /XYZ 115.0 589.684 null]
>>
endobj
21 0 obj
<<
/S /GoTo
/D [31 0 R /XYZ 115.0 448.64 null]
>>
endobj
23 0 obj
<<
/S /GoTo
/D [33 0 R /XYZ 115.0 725.0 null]
>>
endobj
25 0 obj
<<
/S /GoTo
/D [33 0 R /XYZ 115.0 687.009 null]
>>
endobj
27 0 obj
<<
/S /GoTo
/D [37 0 R /XYZ 67.0 725.0 null]
>>
endobj
39 0 obj
<<
/First 41 0 R
/Last 50 0 R
>> endobj
40 0 obj
<<
/S /GoTo
/D [10 0 R /XYZ 115.0 725.0 null]
>>
endobj
42 0 obj
<<
/S /GoTo
/D [12 0 R /XYZ 115.0 715.0 null]
>>
endobj
xref
0 58
0000000000 65535 f
0000012880 00000 n
0000012993 00000 n
0000013085 00000 n
0000000015 00000 n
0000000071 00000 n
0000000358 00000 n
0000000464 00000 n
0000001588 00000 n
0000001694 00000 n
0000001855 00000 n
0000001962 00000 n
0000002554 00000 n
0000002677 00000 n
0000002746 00000 n
0000013232 00000 n
0000002882 00000 n
0000013297 00000 n
0000003018 00000 n
0000013364 00000 n
0000003154 00000 n
0000013431 00000 n
0000003290 00000 n
0000013497 00000 n
0000003426 00000 n
0000013562 00000 n
0000003562 00000 n
0000013629 00000 n
0000003698 00000 n
0000005756 00000 n
0000005864 00000 n
0000006778 00000 n
0000006886 00000 n
0000008550 00000 n
0000008658 00000 n
0000009691 00000 n
0000009799 00000 n
0000010178 00000 n
0000010301 00000 n
0000013693 00000 n
0000013744 00000 n
0000010321 00000 n
0000013809 00000 n
0000010565 00000 n
0000010761 00000 n
0000011032 00000 n
0000011162 00000 n
0000011400 00000 n
0000011600 00000 n
0000011877 00000 n
0000011993 00000 n
0000012105 00000 n
0000012218 00000 n
0000012328 00000 n
0000012443 00000 n
0000012554 00000 n
0000012662 00000 n
0000012774 00000 n
trailer
<<
/Size 58
/Root 2 0 R
/Info 4 0 R
>>
startxref
13874
%%EOF

View File

@@ -0,0 +1,95 @@
/*
see copyright notice in sqrdbg.h
*/
#include <windows.h>
#include <winsock.h>
#include <squirrel.h>
#include <stdlib.h>
#include <stdio.h>
#include <sqstdblob.h>
#include <sqstdio.h>
#include <sqstdaux.h>
#include "sqrdbg.h"
#include "sqdbgserver.h"
#pragma comment (lib ,"Ws2_32.lib")
#ifdef _UNICODE
#define scfprintf fwprintf
#define scvprintf vwprintf
#else
#define scfprintf fprintf
#define scvprintf vprintf
#endif
void printfunc(HSQUIRRELVM v,const SQChar *s,...)
{
va_list vl;
va_start(vl, s);
scvprintf( s, vl);
va_end(vl);
}
void PrintError(HSQUIRRELVM v)
{
const SQChar *err;
sq_getlasterror(v);
if(SQ_SUCCEEDED(sq_getstring(v,-1,&err))) {
scprintf(_SC("SQDBG error : %s"),err);
}else {
scprintf(_SC("SQDBG error"),err);
}
sq_pop(v,1);
}
int main(int argc, char *argv[])
{
if(argc < 2){
scprintf(_SC("SQDBG error : no file specified"));
return -1;
}
HSQUIRRELVM v = sq_open(1024);
sqstd_seterrorhandlers(v);
//!! INITIALIZES THE DEBUGGER ON THE TCP PORT 1234
//!! ENABLES AUTOUPDATE
HSQREMOTEDBG rdbg = sq_rdbg_init(v,1234,SQTrue);
if(rdbg) {
//!! ENABLES DEBUG INFO GENERATION(for the compiler)
sq_enabledebuginfo(v,SQTrue);
sq_setprintfunc(v,printfunc);
//!! SUSPENDS THE APP UNTIL THE DEBUGGER CLIENT CONNECTS
if(SQ_SUCCEEDED(sq_rdbg_waitforconnections(rdbg))) {
scprintf(_SC("connected\n"));
const SQChar *fname=NULL;
#ifdef _UNICODE
SQChar sTemp[256];
mbstowcs(sTemp,argv[1],(int)strlen(argv[1])+1);
fname=sTemp;
#else
fname=argv[1];
#endif
//!!REGISTERS STANDARDS LIBS
sq_pushroottable(v);
sqstd_register_bloblib(v);
sqstd_register_iolib(v);
//!!EXECUTE A SCTIPT
if(SQ_FAILED(sqstd_dofile(v,fname,SQFalse,SQTrue))) {
PrintError(v);
}
}
//!! CLEANUP
sq_rdbg_shutdown(rdbg);
}
else {
PrintError(v);
}
sq_close(v);
return 0;
}

View File

@@ -0,0 +1,13 @@
#!perl
open( HANDLE,shift) || die;
undef $/;
binmode HANDLE;
$data=<HANDLE>;
$ctr=0;
for($i=0;$i<length($data);$i++)
{
$out.=sprintf("0x%02x,", unpack("C", substr($data,$i,1)) );
$out.="\n" if ( ( $ctr % 20) == 19);
$ctr++;
}
print $out;

View File

@@ -0,0 +1,9 @@
#ifdef _PS3
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "tier0/threadtools.h"
typedef int SOCKET;
#define INVALID_SOCKET -1
#endif

View File

@@ -0,0 +1,266 @@
static const SQChar serialize_state_nut[] = {
0x2f,0x2a,0x0d,0x0a,0x09,0x73,0x65,0x65,0x20,0x63,0x6f,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x6e,
0x6f,0x74,0x69,0x63,0x65,0x20,0x69,0x6e,0x20,0x73,0x71,0x72,0x64,0x62,0x67,0x2e,0x68,0x0d,0x0a,0x2a,
0x2f,0x0d,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x73,0x63,0x6f,0x70,
0x65,0x3b,0x0d,0x0a,0x69,0x66,0x20,0x28,0x20,0x3a,0x3a,0x67,0x65,0x74,0x72,0x6f,0x6f,0x74,0x74,0x61,
0x62,0x6c,0x65,0x28,0x29,0x2e,0x70,0x61,0x72,0x65,0x6e,0x74,0x20,0x29,0x0d,0x0a,0x7b,0x0d,0x0a,0x09,
0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x73,0x63,0x6f,0x70,0x65,0x20,0x3d,0x20,0x3a,0x3a,0x67,0x65,0x74,
0x72,0x6f,0x6f,0x74,0x74,0x61,0x62,0x6c,0x65,0x28,0x29,0x3b,0x0d,0x0a,0x09,0x3a,0x3a,0x73,0x65,0x74,
0x72,0x6f,0x6f,0x74,0x74,0x61,0x62,0x6c,0x65,0x28,0x20,0x3a,0x3a,0x67,0x65,0x74,0x72,0x6f,0x6f,0x74,
0x74,0x61,0x62,0x6c,0x65,0x28,0x29,0x2e,0x70,0x61,0x72,0x65,0x6e,0x74,0x20,0x29,0x3b,0x0d,0x0a,0x7d,
0x0d,0x0a,0x74,0x72,0x79,0x20,0x7b,0x0d,0x0a,0x09,0x0d,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6f,0x62,
0x6a,0x73,0x5f,0x72,0x65,0x67,0x20,0x3d,0x20,0x7b,0x20,0x6d,0x61,0x78,0x69,0x64,0x3d,0x30,0x20,0x2c,
0x72,0x65,0x66,0x73,0x3d,0x7b,0x7d,0x20,0x7d,0x0d,0x0a,0x0d,0x0a,0x63,0x6f,0x6d,0x70,0x6c,0x65,0x78,
0x5f,0x74,0x79,0x70,0x65,0x73,0x20,0x3c,0x2d,0x20,0x7b,0x0d,0x0a,0x09,0x5b,0x22,0x74,0x61,0x62,0x6c,
0x65,0x22,0x5d,0x20,0x3d,0x20,0x6e,0x75,0x6c,0x6c,0x2c,0x0d,0x0a,0x09,0x5b,0x22,0x61,0x72,0x72,0x61,
0x79,0x22,0x5d,0x20,0x3d,0x20,0x6e,0x75,0x6c,0x6c,0x2c,0x0d,0x0a,0x09,0x5b,0x22,0x63,0x6c,0x61,0x73,
0x73,0x22,0x5d,0x20,0x3d,0x20,0x6e,0x75,0x6c,0x6c,0x2c,0x0d,0x0a,0x09,0x5b,0x22,0x69,0x6e,0x73,0x74,
0x61,0x6e,0x63,0x65,0x22,0x5d,0x20,0x3d,0x20,0x6e,0x75,0x6c,0x6c,0x2c,0x0d,0x0a,0x09,0x5b,0x22,0x77,
0x65,0x61,0x6b,0x72,0x65,0x66,0x22,0x5d,0x20,0x3d,0x20,0x6e,0x75,0x6c,0x6c,0x2c,0x0d,0x0a,0x7d,0x0d,
0x0a,0x0d,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x62,0x75,0x69,0x6c,0x64,0x5f,0x72,0x65,
0x66,0x73,0x28,0x74,0x29,0x3a,0x28,0x6f,0x62,0x6a,0x73,0x5f,0x72,0x65,0x67,0x29,0x0d,0x0a,0x7b,0x0d,
0x0a,0x09,0x69,0x66,0x28,0x74,0x20,0x3d,0x3d,0x20,0x3a,0x3a,0x67,0x65,0x74,0x72,0x6f,0x6f,0x74,0x74,
0x61,0x62,0x6c,0x65,0x28,0x29,0x29,0x0d,0x0a,0x09,0x09,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0d,0x0a,
0x09,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6f,0x74,0x79,0x70,0x65,0x20,0x3d,0x20,0x3a,0x3a,0x74,0x79,0x70,
0x65,0x28,0x74,0x29,0x3b,0x0d,0x0a,0x09,0x69,0x66,0x28,0x6f,0x74,0x79,0x70,0x65,0x20,0x69,0x6e,0x20,
0x63,0x6f,0x6d,0x70,0x6c,0x65,0x78,0x5f,0x74,0x79,0x70,0x65,0x73,0x29,0x0d,0x0a,0x09,0x7b,0x0d,0x0a,
0x09,0x09,0x69,0x66,0x28,0x21,0x28,0x74,0x20,0x69,0x6e,0x20,0x6f,0x62,0x6a,0x73,0x5f,0x72,0x65,0x67,
0x2e,0x72,0x65,0x66,0x73,0x29,0x29,0x20,0x7b,0x0d,0x0a,0x09,0x09,0x09,0x6f,0x62,0x6a,0x73,0x5f,0x72,
0x65,0x67,0x2e,0x72,0x65,0x66,0x73,0x5b,0x74,0x5d,0x20,0x3c,0x2d,0x20,0x6f,0x62,0x6a,0x73,0x5f,0x72,
0x65,0x67,0x2e,0x6d,0x61,0x78,0x69,0x64,0x2b,0x2b,0x3b,0x0d,0x0a,0x09,0x09,0x0d,0x0a,0x09,0x09,0x20,
0x20,0x20,0x20,0x69,0x74,0x65,0x72,0x61,0x74,0x65,0x6f,0x62,0x6a,0x65,0x63,0x74,0x28,0x74,0x2c,0x66,
0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x6f,0x2c,0x69,0x2c,0x76,0x61,0x6c,0x29,0x3a,0x28,0x6f,0x62,
0x6a,0x73,0x5f,0x72,0x65,0x67,0x29,0x0d,0x0a,0x09,0x09,0x20,0x20,0x20,0x20,0x7b,0x0d,0x0a,0x09,0x09,
0x09,0x20,0x20,0x20,0x20,0x62,0x75,0x69,0x6c,0x64,0x5f,0x72,0x65,0x66,0x73,0x28,0x76,0x61,0x6c,0x29,
0x3b,0x0d,0x0a,0x09,0x09,0x09,0x20,0x20,0x20,0x20,0x62,0x75,0x69,0x6c,0x64,0x5f,0x72,0x65,0x66,0x73,
0x28,0x69,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x20,0x20,0x20,0x20,0x7d,0x29,0x0d,0x0a,0x09,0x09,0x7d,0x0d,
0x0a,0x09,0x09,0x0d,0x0a,0x09,0x7d,0x0d,0x0a,0x7d,0x0d,0x0a,0x0d,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,
0x6f,0x6e,0x20,0x67,0x65,0x74,0x76,0x61,0x6c,0x75,0x65,0x28,0x76,0x29,0x3a,0x28,0x6f,0x62,0x6a,0x73,
0x5f,0x72,0x65,0x67,0x29,0x0d,0x0a,0x7b,0x0d,0x0a,0x09,0x73,0x77,0x69,0x74,0x63,0x68,0x28,0x3a,0x3a,
0x74,0x79,0x70,0x65,0x28,0x76,0x29,0x29,0x0d,0x0a,0x09,0x7b,0x0d,0x0a,0x09,0x09,0x63,0x61,0x73,0x65,
0x20,0x22,0x74,0x61,0x62,0x6c,0x65,0x22,0x3a,0x0d,0x0a,0x09,0x09,0x63,0x61,0x73,0x65,0x20,0x22,0x61,
0x72,0x72,0x61,0x79,0x22,0x3a,0x0d,0x0a,0x09,0x09,0x63,0x61,0x73,0x65,0x20,0x22,0x63,0x6c,0x61,0x73,
0x73,0x22,0x3a,0x0d,0x0a,0x09,0x09,0x63,0x61,0x73,0x65,0x20,0x22,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,
0x65,0x22,0x3a,0x0d,0x0a,0x09,0x09,0x09,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x62,0x6a,0x73,0x5f,
0x72,0x65,0x67,0x2e,0x72,0x65,0x66,0x73,0x5b,0x76,0x5d,0x2e,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,
0x28,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x63,0x61,0x73,0x65,0x20,0x22,0x69,0x6e,0x74,0x65,0x67,0x65,0x72,
0x22,0x3a,0x0d,0x0a,0x09,0x09,0x63,0x61,0x73,0x65,0x20,0x22,0x66,0x6c,0x6f,0x61,0x74,0x22,0x3a,0x0d,
0x0a,0x09,0x09,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x76,0x3b,0x0d,0x0a,0x09,0x09,
0x63,0x61,0x73,0x65,0x20,0x22,0x62,0x6f,0x6f,0x6c,0x22,0x3a,0x0d,0x0a,0x09,0x09,0x20,0x20,0x20,0x20,
0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x76,0x2e,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x29,0x3b,
0x0d,0x0a,0x09,0x09,0x63,0x61,0x73,0x65,0x20,0x22,0x73,0x74,0x72,0x69,0x6e,0x67,0x22,0x3a,0x0d,0x0a,
0x09,0x09,0x09,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x76,0x3b,0x0d,0x0a,0x09,0x09,0x63,0x61,0x73,0x65,
0x20,0x22,0x6e,0x75,0x6c,0x6c,0x22,0x3a,0x0d,0x0a,0x09,0x09,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,
0x72,0x6e,0x20,0x22,0x6e,0x75,0x6c,0x6c,0x22,0x3b,0x0d,0x0a,0x09,0x09,0x64,0x65,0x66,0x61,0x75,0x6c,
0x74,0x3a,0x0d,0x0a,0x09,0x09,0x09,0x0d,0x0a,0x09,0x09,0x09,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,
0x61,0x63,0x6b,0x5f,0x74,0x79,0x70,0x65,0x28,0x3a,0x3a,0x74,0x79,0x70,0x65,0x28,0x76,0x29,0x29,0x3b,
0x0d,0x0a,0x09,0x7d,0x0d,0x0a,0x7d,0x0d,0x0a,0x0d,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x61,0x63,
0x6b,0x65,0x64,0x5f,0x74,0x79,0x70,0x65,0x73,0x3d,0x7b,0x0d,0x0a,0x09,0x5b,0x22,0x6e,0x75,0x6c,0x6c,
0x22,0x5d,0x3d,0x22,0x6e,0x22,0x2c,0x0d,0x0a,0x09,0x5b,0x22,0x73,0x74,0x72,0x69,0x6e,0x67,0x22,0x5d,
0x3d,0x22,0x73,0x22,0x2c,0x0d,0x0a,0x09,0x5b,0x22,0x69,0x6e,0x74,0x65,0x67,0x65,0x72,0x22,0x5d,0x3d,
0x22,0x69,0x22,0x2c,0x0d,0x0a,0x09,0x5b,0x22,0x66,0x6c,0x6f,0x61,0x74,0x22,0x5d,0x3d,0x22,0x66,0x22,
0x2c,0x0d,0x0a,0x09,0x5b,0x22,0x75,0x73,0x65,0x72,0x64,0x61,0x74,0x61,0x22,0x5d,0x3d,0x22,0x75,0x22,
0x2c,0x0d,0x0a,0x09,0x5b,0x22,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x22,0x5d,0x3d,0x22,0x66,0x6e,
0x22,0x2c,0x0d,0x0a,0x09,0x5b,0x22,0x74,0x61,0x62,0x6c,0x65,0x22,0x5d,0x3d,0x22,0x74,0x22,0x2c,0x0d,
0x0a,0x09,0x5b,0x22,0x61,0x72,0x72,0x61,0x79,0x22,0x5d,0x3d,0x22,0x61,0x22,0x2c,0x0d,0x0a,0x09,0x5b,
0x22,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x6f,0x72,0x22,0x5d,0x3d,0x22,0x67,0x22,0x2c,0x0d,0x0a,0x09,
0x5b,0x22,0x74,0x68,0x72,0x65,0x61,0x64,0x22,0x5d,0x3d,0x22,0x68,0x22,0x2c,0x0d,0x0a,0x09,0x5b,0x22,
0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x22,0x5d,0x3d,0x22,0x78,0x22,0x2c,0x20,0x0d,0x0a,0x09,0x5b,
0x22,0x63,0x6c,0x61,0x73,0x73,0x22,0x5d,0x3d,0x22,0x79,0x22,0x2c,0x20,0x20,0x0d,0x0a,0x09,0x5b,0x22,
0x62,0x6f,0x6f,0x6c,0x22,0x5d,0x3d,0x22,0x62,0x22,0x2c,0x0d,0x0a,0x09,0x5b,0x22,0x77,0x65,0x61,0x6b,
0x72,0x65,0x66,0x22,0x5d,0x3d,0x22,0x77,0x22,0x20,0x20,0x0d,0x0a,0x7d,0x0d,0x0a,0x0d,0x0a,0x66,0x75,
0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x70,0x61,0x63,0x6b,0x5f,0x74,0x79,0x70,0x65,0x28,0x74,0x79,0x70,
0x65,0x29,0x3a,0x28,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x74,0x79,0x70,0x65,0x73,0x29,0x0d,0x0a,0x7b,
0x0d,0x0a,0x09,0x69,0x66,0x28,0x74,0x79,0x70,0x65,0x20,0x69,0x6e,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,
0x5f,0x74,0x79,0x70,0x65,0x73,0x29,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,
0x5f,0x74,0x79,0x70,0x65,0x73,0x5b,0x74,0x79,0x70,0x65,0x5d,0x0d,0x0a,0x09,0x72,0x65,0x74,0x75,0x72,
0x6e,0x20,0x74,0x79,0x70,0x65,0x0d,0x0a,0x7d,0x20,0x0d,0x0a,0x0d,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,
0x6f,0x6e,0x20,0x69,0x74,0x65,0x72,0x61,0x74,0x65,0x6f,0x62,0x6a,0x65,0x63,0x74,0x28,0x6f,0x62,0x6a,
0x2c,0x66,0x75,0x6e,0x63,0x29,0x0d,0x0a,0x7b,0x0d,0x0a,0x09,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74,0x79,
0x20,0x3d,0x20,0x3a,0x3a,0x74,0x79,0x70,0x65,0x28,0x6f,0x62,0x6a,0x29,0x3b,0x0d,0x0a,0x09,0x69,0x66,
0x28,0x74,0x79,0x20,0x3d,0x3d,0x20,0x22,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x22,0x29,0x20,0x7b,
0x0d,0x0a,0x09,0x09,0x74,0x72,0x79,0x20,0x7b,0x20,0x2f,0x2f,0x54,0x52,0x59,0x20,0x54,0x4f,0x20,0x55,
0x53,0x45,0x20,0x5f,0x6e,0x65,0x78,0x74,0x69,0x0d,0x0a,0x09,0x09,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,
0x65,0x61,0x63,0x68,0x28,0x69,0x64,0x78,0x2c,0x76,0x61,0x6c,0x20,0x69,0x6e,0x20,0x6f,0x62,0x6a,0x29,
0x0d,0x0a,0x09,0x09,0x20,0x20,0x20,0x20,0x7b,0x0d,0x0a,0x09,0x09,0x09,0x09,0x66,0x75,0x6e,0x63,0x28,
0x6f,0x62,0x6a,0x2c,0x69,0x64,0x78,0x2c,0x76,0x61,0x6c,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x20,0x20,0x20,
0x20,0x7d,0x0d,0x0a,0x09,0x09,0x7d,0x0d,0x0a,0x09,0x09,0x63,0x61,0x74,0x63,0x68,0x28,0x65,0x29,0x20,
0x7b,0x0d,0x0a,0x09,0x09,0x20,0x20,0x20,0x66,0x6f,0x72,0x65,0x61,0x63,0x68,0x28,0x69,0x64,0x78,0x2c,
0x76,0x61,0x6c,0x20,0x69,0x6e,0x20,0x6f,0x62,0x6a,0x2e,0x67,0x65,0x74,0x63,0x6c,0x61,0x73,0x73,0x28,
0x29,0x29,0x0d,0x0a,0x09,0x09,0x20,0x20,0x20,0x7b,0x0d,0x0a,0x09,0x09,0x09,0x66,0x75,0x6e,0x63,0x28,
0x6f,0x62,0x6a,0x2c,0x69,0x64,0x78,0x2c,0x6f,0x62,0x6a,0x5b,0x69,0x64,0x78,0x5d,0x29,0x3b,0x0d,0x0a,
0x09,0x09,0x20,0x20,0x20,0x7d,0x0d,0x0a,0x09,0x09,0x7d,0x0d,0x0a,0x09,0x7d,0x0d,0x0a,0x09,0x65,0x6c,
0x73,0x65,0x20,0x69,0x66,0x28,0x74,0x79,0x20,0x3d,0x3d,0x20,0x22,0x77,0x65,0x61,0x6b,0x72,0x65,0x66,
0x22,0x29,0x20,0x7b,0x0d,0x0a,0x09,0x09,0x66,0x75,0x6e,0x63,0x28,0x6f,0x62,0x6a,0x2c,0x22,0x40,0x72,
0x65,0x66,0x22,0x2c,0x6f,0x62,0x6a,0x2e,0x72,0x65,0x66,0x28,0x29,0x29,0x3b,0x0d,0x0a,0x09,0x7d,0x0d,
0x0a,0x09,0x65,0x6c,0x73,0x65,0x20,0x7b,0x0d,0x0a,0x09,0x09,0x66,0x6f,0x72,0x65,0x61,0x63,0x68,0x28,
0x69,0x64,0x78,0x2c,0x76,0x61,0x6c,0x20,0x69,0x6e,0x20,0x6f,0x62,0x6a,0x29,0x0d,0x0a,0x09,0x09,0x7b,
0x0d,0x0a,0x09,0x09,0x20,0x20,0x20,0x20,0x66,0x75,0x6e,0x63,0x28,0x6f,0x62,0x6a,0x2c,0x69,0x64,0x78,
0x2c,0x76,0x61,0x6c,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x7d,0x0d,0x0a,0x09,0x7d,0x0d,0x0a,0x09,0x09,0x09,
0x0d,0x0a,0x7d,0x0d,0x0a,0x0d,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x62,0x75,0x69,0x6c,
0x64,0x5f,0x74,0x72,0x65,0x65,0x28,0x29,0x3a,0x28,0x6f,0x62,0x6a,0x73,0x5f,0x72,0x65,0x67,0x29,0x0d,
0x0a,0x7b,0x0d,0x0a,0x09,0x66,0x6f,0x72,0x65,0x61,0x63,0x68,0x28,0x69,0x2c,0x6f,0x20,0x69,0x6e,0x20,
0x6f,0x62,0x6a,0x73,0x5f,0x72,0x65,0x67,0x2e,0x72,0x65,0x66,0x73,0x29,0x0d,0x0a,0x09,0x7b,0x0d,0x0a,
0x09,0x09,0x62,0x65,0x67,0x69,0x6e,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x28,0x22,0x6f,0x22,0x29,0x3b,
0x0d,0x0a,0x09,0x09,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x22,0x74,0x79,0x70,0x65,0x22,
0x2c,0x28,0x69,0x3d,0x3d,0x3a,0x3a,0x67,0x65,0x74,0x72,0x6f,0x6f,0x74,0x74,0x61,0x62,0x6c,0x65,0x28,
0x29,0x3f,0x22,0x72,0x22,0x3a,0x70,0x61,0x63,0x6b,0x5f,0x74,0x79,0x70,0x65,0x28,0x3a,0x3a,0x74,0x79,
0x70,0x65,0x28,0x69,0x29,0x29,0x29,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x5f,
0x74,0x79,0x70,0x65,0x6f,0x66,0x20,0x3d,0x20,0x74,0x79,0x70,0x65,0x6f,0x66,0x20,0x69,0x3b,0x0d,0x0a,
0x09,0x09,0x69,0x66,0x28,0x5f,0x74,0x79,0x70,0x65,0x6f,0x66,0x20,0x21,0x3d,0x20,0x3a,0x3a,0x74,0x79,
0x70,0x65,0x28,0x69,0x29,0x29,0x20,0x7b,0x0d,0x0a,0x09,0x09,0x09,0x61,0x74,0x74,0x72,0x69,0x62,0x75,
0x74,0x65,0x28,0x22,0x74,0x79,0x70,0x65,0x6f,0x66,0x22,0x2c,0x5f,0x74,0x79,0x70,0x65,0x6f,0x66,0x29,
0x3b,0x0d,0x0a,0x09,0x09,0x7d,0x0d,0x0a,0x09,0x09,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,
0x22,0x72,0x65,0x66,0x22,0x2c,0x6f,0x2e,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x29,0x29,0x3b,
0x0d,0x0a,0x09,0x09,0x69,0x66,0x28,0x69,0x20,0x21,0x3d,0x20,0x3a,0x3a,0x67,0x65,0x74,0x72,0x6f,0x6f,
0x74,0x74,0x61,0x62,0x6c,0x65,0x28,0x29,0x29,0x7b,0x0d,0x0a,0x09,0x09,0x09,0x69,0x74,0x65,0x72,0x61,
0x74,0x65,0x6f,0x62,0x6a,0x65,0x63,0x74,0x28,0x69,0x2c,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,
0x28,0x6f,0x62,0x6a,0x2c,0x69,0x64,0x78,0x2c,0x76,0x61,0x6c,0x29,0x20,0x7b,0x0d,0x0a,0x09,0x09,0x09,
0x09,0x69,0x66,0x28,0x3a,0x3a,0x74,0x79,0x70,0x65,0x28,0x76,0x61,0x6c,0x29,0x20,0x3d,0x3d,0x20,0x22,
0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x22,0x29,0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x72,0x65,0x74,
0x75,0x72,0x6e,0x3b,0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x0d,0x0a,0x09,0x09,0x09,0x09,0x69,0x66,0x20,
0x28,0x20,0x3a,0x3a,0x74,0x79,0x70,0x65,0x28,0x69,0x64,0x78,0x29,0x20,0x3d,0x3d,0x20,0x22,0x73,0x74,
0x72,0x69,0x6e,0x67,0x22,0x20,0x26,0x26,0x20,0x69,0x64,0x78,0x2e,0x66,0x69,0x6e,0x64,0x28,0x20,0x22,
0x5f,0x5f,0x22,0x20,0x29,0x20,0x3d,0x3d,0x20,0x30,0x20,0x29,0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x72,
0x65,0x74,0x75,0x72,0x6e,0x3b,0x0d,0x0a,0x0d,0x0a,0x09,0x09,0x09,0x09,0x62,0x65,0x67,0x69,0x6e,0x65,
0x6c,0x65,0x6d,0x65,0x6e,0x74,0x28,0x22,0x65,0x22,0x29,0x3b,0x09,0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,
0x65,0x6d,0x69,0x74,0x76,0x61,0x6c,0x75,0x65,0x28,0x22,0x6b,0x74,0x22,0x2c,0x22,0x6b,0x76,0x22,0x2c,
0x69,0x64,0x78,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x65,0x6d,0x69,0x74,0x76,0x61,0x6c,0x75,
0x65,0x28,0x22,0x76,0x74,0x22,0x2c,0x22,0x76,0x22,0x2c,0x6f,0x62,0x6a,0x5b,0x69,0x64,0x78,0x5d,0x29,
0x3b,0x0d,0x0a,0x09,0x09,0x09,0x09,0x65,0x6e,0x64,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x28,0x22,0x65,
0x22,0x29,0x3b,0x09,0x0d,0x0a,0x0d,0x0a,0x09,0x09,0x09,0x7d,0x29,0x0d,0x0a,0x09,0x09,0x7d,0x0d,0x0a,
0x09,0x09,0x65,0x6e,0x64,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x28,0x22,0x6f,0x22,0x29,0x3b,0x0d,0x0a,
0x09,0x7d,0x0d,0x0a,0x7d,0x0d,0x0a,0x0d,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x65,0x76,
0x61,0x6c,0x75,0x61,0x74,0x65,0x5f,0x77,0x61,0x74,0x63,0x68,0x28,0x6c,0x6f,0x63,0x61,0x6c,0x73,0x2c,
0x69,0x64,0x2c,0x65,0x78,0x70,0x72,0x65,0x73,0x73,0x69,0x6f,0x6e,0x29,0x0d,0x0a,0x7b,0x0d,0x0a,0x09,
0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x5f,0x73,0x72,0x63,0x3d,0x22,0x72,0x65,0x74,0x75,
0x72,0x6e,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x28,0x22,0x0d,0x0a,0x09,0x6c,0x6f,0x63,
0x61,0x6c,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3d,0x5b,0x5d,0x3b,0x0d,0x0a,0x09,0x0d,0x0a,0x09,0x70,
0x61,0x72,0x61,0x6d,0x73,0x2e,0x61,0x70,0x70,0x65,0x6e,0x64,0x28,0x6c,0x6f,0x63,0x61,0x6c,0x73,0x5b,
0x22,0x74,0x68,0x69,0x73,0x22,0x5d,0x29,0x0d,0x0a,0x09,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x69,0x72,
0x73,0x74,0x3d,0x31,0x3b,0x0d,0x0a,0x09,0x66,0x6f,0x72,0x65,0x61,0x63,0x68,0x28,0x69,0x2c,0x76,0x20,
0x69,0x6e,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x73,0x29,0x7b,0x0d,0x0a,0x09,0x09,0x69,0x66,0x28,0x69,0x21,
0x3d,0x22,0x74,0x68,0x69,0x73,0x22,0x20,0x26,0x26,0x20,0x69,0x5b,0x30,0x5d,0x20,0x21,0x3d,0x20,0x27,
0x40,0x27,0x29,0x7b,0x20,0x2f,0x2f,0x66,0x6f,0x72,0x65,0x61,0x63,0x68,0x20,0x69,0x74,0x65,0x72,0x61,
0x74,0x6f,0x72,0x73,0x20,0x73,0x74,0x61,0x72,0x74,0x20,0x77,0x69,0x74,0x68,0x20,0x40,0x0d,0x0a,0x09,
0x09,0x09,0x69,0x66,0x28,0x21,0x66,0x69,0x72,0x73,0x74,0x29,0x7b,0x0d,0x0a,0x09,0x09,0x09,0x09,0x66,
0x75,0x6e,0x63,0x5f,0x73,0x72,0x63,0x3d,0x66,0x75,0x6e,0x63,0x5f,0x73,0x72,0x63,0x2b,0x22,0x2c,0x22,
0x0d,0x0a,0x09,0x09,0x09,0x09,0x0d,0x0a,0x09,0x09,0x09,0x7d,0x0d,0x0a,0x09,0x09,0x09,0x66,0x69,0x72,
0x73,0x74,0x3d,0x6e,0x75,0x6c,0x6c,0x0d,0x0a,0x09,0x09,0x09,0x70,0x61,0x72,0x61,0x6d,0x73,0x2e,0x61,
0x70,0x70,0x65,0x6e,0x64,0x28,0x76,0x29,0x0d,0x0a,0x09,0x09,0x09,0x66,0x75,0x6e,0x63,0x5f,0x73,0x72,
0x63,0x3d,0x66,0x75,0x6e,0x63,0x5f,0x73,0x72,0x63,0x2b,0x69,0x0d,0x0a,0x09,0x09,0x7d,0x0d,0x0a,0x09,
0x7d,0x0d,0x0a,0x09,0x66,0x75,0x6e,0x63,0x5f,0x73,0x72,0x63,0x3d,0x66,0x75,0x6e,0x63,0x5f,0x73,0x72,
0x63,0x2b,0x22,0x29,0x7b,0x5c,0x6e,0x22,0x0d,0x0a,0x09,0x66,0x75,0x6e,0x63,0x5f,0x73,0x72,0x63,0x3d,
0x66,0x75,0x6e,0x63,0x5f,0x73,0x72,0x63,0x2b,0x22,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x22,0x2b,
0x65,0x78,0x70,0x72,0x65,0x73,0x73,0x69,0x6f,0x6e,0x2b,0x22,0x29,0x5c,0x6e,0x7d,0x22,0x0d,0x0a,0x09,
0x0d,0x0a,0x09,0x74,0x72,0x79,0x20,0x7b,0x0d,0x0a,0x09,0x09,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,
0x6e,0x63,0x3d,0x3a,0x3a,0x63,0x6f,0x6d,0x70,0x69,0x6c,0x65,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x66,
0x75,0x6e,0x63,0x5f,0x73,0x72,0x63,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,
0x7b,0x73,0x74,0x61,0x74,0x75,0x73,0x3d,0x22,0x6f,0x6b,0x22,0x20,0x2c,0x20,0x76,0x61,0x6c,0x3d,0x66,
0x75,0x6e,0x63,0x28,0x29,0x2e,0x61,0x63,0x61,0x6c,0x6c,0x28,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x7d,
0x3b,0x0d,0x0a,0x09,0x7d,0x0d,0x0a,0x09,0x63,0x61,0x74,0x63,0x68,0x28,0x65,0x29,0x0d,0x0a,0x09,0x7b,
0x0d,0x0a,0x09,0x09,0x0d,0x0a,0x09,0x09,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x7b,0x73,0x74,0x61,0x74,
0x75,0x73,0x3d,0x22,0x65,0x72,0x72,0x6f,0x72,0x22,0x7d,0x0d,0x0a,0x09,0x7d,0x0d,0x0a,0x7d,0x0d,0x0a,
0x0d,0x0a,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,
0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,
0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,
0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x0d,
0x0a,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,
0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,
0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,
0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x0d,0x0a,
0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x65,0x6d,0x69,0x74,0x76,0x61,0x6c,0x75,0x65,0x28,0x74,
0x79,0x70,0x65,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x2c,0x76,0x61,0x6c,0x75,0x65,0x5f,0x61,0x74,0x74,
0x72,0x69,0x62,0x2c,0x76,0x61,0x6c,0x29,0x0d,0x0a,0x7b,0x0d,0x0a,0x09,0x61,0x74,0x74,0x72,0x69,0x62,
0x75,0x74,0x65,0x28,0x74,0x79,0x70,0x65,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x2c,0x70,0x61,0x63,0x6b,
0x5f,0x74,0x79,0x70,0x65,0x28,0x3a,0x3a,0x74,0x79,0x70,0x65,0x28,0x76,0x61,0x6c,0x29,0x29,0x29,0x3b,
0x0d,0x0a,0x09,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x76,0x61,0x6c,0x75,0x65,0x5f,0x61,
0x74,0x74,0x72,0x69,0x62,0x2c,0x67,0x65,0x74,0x76,0x61,0x6c,0x75,0x65,0x28,0x76,0x61,0x6c,0x29,0x2e,
0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x29,0x29,0x3b,0x0d,0x0a,0x7d,0x0d,0x0a,0x0d,0x0a,0x6c,
0x6f,0x63,0x61,0x6c,0x20,0x73,0x74,0x61,0x63,0x6b,0x3d,0x5b,0x5d,0x0d,0x0a,0x6c,0x6f,0x63,0x61,0x6c,
0x20,0x6c,0x65,0x76,0x65,0x6c,0x3d,0x33,0x3b,0x0d,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x69,0x3b,
0x0d,0x0a,0x0d,0x0a,0x09,0x2f,0x2f,0x45,0x4e,0x55,0x4d,0x45,0x52,0x41,0x54,0x45,0x20,0x54,0x48,0x45,
0x20,0x53,0x54,0x41,0x43,0x4b,0x20,0x57,0x41,0x54,0x43,0x48,0x45,0x53,0x0d,0x0a,0x09,0x77,0x68,0x69,
0x6c,0x65,0x28,0x73,0x69,0x3d,0x3a,0x3a,0x67,0x65,0x74,0x73,0x74,0x61,0x63,0x6b,0x69,0x6e,0x66,0x6f,
0x73,0x28,0x6c,0x65,0x76,0x65,0x6c,0x29,0x29,0x0d,0x0a,0x09,0x7b,0x0d,0x0a,0x09,0x09,0x73,0x74,0x61,
0x63,0x6b,0x2e,0x61,0x70,0x70,0x65,0x6e,0x64,0x28,0x73,0x69,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x6c,0x65,
0x76,0x65,0x6c,0x2b,0x2b,0x3b,0x0d,0x0a,0x09,0x7d,0x0d,0x0a,0x0d,0x0a,0x09,0x2f,0x2f,0x45,0x56,0x41,
0x4c,0x55,0x41,0x54,0x45,0x20,0x41,0x4c,0x4c,0x20,0x57,0x41,0x54,0x43,0x48,0x45,0x53,0x0d,0x0a,0x09,
0x6f,0x62,0x6a,0x73,0x5f,0x72,0x65,0x67,0x2e,0x72,0x65,0x66,0x73,0x5b,0x3a,0x3a,0x67,0x65,0x74,0x72,
0x6f,0x6f,0x74,0x74,0x61,0x62,0x6c,0x65,0x28,0x29,0x5d,0x20,0x3c,0x2d,0x20,0x6f,0x62,0x6a,0x73,0x5f,
0x72,0x65,0x67,0x2e,0x6d,0x61,0x78,0x69,0x64,0x2b,0x2b,0x3b,0x0d,0x0a,0x09,0x66,0x6f,0x72,0x65,0x61,
0x63,0x68,0x28,0x69,0x2c,0x76,0x61,0x6c,0x20,0x69,0x6e,0x20,0x73,0x74,0x61,0x63,0x6b,0x29,0x0d,0x0a,
0x09,0x7b,0x0d,0x0a,0x09,0x09,0x69,0x66,0x28,0x76,0x61,0x6c,0x2e,0x73,0x72,0x63,0x21,0x3d,0x22,0x4e,
0x41,0x54,0x49,0x56,0x45,0x22,0x29,0x20,0x7b,0x0d,0x0a,0x09,0x09,0x09,0x69,0x66,0x28,0x22,0x77,0x61,
0x74,0x63,0x68,0x65,0x73,0x22,0x20,0x69,0x6e,0x20,0x74,0x68,0x69,0x73,0x29,0x20,0x7b,0x0d,0x0a,0x09,
0x09,0x09,0x09,0x76,0x61,0x6c,0x2e,0x77,0x61,0x74,0x63,0x68,0x65,0x73,0x20,0x3c,0x2d,0x20,0x7b,0x7d,
0x0d,0x0a,0x09,0x09,0x09,0x09,0x66,0x6f,0x72,0x65,0x61,0x63,0x68,0x28,0x69,0x2c,0x77,0x61,0x74,0x63,
0x68,0x20,0x69,0x6e,0x20,0x77,0x61,0x74,0x63,0x68,0x65,0x73,0x29,0x0d,0x0a,0x09,0x09,0x09,0x09,0x7b,
0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x69,0x66,0x28,0x76,0x61,0x6c,0x2e,0x73,0x72,0x63,0x21,0x3d,0x22,
0x4e,0x41,0x54,0x49,0x56,0x45,0x22,0x29,0x7b,0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x09,0x76,0x61,0x6c,
0x2e,0x77,0x61,0x74,0x63,0x68,0x65,0x73,0x5b,0x69,0x5d,0x20,0x3c,0x2d,0x20,0x65,0x76,0x61,0x6c,0x75,
0x61,0x74,0x65,0x5f,0x77,0x61,0x74,0x63,0x68,0x28,0x76,0x61,0x6c,0x2e,0x6c,0x6f,0x63,0x61,0x6c,0x73,
0x2c,0x69,0x2c,0x77,0x61,0x74,0x63,0x68,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x09,0x69,0x66,
0x28,0x76,0x61,0x6c,0x2e,0x77,0x61,0x74,0x63,0x68,0x65,0x73,0x5b,0x69,0x5d,0x2e,0x73,0x74,0x61,0x74,
0x75,0x73,0x21,0x3d,0x22,0x65,0x72,0x72,0x6f,0x72,0x22,0x29,0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x09,
0x09,0x62,0x75,0x69,0x6c,0x64,0x5f,0x72,0x65,0x66,0x73,0x28,0x76,0x61,0x6c,0x2e,0x77,0x61,0x74,0x63,
0x68,0x65,0x73,0x5b,0x69,0x5d,0x2e,0x76,0x61,0x6c,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x7d,
0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x65,0x6c,0x73,0x65,0x7b,0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x09,
0x76,0x61,0x6c,0x2e,0x77,0x61,0x74,0x63,0x68,0x65,0x73,0x5b,0x69,0x5d,0x20,0x3c,0x2d,0x20,0x7b,0x73,
0x74,0x61,0x74,0x75,0x73,0x3d,0x22,0x65,0x72,0x72,0x6f,0x72,0x22,0x7d,0x0d,0x0a,0x09,0x09,0x09,0x09,
0x09,0x7d,0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x76,0x61,0x6c,0x2e,0x77,0x61,0x74,0x63,0x68,0x65,0x73,
0x5b,0x69,0x5d,0x2e,0x65,0x78,0x70,0x20,0x3c,0x2d,0x20,0x77,0x61,0x74,0x63,0x68,0x3b,0x0d,0x0a,0x09,
0x09,0x09,0x09,0x7d,0x0d,0x0a,0x09,0x09,0x09,0x09,0x0d,0x0a,0x09,0x09,0x09,0x7d,0x0d,0x0a,0x09,0x09,
0x7d,0x0d,0x0a,0x09,0x09,0x66,0x6f,0x72,0x65,0x61,0x63,0x68,0x28,0x69,0x2c,0x6c,0x20,0x69,0x6e,0x20,
0x76,0x61,0x6c,0x2e,0x6c,0x6f,0x63,0x61,0x6c,0x73,0x29,0x0d,0x0a,0x09,0x09,0x09,0x62,0x75,0x69,0x6c,
0x64,0x5f,0x72,0x65,0x66,0x73,0x28,0x6c,0x29,0x3b,0x0d,0x0a,0x09,0x7d,0x0d,0x0a,0x0d,0x0a,0x0d,0x0a,
0x09,0x62,0x65,0x67,0x69,0x6e,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x28,0x22,0x6f,0x62,0x6a,0x73,0x22,
0x29,0x3b,0x0d,0x0a,0x09,0x62,0x75,0x69,0x6c,0x64,0x5f,0x74,0x72,0x65,0x65,0x28,0x29,0x3b,0x0d,0x0a,
0x09,0x65,0x6e,0x64,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x28,0x22,0x6f,0x62,0x6a,0x73,0x22,0x29,0x3b,
0x0d,0x0a,0x0d,0x0a,0x09,0x62,0x65,0x67,0x69,0x6e,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x28,0x22,0x63,
0x61,0x6c,0x6c,0x73,0x22,0x29,0x3b,0x0d,0x0a,0x0d,0x0a,0x09,0x66,0x6f,0x72,0x65,0x61,0x63,0x68,0x28,
0x69,0x2c,0x76,0x61,0x6c,0x20,0x69,0x6e,0x20,0x73,0x74,0x61,0x63,0x6b,0x29,0x0d,0x0a,0x09,0x7b,0x0d,
0x0a,0x0d,0x0a,0x09,0x09,0x62,0x65,0x67,0x69,0x6e,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x28,0x22,0x63,
0x61,0x6c,0x6c,0x22,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,
0x22,0x66,0x6e,0x63,0x22,0x2c,0x76,0x61,0x6c,0x2e,0x66,0x75,0x6e,0x63,0x29,0x3b,0x0d,0x0a,0x09,0x09,
0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x22,0x73,0x72,0x63,0x22,0x2c,0x76,0x61,0x6c,0x2e,
0x73,0x72,0x63,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x22,
0x6c,0x69,0x6e,0x65,0x22,0x2c,0x76,0x61,0x6c,0x2e,0x6c,0x69,0x6e,0x65,0x2e,0x74,0x6f,0x73,0x74,0x72,
0x69,0x6e,0x67,0x28,0x29,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x66,0x6f,0x72,0x65,0x61,0x63,0x68,0x28,0x69,
0x2c,0x76,0x20,0x69,0x6e,0x20,0x76,0x61,0x6c,0x2e,0x6c,0x6f,0x63,0x61,0x6c,0x73,0x29,0x0d,0x0a,0x09,
0x09,0x7b,0x0d,0x0a,0x09,0x09,0x09,0x62,0x65,0x67,0x69,0x6e,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x28,
0x22,0x6c,0x22,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x09,0x09,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,
0x28,0x22,0x6e,0x61,0x6d,0x65,0x22,0x2c,0x67,0x65,0x74,0x76,0x61,0x6c,0x75,0x65,0x28,0x69,0x29,0x2e,
0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x29,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x09,0x09,0x65,0x6d,
0x69,0x74,0x76,0x61,0x6c,0x75,0x65,0x28,0x22,0x74,0x79,0x70,0x65,0x22,0x2c,0x22,0x76,0x61,0x6c,0x22,
0x2c,0x76,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x09,0x65,0x6e,0x64,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x28,
0x22,0x6c,0x22,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x7d,0x0d,0x0a,0x09,0x09,0x69,0x66,0x28,0x22,0x77,0x61,
0x74,0x63,0x68,0x65,0x73,0x22,0x20,0x69,0x6e,0x20,0x76,0x61,0x6c,0x29,0x20,0x7b,0x0d,0x0a,0x09,0x09,
0x09,0x66,0x6f,0x72,0x65,0x61,0x63,0x68,0x28,0x69,0x2c,0x76,0x20,0x69,0x6e,0x20,0x76,0x61,0x6c,0x2e,
0x77,0x61,0x74,0x63,0x68,0x65,0x73,0x29,0x0d,0x0a,0x09,0x09,0x09,0x7b,0x0d,0x0a,0x09,0x09,0x09,0x09,
0x62,0x65,0x67,0x69,0x6e,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x28,0x22,0x77,0x22,0x29,0x3b,0x0d,0x0a,
0x09,0x09,0x09,0x09,0x09,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x22,0x69,0x64,0x22,0x2c,
0x69,0x2e,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x29,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x09,0x09,
0x09,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x22,0x65,0x78,0x70,0x22,0x2c,0x76,0x2e,0x65,
0x78,0x70,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,
0x28,0x22,0x73,0x74,0x61,0x74,0x75,0x73,0x22,0x2c,0x76,0x2e,0x73,0x74,0x61,0x74,0x75,0x73,0x29,0x3b,
0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x69,0x66,0x28,0x76,0x2e,0x73,0x74,0x61,0x74,0x75,0x73,0x21,0x3d,
0x22,0x65,0x72,0x72,0x6f,0x72,0x22,0x29,0x20,0x7b,0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x09,0x65,0x6d,
0x69,0x74,0x76,0x61,0x6c,0x75,0x65,0x28,0x22,0x74,0x79,0x70,0x65,0x22,0x2c,0x22,0x76,0x61,0x6c,0x22,
0x2c,0x76,0x2e,0x76,0x61,0x6c,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x09,0x09,0x09,0x7d,0x0d,0x0a,0x09,0x09,
0x09,0x09,0x65,0x6e,0x64,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x28,0x22,0x77,0x22,0x29,0x3b,0x0d,0x0a,
0x09,0x09,0x09,0x7d,0x0d,0x0a,0x09,0x09,0x7d,0x0d,0x0a,0x09,0x09,0x65,0x6e,0x64,0x65,0x6c,0x65,0x6d,
0x65,0x6e,0x74,0x28,0x22,0x63,0x61,0x6c,0x6c,0x22,0x29,0x3b,0x0d,0x0a,0x09,0x09,0x20,0x0d,0x0a,0x09,
0x7d,0x0d,0x0a,0x09,0x65,0x6e,0x64,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x28,0x22,0x63,0x61,0x6c,0x6c,
0x73,0x22,0x29,0x3b,0x0d,0x0a,0x0d,0x0a,0x0d,0x0a,0x09,0x6f,0x62,0x6a,0x73,0x5f,0x72,0x65,0x67,0x20,
0x3d,0x20,0x6e,0x75,0x6c,0x6c,0x3b,0x0d,0x0a,0x09,0x73,0x74,0x61,0x63,0x6b,0x20,0x3d,0x20,0x6e,0x75,
0x6c,0x6c,0x3b,0x0d,0x0a,0x09,0x0d,0x0a,0x09,0x69,0x66,0x28,0x22,0x63,0x6f,0x6c,0x6c,0x65,0x63,0x74,
0x67,0x61,0x72,0x62,0x61,0x67,0x65,0x22,0x20,0x69,0x6e,0x20,0x3a,0x3a,0x67,0x65,0x74,0x72,0x6f,0x6f,
0x74,0x74,0x61,0x62,0x6c,0x65,0x28,0x29,0x29,0x20,0x3a,0x3a,0x63,0x6f,0x6c,0x6c,0x65,0x63,0x74,0x67,
0x61,0x72,0x62,0x61,0x67,0x65,0x28,0x29,0x3b,0x0d,0x0a,0x7d,0x63,0x61,0x74,0x63,0x68,0x28,0x65,0x29,
0x0d,0x0a,0x7b,0x0d,0x0a,0x09,0x3a,0x3a,0x70,0x72,0x69,0x6e,0x74,0x28,0x22,0x45,0x52,0x52,0x4f,0x52,
0x22,0x2b,0x65,0x2b,0x22,0x5c,0x6e,0x22,0x29,0x3b,0x0d,0x0a,0x7d,0x0d,0x0a,0x0d,0x0a,0x69,0x66,0x20,
0x28,0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x73,0x63,0x6f,0x70,0x65,0x20,0x29,0x0d,0x0a,0x7b,0x0d,
0x0a,0x09,0x3a,0x3a,0x73,0x65,0x74,0x72,0x6f,0x6f,0x74,0x74,0x61,0x62,0x6c,0x65,0x28,0x20,0x63,0x75,
0x72,0x72,0x65,0x6e,0x74,0x73,0x63,0x6f,0x70,0x65,0x20,0x29,0x3b,0x0d,0x0a,0x7d,0x0d,0x0a,
};

View File

@@ -0,0 +1,277 @@
/*
see copyright notice in sqrdbg.h
*/
local currentscope;
if ( ::getroottable().parent )
{
currentscope = ::getroottable();
::setroottable( ::getroottable().parent );
}
try {
local objs_reg = { maxid=0 ,refs={} }
complex_types <- {
["table"] = null,
["array"] = null,
["class"] = null,
["instance"] = null,
["weakref"] = null,
}
function build_refs(t):(objs_reg)
{
if(t == ::getroottable())
return;
local otype = ::type(t);
if(otype in complex_types)
{
if(!(t in objs_reg.refs)) {
objs_reg.refs[t] <- objs_reg.maxid++;
iterateobject(t,function(o,i,val):(objs_reg)
{
build_refs(val);
build_refs(i);
})
}
}
}
function getvalue(v):(objs_reg)
{
switch(::type(v))
{
case "table":
case "array":
case "class":
case "instance":
return objs_reg.refs[v].tostring();
case "integer":
case "float":
return v;
case "bool":
return v.tostring();
case "string":
return v;
case "null":
return "null";
default:
return pack_type(::type(v));
}
}
local packed_types={
["null"]="n",
["string"]="s",
["integer"]="i",
["float"]="f",
["userdata"]="u",
["function"]="fn",
["table"]="t",
["array"]="a",
["generator"]="g",
["thread"]="h",
["instance"]="x",
["class"]="y",
["bool"]="b",
["weakref"]="w"
}
function pack_type(type):(packed_types)
{
if(type in packed_types)return packed_types[type]
return type
}
function iterateobject(obj,func)
{
local ty = ::type(obj);
if(ty == "instance") {
try { //TRY TO USE _nexti
foreach(idx,val in obj)
{
func(obj,idx,val);
}
}
catch(e) {
foreach(idx,val in obj.getclass())
{
func(obj,idx,obj[idx]);
}
}
}
else if(ty == "weakref") {
func(obj,"@ref",obj.ref());
}
else {
foreach(idx,val in obj)
{
func(obj,idx,val);
}
}
}
function build_tree():(objs_reg)
{
foreach(i,o in objs_reg.refs)
{
beginelement("o");
attribute("type",(i==::getroottable()?"r":pack_type(::type(i))));
local _typeof = typeof i;
if(_typeof != ::type(i)) {
attribute("typeof",_typeof);
}
attribute("ref",o.tostring());
if(i != ::getroottable()){
iterateobject(i,function (obj,idx,val) {
if(::type(val) == "function")
return;
if ( ::type(idx) == "string" && idx.find( "__" ) == 0 )
return;
beginelement("e");
emitvalue("kt","kv",idx);
emitvalue("vt","v",obj[idx]);
endelement("e");
})
}
endelement("o");
}
}
function evaluate_watch(locals,id,expression)
{
local func_src="return function ("
local params=[];
params.append(locals["this"])
local first=1;
foreach(i,v in locals){
if(i!="this" && i[0] != '@'){ //foreach iterators start with @
if(!first){
func_src=func_src+","
}
first=null
params.append(v)
func_src=func_src+i
}
}
func_src=func_src+"){\n"
func_src=func_src+"return ("+expression+")\n}"
try {
local func=::compilestring(func_src);
return {status="ok" , val=func().acall(params)};
}
catch(e)
{
return {status="error"}
}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
function emitvalue(type_attrib,value_attrib,val)
{
attribute(type_attrib,pack_type(::type(val)));
attribute(value_attrib,getvalue(val).tostring());
}
local stack=[]
local level=3;
local si;
//ENUMERATE THE STACK WATCHES
while(si=::getstackinfos(level))
{
stack.append(si);
level++;
}
//EVALUATE ALL WATCHES
objs_reg.refs[::getroottable()] <- objs_reg.maxid++;
foreach(i,val in stack)
{
if(val.src!="NATIVE") {
if("watches" in this) {
val.watches <- {}
foreach(i,watch in watches)
{
if(val.src!="NATIVE"){
val.watches[i] <- evaluate_watch(val.locals,i,watch);
if(val.watches[i].status!="error")
build_refs(val.watches[i].val);
}
else{
val.watches[i] <- {status="error"}
}
val.watches[i].exp <- watch;
}
}
}
foreach(i,l in val.locals)
build_refs(l);
}
beginelement("objs");
build_tree();
endelement("objs");
beginelement("calls");
foreach(i,val in stack)
{
beginelement("call");
attribute("fnc",val.func);
attribute("src",val.src);
attribute("line",val.line.tostring());
foreach(i,v in val.locals)
{
beginelement("l");
attribute("name",getvalue(i).tostring());
emitvalue("type","val",v);
endelement("l");
}
if("watches" in val) {
foreach(i,v in val.watches)
{
beginelement("w");
attribute("id",i.tostring());
attribute("exp",v.exp);
attribute("status",v.status);
if(v.status!="error") {
emitvalue("type","val",v.val);
}
endelement("w");
}
}
endelement("call");
}
endelement("calls");
objs_reg = null;
stack = null;
if("collectgarbage" in ::getroottable()) ::collectgarbage();
}catch(e)
{
::print("ERROR"+e+"\n");
}
if ( currentscope )
{
::setroottable( currentscope );
}

View File

@@ -0,0 +1,162 @@
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
<FileVersion major="1" minor="1"/>
<Project>
<Option title="sqdbg"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option compiler="0"/>
<Build>
<Target title="Debug">
<Option output="Debug\sqdbg.exe"/>
<Option working_dir="."/>
<Option object_output="Debug"/>
<Option deps_output=".deps"/>
<Option external_deps="..\lib\libsqdbglibD.a;..\lib\libsquirrelD.a;..\lib\libsqstdlibD.a;"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-W"/>
<Add option="-O0"/>
<Add option="-DWIN32"/>
<Add option="-D_DEBUG"/>
<Add option="-D_CONSOLE"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add directory="..\include"/>
</Compiler>
<Linker>
<Add library="..\lib\libsqdbglibD.a"/>
<Add library="..\lib\libsquirrelD.a"/>
<Add library="..\lib\libsqstdlibD.a"/>
<Add library="wsock32"/>
<Add directory="..\lib"/>
</Linker>
</Target>
<Target title="Release">
<Option output="Release\sqdbg.exe"/>
<Option working_dir="."/>
<Option object_output="Release"/>
<Option deps_output=".deps"/>
<Option external_deps="..\lib\libsqdbglib.a;..\lib\libsquirrel.a;..\lib\libsqstdlib.a;"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-W"/>
<Add option="-g"/>
<Add option="-DWIN32"/>
<Add option="-DNDEBUG"/>
<Add option="-D_CONSOLE"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add directory="..\include"/>
</Compiler>
<Linker>
<Add library="..\lib\libsqdbglib.a"/>
<Add library="..\lib\libsquirrel.a"/>
<Add library="..\lib\libsqstdlib.a"/>
<Add library="wsock32"/>
<Add directory="..\lib"/>
</Linker>
</Target>
<Target title="Debug - Unicode">
<Option output="Debug - Unicode\sqdbg.exe"/>
<Option working_dir="."/>
<Option object_output="Debug - Unicode"/>
<Option deps_output=".deps"/>
<Option external_deps="..\lib\libsqdbglibDU.a;..\lib\libsquirrelDU.a;..\lib\libsqstdlibDU.a;"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-W"/>
<Add option="-O0"/>
<Add option="-DWIN32"/>
<Add option="-D_DEBUG"/>
<Add option="-D_CONSOLE"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add option="-D_CRT_NON_CONFORMING_SWPRINTFS"/>
<Add directory="..\include"/>
</Compiler>
<Linker>
<Add library="..\lib\libsqdbglibDU.a"/>
<Add library="..\lib\libsquirrelDU.a"/>
<Add library="..\lib\libsqstdlibDU.a"/>
<Add library="wsock32"/>
<Add directory="..\lib"/>
</Linker>
</Target>
<Target title="Release - Unicode">
<Option output="Release - Unicode\sqdbg.exe"/>
<Option working_dir="."/>
<Option object_output="Release - Unicode"/>
<Option deps_output=".deps"/>
<Option external_deps="..\lib\libsqdbglibU.a;..\lib\libsquirrelU.a;..\lib\libsqstdlibU.a;"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-W"/>
<Add option="-g"/>
<Add option="-DWIN32"/>
<Add option="-DNDEBUG"/>
<Add option="-D_CONSOLE"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add option="-D_CRT_NON_CONFORMING_SWPRINTFS"/>
<Add directory="..\include"/>
</Compiler>
<Linker>
<Add library="..\lib\libsqdbglibU.a"/>
<Add library="..\lib\libsquirrelU.a"/>
<Add library="..\lib\libsqstdlibU.a"/>
<Add library="wsock32"/>
<Add directory="..\lib"/>
</Linker>
</Target>
</Build>
<Unit filename="..\include\sqdbgserver.h">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="..\include\sqrdbg.h">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="main.cpp">
<Option compilerVar="CPP"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="serialize_state.nut">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="test.nut">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
</Project>
</CodeBlocks_project_file>

Binary file not shown.

View File

@@ -0,0 +1,494 @@
%PDF-1.3
%<25><><EFBFBD><EFBFBD>
4 0 obj
<< /Type /Info
/Producer (FOP 0.20.5) >>
endobj
5 0 obj
<< /Length 196 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
GaqdY]+0EX&;B(lT41D@*+tSN;/4Ut;R\G?OEDk#&6F++6)>^%qht(5^"An`O:%O/^cqrFJZf5C'FZgXJMj2O1`/_b3XrfU>BYFS9hM,(@3_nF3gBoT9Bc3qXP4mt@uMS5.jO.p#ClaLCf.d3?VEJJ<[f`FTjmgRGAS)Ccn@nXebn8]oeWu"qgWh^iWC>m0t%~>
endstream
endobj
6 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 5 0 R
>>
endobj
7 0 obj
<< /Length 1032 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Gasao968i1&AJ$CE(_rr;`u\TDGNtK1[1kLh:`p3KHqH]*!CH`mu*-((.W6uT(0&.o'MVOh.MXI+(H"fnJYuh,!bfF7"P/f.#\3ITJY<\-jii&U@5SKShuXoniO49dM2/YRh4D)V6*SD;n]*>Y%oLMAVbt#oFkf.N5l'T"1[mbHe[m"]Ltb5Dg>*S&d(Z[C`:rl'b09+++Z$SDqFFH40_"A<]A/Art-QNPG01U=6;/UWrG.#,2^ZM^.E;WVq-(C$jTJk3uk.)]'Vq_N^QdDo.BZ6**>d*W4O5OMY/o$W&lcb#d'bWF=/Kbhg7qA%pVZOEP(DXpLI`sUf/WLPn+n"3oN(ZcqaCVE=QR1Gf^S8_NnM)\S#;blp\i1agl%]q,ps5?'9@g582-SVc-qn9mbJs,$E7'g*nL#=so:Y=@)[H&/DQ]!-2g2Sr[G'inY<lB.@-:pIq+#]ShO)(<WfGTd.!?<ak1>Y"eVaU[rhBW8g>L1#X*UbuiN2W(tu\\JID7K'9dtlZ0(o<>D6FW@SnF!+g*2X!#Pqeh83A[9U59+:+jIS<:0hrKS_M0b1+u.`l_55eED8/Z+c)QCq_Ks$[<'!O'6s!gV\K*5-nX(X71TcDeOLO"B)EG`"&ZpM8[t6P7fS_@RIJJ6]YXe3PU19QJ^k\lVYl";#Te`d12]At[%@]l=u=TjIq'E5Gcq(/\-uNcKFU[\/F1;`cU\7\DXMeJ7.bZsdD*C*!@)L'8O:T`Z"eQA0r`>pqBF"<&&:SN(Xnf'UP+cb[8.)<%*['SRURShGgs+,./IB>kiUR#<5h\Q^9dN!:2H#LkOfCDtFUTr-p6%jej'EFOU[qe*&Uo[XC%$P:a;b(6gJgM(,gLVGbMe+")*-1VY"'1eY)BY;c[f3EQG6@\ufcb%;uGCR;d\^?otfbREY^KEbR,`[gm:u/4`kSJlJD9;#G8P8TVFb&.JrZ3l/CnLa#NV#El=i7A-3)+at]KTka-i6>G^BDgQQ([eq*LN+fW*4ROgh2t.Rl-50g&1q"H]<^~>
endstream
endobj
8 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 7 0 R
>>
endobj
9 0 obj
<< /Length 71 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Garg^iGoCd.c`?]8EV`b1=.gR0K1`91K?+0ZOMGdU/Zh'Y!=Te%#&:?HH*JE!<E/X&V'~>
endstream
endobj
10 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 9 0 R
>>
endobj
11 0 obj
<< /Length 500 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Gb"/h4)]a*&:etR`JnDaMdI=@V@P+]qN/1d6QUtO9qeC?l-HOB8Xr1GUoFN2F^k/oR):!5dpWGA34n<<'k%F4/;PDZ-q*d'TGWM.N`2)J$2PAX6Tl@69b7(o.?[:Q+=sjiiC-o!VPl_*n-&U-VNsIlS&JuGB;NfU@Z_5%BUb;#QUJE0W1T%k>ak1qSt!klKQO7$h9>R6&eYfioViB3kt3uUd59gL.kd@GKrGhDZYU&F\m@<.'%5[1j,RQQGKeEW5^>5eB1:\31c"`I=#9MT%Cb0Dam9TGl$q.OlD;p1n':)d@HqE,^%fBI<S$9-S@cr*ZKkd>+X-5P38:Y+p95\Q^;:cXomD3IoRdC4RE?5-7K?$8oo>,qOA:j;VVqc,$(5gPR]Y%34Dd>M6MdNgRVkSAD#:SJC;0$JK(5u[NJ)t<oHV>sQ/\rgnD=.lDB,PW,n`V`Oep2c(>K,s]g"4eKHH_nFs`9O/La4cKPHc4>PNDk"5=c#SH~>
endstream
endobj
12 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 11 0 R
/Annots 13 0 R
>>
endobj
13 0 obj
[
14 0 R
16 0 R
18 0 R
20 0 R
22 0 R
24 0 R
26 0 R
]
endobj
14 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 120.0 655.001 187.48 645.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 15 0 R
/H /I
>>
endobj
16 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 144.0 644.001 183.43 634.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 17 0 R
/H /I
>>
endobj
18 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 144.0 633.001 242.31 623.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 19 0 R
/H /I
>>
endobj
20 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 144.0 622.001 230.65 612.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 21 0 R
/H /I
>>
endobj
22 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 120.0 611.001 189.14 601.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 23 0 R
/H /I
>>
endobj
24 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 144.0 600.001 183.43 590.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 25 0 R
/H /I
>>
endobj
26 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 120.0 589.001 142.77 579.001 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A 27 0 R
/H /I
>>
endobj
28 0 obj
<< /Length 1965 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Gatm<>B?Pt'RnB3@(-Z']8csPhKBu]nRgV!g.>!3Th?_b6+1J^&:s5GSc8@)&0QODZIA(57H^=bqfFHR0:\fD:TB(*A6Gqn/<47TH)*tdr"R8k8<s\-7YYMIc<C'fEk1bhSBuh/MG4c;Q>@MgM1XHgZQa8+'q'!+b<kPmEde1E\tmE?)U-a/'O3=#6UQ`F1L&-SbR-LZn`;%hB[3Sf_:L\'a+tl.2es$6>6C&a1n54Ff.,Hn,)gTKUg?e+B[!&,+f-ID*(ne=\34NBj#["i':*>NKt`n/8W4Q=!.5ZPW\1$^J6+TRCD@]8/YUp\m,!In[ZRD%9PS`pF`@la<GWflgrfEGj3'QD?T<3(i<(I%E)&PGI*G`!/guRNA1&eM'>>er(^YfTcSW`LVe]Cq"nAd'"CL+iB^A0>7*Z:Aa-IO"L2t_*$cm%9=rSpH[Q%1O"OG(hUJfH(\o$2&pW19+/B\3OLfM?o+E-JSQ][rc9&bljbM0AnD9%XG,K/O,-kGq0%VN&'rPEb3$M1L64^ZTIZWqXdM)lenrTIB27k`]B!@=?$[Fsn.dTkBuAE$5/\15KP?8aB'PKfsM3@"=USt^!MdW*`7LmT#Rh=_NgoSmf-=,42MEH<iJ7AXu:T0hto9bqWg:_`E4NE?0l$YqSTQGk`-(FBj*/.)3J`;bI`<gO1JLfg]H$M>F8ME*l46u8DslKuMb<jmj^7oJ=M6:VgF?NQ#hjE)_rRf?.\4EDZsI?FrG(8?C]",;+5>UlLh#H0j&7HpE:_&aUC9.4VMXY6F"=:jTuZkVa",SIu?_K?cZIP3NNk$GP7lQE&Q<A:.G6?<`O#F&s;rZr&U<jSlP?bc*i1A5creI,/pRsQo!6d(2b@5j1YU)<_AOl[kMeGSFT(PX@ah6=fWA/Ht_N0?mI'3`F\n^a1'E+CT2#]4r1Oha-%#\cV*j?p1e(6:>"I]B1OIgRja'6ipQ?<H+6_3=5)F4%5f59G#.ZJC_aZG#_,$'up4D&VE1_0l&XBP^,Kn$oB%HfBhG8X#,m_Gb7[Y)_?5C@9@To1Yf[RPck[ehHf]2/?SWb>7,bp`5V-R]Jpuir1>WDgq(=b2cB9SHi'eJlbfM9T[WTJi1\>=:bi607+)u@Kpt>*Pu'8j8JEq[7LJ1,mjC3pN=<]4,9iFVC!6RRZ0.,Q8(YLDHr^JjrpXT,joW?gW&2=`c-rmh6pU!c2r?fMH*KG=B\orR<,+'05\::'\2F.ggb8d-d:doqo`jl7\/2s6Jg0hU>M;u)W&e1oNF;]glO8-E[;KeUY:gQP?iNDm'^%<?2?o`qC@VIl::W\rV"m:fsZNMN7@^gnTT28@22utN&7SYA`8s;\Gfk1'"`e!$EP(u$Fp*RbrPYM"nt=1e*PLGH!`dA.OBbr6u`/R^5N`>?EfWmW%96D\-P[qhAs+YTDO$j0J\X1#>4OrNOaX>V(5NaY%)"oa7)n)(0-&^XL<MJh*$_cmmf=u"/f&2ji`^:cd,BY9&M*4)/K+E=3@e*<*g\M*^"!Z0-ON82(p-f)Ue>P[&bIHpAXFFh)fM&4;g6@o:,8gUD[]*T1>E])I5I1?]XV8B0&&WQ/11Eic]Y:E([t3hQ*CC9sI]/C;%?@-Kc1(U0m'ocLg)hlJ*9MX0P]8#q'[VqD*1_Xe[EbbFqiG`p%YKpcG#%3HRUuTrJfV>o;J^GmU4$qPPd?Y"+]'rOF_U:>BSj<ZbEkYH'ZdVi^7e^OV_2\qX2[Q-7PJX`.7,65EW&q8MV4??V#Z-OqS%?maKM^nf2-c8</FCcA+Xm&eCMahuBJT!GXD.5Ea)3h.;/76hVnqWVED^78O&B)t\2V9Z!AfutW*oGcA@a8QW$*T7ogofUE]SI]jC8e&u;WB:[6T'HllS45rt<c!!L6/fV<S>0`j^KMM6WPKe_mU*pO*XWN+dc0KYkecS%KT&fUp[qiITW3-Zbb=m:3e^f<(D0ffdf~>
endstream
endobj
29 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 28 0 R
>>
endobj
30 0 obj
<< /Length 822 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Gas1]>u03/'RfGR0MI[.$/@MKj$XOk1c6?g.dc4fP6e0\j-4:).8C3\e,K67-H--nP_[3&\`]R]fb^4970nt_>p-G5$Pj`c>l>dqr'4UEf7OJ4nHA9M/>#)IZVnlBooC`8#NDW^HSpEtH8)!$pmYNRnfqmBkm&7<_gT[q>.iXaqZEW&6\KZZH+M5dX;"%M$8(FV[EP[&EMd`?361Q6d(eq!;r=\`SSYj"k&g=19To<5l(2_1,i)6O)Ld8]D.?dbjs--T/<]GY%q#qD2&KieLNYCMWBqKsAMmE:11-E<l>]U*.N^R,KiD75B4\2$&&Y&7OHS-`ji734*Jao.(p_0DT+sXZ!kgMK?LR+!E5n)d`.rutgk[Iu%d0UL3D>1eqW7cs_#'>=9E*,i6oW_F./(rq_]b(/C_mp"LdP+&GW^s5;8i9\%hbdfT%4(6^<W$E<iC;+kAjl\MnD`RVK2?>>hSF6)1`LVle#+X[-=/LeY/5C!1>t?h`R>5^6cP)^!oO2H6hi>KYXgoLCS48.3DPe<7U>D,noJ'TR0A+]BdDuZ:_$/;>7g`C&7cR*ad.`W9UigRtL*(4UO@MA]#Vt0s``2FMlF[PEF\DV3%F\YdQD>+#d2']]QgufbKX26Jj&!^+)a%,$K4V+Ud[9in?=%@2+G<@d[N0TRS^jl[?=]1TuQ!K_n%;(Y]i$(kZ6^>R$^'<j.5RoDWd4MQ3$[X#Fqm[Y`ll_0WALh.@D2KA4t/Mp?CM['q_Y&>Xhm^Kpf7,fi%,:1'Bcd*=d]!s=A34/oTTa`cLmq0bDG?d`Fc01euYig/@U7/m99iIp:~>
endstream
endobj
31 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 30 0 R
>>
endobj
32 0 obj
<< /Length 1571 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
GatTIgMYb(o\ElJ[jFAWLn_',;q!'tL)/%QmE7U+Zpi_;AC6MfBA(n'OsoikAfM%CJ;!+Tgi[MYj`GN_9cVJLED2neEoK-\$$KSHK:U(NXqSe]$N8&6DOeI;5-='MZJs@opS%p>Z($ElM2-iTa4m(,igq`)_=@akFoHBXJ$g2#'To'>37J]HaRt`tgLiFJ<i]D0_fdo.4LOl3Aju"(#fj[>2irq!VdRejE]:P!!`GPeM\(4`<2;A`%McC*1@Q6V7o3snRaS)4i];'uN<\fZYON.DL]i1m?hs?#8E[%G4QfW>BW,_?+:/TN2"dIOGP>0G^J1mq?iJFX'&u,DSkI))(.C+p]dO_=c>'cEDsm(t^ARc+^+.-?c#g6Q"$i-<I$M#PTZXYj,_3?2KIdXXkB;pH!!Pb@^D%kj4CQE".k.K88gTstrn_u6=9@:a$3PrC6&U=D[^+3$TTs)K3I<XacV$j!7-u[;C!L`.0$:)L(BqtjVI1>d!Ca$;(YLqt^+jS"$bBcHZHD(KVfh`>9Bq`M0]3q"*Z_9:Jaeb%4-VJh9@@:gUk'Jqh467_q7`ckgU?tc0mZ.BKYt/':"HuAb!>%[e*Y-!Xg+sm@'`)XV.;SW$$h3sW^l`^*q!@XcaQW'E`c*")7rFb=o[;R+(4)1__@j5*uh0_P?!aGCcYYfnJcB(m$d&ce-,qA&*8$sCrmn(e8Ja1L),h]@f^am;dFMtq/1jVlO3*Ml&`P7B3A3lVG0nsJB2EJ1XEA#lj]5-6*opsTPMn>>u/s%j^`OLmb!O704PgQ$uckV2giO8V!I$k*]'C?MoI8qB)f/*-!?*6l6H)(2AREZ,t)L@`EMa7?s8EhE,E(P$@q1]#I<EZ8ctp,S9"]`eo\Bf@ZC71M2hD?@Dqihj?&c2jbn[F+gu"f>`7c+TE`em9FY+=K>-*G692G&%HcfB3=Buc4/d-KYG!!IY&o\;Li;tk;!VO0_7%"<%?&hsK%ukX(VEVH%8tqe:QlD/oX-*KN2=@&r"03AWPJQe3B.gsYu$:KV^r";$+jPAB`'>gK;XA"g[>A?R[)g2NN`V/8bMJfngV123gcpOf[cA]lpLImO8'de_kWM[ie8ceO'2%6U"&?bjnk?+6I]a@7_;a4Y%0#RF)0qaWi^qO2q%/u*km,l*np.'(lu46d:;#(6@[3B)m,I_:od#+ZYk'RQ/Hf%*ia8(neCFpK+4UCJSh[)\RfX2JhK+d3Odbq(Fh(oN=#&WW&t,@?]W*uZ0oVA3<tnNK4ED06`:fBG`LCaJm91)09-;Fh4oi4X5IF\R,U,\;QJE6mjfG!&ep=hqS:[7PuTPfk8O^TnX.k,b$$s52s1(RePlMA4(55lbpK7;`2MRA>(GccWH4LGN-_a"5gYaYN>"EEH==#)p>od\+3^8M!$hP+gSrVX'B#rn\JCnPHG_&,)?5cOT7^8=W'2nXbEraqZLs$ASY![S_*Q[U<r$4WBAi0%9C/:$47NURc2?[ghR(%j2g]&D(%,qfh,_%($J5\;6&8t`KDiMB._8/6!eN?\^A\(cY;TZ*S`siVi<+\CJ,U"SnJA4W:s/~>
endstream
endobj
33 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 32 0 R
>>
endobj
34 0 obj
<< /Length 941 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
GatU1hf"u<&:Vr4_.+[3'SCsKHYTs3l[GdJbFY$!EkkMP`2:Og[/KYR`oK6K>A4``]!HhBh0hKESRo.f$P[h6n,k<oB7X./O;I*kH"`W0`FKk_..sm*pLF3mpA3qLlW&--rp7P>H]nT'eQ`mUC>o-`Z;2AhhEq`+;/e:B;>4$oLU"*b6rm9<?I8ARWi3:\qd@9Y2bD@;78gOYr2mEGb6W<h7*?0/S_+*lqu'.l/#tZ\60gnBMPTXJ<hQc7jFWXCQ'<fNQ>kI)h::\`B94:)@:^fkW1B"\TTP*c50gdT"O52Q2rOqE`@3BBLJ.a>g*'Ts`gL;3B"r&b>56S-L.d<W%?V1'@2B(o]$mbogSQ+9j;28i*gl5(!b*HD!Esq*=RI#k698.A;mVuB-Fe]).9<)V!b<pRNI14a-NdIhgL$W(68V2mQ.XK^_ZK.\7OOrdNK>l0+7Hd%^Zub>buY;*CT,`CD-C&P]E27"D9/nflgN1MlCL"?4''t+Yt[T+ja_@&cABm+EB:?Ih'Zgp,s8*-D]hqBo]?tg^%BJB?M`3@4]'KTZD#PjF(@l5>\FWO/RZt*Vj1Jd*+sbdf&>SNe1I4b/(XaBLQN6;UX^]0cgD+24"mEbO4>_Ve/8aWjZK"qpANCOQ8f1.n(>^4Q6c.Gg%F\_Et4q@hM?/dO.\,bM/tC0J?PQNNm5*`a2]">KC4Z7Yd90R5I!$S>jM_p\dWVq3R-qS:NV:mGD-b(VU/=[[n#Z/@>[QUY<&224,V&'="fN)e`,Bm'?DL5/H*Y!FeLd3ZgUFc@9ckdj-<P9DT#?j@KRNg:=lQh(ScO>h/mX_ZB)"/?+h[:]=p?\*#thc.Nc]=p`FS1L&(JRN5Kau1,5+U^l1m!<8/ikcTJ5D?^N0(Nq>X$e#2(U!WRnCELkQm#7:+!(\+7ClJ?@<@uH?JkRY5-16q~>
endstream
endobj
35 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 34 0 R
>>
endobj
36 0 obj
<< /Length 287 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
GasJM_/@+D%#44r$6MQC-Ae9M>`gpYgns0k9o.14H6=5F&:=>/Q>R*XTj4\os1ZFngl(D1JS'"a^m@C)7OX@4.EF><Y\o2]1[mJN)a/thp_q%3pdN4P7QsZOOZ\K)&iK?tlVH/`P,W^=me*+/bk9q<^MNJ%c*@[VS;cDmRhINNZf<]/p4d@lLR?]6E0o,;L-9qHX'".'e%jSrEE0u`DUrq9`B%%BBJ1oa[QJl@n(tM%A?=,X>F0)mWht;E]SO,5b#q412`=ou,c,oV3.-h`4ms=llYUJ~>
endstream
endobj
37 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 36 0 R
/Annots 38 0 R
>>
endobj
38 0 obj
[
]
endobj
41 0 obj
<<
/Title (\376\377\0\123\0\161\0\165\0\151\0\162\0\162\0\145\0\154\0\40\0\122\0\145\0\155\0\157\0\164\0\145\0\40\0\104\0\145\0\142\0\165\0\147\0\147\0\145\0\162\0\40\0\61\0\56\0\60)
/Parent 39 0 R
/Next 43 0 R
/A 40 0 R
>> endobj
43 0 obj
<<
/Title (\376\377\0\124\0\141\0\142\0\154\0\145\0\40\0\157\0\146\0\40\0\103\0\157\0\156\0\164\0\145\0\156\0\164\0\163)
/Parent 39 0 R
/Prev 41 0 R
/Next 44 0 R
/A 42 0 R
>> endobj
44 0 obj
<<
/Title (\376\377\0\103\0\150\0\141\0\160\0\164\0\145\0\162\0\240\0\61\0\56\0\240\0\124\0\150\0\145\0\40\0\104\0\145\0\142\0\165\0\147\0\147\0\145\0\162)
/Parent 39 0 R
/First 45 0 R
/Last 47 0 R
/Prev 43 0 R
/Next 48 0 R
/Count -3
/A 15 0 R
>> endobj
45 0 obj
<<
/Title (\376\377\0\117\0\166\0\145\0\162\0\166\0\151\0\145\0\167)
/Parent 44 0 R
/Next 46 0 R
/A 17 0 R
>> endobj
46 0 obj
<<
/Title (\376\377\0\111\0\156\0\164\0\145\0\147\0\162\0\141\0\164\0\151\0\156\0\147\0\40\0\164\0\150\0\145\0\40\0\144\0\145\0\142\0\165\0\147\0\147\0\145\0\162)
/Parent 44 0 R
/Prev 45 0 R
/Next 47 0 R
/A 19 0 R
>> endobj
47 0 obj
<<
/Title (\376\377\0\124\0\150\0\145\0\40\0\156\0\145\0\164\0\167\0\157\0\162\0\153\0\40\0\160\0\162\0\157\0\164\0\157\0\143\0\157\0\154)
/Parent 44 0 R
/Prev 46 0 R
/A 21 0 R
>> endobj
48 0 obj
<<
/Title (\376\377\0\103\0\150\0\141\0\160\0\164\0\145\0\162\0\240\0\62\0\56\0\240\0\101\0\120\0\111\0\40\0\122\0\145\0\146\0\145\0\162\0\145\0\156\0\143\0\145)
/Parent 39 0 R
/First 49 0 R
/Last 49 0 R
/Prev 44 0 R
/Next 50 0 R
/Count -1
/A 23 0 R
>> endobj
49 0 obj
<<
/Title (\376\377\0\104\0\145\0\142\0\165\0\147\0\147\0\145\0\162)
/Parent 48 0 R
/A 25 0 R
>> endobj
50 0 obj
<<
/Title (\376\377\0\111\0\156\0\144\0\145\0\170)
/Parent 39 0 R
/Prev 48 0 R
/A 27 0 R
>> endobj
51 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F3
/BaseFont /Helvetica-Bold
/Encoding /WinAnsiEncoding >>
endobj
52 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F5
/BaseFont /Times-Roman
/Encoding /WinAnsiEncoding >>
endobj
53 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F10
/BaseFont /Courier-Oblique
/Encoding /WinAnsiEncoding >>
endobj
54 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F6
/BaseFont /Times-Italic
/Encoding /WinAnsiEncoding >>
endobj
55 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F1
/BaseFont /Helvetica
/Encoding /WinAnsiEncoding >>
endobj
56 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F11
/BaseFont /Courier-Bold
/Encoding /WinAnsiEncoding >>
endobj
57 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F9
/BaseFont /Courier
/Encoding /WinAnsiEncoding >>
endobj
1 0 obj
<< /Type /Pages
/Count 9
/Kids [6 0 R 8 0 R 10 0 R 12 0 R 29 0 R 31 0 R 33 0 R 35 0 R 37 0 R ] >>
endobj
2 0 obj
<< /Type /Catalog
/Pages 1 0 R
/Outlines 39 0 R
/PageMode /UseOutlines
>>
endobj
3 0 obj
<<
/Font << /F3 51 0 R /F5 52 0 R /F10 53 0 R /F1 55 0 R /F6 54 0 R /F9 57 0 R /F11 56 0 R >>
/ProcSet [ /PDF /ImageC /Text ] >>
endobj
15 0 obj
<<
/S /GoTo
/D [29 0 R /XYZ 115.0 725.0 null]
>>
endobj
17 0 obj
<<
/S /GoTo
/D [29 0 R /XYZ 115.0 666.009 null]
>>
endobj
19 0 obj
<<
/S /GoTo
/D [29 0 R /XYZ 115.0 589.684 null]
>>
endobj
21 0 obj
<<
/S /GoTo
/D [31 0 R /XYZ 115.0 448.64 null]
>>
endobj
23 0 obj
<<
/S /GoTo
/D [33 0 R /XYZ 115.0 725.0 null]
>>
endobj
25 0 obj
<<
/S /GoTo
/D [33 0 R /XYZ 115.0 687.009 null]
>>
endobj
27 0 obj
<<
/S /GoTo
/D [37 0 R /XYZ 67.0 725.0 null]
>>
endobj
39 0 obj
<<
/First 41 0 R
/Last 50 0 R
>> endobj
40 0 obj
<<
/S /GoTo
/D [10 0 R /XYZ 115.0 725.0 null]
>>
endobj
42 0 obj
<<
/S /GoTo
/D [12 0 R /XYZ 115.0 715.0 null]
>>
endobj
xref
0 58
0000000000 65535 f
0000012880 00000 n
0000012993 00000 n
0000013085 00000 n
0000000015 00000 n
0000000071 00000 n
0000000358 00000 n
0000000464 00000 n
0000001588 00000 n
0000001694 00000 n
0000001855 00000 n
0000001962 00000 n
0000002554 00000 n
0000002677 00000 n
0000002746 00000 n
0000013232 00000 n
0000002882 00000 n
0000013297 00000 n
0000003018 00000 n
0000013364 00000 n
0000003154 00000 n
0000013431 00000 n
0000003290 00000 n
0000013497 00000 n
0000003426 00000 n
0000013562 00000 n
0000003562 00000 n
0000013629 00000 n
0000003698 00000 n
0000005756 00000 n
0000005864 00000 n
0000006778 00000 n
0000006886 00000 n
0000008550 00000 n
0000008658 00000 n
0000009691 00000 n
0000009799 00000 n
0000010178 00000 n
0000010301 00000 n
0000013693 00000 n
0000013744 00000 n
0000010321 00000 n
0000013809 00000 n
0000010565 00000 n
0000010761 00000 n
0000011032 00000 n
0000011162 00000 n
0000011400 00000 n
0000011600 00000 n
0000011877 00000 n
0000011993 00000 n
0000012105 00000 n
0000012218 00000 n
0000012328 00000 n
0000012443 00000 n
0000012554 00000 n
0000012662 00000 n
0000012774 00000 n
trailer
<<
/Size 58
/Root 2 0 R
/Info 4 0 R
>>
startxref
13874
%%EOF

View File

@@ -0,0 +1,381 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="sqdbg"
ProjectGUID="{B31D0390-C9F7-4D1C-9DBA-0AE6B7357E75}"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib"
IgnoreDefaultLibraryNames="LIBCMT"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/sqdbg.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\lib\sqstdlib.lib ..\lib\squirrel.lib ..\lib\sqdbglib.lib"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib"
IgnoreDefaultLibraryNames="LIBCMT"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/sqdbg.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\main.cpp"
>
</File>
<File
RelativePath=".\serialize_state.nut"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\sqrdbg.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\test.nut"
>
</File>
</Filter>
</Files>
<Globals>
<Global
Name="DevPartner_IsInstrumented"
Value="0"
/>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,251 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="sqdbg"
ProjectGUID="{B31D0390-C9F7-4D1C-9DBA-0AE6B7357E75}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib"
IgnoreDefaultLibraryNames="LIBCMT"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/sqdbg.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib"
IgnoreDefaultLibraryNames="LIBCMT"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/sqdbg.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\main.cpp">
</File>
<File
RelativePath=".\serialize_state.nut">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath=".\sqdbgserver.h">
</File>
<File
RelativePath=".\sqrdbg.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
<File
RelativePath=".\test.nut">
</File>
</Filter>
</Files>
<Globals>
<Global
Name="DevPartner_IsInstrumented"
Value="0"/>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,254 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="sqdbg"
ProjectGUID="{B31D0390-C9F7-4D1C-9DBA-0AE6B7357E75}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="squirrelD.lib sqstdlibD.lib"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib"
IgnoreDefaultLibraryNames="LIBCMT"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/sqdbg.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="squirrel.lib sqstdlib.lib"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_UNICODE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="squirrelD.lib sqstdlibD.lib"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/sqdbg.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_UNICODE"
RuntimeLibrary="4"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="squirrel.lib sqstdlib.lib"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\main.cpp">
</File>
<File
RelativePath=".\serialize_state.nut">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath=".\sqdbgserver.h">
</File>
<File
RelativePath=".\sqrdbg.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
<File
RelativePath=".\test.nut">
</File>
</Filter>
</Files>
<Globals>
<Global
Name="DevPartner_IsInstrumented"
Value="0"/>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,254 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="sqdbg"
ProjectGUID="{B31D0390-C9F7-4D1C-9DBA-0AE6B7357E75}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="squirrelD.lib sqstdlibD.lib"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib"
IgnoreDefaultLibraryNames="LIBCMT"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/sqdbg.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="squirrel.lib sqstdlib.lib"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_UNICODE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="squirrelD.lib sqstdlibD.lib"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/sqdbg.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_UNICODE"
RuntimeLibrary="4"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="squirrel.lib sqstdlib.lib"
OutputFile="$(OutDir)/sqdbg.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\main.cpp">
</File>
<File
RelativePath=".\serialize_state.nut">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath=".\sqdbgserver.h">
</File>
<File
RelativePath=".\sqrdbg.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
<File
RelativePath=".\test.nut">
</File>
</Filter>
</Files>
<Globals>
<Global
Name="DevPartner_IsInstrumented"
Value="0"/>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,694 @@
#include "tier0/basetypes.h"
#include "tier1/strtools.h"
#include "tier0/threadtools.h"
#include <squirrel.h>
#include <assert.h>
#include <sqstdblob.h>
#include "sqrdbg.h"
#include "sqdbgserver.h"
#if defined(VSCRIPT_DLL_EXPORT) || defined(VSQUIRREL_TEST)
#include "memdbgon.h"
#endif
#ifndef _UNICODE
#define scstrcpy strcpy
#else
#define scstrcpy wcscpy
#endif
struct XMLEscape{
const SQChar c;
const SQChar *esc;
};
#define SQDBG_DEBUG_HOOK _SC("_sqdbg_debug_hook_")
#define SQDBG_ERROR_HANDLER _SC("_sqdbg_error_handler_")
XMLEscape g_escapes[]={
{_SC('<'),_SC("&lt;")},{'>',_SC("&gt;")},{_SC('&'),_SC("&amp;")},{_SC('\''),_SC("&apos;")},{_SC('\"'),_SC("&quot;")},{_SC('\n'),_SC("&quot;n")},{_SC('\r'),_SC("&quot;r")},{NULL,NULL}
};
const SQChar *IntToString(int n)
{
static SQChar temp[256];
scsprintf(temp,_SC("%d"),n);
return temp;
}
SQInteger debug_hook(HSQUIRRELVM v);
SQInteger error_handler(HSQUIRRELVM v);
SQInteger beginelement(HSQUIRRELVM v)
{
SQUserPointer up;
const SQChar *name;
sq_getuserpointer(v,-1,&up);
SQDbgServer *self = (SQDbgServer*)up;
sq_getuserpointer(v,-1,&up);
sq_getstring(v,2,&name);
self->BeginElement(name);
return 0;
}
SQInteger endelement(HSQUIRRELVM v)
{
SQUserPointer up;
const SQChar *name;
sq_getuserpointer(v,-1,&up);
SQDbgServer *self = (SQDbgServer*)up;
sq_getuserpointer(v,-1,&up);
sq_getstring(v,2,&name);
self->EndElement(name);
return 0;
}
SQInteger attribute(HSQUIRRELVM v)
{
SQUserPointer up;
const SQChar *name,*value;
sq_getuserpointer(v,-1,&up);
SQDbgServer *self = (SQDbgServer*)up;
sq_getuserpointer(v,-1,&up);
sq_getstring(v,2,&name);
sq_getstring(v,3,&value);
self->Attribute(name,value);
return 0;
}
const SQChar *EscapeXMLString(HSQUIRRELVM v,const SQChar *s)
{
SQChar *temp=sq_getscratchpad(v,((int)scstrlen(s)*6) + sizeof (SQChar));
SQChar *dest=temp;
while(*s!=_SC('\0')){
int i=0;
bool escaped=false;
while(g_escapes[i].esc!=NULL){
if(*s==g_escapes[i].c){
scstrcpy(dest,g_escapes[i].esc);
dest+=scstrlen(g_escapes[i].esc);
escaped=true;
break;
}
i++;
}
if(!escaped){*dest=*s;dest++;}
s++;
}
*dest=_SC('\0');
return temp;
}
SQDbgServer::SQDbgServer(HSQUIRRELVM v)
{
_ready = false;
_nestedcalls = 0;
_autoupdate = false;
_v = v;
_state = eDBG_Running;
_accept = INVALID_SOCKET;
_endpoint = INVALID_SOCKET;
_maxrecursion = 10;
sq_resetobject(&_debugroot);
sq_resetobject(&_serializefunc);
}
SQDbgServer::~SQDbgServer()
{
sq_pushnull(_v);
sq_setdebughook(_v);
sq_pushnull(_v);
sq_seterrorhandler(_v);
sq_release(_v,&_debugroot);
#ifndef _X360
if(_accept != INVALID_SOCKET)
sqdbg_closesocket(_accept);
if(_endpoint != INVALID_SOCKET)
sqdbg_closesocket(_endpoint);
#endif
}
bool SQDbgServer::Init()
{
//creates an environment table for the debugger
sq_newtable(_v);
sq_getstackobj(_v,-1,&_debugroot);
sq_addref(_v,&_debugroot);
//creates a emptyslot to store the watches
sq_pushstring(_v,_SC("watches"),-1);
sq_pushnull(_v);
sq_createslot(_v,-3);
sq_pushstring(_v,_SC("beginelement"),-1);
sq_pushuserpointer(_v,this);
sq_newclosure(_v,beginelement,1);
sq_setparamscheck(_v,2,_SC(".s"));
sq_createslot(_v,-3);
sq_pushstring(_v,_SC("endelement"),-1);
sq_pushuserpointer(_v,this);
sq_newclosure(_v,endelement,1);
sq_setparamscheck(_v,2,_SC(".s"));
sq_createslot(_v,-3);
sq_pushstring(_v,_SC("attribute"),-1);
sq_pushuserpointer(_v,this);
sq_newclosure(_v,attribute,1);
sq_setparamscheck(_v,3,_SC(".ss"));
sq_createslot(_v,-3);
sq_pop(_v,1);
//stores debug hook and error handler in the registry
sq_pushregistrytable(_v);
sq_pushstring(_v,SQDBG_DEBUG_HOOK,-1);
sq_pushuserpointer(_v,this);
sq_newclosure(_v,debug_hook,1);
sq_createslot(_v,-3);
sq_pushstring(_v,SQDBG_ERROR_HANDLER,-1);
sq_pushuserpointer(_v,this);
sq_newclosure(_v,error_handler,1);
sq_createslot(_v,-3);
sq_pop(_v,1);
//sets the error handlers
SetErrorHandlers();
return true;
}
bool SQDbgServer::IsConnected()
{
#ifndef _GAMECONSOLE
if ( _endpoint != INVALID_SOCKET )
{
fd_set set;
#if defined(_WIN32) || defined(_PS3)
set.fd_count = 1;
set.fd_array[0] = _endpoint;
#else
FD_SET( _endpoint, &set );
#endif
timeval timeVal = { 0,0 };
if ( select( 0, &set, NULL, NULL, &timeVal ) != SOCKET_ERROR )
{
return true;
}
DevMsg( "Script debugger disconnected\n" );
}
#endif
return false;
}
bool SQDbgServer::ReadMsg()
{
return false;
}
void SQDbgServer::BusyWait()
{
while( !ReadMsg() )
ThreadSleep(0);
}
void SQDbgServer::SendChunk(const SQChar *chunk)
{
#ifndef _GAMECONSOLE
char *buf=NULL;
int buf_len=0;
#ifdef _UNICODE
buf_len=(int)scstrlen(chunk)+1;
buf=(char *)sq_getscratchpad(_v,(buf_len)*3);
wcstombs((char *)buf,chunk,buf_len);
#else
buf_len=(int)scstrlen(chunk);
buf=(char *)chunk;
#endif
send(_endpoint,(const char*)buf,(int)strlen((const char *)buf),0);
#endif
}
void SQDbgServer::Terminated()
{
BeginElement(_SC("terminated"));
EndElement(_SC("terminated"));
ThreadSleep(200);
}
void SQDbgServer::Hook(int type,int line,const SQChar *src,const SQChar *func)
{
switch(_state){
case eDBG_Running:
if(type==_SC('l') && _breakpoints.size()) {
BreakPointSetItor itr = _breakpoints.find(BreakPoint(line,src));
if(itr != _breakpoints.end()) {
Break(line,src,_SC("breakpoint"));
BreakExecution();
}
}
break;
case eDBG_Suspended:
_nestedcalls=0;
case eDBG_StepOver:
switch(type){
case _SC('l'):
if(_nestedcalls==0) {
Break(line,src,_SC("step"));
BreakExecution();
}
break;
case _SC('c'):
_nestedcalls++;
break;
case _SC('r'):
if(_nestedcalls==0){
_nestedcalls=0;
}else{
_nestedcalls--;
}
break;
}
break;
case eDBG_StepInto:
switch(type){
case _SC('l'):
_nestedcalls=0;
Break(line,src,_SC("step"));
BreakExecution();
break;
}
break;
case eDBG_StepReturn:
switch(type){
case _SC('l'):
break;
case _SC('c'):
_nestedcalls++;
break;
case _SC('r'):
if(_nestedcalls==0){
_nestedcalls=0;
_state=eDBG_StepOver;
}else{
_nestedcalls--;
}
break;
}
break;
case eDBG_Disabled:
break;
}
}
#define MSG_ID(x,y) ((y<<8)|x)
//ab Add Breakpoint
//rb Remove Breakpoint
//sp Suspend
void SQDbgServer::ParseMsg(const char *msg)
{
switch(*((unsigned short *)msg)){
case MSG_ID('a','b'): {
BreakPoint bp;
if(ParseBreakpoint(msg+3,bp)){
AddBreakpoint(bp);
scprintf(_SC("added bp %d %s\n"),bp._line,bp._src.c_str());
}
else
scprintf(_SC("error parsing add breakpoint"));
}
break;
case MSG_ID('r','b'): {
BreakPoint bp;
if(ParseBreakpoint(msg+3,bp)){
RemoveBreakpoint(bp);
scprintf(_SC("removed bp %d %s\n"),bp._line,bp._src.c_str());
}else
scprintf(_SC("error parsing remove breakpoint"));
}
break;
case MSG_ID('g','o'):
if(_state!=eDBG_Running){
_state=eDBG_Running;
BeginDocument();
BeginElement(_SC("resumed"));
EndElement(_SC("resumed"));
EndDocument();
// Send(_SC("<resumed/>\r\n"));
scprintf(_SC("go (execution resumed)\n"));
}
break;
case MSG_ID('s','p'):
if(_state!=eDBG_Suspended){
_state=eDBG_Suspended;
scprintf(_SC("suspend\n"));
}
break;
case MSG_ID('s','o'):
if(_state==eDBG_Suspended){
_state=eDBG_StepOver;
}
break;
case MSG_ID('s','i'):
if(_state==eDBG_Suspended){
_state=eDBG_StepInto;
scprintf(_SC("step into\n"));
}
break;
case MSG_ID('s','r'):
if(_state==eDBG_Suspended){
_state=eDBG_StepReturn;
scprintf(_SC("step return\n"));
}
break;
case MSG_ID('d','i'):
if(_state!=eDBG_Disabled){
_state=eDBG_Disabled;
scprintf(_SC("disabled\n"));
}
break;
case MSG_ID('a','w'): {
Watch w;
if(ParseWatch(msg+3,w))
{
AddWatch(w);
scprintf(_SC("added watch %d %s\n"),w._id,w._exp.c_str());
}
else
scprintf(_SC("error parsing add watch"));
}
break;
case MSG_ID('r','w'): {
int id;
if(ParseRemoveWatch(msg+3,id))
{
RemoveWatch(id);
scprintf(_SC("added watch %d\n"),id);
}
else
scprintf(_SC("error parsing remove watch"));
}
break;
case MSG_ID('t','r'):
{
scprintf(_SC("terminate from user\n"));
#ifndef _X360
sqdbg_closesocket(_endpoint);
#endif
_endpoint = INVALID_SOCKET;
}
break;
case MSG_ID('r','d'):
scprintf(_SC("ready\n"));
_ready=true;
break;
default:
scprintf(_SC("unknown packet"));
}
}
/*
see copyright notice in sqrdbg.h
*/
bool SQDbgServer::ParseBreakpoint(const char *msg,BreakPoint &out)
{
static char stemp[MAX_BP_PATH];
char *ep=NULL;
out._line=strtoul(msg,&ep,16);
if(ep==msg || (*ep)!=':')return false;
char *dest=stemp;
ep++;
while((*ep)!='\n' && (*ep)!='\0')
{
*dest=*ep;
dest++;ep++;
}
*dest='\0';
dest++;
*dest='\0';
#ifdef _UNICODE
int len=(int)strlen(stemp);
SQChar *p=sq_getscratchpad(_v,(SQInteger)(mbstowcs(NULL,stemp,len)+2)*sizeof(SQChar));
size_t destlen=mbstowcs(p,stemp,len);
p[destlen]=_SC('\0');
out._src=( V_strrchr( p, '/' ) ) ? V_strrchr( p, '/' ) + 1 : p;
#else
out._src=( V_strrchr( stemp, '/' ) ) ? V_strrchr( stemp, '/' ) + 1 : stemp;
#endif
return true;
}
bool SQDbgServer::ParseWatch(const char *msg,Watch &out)
{
char *ep=NULL;
out._id=strtoul(msg,&ep,16);
if(ep==msg || (*ep)!=':')return false;
//char *dest=out._src;
ep++;
while((*ep)!='\n' && (*ep)!='\0')
{
out._exp.append(1,*ep);
ep++;
}
return true;
}
bool SQDbgServer::ParseRemoveWatch(const char *msg,int &id)
{
char *ep=NULL;
id=strtoul(msg,&ep,16);
if(ep==msg)return false;
return true;
}
void SQDbgServer::BreakExecution()
{
_state=eDBG_Suspended;
while(_state==eDBG_Suspended){
if(SQ_FAILED(sq_rdbg_update(this)))
{
extern bool g_bSqDbgTerminateScript;
g_bSqDbgTerminateScript = true;
return;
}
ThreadSleep(10);
}
}
//COMMANDS
void SQDbgServer::AddBreakpoint(BreakPoint &bp)
{
_breakpoints.insert(bp);
BeginDocument();
BeginElement(_SC("addbreakpoint"));
Attribute(_SC("line"),IntToString(bp._line));
Attribute(_SC("src"),bp._src.c_str());
EndElement(_SC("addbreakpoint"));
EndDocument();
}
void SQDbgServer::AddWatch(Watch &w)
{
_watches.insert(w);
}
void SQDbgServer::RemoveWatch(int id)
{
WatchSetItor itor=_watches.find(Watch(id,_SC("")));
if(itor==_watches.end()){
BeginDocument();
BeginElement(_SC("error"));
Attribute(_SC("desc"),_SC("the watch does not exists"));
EndElement(_SC("error"));
EndDocument();
}
else{
_watches.erase(itor);
scprintf(_SC("removed watch %d\n"),id);
}
}
void SQDbgServer::RemoveBreakpoint(BreakPoint &bp)
{
BreakPointSetItor itor=_breakpoints.find(bp);
if(itor==_breakpoints.end()){
BeginDocument();
BeginElement(_SC("break"));
Attribute(_SC("desc"),_SC("the breakpoint doesn't exists"));
EndElement(_SC("break"));
EndDocument();
}
else{
BeginDocument();
BeginElement(_SC("removebreakpoint"));
Attribute(_SC("line"),IntToString(bp._line));
Attribute(_SC("src"),bp._src.c_str());
EndElement(_SC("removebreakpoint"));
EndDocument();
_breakpoints.erase(itor);
}
}
void SQDbgServer::Break(int line,const SQChar *src,const SQChar *type,const SQChar *error)
{
if(!error){
BeginDocument();
BeginElement(_SC("break"));
Attribute(_SC("line"),IntToString(line));
Attribute(_SC("src"),src);
Attribute(_SC("type"),type);
SerializeState();
EndElement(_SC("break"));
EndDocument();
}else{
BeginDocument();
BeginElement(_SC("break"));
Attribute(_SC("line"),IntToString(line));
Attribute(_SC("src"),src);
Attribute(_SC("type"),type);
Attribute(_SC("error"),error);
SerializeState();
EndElement(_SC("break"));
EndDocument();
}
}
void SQDbgServer::SerializeState()
{
sq_pushnull(_v);
sq_setdebughook(_v);
sq_pushnull(_v);
sq_seterrorhandler(_v);
const SQChar *sz;
sq_pushobject(_v,_serializefunc);
sq_pushobject(_v,_debugroot);
sq_pushstring(_v,_SC("watches"),-1);
sq_newtable(_v);
for(WatchSetItor i=_watches.begin(); i!=_watches.end(); ++i)
{
sq_pushinteger(_v,i->_id);
sq_pushstring(_v,i->_exp.c_str(),(int)i->_exp.length());
sq_createslot(_v,-3);
}
sq_rawset(_v,-3);
if(SQ_SUCCEEDED(sq_call(_v,1,SQTrue,SQTrue))){
if(SQ_SUCCEEDED(sqstd_getblob(_v,-1,(SQUserPointer*)&sz)))
SendChunk(sz);
}
sq_pop(_v,2);
SetErrorHandlers();
}
void SQDbgServer::SetErrorHandlers()
{
sq_pushregistrytable(_v);
sq_pushstring(_v,SQDBG_DEBUG_HOOK,-1);
sq_rawget(_v,-2);
sq_setdebughook(_v);
sq_pushstring(_v,SQDBG_ERROR_HANDLER,-1);
sq_rawget(_v,-2);
sq_seterrorhandler(_v);
sq_pop(_v,1);
}
void SQDbgServer::BeginElement(const SQChar *name)
{
_xmlcurrentement++;
// for ( int i = 0; i < _xmlcurrentement; i++ )
// {
// printf(" ");
// }
// printf( "BeginElement( %s )\n", name );
XMLElementState *self = &xmlstate[_xmlcurrentement];
scstrcpy(self->name,name);
self->haschildren = false;
if(_xmlcurrentement > 0) {
XMLElementState *parent = &xmlstate[_xmlcurrentement-1];
if(!parent->haschildren) {
SendChunk(_SC(">")); // closes the parent tag
parent->haschildren = true;
}
}
_scratchstring.resize(2+scstrlen(name));
scsprintf(&_scratchstring[0],_SC("<%s"),name);
SendChunk(&_scratchstring[0]);
}
void SQDbgServer::Attribute(const SQChar *name,const SQChar *value)
{
XMLElementState *self = &xmlstate[_xmlcurrentement];
Assert(!self->haschildren); //cannot have attributes if already has children
const SQChar *escval = escape_xml(value);
_scratchstring.resize(5+scstrlen(name)+scstrlen(escval));
scsprintf(&_scratchstring[0],_SC(" %s=\"%s\""),name,escval);
SendChunk(&_scratchstring[0]);
}
void SQDbgServer::EndElement(const SQChar *name)
{
// for ( int i = 0; i < _xmlcurrentement; i++ )
// {
// printf(" ");
// }
// printf( "EndElement( %s )\n", name );
XMLElementState *self = &xmlstate[_xmlcurrentement];
Assert(scstrcmp(self->name,name) == 0);
if(self->haschildren) {
_scratchstring.resize(4+scstrlen(name));
scsprintf(&_scratchstring[0],_SC("</%s>"),name);
SendChunk(&_scratchstring[0]);
}
else {
SendChunk(_SC("/>"));
}
_xmlcurrentement--;
}
void SQDbgServer::EndDocument()
{
SendChunk(_SC("\r\n"));
}
//this can be done much better/faster(do we need that?)
const SQChar *SQDbgServer::escape_xml(const SQChar *s)
{
SQChar *temp=sq_getscratchpad(_v,((int)scstrlen(s)*6) + sizeof(SQChar));
SQChar *dest=temp;
while(*s!=_SC('\0')){
int i=0;
bool escaped=false;
while(g_escapes[i].esc!=NULL){
if(*s==g_escapes[i].c){
scstrcpy(dest,g_escapes[i].esc);
dest+=scstrlen(g_escapes[i].esc);
escaped=true;
break;
}
i++;
}
if(!escaped){*dest=*s;dest++;}
s++;
}
*dest=_SC('\0');
return temp;
}

View File

@@ -0,0 +1,186 @@
/*
see copyright notice in sqrdbg.h
*/
#include "tier0/basetypes.h"
#include <squirrel.h>
#if !defined( _X360 ) && !defined( _PS3 ) && !defined( POSIX )
#include <winsock.h>
#endif
#include "sqrdbg.h"
#include "sqdbgserver.h"
SQInteger debug_hook(HSQUIRRELVM v);
SQInteger error_handler(HSQUIRRELVM v);
#include "serialize_state.inl"
#if defined(VSCRIPT_DLL_EXPORT) || defined(VSQUIRREL_TEST)
#include "memdbgon.h"
#endif
HSQREMOTEDBG sq_rdbg_init(HSQUIRRELVM v,unsigned short port,SQBool autoupdate)
{
#ifndef _GAMECONSOLE
sockaddr_in bindaddr;
#ifdef _WIN32
WSADATA wsadata;
if (WSAStartup (MAKEWORD(1,1), &wsadata) != 0){
return NULL;
}
#endif
SQDbgServer *rdbg = new SQDbgServer(v);
rdbg->_autoupdate = autoupdate?true:false;
rdbg->_accept = socket(AF_INET,SOCK_STREAM,0);
bindaddr.sin_family = AF_INET;
bindaddr.sin_port = htons(port);
bindaddr.sin_addr.s_addr = htonl (INADDR_ANY);
if(bind(rdbg->_accept,(sockaddr*)&bindaddr,sizeof(bindaddr))==SOCKET_ERROR){
delete rdbg;
sq_throwerror(v,_SC("failed to bind the socket"));
return NULL;
}
if(!rdbg->Init()) {
delete rdbg;
sq_throwerror(v,_SC("failed to initialize the debugger"));
return NULL;
}
return rdbg;
#else
return NULL;
#endif
}
SQRESULT sq_rdbg_waitforconnections(HSQREMOTEDBG rdbg)
{
#ifndef _GAMECONSOLE
if(SQ_FAILED(sq_compilebuffer(rdbg->_v,serialize_state_nut,(SQInteger)scstrlen(serialize_state_nut),_SC("SERIALIZE_STATE"),SQFalse))) {
sq_throwerror(rdbg->_v,_SC("error compiling the serialization function"));
}
sq_getstackobj(rdbg->_v,-1,&rdbg->_serializefunc);
sq_addref(rdbg->_v,&rdbg->_serializefunc);
sq_pop(rdbg->_v,1);
sockaddr_in cliaddr;
int addrlen=sizeof(cliaddr);
if(listen(rdbg->_accept,0)==SOCKET_ERROR)
return sq_throwerror(rdbg->_v,_SC("error on listen(socket)"));
rdbg->_endpoint = accept(rdbg->_accept,(sockaddr*)&cliaddr,(socklen_t *)&addrlen);
//do not accept any other connection
sqdbg_closesocket(rdbg->_accept);
rdbg->_accept = INVALID_SOCKET;
if(rdbg->_endpoint==INVALID_SOCKET){
return sq_throwerror(rdbg->_v,_SC("error accept(socket)"));
}
while(!rdbg->_ready){
sq_rdbg_update(rdbg);
}
#endif
return SQ_OK;
}
SQRESULT sq_rdbg_update(HSQREMOTEDBG rdbg)
{
#ifndef _GAMECONSOLE
#ifdef _WIN32
TIMEVAL time;
#else
struct timeval time;
#endif
time.tv_sec=0;
time.tv_usec=0;
fd_set read_flags;
FD_ZERO(&read_flags);
FD_SET(rdbg->_endpoint, &read_flags);
select(NULL/*ignored*/, &read_flags, NULL, NULL, &time);
if(FD_ISSET(rdbg->_endpoint,&read_flags)){
char temp[1024];
int size=0;
char c,prev=NULL;
memset(&temp,0,sizeof(temp));
int res;
FD_CLR(rdbg->_endpoint, &read_flags);
while((res = recv(rdbg->_endpoint,&c,1,0))>0){
if(c=='\n')break;
if(c!='\r'){
temp[size]=c;
prev=c;
size++;
}
}
switch(res){
case 0:
return sq_throwerror(rdbg->_v,_SC("disconnected"));
case SOCKET_ERROR:
return sq_throwerror(rdbg->_v,_SC("socket error"));
}
temp[size]=NULL;
temp[size+1]=NULL;
rdbg->ParseMsg(temp);
}
#endif
return SQ_OK;
}
SQInteger debug_hook(HSQUIRRELVM v)
{
SQUserPointer up;
intp event_type,line;
const SQChar *src,*func;
sq_getinteger(v,2,&event_type);
sq_getstring(v,3,&src);
sq_getinteger(v,4,&line);
sq_getstring(v,5,&func);
sq_getuserpointer(v,-1,&up);
HSQREMOTEDBG rdbg = (HSQREMOTEDBG)up;
rdbg->Hook(event_type,line,src,func);
if(rdbg->_autoupdate) {
if(SQ_FAILED(sq_rdbg_update(rdbg)))
return sq_throwerror(v,_SC("socket failed"));
}
return 0;
}
SQInteger error_handler(HSQUIRRELVM v)
{
SQUserPointer up;
const SQChar *sErr=NULL;
const SQChar *fn=_SC("unknown");
const SQChar *src=_SC("unknown");
int line=-1;
SQStackInfos si;
sq_getuserpointer(v,-1,&up);
HSQREMOTEDBG rdbg=(HSQREMOTEDBG)up;
if(SQ_SUCCEEDED(sq_stackinfos(v,1,&si)))
{
if(si.funcname)fn=si.funcname;
if(si.source)src=si.source;
line=si.line;
scprintf(_SC("*FUNCTION [%s] %s line [%d]\n"),fn,src,si.line);
}
if(sq_gettop(v)>=1){
if(SQ_SUCCEEDED(sq_getstring(v,2,&sErr))) {
scprintf(_SC("\nAN ERROR HAS OCCURED [%s]\n"),sErr);
rdbg->Break(si.line,src,_SC("error"),sErr);
}
else{
scprintf(_SC("\nAN ERROR HAS OCCURED [unknown]\n"));
rdbg->Break(si.line,src,_SC("error"),_SC("unknown"));
}
}
rdbg->BreakExecution();
return 0;
}
SQRESULT sq_rdbg_shutdown(HSQREMOTEDBG rdbg)
{
#ifndef _GAMECONSOLE
delete rdbg;
#ifdef _WIN32
WSACleanup();
#endif
#endif
return SQ_OK;
}

View File

@@ -0,0 +1,50 @@
local x=10;
local y="asd"
local testy = function(){return 0;}
TestTable <- {
livello2 = {
livello3 = {
["yooo"]="I'm cool",
["jaaaa"]=[1,2,3,4,5,6,7,8,9,10],
}
}
}
function TestFunc(a,b)
{
local z=100
local s="I'm a string"
for(local i=0;i<10;i++)
TestTable.cappero(z,i);
//index_that_desnt_exist=100; //error
return 0;
}
function TestTable::cappero(a,b)
{
local ueueueu=100
local s={x="I'm a string"}
oioioi(1,2)
}
function TestTable::oioioi(a,b)
{
local frrrr=100
local xyz={x="I'm a string"}
}
local i = 0;
while(1)
{
local ret;
local testweak = "asdasd";
local weako = testweak.weakref();
i++;
ret=TestFunc("param 1","param 2");
}

View File

@@ -0,0 +1,15 @@
//loads an external file
dofile("utils\\coMmons.nut");
//declares some locals
local x=10;
local y="asd"
local testy=function(){return 0;}
while(1)
{
local ret;
ret = TestFunc("param 1","param 2");
}

View File

@@ -0,0 +1,33 @@
Fagiano <- {
livello2 = {
livello3 = {
[{}]="I'm cool",
[([])]=[1,2,3,4,5,6,7,8,9,10],
}
}
}
function TestFunc(a,b)
{
local z=100
local s="I'm a string"
for(local i=0;i<10;i++)
Fagiano.cappero(z,i);
//index_that_desnt_exist=100; //error
return 0;
}
function Fagiano::cappero(a,b)
{
local ueueueu=100
local s={x="I'm a string"}
oioioi(1,2)
}
function Fagiano::oioioi(a,b)
{
local frrrr=100
local xyz={x="I'm a string"}
}

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>sqdbg</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
<nature>org.squirrel_lang.sqdev.squirrelnature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,21 @@
========================================================================
STATIC LIBRARY : sqdbglib Project Overview
========================================================================
AppWizard has created this sqdbglib library project for you.
No source files were created as part of your project.
sqdbglib.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,106 @@
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
<FileVersion major="1" minor="1"/>
<Project>
<Option title="sqdbglib"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option default_target="-1"/>
<Option compiler="0"/>
<Build>
<Target title="Debug">
<Option output="..\lib\libsqdbglibD.a"/>
<Option working_dir=""/>
<Option object_output="Debug"/>
<Option deps_output=".deps"/>
<Option type="2"/>
<Option compiler="0"/>
<Option createDefFile="1"/>
<Option projectResourceIncludeDirsRelation="2"/>
<Compiler>
<Add option="-DWIN32"/>
<Add option="-D_DEBUG"/>
<Add option="-D_LIB"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add option="-W"/>
<Add option="-O0"/>
<Add directory="..\include"/>
</Compiler>
</Target>
<Target title="Release">
<Option output="..\lib\libsqdbglib.a"/>
<Option working_dir=""/>
<Option object_output="Release"/>
<Option deps_output=".deps"/>
<Option type="2"/>
<Option compiler="0"/>
<Option createDefFile="1"/>
<Option projectResourceIncludeDirsRelation="2"/>
<Compiler>
<Add option="-DWIN32"/>
<Add option="-DNDEBUG"/>
<Add option="-D_LIB"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add option="-W"/>
<Add option="-g"/>
<Add directory="..\include"/>
</Compiler>
</Target>
<Target title="Debug - Unicode">
<Option output="..\lib\libsqdbglibDU.a"/>
<Option working_dir=""/>
<Option object_output="Debug - Unicode"/>
<Option deps_output=".deps"/>
<Option type="2"/>
<Option compiler="0"/>
<Option createDefFile="1"/>
<Option projectResourceIncludeDirsRelation="2"/>
<Compiler>
<Add option="-DWIN32"/>
<Add option="-D_DEBUG"/>
<Add option="-D_LIB"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add option="-D_CRT_NON_CONFORMING_SWPRINTFS"/>
<Add option="-W"/>
<Add option="-O0"/>
<Add directory="..\include"/>
</Compiler>
</Target>
<Target title="Release - Unicode">
<Option output="..\lib\libsqdbglibU.a"/>
<Option working_dir=""/>
<Option object_output="Release - Unicode"/>
<Option deps_output=".deps"/>
<Option type="2"/>
<Option compiler="0"/>
<Option createDefFile="1"/>
<Option projectResourceIncludeDirsRelation="2"/>
<Compiler>
<Add option="-DWIN32"/>
<Add option="-DNDEBUG"/>
<Add option="-D_LIB"/>
<Add option="-D_CRT_SECURE_NO_DEPRECATE"/>
<Add option="-D_CRT_NON_CONFORMING_SWPRINTFS"/>
<Add option="-W"/>
<Add option="-g"/>
<Add directory="..\include"/>
</Compiler>
</Target>
</Build>
<Unit filename="..\sqdbg\sqdbgserver.cpp">
<Option compilerVar="CPP"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
<Unit filename="..\sqdbg\sqrdbg.cpp">
<Option compilerVar="CPP"/>
<Option target="Debug"/>
<Option target="Release"/>
<Option target="Debug - Unicode"/>
<Option target="Release - Unicode"/>
</Unit>
</Project>
</CodeBlocks_project_file>

View File

@@ -0,0 +1,304 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="sqdbglib"
ProjectGUID="{63A56F4B-5B83-4B89-B387-B456FE002528}"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\sqdbglibD.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\sqdbglib.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\sqdbglibDU.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\sqdbglibU.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\sqdbg\sqdbgserver.cpp"
>
</File>
<File
RelativePath="..\sqdbg\sqrdbg.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,203 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="sqdbglib"
ProjectGUID="{63A56F4B-5B83-4B89-B387-B456FE002528}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\sqdbglibD.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\sqdbglib.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\sqdbglibDU.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release - Unicode|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\sqdbglibU.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\sqdbg\sqdbgserver.cpp">
</File>
<File
RelativePath="..\sqdbg\sqrdbg.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,18 @@
SQUIRREL= ..
OUT= $(SQUIRREL)/lib/libsqplus.a
INCDIRS= -I$(SQUIRREL)/include -I. -Iinclude
ALLSRCS = $(wildcard *.cpp)
WIN32SRCS = $(wildcard *Win32*)
SRCS = $(filter-out $(WIN32SRCS),$(ALLSRCS))
sqplus:
# g++ -fno-rtti -c $(SRCS) $(INCDIRS)
g++ -O3 -fno-rtti -Os -c $(SRCS) $(INCDIRS)
ar rc $(OUT) *.o
rm *.o
#g++ -O3 -fno-rtti -Os -c $(SRCS) $(INCDIRS)
#g++ -ggdb -fno-rtti -c $(SRCS) $(INCDIRS)

View File

@@ -0,0 +1,298 @@
#include "sqplus.h"
#ifdef _PS3
#undef _STD_USING
#endif
#include <stdio.h>
#if defined(VSCRIPT_DLL_EXPORT) || defined(VSQUIRREL_TEST)
#include "memdbgon.h"
#endif
namespace SqPlus {
static int getVarInfo(StackHandler & sa,VarRefPtr & vr) {
HSQOBJECT htable = sa.GetObjectHandle(1);
SquirrelObject table(htable);
#ifdef _DEBUG
SQObjectType type = (SQObjectType)sa.GetType(2);
#endif
const SQChar * el = sa.GetString(2);
ScriptStringVar256 varNameTag;
getVarNameTag(varNameTag,sizeof(varNameTag),el);
SQUserPointer data=0;
if (!table.RawGetUserData(varNameTag,&data)) {
// throw SquirrelError("getVarInfo: Could not retrieve UserData");
return sa.ThrowError(_T("getVarInfo: Could not retrieve UserData")); // Results in variable not being found error.
} // if
vr = (VarRefPtr)data;
return SQ_OK;
} // getVarInfo
static int getInstanceVarInfo(StackHandler & sa,VarRefPtr & vr,SQUserPointer & data) {
HSQOBJECT ho = sa.GetObjectHandle(1);
SquirrelObject instance(ho);
#ifdef _DEBUG
SQObjectType type = (SQObjectType)sa.GetType(2);
#endif
const SQChar * el = sa.GetString(2);
ScriptStringVar256 varNameTag;
getVarNameTag(varNameTag,sizeof(varNameTag),el);
SQUserPointer ivrData=0;
if (!instance.RawGetUserData(varNameTag,&ivrData)) {
// throw SquirrelError("getInstanceVarInfo: Could not retrieve UserData");
return sa.ThrowError(_T("getInstanceVarInfo: Could not retrieve UserData")); // Results in variable not being found error.
} // if
vr = (VarRefPtr)ivrData;
unsigned char * up;
if (!(vr->access & (VAR_ACCESS_STATIC|VAR_ACCESS_CONSTANT))) {
#ifdef SQ_USE_CLASS_INHERITANCE
SQUserPointer typetag; instance.GetTypeTag(&typetag);
if (typetag != vr->instanceType) {
SquirrelObject typeTable = instance.GetValue(SQ_CLASS_OBJECT_TABLE_NAME);
up = (unsigned char *)typeTable.GetUserPointer(INT((size_t)vr->instanceType)); // <TODO> 64-bit compatible version.
if (!up) {
throw SquirrelError(_T("Invalid Instance Type"));
} // if
} else {
up = (unsigned char *)instance.GetInstanceUP(0);
} // if
#else
up = (unsigned char *)instance.GetInstanceUP(0);
#endif
up += (size_t)vr->offsetOrAddrOrConst; // Offset
} else {
up = (unsigned char *)vr->offsetOrAddrOrConst; // Address
} // if
data = up;
return SQ_OK;
} // getInstanceVarInfo
static int setVar(StackHandler & sa,VarRef * vr,void * data) {
if (vr->access & (VAR_ACCESS_READ_ONLY|VAR_ACCESS_CONSTANT)) {
ScriptStringVar256 msg;
const SQChar * el = sa.GetString(2);
SCSNPRINTF(msg.s,sizeof(msg),_T("setVar(): Cannot write to constant: %s"),el);
throw SquirrelError(msg.s);
} // if
switch (vr->type) {
case TypeInfo<INT>::TypeID: {
INT * val = (INT *)data; // Address
if (val) {
*val = sa.GetInt(3);
return sa.Return(*val);
} // if
break;
} // case
case TypeInfo<FLOAT>::TypeID: {
FLOAT * val = (FLOAT *)data; // Address
if (val) {
*val = sa.GetFloat(3);
return sa.Return(*val);
} // if
break;
} // case
case TypeInfo<bool>::TypeID: {
bool * val = (bool *)data; // Address
if (val) {
*val = sa.GetBool(3) ? true : false;
return sa.Return(*val);
} // if
break;
} // case
case VAR_TYPE_INSTANCE: {
HSQUIRRELVM v = sa.GetVMPtr();
// vr->copyFunc is the LHS variable type: the RHS var's type is ClassType<>::type() (both point to ClassType<>::copy()).
// src will be null if the LHS and RHS types don't match.
SQUserPointer src = sa.GetInstanceUp(3,(SQUserPointer)vr->copyFunc); // Effectively performs: ClassType<>::type() == ClassType<>getCopyFunc().
if (!src) throw SquirrelError(_T("INSTANCE type assignment mismatch"));
vr->copyFunc(data,src);
#if 0 // Return an instance on the stack (allocates memory)
if (!CreateNativeClassInstance(sa.GetVMPtr(),vr->typeName,data,0)) { // data = address
ScriptStringVar256 msg;
SCSNPRINTF(msg.s,sizeof(msg),_T("getVar(): Could not create instance: %s"),vr->typeName);
throw SquirrelError(msg.s);
} // if
return 1;
#else // Don't return on stack.
return 0;
#endif
}
case TypeInfo<SQUserPointer>::TypeID: {
ScriptStringVar256 msg;
const SQChar * el = sa.GetString(2);
SCSNPRINTF(msg.s,sizeof(msg),_T("setVar(): Cannot write to an SQUserPointer: %s"),el);
throw SquirrelError(msg.s);
} // case
case TypeInfo<ScriptStringVarBase>::TypeID: {
ScriptStringVarBase * val = (ScriptStringVarBase *)data; // Address
if (val) {
const SQChar * strVal = sa.GetString(3);
if (strVal) {
*val = strVal;
return sa.Return(val->s);
} // if
} // if
break;
} // case
} // switch
return SQ_ERROR;
} // setVar
static int getVar(StackHandler & sa,VarRef * vr,void * data) {
switch (vr->type) {
case TypeInfo<INT>::TypeID: {
if (!(vr->access & VAR_ACCESS_CONSTANT)) {
INT * val = (INT *)data; // Address
if (val) {
return sa.Return(*val);
} // if
} else {
INT * val = (INT *)&data; // Constant value
return sa.Return(*val);
} // if
break;
} // case
case TypeInfo<FLOAT>::TypeID: {
if (!(vr->access & VAR_ACCESS_CONSTANT)) {
FLOAT * val = (FLOAT *)data; // Address
if (val) {
return sa.Return(*val);
} // if
} else {
FLOAT * val = (FLOAT *)&data; // Constant value
return sa.Return(*val);
} // if
break;
} // case
case TypeInfo<bool>::TypeID: {
if (!(vr->access & VAR_ACCESS_CONSTANT)) {
bool * val = (bool *)data; // Address
if (val) {
return sa.Return(*val);
} // if
} else {
bool * val = (bool *)&data; // Constant value
return sa.Return(*val);
} // if
break;
} // case
case VAR_TYPE_INSTANCE:
if (!CreateNativeClassInstance(sa.GetVMPtr(),vr->typeName,data,0)) { // data = address. Allocates memory.
ScriptStringVar256 msg;
SCSNPRINTF(msg.s,sizeof(msg),_T("getVar(): Could not create instance: %s"),vr->typeName);
throw SquirrelError(msg.s);
} // if
return 1;
case TypeInfo<SQUserPointer>::TypeID: {
return sa.Return(data); // The address of member variable, not the variable itself.
} // case
case TypeInfo<ScriptStringVarBase>::TypeID: {
if (!(vr->access & VAR_ACCESS_CONSTANT)) {
ScriptStringVarBase * val = (ScriptStringVarBase *)data; // Address
if (val) {
return sa.Return(val->s);
} // if
} else {
throw SquirrelError(_T("getVar(): Invalid type+access: 'ScriptStringVarBase' with VAR_ACCESS_CONSTANT (use VAR_ACCESS_READ_ONLY instead)"));
} // if
break;
} // case
case TypeInfo<const SQChar *>::TypeID: {
if (!(vr->access & VAR_ACCESS_CONSTANT)) {
throw SquirrelError(_T("getVar(): Invalid type+access: 'const SQChar *' without VAR_ACCESS_CONSTANT"));
} else {
return sa.Return((const SQChar *)data); // Address
} // if
break;
} // case
} // switch
return SQ_ERROR;
} // getVar
// === Global Vars ===
SQInteger setVarFunc(HSQUIRRELVM v) {
StackHandler sa(v);
if (sa.GetType(1) == OT_TABLE) {
VarRefPtr vr;
int res = getVarInfo(sa,vr);
if (res != SQ_OK) return res;
return setVar(sa,vr,vr->offsetOrAddrOrConst);
} // if
return SQ_ERROR;
} // setVarFunc
SQInteger getVarFunc(HSQUIRRELVM v) {
StackHandler sa(v);
if (sa.GetType(1) == OT_TABLE) {
VarRefPtr vr;
int res = getVarInfo(sa,vr);
if (res != SQ_OK) return res;
return getVar(sa,vr,vr->offsetOrAddrOrConst);
} // if
return SQ_ERROR;
} // getVarFunc
// === Instance Vars ===
SQInteger setInstanceVarFunc(HSQUIRRELVM v) {
StackHandler sa(v);
if (sa.GetType(1) == OT_INSTANCE) {
VarRefPtr vr;
void * data;
int res = getInstanceVarInfo(sa,vr,data);
if (res != SQ_OK) return res;
return setVar(sa,vr,data);
} // if
return SQ_ERROR;
} // setInstanceVarFunc
SQInteger getInstanceVarFunc(HSQUIRRELVM v) {
StackHandler sa(v);
if (sa.GetType(1) == OT_INSTANCE) {
VarRefPtr vr;
void * data;
int res = getInstanceVarInfo(sa,vr,data);
if (res != SQ_OK) return res;
return getVar(sa,vr,data);
} // if
return SQ_ERROR;
} // getInstanceVarFunc
// === Classes ===
BOOL CreateClass(HSQUIRRELVM v,SquirrelObject & newClass,SQUserPointer classType,const SQChar * name,const SQChar * baseName) {
int n = 0;
int oldtop = sq_gettop(v);
sq_pushroottable(v);
sq_pushstring(v,name,-1);
if (baseName) {
sq_pushstring(v,baseName,-1);
if (SQ_FAILED(sq_get(v,-3))) { // Make sure the base exists if specified by baseName.
sq_settop(v,oldtop);
return FALSE;
} // if
} // if
if (SQ_FAILED(sq_newclass(v,baseName ? 1 : 0))) { // Will inherit from base class on stack from sq_get() above.
sq_settop(v,oldtop);
return FALSE;
} // if
newClass.AttachToStackObject(-1);
sq_settypetag(v,-1,classType);
sq_createslot(v,-3);
sq_pop(v,1);
return TRUE;
} // CreateClass
SquirrelObject RegisterClassType(HSQUIRRELVM v,const SQChar * scriptClassName,SQUserPointer classType,SQFUNCTION constructor) {
int top = sq_gettop(v);
SquirrelObject newClass;
if (CreateClass(v,newClass,classType,scriptClassName)) {
SquirrelVM::CreateFunction(newClass,constructor,_T("constructor"));
} // if
sq_settop(v,top);
return newClass;
} // RegisterClassType
}; // namespace SqPlus
// sqPlus

View File

@@ -0,0 +1,334 @@
// SqPlusConst.h
// SqPlus constant type and constant member function support created by Simon Michelmore.
// Modular integration 11/14/05 jcs.
#ifdef SQPLUS_DECLARE_INSTANCE_TYPE_CONST
#undef SQPLUS_DECLARE_INSTANCE_TYPE_CONST
// Kamaitati's NULL_INSTANCE support. 5/28/06 jcs
#ifdef SQPLUS_SUPPORT_NULL_INSTANCES
#define DECLARE_INSTANCE_TYPE_NAME_CONST(TYPE,NAME) \
DECLARE_INSTANCE_TYPE_NAME_(TYPE,NAME) \
namespace SqPlus { \
inline void Push(HSQUIRRELVM v,const TYPE * value) { \
if (!value) sq_pushnull(v); \
else if (!CreateNativeClassInstance(v,GetTypeName(*value),(TYPE*)value,0)) \
throw SquirrelError(_T("Push(): could not create INSTANCE (check registration name)")); } \
inline void Push(HSQUIRRELVM v,const TYPE & value) { if (!CreateCopyInstance(GetTypeName(value),value)) throw SquirrelError(_T("Push(): could not create INSTANCE copy (check registration name)")); } \
inline bool Match(TypeWrapper<const TYPE &>,HSQUIRRELVM v,int idx) { return GetInstance<TYPE,false>(v,idx) != NULL; } \
inline const TYPE & Get(TypeWrapper<const TYPE &>,HSQUIRRELVM v,int idx) { return *GetInstance<TYPE,true>(v,idx); } \
} // nameSpace SqPlus
#else
#define DECLARE_INSTANCE_TYPE_NAME_CONST(TYPE,NAME) \
DECLARE_INSTANCE_TYPE_NAME_(TYPE,NAME) \
namespace SqPlus { \
inline void Push(HSQUIRRELVM v,const TYPE * value) { if (!CreateNativeClassInstance(v,GetTypeName(*value),(TYPE*)value,0)) throw SquirrelError(_T("Push(): could not create INSTANCE (check registration name)")); } \
inline void Push(HSQUIRRELVM v,const TYPE & value) { if (!CreateCopyInstance(GetTypeName(value),value)) throw SquirrelError(_T("Push(): could not create INSTANCE copy (check registration name)")); } \
inline bool Match(TypeWrapper<const TYPE &>,HSQUIRRELVM v,int idx) { return GetInstance<TYPE,false>(v,idx) != NULL; } \
inline const TYPE & Get(TypeWrapper<const TYPE &>,HSQUIRRELVM v,int idx) { return *GetInstance<TYPE,true>(v,idx); } \
} // nameSpace SqPlus
#endif
#define DECLARE_INSTANCE_TYPE(TYPE) DECLARE_INSTANCE_TYPE_NAME_CONST(TYPE,TYPE)
#define DECLARE_INSTANCE_TYPE_NAME(TYPE,NAME) DECLARE_INSTANCE_TYPE_NAME_CONST(TYPE,NAME)
#endif
#ifdef SQPLUS_CALL_CONST_MFUNC_RET0
#undef SQPLUS_CALL_CONST_MFUNC_RET0
template <typename Callee>
static int Call(Callee & callee,RT (Callee::*func)() const,HSQUIRRELVM v,int /*index*/) {
RT ret = (callee.*func)();
Push(v,ret);
return 1;
}
template <typename Callee,typename P1>
static int Call(Callee & callee,RT (Callee::*func)(P1) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
RT ret = (callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0)
);
Push(v,ret);
return 1;
}
template<typename Callee,typename P1,typename P2>
static int Call(Callee & callee,RT (Callee::*func)(P1,P2) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
RT ret = (callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1)
);
Push(v,ret);
return 1;
}
template<typename Callee,typename P1,typename P2,typename P3>
static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
RT ret = (callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2)
);
Push(v,ret);
return 1;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4>
static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
RT ret = (callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3)
);
Push(v,ret);
return 1;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4,typename P5>
static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
sq_argassert(5,index + 4);
RT ret = (callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3),
Get(TypeWrapper<P5>(),v,index + 4)
);
Push(v,ret);
return 1;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4,typename P5,typename P6>
static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5,P6) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
sq_argassert(5,index + 4);
sq_argassert(6,index + 5);
RT ret = (callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3),
Get(TypeWrapper<P5>(),v,index + 4),
Get(TypeWrapper<P6>(),v,index + 5)
);
Push(v,ret);
return 1;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4,typename P5,typename P6,typename P7>
static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5,P6,P7) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
sq_argassert(5,index + 4);
sq_argassert(6,index + 5);
sq_argassert(7,index + 6);
RT ret = (callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3),
Get(TypeWrapper<P5>(),v,index + 4),
Get(TypeWrapper<P6>(),v,index + 5),
Get(TypeWrapper<P7>(),v,index + 6)
);
Push(v,ret);
return 1;
}
#endif
#ifdef SQPLUS_CALL_CONST_MFUNC_NORET
#undef SQPLUS_CALL_CONST_MFUNC_NORET
template<typename Callee>
static int Call(Callee & callee,void (Callee::*func)() const,HSQUIRRELVM,int /*index*/) {
(callee.*func)();
return 0;
}
template<typename Callee,typename P1>
static int Call(Callee & callee,void (Callee::*func)(P1) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
(callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0)
);
return 0;
}
template<typename Callee,typename P1,typename P2>
static int Call(Callee & callee,void (Callee::*func)(P1,P2) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
(callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1)
);
return 0;
}
template<typename Callee,typename P1,typename P2,typename P3>
static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
(callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2)
);
return 0;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4>
static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3,P4) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
(callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3)
);
return 0;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4,typename P5>
static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3,P4,P5) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
sq_argassert(5,index + 4);
(callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3),
Get(TypeWrapper<P5>(),v,index + 4)
);
return 0;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4,typename P5,typename P6>
static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3,P4,P5,P6) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
sq_argassert(5,index + 4);
sq_argassert(6,index + 5);
(callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3),
Get(TypeWrapper<P5>(),v,index + 4),
Get(TypeWrapper<P6>(),v,index + 5)
);
return 0;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4,typename P5,typename P6,typename P7>
static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3,P4,P5,P6,P7) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
sq_argassert(5,index + 4);
sq_argassert(6,index + 5);
sq_argassert(7,index + 6);
(callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3),
Get(TypeWrapper<P5>(),v,index + 4),
Get(TypeWrapper<P6>(),v,index + 5),
Get(TypeWrapper<P7>(),v,index + 6)
);
return 0;
}
#endif
#ifdef SQPLUS_CALL_CONST_MFUNC_RET1
#undef SQPLUS_CALL_CONST_MFUNC_RET1
template<typename Callee,typename RT>
int Call(Callee & callee, RT (Callee::*func)() const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
template<typename Callee,typename RT,typename P1>
int Call(Callee & callee,RT (Callee::*func)(P1) const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
template<typename Callee,typename RT,typename P1,typename P2>
int Call(Callee & callee,RT (Callee::*func)(P1,P2) const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
template<typename Callee,typename RT,typename P1,typename P2,typename P3>
int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3) const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
template<typename Callee,typename RT,typename P1,typename P2,typename P3,typename P4>
int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4) const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
template<typename Callee,typename RT,typename P1,typename P2,typename P3,typename P4,typename P5>
int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5) const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
template<typename Callee,typename RT,typename P1,typename P2,typename P3,typename P4,typename P5,typename P6>
int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5,P6) const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
template<typename Callee,typename RT,typename P1,typename P2,typename P3,typename P4,typename P5,typename P6,typename P7>
int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5,P6,P7) const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
#undef SQPLUS_CALL_CONST_MFUNC_RET1
#endif
#ifdef SQ_REG_CONST_STATIC_VAR
#undef SQ_REG_CONST_STATIC_VAR
template<typename VarType>
SQClassDefBase & staticVar(const VarType * pvar,const SQChar * name,VarAccessType access=VAR_ACCESS_READ_ONLY) {
struct CV {
const VarType * var;
} cv; // Cast Variable helper.
cv.var = pvar;
RegisterInstanceVariable(newClass,ClassType<TClassType>::type(),*(VarType **)&cv,name,VarAccessType(access|VAR_ACCESS_STATIC));
return *this;
} // staticVar
#endif
// SqPlusConst.h

View File

@@ -0,0 +1,122 @@
#include "sqplus.h"
#if defined(VSCRIPT_DLL_EXPORT) || defined(VSQUIRREL_TEST)
#include "memdbgon.h"
#endif
BOOL CreateStaticNamespace(HSQUIRRELVM v,ScriptNamespaceDecl *sn)
{
int n = 0;
sq_pushroottable(v);
sq_pushstring(v,sn->name,-1);
sq_newtable(v);
const ScriptClassMemberDecl *members = sn->members;
const ScriptClassMemberDecl *m = NULL;
while(members[n].name) {
m = &members[n];
sq_pushstring(v,m->name,-1);
sq_newclosure(v,m->func,0);
sq_setparamscheck(v,m->params,m->typemask);
sq_setnativeclosurename(v,-1,m->name);
sq_createslot(v,-3);
n++;
}
const ScriptConstantDecl *consts = sn->constants;
const ScriptConstantDecl *c = NULL;
n = 0;
while(consts[n].name) {
c = &consts[n];
sq_pushstring(v,c->name,-1);
switch(c->type) {
case OT_STRING: sq_pushstring(v,c->val.s,-1);break;
case OT_INTEGER: sq_pushinteger(v,c->val.i);break;
case OT_FLOAT: sq_pushfloat(v,c->val.f);break;
}
sq_createslot(v,-3);
n++;
}
if(sn->delegate) {
const ScriptClassMemberDecl *members = sn->delegate;
const ScriptClassMemberDecl *m = NULL;
sq_newtable(v);
while(members[n].name) {
m = &members[n];
sq_pushstring(v,m->name,-1);
sq_newclosure(v,m->func,0);
sq_setparamscheck(v,m->params,m->typemask);
sq_setnativeclosurename(v,-1,m->name);
sq_createslot(v,-3);
n++;
}
sq_setdelegate(v,-2);
}
sq_createslot(v,-3);
sq_pop(v,1);
return TRUE;
}
BOOL CreateClass(HSQUIRRELVM v,SquirrelClassDecl *cd)
{
int n = 0;
int oldtop = sq_gettop(v);
sq_pushroottable(v);
sq_pushstring(v,cd->name,-1);
if(cd->base) {
sq_pushstring(v,cd->base,-1);
if(SQ_FAILED(sq_get(v,-3))) { // Make sure the base exists if specified by cd->base name.
sq_settop(v,oldtop);
return FALSE;
}
}
if(SQ_FAILED(sq_newclass(v,cd->base?1:0))) { // Will inherit from base class on stack from sq_get() above.
sq_settop(v,oldtop);
return FALSE;
}
// sq_settypetag(v,-1,(unsigned int)cd);
#ifdef _WIN32
#pragma warning(disable : 4311)
#endif
sq_settypetag(v,-1,reinterpret_cast<SQUserPointer>(cd));
const ScriptClassMemberDecl *members = cd->members;
const ScriptClassMemberDecl *m = NULL;
if (members) {
while(members[n].name) {
m = &members[n];
sq_pushstring(v,m->name,-1);
sq_newclosure(v,m->func,0);
sq_setparamscheck(v,m->params,m->typemask);
sq_setnativeclosurename(v,-1,m->name);
sq_createslot(v,-3);
n++;
}
} // if
sq_createslot(v,-3);
sq_pop(v,1);
return TRUE;
}
BOOL CreateNativeClassInstance(HSQUIRRELVM v,const SQChar *classname,SQUserPointer ud,SQRELEASEHOOK hook)
{
int oldtop = sq_gettop(v);
sq_pushroottable(v);
sq_pushstring(v,classname,-1);
if(SQ_FAILED(sq_rawget(v,-2))){ // Get the class (created with sq_newclass()).
sq_settop(v,oldtop);
return FALSE;
}
//sq_pushroottable(v);
if(SQ_FAILED(sq_createinstance(v,-1))) {
sq_settop(v,oldtop);
return FALSE;
}
sq_remove(v,-3); //removes the root table
sq_remove(v,-2); //removes the class
if(SQ_FAILED(sq_setinstanceup(v,-1,ud))) {
sq_settop(v,oldtop);
return FALSE;
}
sq_setreleasehook(v,-1,hook);
return TRUE;
}

View File

@@ -0,0 +1,151 @@
#ifndef SQUIRREL_BINDINGS_UTILS_H
#define SQUIRREL_BINDINGS_UTILS_H
struct ScriptClassMemberDecl {
const SQChar *name;
SQFUNCTION func;
int params;
const SQChar *typemask;
};
struct SquirrelClassDecl {
const SQChar *name;
const SQChar *base;
const ScriptClassMemberDecl *members;
};
struct ScriptConstantDecl {
const SQChar *name;
SQObjectType type;
union value {
value(float v){ f = v; }
value(int v){ i = v; }
value(long int v){ li = v; }
value(const SQChar *v){ s = v; }
float f;
int i;
long int li;
const SQChar *s;
} val;
};
struct ScriptNamespaceDecl {
const SQChar *name;
const ScriptClassMemberDecl *members;
const ScriptConstantDecl *constants;
const ScriptClassMemberDecl *delegate;
};
#define _BEGIN_CLASS(classname) \
int __##classname##__typeof(HSQUIRRELVM v) \
{ \
sq_pushstring(v,_T(#classname),-1); \
return 1; \
} \
struct ScriptClassMemberDecl __##classname##_members[] = { \
{_T("_typeof"),__##classname##__typeof,1,NULL},
#define _BEGIN_NAMESPACE(xnamespace) struct ScriptClassMemberDecl __##xnamespace##_members[] = {
#define _BEGIN_NAMESPACE_CONSTANTS(xnamespace) {NULL,NULL,0,NULL}}; \
struct ScriptConstantDecl __##xnamespace##_constants[] = {
#define _BEGIN_DELEGATE(xnamespace) struct ScriptClassMemberDecl __##xnamespace##_delegate[] = {
#define _DELEGATE(xnamespace) __##xnamespace##_delegate
#define _END_DELEGATE(classname) {NULL,NULL,NULL,NULL}};
#define _CONSTANT(name,type,val) {_T(#name),type,val},
#define _CONSTANT_IMPL(name,type) {_T(#name),type,name},
#define _MEMBER_FUNCTION(classname,name,nparams,typemask) \
{_T(#name),__##classname##_##name,nparams,typemask},
#define _END_NAMESPACE(classname,delegate) {NULL,OT_NULL,0}}; \
struct ScriptNamespaceDecl __##classname##_decl = { \
_T(#classname), __##classname##_members,__##classname##_constants,delegate };
#define _END_CLASS(classname) {NULL,NULL,0,NULL}}; \
struct SquirrelClassDecl __##classname##_decl = { \
_T(#classname), NULL, __##classname##_members };
#define _END_CLASS_INHERITANCE(classname,base) {NULL,NULL,NULL,NULL}}; \
struct SquirrelClassDecl __##classname##_decl = { \
_T(#classname), _T(#base), __##classname##_members };
#define _MEMBER_FUNCTION_IMPL(classname,name) \
int __##classname##_##name(HSQUIRRELVM v)
#define _INIT_STATIC_NAMESPACE(classname) CreateStaticNamespace(SquirrelVM::GetVMPtr(),&__##classname##_decl);
#define _INIT_CLASS(classname)CreateClass(SquirrelVM::GetVMPtr(),&__##classname##_decl);
#define _DECL_STATIC_NAMESPACE(xnamespace) extern struct ScriptNamespaceDecl __##xnamespace##_decl;
#define _DECL_CLASS(classname) extern struct SquirrelClassDecl __##classname##_decl;
#define _CHECK_SELF(cppclass,scriptclass) \
cppclass *self = NULL; \
if(SQ_FAILED(sq_getinstanceup(v,1,(SQUserPointer*)&self,(SQUserPointer)&__##scriptclass##_decl))) { \
return sq_throwerror(v,_T("invalid instance type"));\
}
#define _CHECK_INST_PARAM(pname,idx,cppclass,scriptclass) \
cppclass *pname = NULL; \
if(SQ_FAILED(sq_getinstanceup(v,idx,(SQUserPointer*)&pname,(SQUserPointer)&__##scriptclass##_decl))) { \
return sq_throwerror(v,_T("invalid instance type"));\
} \
#define _CHECK_INST_PARAM_BREAK(pname,idx,cppclass,scriptclass) \
cppclass *pname = NULL; \
if(SQ_FAILED(sq_getinstanceup(v,idx,(SQUserPointer*)&pname,(SQUserPointer)&__##scriptclass##_decl))) { \
break; \
} \
#define _CLASS_TAG(classname) ((unsigned int)&__##classname##_decl)
#define _DECL_NATIVE_CONSTRUCTION(classname,cppclass) \
BOOL push_##classname(cppclass &quat); \
SquirrelObject new_##classname(cppclass &quat);
#define _IMPL_NATIVE_CONSTRUCTION(classname,cppclass) \
static int classname##_release_hook(SQUserPointer p, int size) \
{ \
if(p) { \
cppclass *pv = (cppclass *)p; \
delete pv; \
} \
return 0; \
} \
BOOL push_##classname(cppclass &quat) \
{ \
cppclass *newquat = new cppclass; \
*newquat = quat; \
if(!CreateNativeClassInstance(SquirrelVM::GetVMPtr(),_T(#classname),newquat,classname##_release_hook)) { \
delete newquat; \
return FALSE; \
} \
return TRUE; \
} \
SquirrelObject new_##classname(cppclass &quat) \
{ \
SquirrelObject ret; \
if(push_##classname(quat)) { \
ret.AttachToStackObject(-1); \
sq_pop(SquirrelVM::GetVMPtr(),1); \
} \
return ret; \
} \
int construct_##classname(cppclass *p) \
{ \
sq_setinstanceup(SquirrelVM::GetVMPtr(),1,p); \
sq_setreleasehook(SquirrelVM::GetVMPtr(),1,classname##_release_hook); \
return 1; \
}
BOOL CreateStaticClass(HSQUIRRELVM v,SquirrelClassDecl *cd);
BOOL CreateStaticNamespace(HSQUIRRELVM v,ScriptNamespaceDecl *sn);
BOOL CreateClass(HSQUIRRELVM v,SquirrelClassDecl *cd);
BOOL InitScriptClasses(HSQUIRRELVM v);
BOOL CreateNativeClassInstance(HSQUIRRELVM v,const SQChar *classname,SQUserPointer ud,SQRELEASEHOOK hook);
#endif // SQUIRREL_BINDINGS_UTILS_H

Some files were not shown because too many files have changed in this diff Show More