mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-06 08:15:59 +02:00
Initial checkin
This commit is contained in:
parent
c74712dad9
commit
078564ac9e
3242 changed files with 1616395 additions and 0 deletions
5
BeefTools/BeefInstall/BeefProj.toml
Normal file
5
BeefTools/BeefInstall/BeefProj.toml
Normal file
|
@ -0,0 +1,5 @@
|
|||
FileVersion = 1
|
||||
|
||||
[Project]
|
||||
Name = "BeefInstall"
|
||||
StartupObject = "BeefInstall.Program"
|
5
BeefTools/BeefInstall/BeefSpace.toml
Normal file
5
BeefTools/BeefInstall/BeefSpace.toml
Normal file
|
@ -0,0 +1,5 @@
|
|||
FileVersion = 1
|
||||
Projects = {BeefInstall = {Path = "."}}
|
||||
|
||||
[Workspace]
|
||||
StartupProject = "BeefInstall"
|
277
BeefTools/BeefInstall/src/CabFile.bf
Normal file
277
BeefTools/BeefInstall/src/CabFile.bf
Normal file
|
@ -0,0 +1,277 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
namespace BeefInstall
|
||||
{
|
||||
class CabFile
|
||||
{
|
||||
struct HFDI : int
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
struct HFile : int
|
||||
{
|
||||
}
|
||||
|
||||
enum FDIERROR : int32
|
||||
{
|
||||
FDIERROR_NONE,
|
||||
FDIERROR_CABINET_NOT_FOUND,
|
||||
FDIERROR_NOT_A_CABINET,
|
||||
FDIERROR_UNKNOWN_CABINET_VERSION,
|
||||
FDIERROR_CORRUPT_CABINET,
|
||||
FDIERROR_ALLOC_FAIL,
|
||||
FDIERROR_BAD_COMPR_TYPE,
|
||||
FDIERROR_MDI_FAIL,
|
||||
FDIERROR_TARGET_FILE,
|
||||
FDIERROR_RESERVE_MISMATCH,
|
||||
FDIERROR_WRONG_CABINET,
|
||||
FDIERROR_USER_ABORT,
|
||||
FDIERROR_EOF,
|
||||
}
|
||||
|
||||
|
||||
[CRepr]
|
||||
struct FDICABINETINFO
|
||||
{
|
||||
public int32 cbCabinet; // Total length of cabinet file
|
||||
public uint16 cFolders; // Count of folders in cabinet
|
||||
public uint16 cFiles; // Count of files in cabinet
|
||||
public uint16 setID; // Cabinet set ID
|
||||
public uint16 iCabinet; // Cabinet number in set (0 based)
|
||||
public Windows.IntBool fReserve; // TRUE => RESERVE present in cabinet
|
||||
public Windows.IntBool hasprev; // TRUE => Cabinet is chained prev
|
||||
public Windows.IntBool hasnext; // TRUE => Cabinet is chained next
|
||||
}
|
||||
|
||||
[CRepr]
|
||||
struct FDINOTIFICATION
|
||||
{
|
||||
public int32 cb;
|
||||
public char8* psz1;
|
||||
public char8* psz2;
|
||||
public char8* psz3; // Points to a 256 character buffer
|
||||
public void* pv; // Value for client
|
||||
|
||||
public HFile hf;
|
||||
|
||||
public uint16 date;
|
||||
public uint16 time;
|
||||
public uint16 attribs;
|
||||
|
||||
public uint16 setID; // Cabinet set ID
|
||||
public uint16 iCabinet; // Cabinet number (0-based)
|
||||
public uint16 iFolder; // Folder number (0-based)
|
||||
|
||||
public FDIERROR fdie;
|
||||
}
|
||||
|
||||
enum NotificationType : int32
|
||||
{
|
||||
CABINET_INFO, // General information about cabinet
|
||||
PARTIAL_FILE, // First file in cabinet is continuation
|
||||
COPY_FILE, // File to be copied
|
||||
CLOSE_FILE_INFO, // close the file, set relevant info
|
||||
NEXT_CABINET, // File continued to next cabinet
|
||||
ENUMERATE, // Enumeration status
|
||||
}
|
||||
|
||||
struct ERF
|
||||
{
|
||||
public int32 erfOper; // FCI/FDI error code -- see FDIERROR_XXX
|
||||
// and FCIERR_XXX equates for details.
|
||||
|
||||
public int32 erfType; // Optional error value filled in by FCI/FDI.
|
||||
// For FCI, this is usually the C run-time
|
||||
// *errno* value.
|
||||
public Windows.IntBool fError; // TRUE => error present
|
||||
}
|
||||
|
||||
enum FDIDECRYPTTYPE : int32
|
||||
{
|
||||
NEW_CABINET, // New cabinet
|
||||
NEW_FOLDER, // New folder
|
||||
DECRYPT, // Decrypt a data block
|
||||
}
|
||||
|
||||
[CRepr]
|
||||
struct FDIDECRYPT
|
||||
{
|
||||
public FDIDECRYPTTYPE fdidt; // Command type (selects union below)
|
||||
public void* pvUser; // Decryption context
|
||||
}
|
||||
|
||||
[CRepr]
|
||||
struct FDIDECRYPT_CABINET : FDIDECRYPT
|
||||
{
|
||||
public void* pHeaderReserve; // RESERVE section from CFHEADER
|
||||
public uint16 cbHeaderReserve; // Size of pHeaderReserve
|
||||
public uint16 setID; // Cabinet set ID
|
||||
public int32 iCabinet; // Cabinet number in set (0 based)
|
||||
}
|
||||
|
||||
[CRepr]
|
||||
struct FDIDECRYPT_FOLDER : FDIDECRYPT
|
||||
{
|
||||
public void* pFolderReserve; // RESERVE section from CFFOLDER
|
||||
public uint16 cbFolderReserve; // Size of pFolderReserve
|
||||
public uint16 iFolder; // Folder number in cabinet (0 based)
|
||||
}
|
||||
|
||||
[CRepr]
|
||||
struct FDIDECRYPT_DECRYPT : FDIDECRYPT
|
||||
{
|
||||
public void* pDataReserve; // RESERVE section from CFDATA
|
||||
public uint16 cbDataReserve; // Size of pDataReserve
|
||||
public void* pbData; // Data buffer
|
||||
public uint16 cbData; // Size of data buffer
|
||||
public Windows.IntBool fSplit; // TRUE if this is a split data block
|
||||
public uint16 cbPartial; // 0 if this is not a split block, or
|
||||
// the first piece of a split block;
|
||||
// Greater than 0 if this is the
|
||||
// second piece of a split block.
|
||||
}
|
||||
|
||||
function void* FNALLOC(uint32 cb);
|
||||
function void FNFREE(void* p);
|
||||
function HFile FNOPEN(char8* fileName, int32 oflag, int32 pmode);
|
||||
function uint32 FNREAD(HFile file, void* pv, uint32 cb);
|
||||
function uint32 FNWRITE(HFile file, void* pv, uint32 cb);
|
||||
function int32 FNCLOSE(HFile file);
|
||||
function int32 FNSEEK(HFile file, int32 dist, int32 seekType);
|
||||
function int FNFDINOTIFY(NotificationType notifyType, FDINOTIFICATION* notifyData);
|
||||
function int32 FNFDIDECRYPT(FDIDECRYPT* fdid);
|
||||
|
||||
static void* CabMemAlloc(uint32 cb)
|
||||
{
|
||||
return new uint8[cb]*;
|
||||
}
|
||||
|
||||
static void CabMemFree(void* p)
|
||||
{
|
||||
delete p;
|
||||
}
|
||||
|
||||
static HFile CabFileOpen(char8* fileName, int32 oflag, int32 pmode)
|
||||
{
|
||||
String fileNameStr = scope .(fileName);
|
||||
|
||||
Windows.Handle fh;
|
||||
if (oflag & 0x0100 != 0)
|
||||
{
|
||||
// Creating
|
||||
fh = Windows.CreateFileW(fileNameStr.ToScopedNativeWChar!(), Windows.GENERIC_READ | Windows.GENERIC_WRITE, .Read | .Write, null, .Create, 0, .NullHandle);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Reading
|
||||
fh = Windows.CreateFileW(fileNameStr.ToScopedNativeWChar!(), Windows.GENERIC_READ, .Read | .Write, null, .Open, 0, .NullHandle);
|
||||
}
|
||||
|
||||
return (.)fh;
|
||||
}
|
||||
|
||||
static uint32 CabFileRead(HFile file, void* pv, uint32 cb)
|
||||
{
|
||||
Windows.ReadFile((.)file, (.)pv, (.)cb, var bytesRead, null);
|
||||
return (.)bytesRead;
|
||||
}
|
||||
|
||||
static uint32 CabFileWrite(HFile file, void* pv, uint32 cb)
|
||||
{
|
||||
Windows.WriteFile((.)file, (.)pv, (.)cb, var bytesWritten, null);
|
||||
return (.)bytesWritten;
|
||||
}
|
||||
|
||||
static int32 CabFileClose(HFile file)
|
||||
{
|
||||
((Windows.Handle)file).Close();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32 CabFileSeek(HFile file, int32 dist, int32 seekType)
|
||||
{
|
||||
return Windows.SetFilePointer((.)file, dist, null, seekType);
|
||||
}
|
||||
|
||||
static int CabFDINotify(NotificationType notifyType, FDINOTIFICATION* notifyData)
|
||||
{
|
||||
if (notifyType == .COPY_FILE)
|
||||
{
|
||||
String destFileName = scope .();
|
||||
destFileName.Append(@"c:\temp\out\");
|
||||
destFileName.Append(notifyData.psz1);
|
||||
|
||||
//_O_BINARY | _O_CREAT | _O_WRONLY | _O_SEQUENTIAL
|
||||
//_S_IREAD | _S_IWRITE
|
||||
|
||||
String dirPath = scope String();
|
||||
Path.GetDirectoryPath(destFileName, dirPath);
|
||||
Directory.CreateDirectory(dirPath).IgnoreError();
|
||||
|
||||
let hOutFile = CabFileOpen(destFileName, 0x8121, 0x0180);
|
||||
return (.)hOutFile;
|
||||
}
|
||||
else if (notifyType == .CLOSE_FILE_INFO)
|
||||
{
|
||||
CabFileClose(notifyData.hf);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
[Import("Cabinet.lib"), CLink]
|
||||
static extern HFDI FDICreate(FNALLOC pfnalloc,
|
||||
FNFREE pfnfree,
|
||||
FNOPEN pfnopen,
|
||||
FNREAD pfnread,
|
||||
FNWRITE pfnwrite,
|
||||
FNCLOSE pfnclose,
|
||||
FNSEEK pfnseek,
|
||||
int32 cpuType,
|
||||
ERF* erf);
|
||||
|
||||
[CLink]
|
||||
static extern Windows.IntBool FDIDestroy(HFDI hfdi);
|
||||
|
||||
[CLink]
|
||||
static extern Windows.IntBool FDICopy(HFDI hfdi,
|
||||
char8* pszCabinet,
|
||||
char8* pszCabPath,
|
||||
int32 flags,
|
||||
FNFDINOTIFY fnfdin,
|
||||
FNFDIDECRYPT pfnfdid,
|
||||
void* pvUser);
|
||||
|
||||
HFDI mHDFI;
|
||||
|
||||
public ~this()
|
||||
{
|
||||
if (mHDFI != 0)
|
||||
{
|
||||
FDIDestroy(mHDFI);
|
||||
}
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
ERF erf;
|
||||
|
||||
mHDFI = FDICreate(=> CabMemAlloc,
|
||||
=> CabMemFree,
|
||||
=> CabFileOpen,
|
||||
=> CabFileRead,
|
||||
=> CabFileWrite,
|
||||
=> CabFileClose,
|
||||
=> CabFileSeek,
|
||||
1 /*cpu80386*/,
|
||||
&erf);
|
||||
}
|
||||
|
||||
public void Copy()
|
||||
{
|
||||
FDICopy(mHDFI, "test.cab", "c:\\temp\\", 0, => CabFDINotify, null, Internal.UnsafeCastToPtr(this));
|
||||
}
|
||||
}
|
||||
}
|
53
BeefTools/BeefInstall/src/Program.bf
Normal file
53
BeefTools/BeefInstall/src/Program.bf
Normal file
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
|
||||
namespace BeefInstall
|
||||
{
|
||||
class Program
|
||||
{
|
||||
bool HandleCommandLineParam(String key, String value)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void UnhandledCommandLine(String key, String value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ParseCommandLine(String[] args)
|
||||
{
|
||||
for (var str in args)
|
||||
{
|
||||
int eqPos = str.IndexOf('=');
|
||||
if (eqPos == -1)
|
||||
{
|
||||
if (!HandleCommandLineParam(str, null))
|
||||
UnhandledCommandLine(str, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
var cmd = scope String(str, 0, eqPos);
|
||||
var param = scope String(str, eqPos + 1);
|
||||
if (!HandleCommandLineParam(cmd, param))
|
||||
UnhandledCommandLine(cmd, param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Run()
|
||||
{
|
||||
CabFile cabFile = scope .();
|
||||
cabFile.Init();
|
||||
cabFile.Copy();
|
||||
}
|
||||
|
||||
static int Main(String[] args)
|
||||
{
|
||||
Program pg = new Program();
|
||||
pg.ParseCommandLine(args);
|
||||
pg.Run();
|
||||
delete pg;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
6
BeefTools/BfAeDebug/App.config
Normal file
6
BeefTools/BfAeDebug/App.config
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
</configuration>
|
90
BeefTools/BfAeDebug/BfAeDebug.csproj
Normal file
90
BeefTools/BfAeDebug/BfAeDebug.csproj
Normal file
|
@ -0,0 +1,90 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{2E6CBC2C-CC2F-4EAD-A4AE-64FF65797959}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>BfAeDebug</RootNamespace>
|
||||
<AssemblyName>BfAeDebug</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
25
BeefTools/BfAeDebug/BfAeDebug.sln
Normal file
25
BeefTools/BfAeDebug/BfAeDebug.sln
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27406.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BfAeDebug", "BfAeDebug.csproj", "{2E6CBC2C-CC2F-4EAD-A4AE-64FF65797959}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{2E6CBC2C-CC2F-4EAD-A4AE-64FF65797959}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2E6CBC2C-CC2F-4EAD-A4AE-64FF65797959}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2E6CBC2C-CC2F-4EAD-A4AE-64FF65797959}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2E6CBC2C-CC2F-4EAD-A4AE-64FF65797959}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C6D134C5-4F11-42A1-8932-2A3C4B2536BB}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
101
BeefTools/BfAeDebug/Form1.Designer.cs
generated
Normal file
101
BeefTools/BfAeDebug/Form1.Designer.cs
generated
Normal file
|
@ -0,0 +1,101 @@
|
|||
namespace BfAeDebug
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.mBfButton = new System.Windows.Forms.Button();
|
||||
this.mVsButton = new System.Windows.Forms.Button();
|
||||
this.mCancelButton = new System.Windows.Forms.Button();
|
||||
this.mLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// mBfButton
|
||||
//
|
||||
this.mBfButton.Location = new System.Drawing.Point(12, 62);
|
||||
this.mBfButton.Name = "mBfButton";
|
||||
this.mBfButton.Size = new System.Drawing.Size(160, 32);
|
||||
this.mBfButton.TabIndex = 0;
|
||||
this.mBfButton.Text = "Attach Beef Debugger (d)";
|
||||
this.mBfButton.UseVisualStyleBackColor = true;
|
||||
this.mBfButton.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// mVsButton
|
||||
//
|
||||
this.mVsButton.Location = new System.Drawing.Point(178, 62);
|
||||
this.mVsButton.Name = "mVsButton";
|
||||
this.mVsButton.Size = new System.Drawing.Size(160, 32);
|
||||
this.mVsButton.TabIndex = 1;
|
||||
this.mVsButton.Text = "Attach Visual Studio";
|
||||
this.mVsButton.UseVisualStyleBackColor = true;
|
||||
this.mVsButton.Click += new System.EventHandler(this.mVsButton_Click);
|
||||
//
|
||||
// mCancelButton
|
||||
//
|
||||
this.mCancelButton.Location = new System.Drawing.Point(344, 62);
|
||||
this.mCancelButton.Name = "mCancelButton";
|
||||
this.mCancelButton.Size = new System.Drawing.Size(160, 32);
|
||||
this.mCancelButton.TabIndex = 2;
|
||||
this.mCancelButton.Text = "Cancel";
|
||||
this.mCancelButton.UseVisualStyleBackColor = true;
|
||||
this.mCancelButton.Click += new System.EventHandler(this.mCancelButton_Click);
|
||||
//
|
||||
// mLabel
|
||||
//
|
||||
this.mLabel.AutoSize = true;
|
||||
this.mLabel.Location = new System.Drawing.Point(12, 9);
|
||||
this.mLabel.Name = "mLabel";
|
||||
this.mLabel.Size = new System.Drawing.Size(87, 13);
|
||||
this.mLabel.TabIndex = 3;
|
||||
this.mLabel.Text = "Process Crashed";
|
||||
this.mLabel.Click += new System.EventHandler(this.label1_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(518, 114);
|
||||
this.Controls.Add(this.mLabel);
|
||||
this.Controls.Add(this.mCancelButton);
|
||||
this.Controls.Add(this.mVsButton);
|
||||
this.Controls.Add(this.mBfButton);
|
||||
this.Name = "Form1";
|
||||
this.Text = "Attach Debugger ...";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button mBfButton;
|
||||
private System.Windows.Forms.Button mVsButton;
|
||||
private System.Windows.Forms.Button mCancelButton;
|
||||
private System.Windows.Forms.Label mLabel;
|
||||
}
|
||||
}
|
||||
|
89
BeefTools/BfAeDebug/Form1.cs
Normal file
89
BeefTools/BfAeDebug/Form1.cs
Normal file
|
@ -0,0 +1,89 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BfAeDebug
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
try
|
||||
{
|
||||
Process process = Process.GetProcessById(int.Parse(Program.sProcessId));
|
||||
mLabel.Text = String.Format("Process {0} ({1})", Program.sProcessId, process.ProcessName);
|
||||
process.Dispose();
|
||||
|
||||
//var mainWindowHandle = process.MainWindowHandle;
|
||||
//NativeWindow.FromHandle(mainWindowHandle).
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
CenterToScreen();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Directory.SetCurrentDirectory(@"C:\Beef\IDE\dist");
|
||||
var process = Process.Start(@"C:\Beef\IDE\dist\BeefIDE_d.exe", String.Format("-attachId={0} -attachHandle={1}", Program.sProcessId, Program.sEventId));
|
||||
Hide();
|
||||
process.WaitForExit();
|
||||
Close();
|
||||
}
|
||||
|
||||
private void mVsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
// ProcessStartInfo psi = new ProcessStartInfo();
|
||||
// psi.FileName = @"c:\\windows\\system32\\vsjitdebugger.exe";
|
||||
// psi.CreateNoWindow = false;
|
||||
// psi.WorkingDirectory = "C:\\";
|
||||
// psi.WindowStyle = ProcessWindowStyle.Normal;
|
||||
// psi.Arguments = String.Format("-p {0} -e {1}", Program.sProcessId, Program.sEventId);
|
||||
// psi.UseShellExecute = false;
|
||||
// psi.ErrorDialog = true;
|
||||
// psi.RedirectStandardError = true;
|
||||
// psi.RedirectStandardInput = true;
|
||||
// psi.RedirectStandardOutput = true;
|
||||
// var process = Process.Start(psi);
|
||||
//MessageBox.Show(@"C:\Windows\system32\vsjitdebugger.exe" + " " + String.Format("-p {0} -e {1}", Program.sProcessId, Program.sEventId));
|
||||
try
|
||||
{
|
||||
var process = Process.Start(@"C:\Windows\system32\vsjitdebugger.exe\", String.Format("-p {0} -e {1}", Program.sProcessId, Program.sEventId));
|
||||
Hide();
|
||||
process.WaitForExit();
|
||||
int exitCode = process.ExitCode;
|
||||
if (exitCode != 0)
|
||||
MessageBox.Show("vsjitdebugger exit code: " + exitCode);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("vsjitdebugger exception: " + ex.ToString());
|
||||
}
|
||||
//MessageBox.Show("Done");
|
||||
Close();
|
||||
}
|
||||
|
||||
private void mCancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void label1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
120
BeefTools/BfAeDebug/Form1.resx
Normal file
120
BeefTools/BfAeDebug/Form1.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
38
BeefTools/BfAeDebug/Program.cs
Normal file
38
BeefTools/BfAeDebug/Program.cs
Normal file
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BfAeDebug
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
///
|
||||
public static String sProcessId;
|
||||
public static String sEventId;
|
||||
|
||||
[STAThread]
|
||||
static void Main(String[] args)
|
||||
{
|
||||
if (args.Length < 2)
|
||||
{
|
||||
String argStr = "Args: ";
|
||||
foreach (var arg in args)
|
||||
argStr += arg;
|
||||
MessageBox.Show(argStr);
|
||||
return;
|
||||
}
|
||||
|
||||
sProcessId = args[args.Length - 2];
|
||||
sEventId = args[args.Length - 1];
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
}
|
||||
}
|
36
BeefTools/BfAeDebug/Properties/AssemblyInfo.cs
Normal file
36
BeefTools/BfAeDebug/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("BfAeDebug")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("BfAeDebug")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("2e6cbc2c-cc2f-4ead-a4ae-64ff65797959")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
71
BeefTools/BfAeDebug/Properties/Resources.Designer.cs
generated
Normal file
71
BeefTools/BfAeDebug/Properties/Resources.Designer.cs
generated
Normal file
|
@ -0,0 +1,71 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace BfAeDebug.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BfAeDebug.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
117
BeefTools/BfAeDebug/Properties/Resources.resx
Normal file
117
BeefTools/BfAeDebug/Properties/Resources.resx
Normal file
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
30
BeefTools/BfAeDebug/Properties/Settings.Designer.cs
generated
Normal file
30
BeefTools/BfAeDebug/Properties/Settings.Designer.cs
generated
Normal file
|
@ -0,0 +1,30 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace BfAeDebug.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
7
BeefTools/BfAeDebug/Properties/Settings.settings
Normal file
7
BeefTools/BfAeDebug/Properties/Settings.settings
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
10
BeefTools/DocPrep/BeefProj.toml
Normal file
10
BeefTools/DocPrep/BeefProj.toml
Normal file
|
@ -0,0 +1,10 @@
|
|||
FileVersion = 1
|
||||
|
||||
[Project]
|
||||
Name = "DocPrep"
|
||||
StartupObject = "DocPrep.Program"
|
||||
|
||||
[Configs.Debug.Win64]
|
||||
TargetDirectory = "$(WorkspaceDir)/../../IDE/dist"
|
||||
OtherLinkFlags = "$(LinkFlags) IDEHelper64_d.lib"
|
||||
DebugCommandArguments = "c:\\beef\\BeefLibs\\corlib\\_test c:\\beef\\hugo\\temp"
|
5
BeefTools/DocPrep/BeefSpace.toml
Normal file
5
BeefTools/DocPrep/BeefSpace.toml
Normal file
|
@ -0,0 +1,5 @@
|
|||
FileVersion = 1
|
||||
Projects = {DocPrep = {Path = "."}}
|
||||
|
||||
[Workspace]
|
||||
StartupProject = "DocPrep"
|
159
BeefTools/DocPrep/src/Program.bf
Normal file
159
BeefTools/DocPrep/src/Program.bf
Normal file
|
@ -0,0 +1,159 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace DocPrep
|
||||
{
|
||||
class Program
|
||||
{
|
||||
[StdCall, CLink]
|
||||
static extern void* BfSystem_Create();
|
||||
|
||||
[StdCall, CLink]
|
||||
static extern void BfSystem_Delete(void* bfSystem);
|
||||
|
||||
[StdCall, CLink]
|
||||
static extern void* BfSystem_CreateParser(void* bfSystem, void* bfProject);
|
||||
|
||||
[StdCall, CLink]
|
||||
static extern void* BfSystem_CreatePassInstance(void* bfSystem);
|
||||
|
||||
[StdCall, CLink]
|
||||
static extern void BfPassInstance_Delete(void* bfSystem);
|
||||
|
||||
[StdCall, CLink]
|
||||
static extern void BfSystem_DeleteParser(void* bfSystem, void* bfParser);
|
||||
|
||||
[StdCall, CLink]
|
||||
static extern void BfParser_SetSource(void* bfParser, char8* data, int32 length, char8* fileName);
|
||||
|
||||
[StdCall, CLink]
|
||||
static extern bool BfParser_Parse(void* bfParser, void* bfPassInstance, bool compatMode);
|
||||
|
||||
[StdCall, CLink]
|
||||
static extern bool BfParser_Reduce(void* bfParser, void* bfPassInstance);
|
||||
|
||||
[StdCall, CLink]
|
||||
static extern char8* BfParser_Format(void* bfParser, int32 formatEnd, int32 formatStart, out int32* outCharMapping);
|
||||
|
||||
[StdCall, CLink]
|
||||
static extern char8* BfParser_DocPrep(void* bfParser);
|
||||
|
||||
/*[StdCall, CLink]
|
||||
static extern char8* BfParser_Prep*/
|
||||
|
||||
[StdCall, CLink]
|
||||
static extern void* BfSystem_CreateProject(void* bfSystem, char8* projectName);
|
||||
|
||||
String mSrcDirPath;
|
||||
String mDestDirPath;
|
||||
|
||||
void* mSystem;
|
||||
void* mProject;
|
||||
|
||||
this()
|
||||
{
|
||||
mSystem = BfSystem_Create();
|
||||
mProject = BfSystem_CreateProject(mSystem, "main");
|
||||
}
|
||||
|
||||
void GenFile(String relFilePath)
|
||||
{
|
||||
String inFilePath = scope .();
|
||||
inFilePath.Append(mSrcDirPath, "/", relFilePath);
|
||||
|
||||
String outFilePath = scope .();
|
||||
outFilePath.Append(mDestDirPath, "/", relFilePath);
|
||||
|
||||
String text = scope .();
|
||||
File.ReadAllText(inFilePath, text, false);
|
||||
|
||||
void* parser = BfSystem_CreateParser(mSystem, mProject);
|
||||
BfParser_SetSource(parser, text.Ptr, (.)text.Length, inFilePath);
|
||||
|
||||
void* passInstance = BfSystem_CreatePassInstance(mSystem);
|
||||
BfParser_Parse(parser, passInstance, false);
|
||||
BfParser_Reduce(parser, passInstance);
|
||||
|
||||
char8* docText = BfParser_DocPrep(parser);
|
||||
|
||||
String outDirPath = scope .();
|
||||
Path.GetDirectoryPath(outFilePath, outDirPath);
|
||||
Directory.CreateDirectory(outDirPath);
|
||||
|
||||
File.WriteAllText(outFilePath, .(docText));
|
||||
|
||||
BfSystem_DeleteParser(mSystem, parser);
|
||||
}
|
||||
|
||||
void AddFiles(String relDirPath)
|
||||
{
|
||||
String dirPath = scope .(mSrcDirPath);
|
||||
dirPath.Append("/");
|
||||
dirPath.Append(relDirPath);
|
||||
|
||||
for (let val in Directory.EnumerateDirectories(dirPath))
|
||||
{
|
||||
String subDirPath = scope .();
|
||||
subDirPath.Append(relDirPath, "/");
|
||||
val.GetFileName(subDirPath);
|
||||
AddFiles(subDirPath);
|
||||
}
|
||||
|
||||
for (let val in Directory.EnumerateFiles(dirPath))
|
||||
{
|
||||
String relFilePath = scope .();
|
||||
relFilePath.Append(relDirPath, "/");
|
||||
val.GetFileName(relFilePath);
|
||||
GenFile(relFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
bool TestDestPath(String relDirPath)
|
||||
{
|
||||
String dirPath = scope .(mDestDirPath);
|
||||
dirPath.Append("/");
|
||||
dirPath.Append(relDirPath);
|
||||
|
||||
for (let val in Directory.EnumerateDirectories(dirPath))
|
||||
{
|
||||
String subDirPath = scope .();
|
||||
subDirPath.Append(relDirPath, "/");
|
||||
val.GetFileName(subDirPath);
|
||||
if (!TestDestPath(subDirPath))
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let val in Directory.EnumerateFiles(dirPath))
|
||||
{
|
||||
String filePath = scope .();
|
||||
val.GetFilePath(filePath);
|
||||
|
||||
if (!filePath.EndsWith(".bf"))
|
||||
{
|
||||
Console.Error.WriteLine("Dest past not empty. Invalid file found: {}", filePath);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static int32 Main(String[] args)
|
||||
{
|
||||
Program pg = scope .();
|
||||
pg.mSrcDirPath = args[0];
|
||||
pg.mDestDirPath = args[1];
|
||||
if (!pg.TestDestPath(""))
|
||||
return 1;
|
||||
if (Directory.DelTree(pg.mDestDirPath) case .Err)
|
||||
{
|
||||
Console.Error.Write("Failed to clear dest path");
|
||||
return 2;
|
||||
}
|
||||
|
||||
pg.AddFiles("");
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
231
BeefTools/ImgCreate/ImgCreate.cpp
Normal file
231
BeefTools/ImgCreate/ImgCreate.cpp
Normal file
|
@ -0,0 +1,231 @@
|
|||
#include "BeefySysLib/Common.h"
|
||||
#include "BeefySysLib/util/Array.h"
|
||||
#include "BeefySysLib/img/PSDReader.h"
|
||||
#include "BeefySysLib/img/PNGData.h"
|
||||
|
||||
USING_NS_BF;
|
||||
|
||||
void Resize(ImageData* srcImage, int srcX, int srcY, int srcScale, ImageData* destImage, int destX, int destY, int scale)
|
||||
{
|
||||
if (srcScale > scale)
|
||||
{
|
||||
struct Color
|
||||
{
|
||||
uint8 mElems[4];
|
||||
};
|
||||
|
||||
struct ColorT
|
||||
{
|
||||
float mElems[4];
|
||||
};
|
||||
|
||||
ColorT colorT = { 0 };
|
||||
|
||||
int sampleScale = srcScale / scale;
|
||||
float totalDiv = 0;
|
||||
for (int srcYOfs = 0; srcYOfs < sampleScale; srcYOfs++)
|
||||
{
|
||||
for (int srcXOfs = 0; srcXOfs < sampleScale; srcXOfs++)
|
||||
{
|
||||
auto color = *(Color*)&srcImage->mBits[(srcX - srcImage->mX + srcXOfs) + (srcY - srcImage->mY + srcYOfs)*srcImage->mWidth];
|
||||
|
||||
totalDiv += 1.0f;
|
||||
|
||||
float alpha = color.mElems[3];
|
||||
colorT.mElems[0] += color.mElems[0] * alpha;
|
||||
colorT.mElems[1] += color.mElems[1] * alpha;
|
||||
colorT.mElems[2] += color.mElems[2] * alpha;
|
||||
colorT.mElems[3] += alpha;
|
||||
}
|
||||
}
|
||||
|
||||
Color outColor;
|
||||
float alpha = colorT.mElems[3] / totalDiv;
|
||||
float valScale = 0;
|
||||
if (alpha > 0)
|
||||
valScale = 1 / alpha / totalDiv;
|
||||
outColor.mElems[0] = (int)round(colorT.mElems[0] * valScale);
|
||||
outColor.mElems[1] = (int)round(colorT.mElems[1] * valScale);
|
||||
outColor.mElems[2] = (int)round(colorT.mElems[2] * valScale);
|
||||
outColor.mElems[3] = (int)round(alpha);
|
||||
|
||||
destImage->mBits[destX + destY * destImage->mWidth] = *(uint32*)&outColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32 color = srcImage->mBits[(srcX - srcImage->mX) + (srcY - srcImage->mY)*srcImage->mWidth];
|
||||
destImage->mBits[destX + destY * destImage->mWidth] = color;
|
||||
}
|
||||
}
|
||||
|
||||
void ConvImage(const StringImpl& baseName, int wantSize)
|
||||
{
|
||||
PNGData srcImage;
|
||||
bool success = srcImage.LoadFromFile(baseName + "_4.png");
|
||||
BF_ASSERT(success);
|
||||
|
||||
int srcScale = 4;
|
||||
int destScale = 1 << wantSize;
|
||||
|
||||
PNGData destImage;
|
||||
destImage.CreateNew(srcImage.mWidth * destScale / srcScale, srcImage.mHeight * destScale / srcScale);
|
||||
for (int destY = 0; destY < destImage.mHeight; destY++)
|
||||
{
|
||||
for (int destX = 0; destX < destImage.mWidth; destX++)
|
||||
{
|
||||
Resize(&srcImage, destX * srcScale / destScale, destY * srcScale / destScale, srcScale, &destImage, destX, destY, destScale);
|
||||
}
|
||||
}
|
||||
String destName;
|
||||
if (wantSize == 0)
|
||||
destName = baseName + ".png";
|
||||
else
|
||||
destName = baseName + StrFormat("_%d.png", destScale);
|
||||
|
||||
success = destImage.WriteToFile(destName);
|
||||
BF_ASSERT(success);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int baseWidth = 0;
|
||||
int baseHeight = 0;
|
||||
|
||||
PSDReader readers[3];
|
||||
ImageData* imageDatas[3];
|
||||
for (int size = 0; size < 3; size++)
|
||||
{
|
||||
auto& reader = readers[size];
|
||||
auto& imageData = imageDatas[size];
|
||||
|
||||
String fileName;
|
||||
if (size == 0)
|
||||
fileName = "DarkUI.psd";
|
||||
else if (size == 1)
|
||||
fileName = "DarkUI_2.psd" ;
|
||||
else
|
||||
fileName = "DarkUI_4.psd";
|
||||
|
||||
if (!reader.Init(fileName))
|
||||
{
|
||||
if (size == 0)
|
||||
{
|
||||
printf("Failed to open %s - incorrect working directory?", fileName.c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
imageData = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (size == 0)
|
||||
{
|
||||
baseWidth = reader.mWidth;
|
||||
baseHeight = reader.mHeight;
|
||||
}
|
||||
|
||||
std::vector<int> layerIndices;
|
||||
for (int layerIdx = 0; layerIdx < (int)reader.mPSDLayerInfoVector.size(); layerIdx++)
|
||||
{
|
||||
auto layer = reader.mPSDLayerInfoVector[layerIdx];
|
||||
if (layer->mVisible)
|
||||
layerIndices.insert(layerIndices.begin(), layerIdx);
|
||||
}
|
||||
|
||||
imageData = reader.MergeLayers(NULL, layerIndices, NULL);
|
||||
}
|
||||
|
||||
int numCols = baseWidth / 20;
|
||||
int numRows = baseHeight / 20;
|
||||
|
||||
auto _HasImage = [&](int col, int row, int size)
|
||||
{
|
||||
int scale = 1 << size;
|
||||
auto srcImage = imageDatas[size];
|
||||
if (srcImage == NULL)
|
||||
return false;
|
||||
|
||||
for (int yOfs = 0; yOfs < 20 * scale; yOfs++)
|
||||
{
|
||||
for (int xOfs = 0; xOfs < 20 * scale; xOfs++)
|
||||
{
|
||||
int srcX = (col * 20 * scale) + xOfs;
|
||||
int srcY = (row * 20 * scale) + yOfs;
|
||||
auto color = srcImage->mBits[(srcX - srcImage->mX) + (srcY - srcImage->mY)*srcImage->mWidth];
|
||||
if (color != 0)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
for (int size = 0; size < 3; size++)
|
||||
{
|
||||
int scale = 1 << size;
|
||||
int outWidth = baseWidth * scale;
|
||||
int outHeight = baseHeight * scale;
|
||||
|
||||
PNGData pngData;
|
||||
pngData.CreateNew(outWidth, outHeight);
|
||||
|
||||
if (size < 2)
|
||||
{
|
||||
ConvImage("IconError", size);
|
||||
ConvImage("IconWarning", size);
|
||||
}
|
||||
|
||||
String fileName;
|
||||
if (size == 0)
|
||||
fileName = "DarkUI.png";
|
||||
else if (size == 1)
|
||||
fileName = "DarkUI_2.png";
|
||||
else
|
||||
fileName = "DarkUI_4.png";
|
||||
|
||||
for (int col = 0; col < numCols; col++)
|
||||
{
|
||||
for (int row = 0; row < numRows; row++)
|
||||
{
|
||||
if ((size == 2) && (col == 11) && (row == 7))
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
|
||||
int srcSize = size;
|
||||
if (!_HasImage(col, row, size))
|
||||
{
|
||||
if (_HasImage(col, row, 2))
|
||||
{
|
||||
srcSize = 2;
|
||||
}
|
||||
else
|
||||
srcSize = 0;
|
||||
}
|
||||
|
||||
int srcScale = 1 << srcSize;
|
||||
for (int yOfs = 0; yOfs < 20 * scale; yOfs++)
|
||||
{
|
||||
for (int xOfs = 0; xOfs < 20 * scale; xOfs++)
|
||||
{
|
||||
int destX = (col * 20 * scale) + xOfs;
|
||||
int destY = (row * 20 * scale) + yOfs;
|
||||
|
||||
int srcX = (col * 20 * srcScale) + xOfs * srcScale / scale;
|
||||
int srcY = (row * 20 * srcScale) + yOfs * srcScale / scale;
|
||||
|
||||
auto srcImage = imageDatas[srcSize];
|
||||
if ((srcX >= srcImage->mX) && (srcY >= srcImage->mY) &&
|
||||
(srcX < srcImage->mX + srcImage->mWidth) &&
|
||||
(srcY < srcImage->mY + srcImage->mHeight))
|
||||
{
|
||||
Resize(srcImage, srcX, srcY, srcScale, &pngData, destX, destY, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool success = pngData.WriteToFile(fileName);
|
||||
BF_ASSERT(success);
|
||||
}
|
||||
}
|
41
BeefTools/ImgCreate/ImgCreate.sln
Normal file
41
BeefTools/ImgCreate/ImgCreate.sln
Normal file
|
@ -0,0 +1,41 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.168
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImgCreate", "ImgCreate.vcxproj", "{89F98CA4-5AB9-49BD-BC95-417388BBEB59}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BeefySysLib_static", "..\..\BeefySysLib\BeefySysLib_static.vcxproj", "{ECEAB68D-2F15-495F-A29C-5EA9548AA23D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{89F98CA4-5AB9-49BD-BC95-417388BBEB59}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{89F98CA4-5AB9-49BD-BC95-417388BBEB59}.Debug|x64.Build.0 = Debug|x64
|
||||
{89F98CA4-5AB9-49BD-BC95-417388BBEB59}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{89F98CA4-5AB9-49BD-BC95-417388BBEB59}.Debug|x86.Build.0 = Debug|Win32
|
||||
{89F98CA4-5AB9-49BD-BC95-417388BBEB59}.Release|x64.ActiveCfg = Release|x64
|
||||
{89F98CA4-5AB9-49BD-BC95-417388BBEB59}.Release|x64.Build.0 = Release|x64
|
||||
{89F98CA4-5AB9-49BD-BC95-417388BBEB59}.Release|x86.ActiveCfg = Release|Win32
|
||||
{89F98CA4-5AB9-49BD-BC95-417388BBEB59}.Release|x86.Build.0 = Release|Win32
|
||||
{ECEAB68D-2F15-495F-A29C-5EA9548AA23D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{ECEAB68D-2F15-495F-A29C-5EA9548AA23D}.Debug|x64.Build.0 = Debug|x64
|
||||
{ECEAB68D-2F15-495F-A29C-5EA9548AA23D}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{ECEAB68D-2F15-495F-A29C-5EA9548AA23D}.Debug|x86.Build.0 = Debug|Win32
|
||||
{ECEAB68D-2F15-495F-A29C-5EA9548AA23D}.Release|x64.ActiveCfg = Release|x64
|
||||
{ECEAB68D-2F15-495F-A29C-5EA9548AA23D}.Release|x64.Build.0 = Release|x64
|
||||
{ECEAB68D-2F15-495F-A29C-5EA9548AA23D}.Release|x86.ActiveCfg = Release|Win32
|
||||
{ECEAB68D-2F15-495F-A29C-5EA9548AA23D}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {EB0764C5-FAAE-4A84-B63B-D0FFC7BA08CA}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
168
BeefTools/ImgCreate/ImgCreate.vcxproj
Normal file
168
BeefTools/ImgCreate/ImgCreate.vcxproj
Normal file
|
@ -0,0 +1,168 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{89F98CA4-5AB9-49BD-BC95-417388BBEB59}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>ImgCreate</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>../../;../../BeefySysLib/platform/win;../../BeefySysLib/third_party</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>../../;../../BeefySysLib/platform/win;../../BeefySysLib/third_party</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ImgCreate.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\BeefySysLib\BeefySysLib_static.vcxproj">
|
||||
<Project>{eceab68d-2f15-495f-a29c-5ea9548aa23d}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
22
BeefTools/ImgCreate/ImgCreate.vcxproj.filters
Normal file
22
BeefTools/ImgCreate/ImgCreate.vcxproj.filters
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ImgCreate.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
39
BeefTools/RandoCode/BeefProj.toml
Normal file
39
BeefTools/RandoCode/BeefProj.toml
Normal file
|
@ -0,0 +1,39 @@
|
|||
FileVersion = 1
|
||||
Dependencies = {Beefy2D = "*", corlib = "*"}
|
||||
|
||||
[Project]
|
||||
Name = "RandoCode"
|
||||
StartupObject = "RandoCode.Program"
|
||||
|
||||
[Configs.Debug.Win32]
|
||||
CLibType = "Static"
|
||||
BeefLibType = "Static"
|
||||
|
||||
[Configs.Debug.Win64]
|
||||
TargetDirectory = "$(ProjectDir)"
|
||||
TargetName = "$(ProjectName)_d"
|
||||
CLibType = "Static"
|
||||
BeefLibType = "Static"
|
||||
DebugCommandArguments = "scripts\\Test001.toml"
|
||||
DebugWorkingDirectory = "$(ProjectDir)\\..\\..\\IDE\\Tests\\Rando"
|
||||
|
||||
[Configs.Paranoid.Win32]
|
||||
CLibType = "Static"
|
||||
BeefLibType = "Static"
|
||||
|
||||
[Configs.Paranoid.Win64]
|
||||
TargetDirectory = "$(ProjectDir)"
|
||||
TargetName = "$(ProjectName)_p"
|
||||
CLibType = "Static"
|
||||
BeefLibType = "Static"
|
||||
|
||||
[Configs.Test.Win32]
|
||||
CLibType = "Static"
|
||||
BeefLibType = "Static"
|
||||
|
||||
[Configs.Test.Win64]
|
||||
CLibType = "Static"
|
||||
BeefLibType = "Static"
|
||||
|
||||
[Configs.Release.Win64]
|
||||
TargetDirectory = "$(ProjectDir)"
|
5
BeefTools/RandoCode/BeefSpace.toml
Normal file
5
BeefTools/RandoCode/BeefSpace.toml
Normal file
|
@ -0,0 +1,5 @@
|
|||
FileVersion = 1
|
||||
Projects = {RandoCode = {Path = "."}, Beefy2D = {Path = "../../Beefy2D"}}
|
||||
|
||||
[Workspace]
|
||||
StartupProject = "RandoCode"
|
36
BeefTools/RandoCode/Properties/AssemblyInfo.cs
Normal file
36
BeefTools/RandoCode/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("RandoCode")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("RandoCode")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2012")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("6380e4fb-6a03-43d9-b1fb-b4d71f5cc11f")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
687
BeefTools/RandoCode/data/1adj.txt
Normal file
687
BeefTools/RandoCode/data/1adj.txt
Normal file
|
@ -0,0 +1,687 @@
|
|||
ace
|
||||
aft
|
||||
ain
|
||||
all
|
||||
alt
|
||||
anal
|
||||
ane
|
||||
ant
|
||||
apt
|
||||
arch
|
||||
arched
|
||||
auld
|
||||
awed
|
||||
backed
|
||||
baked
|
||||
barbed
|
||||
bare
|
||||
barred
|
||||
bats
|
||||
beaut
|
||||
beige
|
||||
bent
|
||||
birch
|
||||
birk
|
||||
bit
|
||||
blae
|
||||
blah
|
||||
blame
|
||||
blamed
|
||||
bland
|
||||
blate
|
||||
bleak
|
||||
blear
|
||||
blest
|
||||
blocked
|
||||
blond
|
||||
blonde
|
||||
bloomed
|
||||
blown
|
||||
blowzed
|
||||
bluff
|
||||
blunt
|
||||
bobs
|
||||
boiled
|
||||
bold
|
||||
boned
|
||||
boon
|
||||
both
|
||||
bought
|
||||
boulle
|
||||
bound
|
||||
brag
|
||||
brash
|
||||
brave
|
||||
braw
|
||||
brief
|
||||
brisk
|
||||
broch
|
||||
broke
|
||||
brood
|
||||
brushed
|
||||
brusque
|
||||
brute
|
||||
bucked
|
||||
buff
|
||||
bugs
|
||||
built
|
||||
bum
|
||||
bung
|
||||
burned
|
||||
burred
|
||||
burst
|
||||
bushed
|
||||
bust
|
||||
bye
|
||||
calced
|
||||
calm
|
||||
canned
|
||||
cauld
|
||||
chance
|
||||
charged
|
||||
chaste
|
||||
cheap
|
||||
checked
|
||||
cheek
|
||||
cheesed
|
||||
chic
|
||||
chill
|
||||
chirk
|
||||
choice
|
||||
clad
|
||||
clean
|
||||
clipped
|
||||
coarse
|
||||
cool
|
||||
corked
|
||||
corned
|
||||
couped
|
||||
coursed
|
||||
couth
|
||||
cowled
|
||||
crack
|
||||
cracked
|
||||
cramped
|
||||
crank
|
||||
crass
|
||||
crazed
|
||||
creole
|
||||
crined
|
||||
crisp
|
||||
crocked
|
||||
cronk
|
||||
crook
|
||||
crossed
|
||||
crowned
|
||||
crude
|
||||
crumb
|
||||
crutched
|
||||
cupped
|
||||
cur
|
||||
curst
|
||||
cusped
|
||||
cute
|
||||
daft
|
||||
damn
|
||||
damned
|
||||
damp
|
||||
dang
|
||||
danged
|
||||
dank
|
||||
darn
|
||||
darned
|
||||
dash
|
||||
dashed
|
||||
deaf
|
||||
deal
|
||||
deft
|
||||
dense
|
||||
dere
|
||||
dern
|
||||
dim
|
||||
dinge
|
||||
dink
|
||||
dire
|
||||
dished
|
||||
doiled
|
||||
domed
|
||||
done
|
||||
douce
|
||||
dour
|
||||
dowf
|
||||
drab
|
||||
dread
|
||||
drear
|
||||
dree
|
||||
dreich
|
||||
dried
|
||||
droll
|
||||
drunk
|
||||
dryer
|
||||
dud
|
||||
due
|
||||
dull
|
||||
dure
|
||||
dusk
|
||||
eared
|
||||
earned
|
||||
eath
|
||||
ebb
|
||||
echt
|
||||
edge
|
||||
eight
|
||||
eighth
|
||||
eild
|
||||
elect
|
||||
else
|
||||
eyed
|
||||
fab
|
||||
fain
|
||||
faint
|
||||
fake
|
||||
famed
|
||||
far
|
||||
farm
|
||||
fat
|
||||
feal
|
||||
feat
|
||||
feigned
|
||||
fell
|
||||
felt
|
||||
few
|
||||
fey
|
||||
fierce
|
||||
finned
|
||||
firm
|
||||
fit
|
||||
flawed
|
||||
fledged
|
||||
flexed
|
||||
flip
|
||||
flown
|
||||
flush
|
||||
fogged
|
||||
foiled
|
||||
fold
|
||||
fond
|
||||
fool
|
||||
forced
|
||||
fore
|
||||
forte
|
||||
fou
|
||||
foul
|
||||
found
|
||||
frail
|
||||
fraught
|
||||
freer
|
||||
fremd
|
||||
fresh
|
||||
frigid
|
||||
frilled
|
||||
fringed
|
||||
frogged
|
||||
frore
|
||||
fumed
|
||||
fun
|
||||
funked
|
||||
furred
|
||||
gauche
|
||||
gauge
|
||||
ghast
|
||||
gibbed
|
||||
gilt
|
||||
ginned
|
||||
girt
|
||||
glare
|
||||
glazed
|
||||
gleg
|
||||
glib
|
||||
glum
|
||||
gnarled
|
||||
gone
|
||||
gorged
|
||||
grab
|
||||
grained
|
||||
grave
|
||||
greige
|
||||
grilled
|
||||
grim
|
||||
grooved
|
||||
grouse
|
||||
grown
|
||||
gruff
|
||||
grum
|
||||
gules
|
||||
gummed
|
||||
gunned
|
||||
guns
|
||||
halt
|
||||
harsh
|
||||
hask
|
||||
heeled
|
||||
heigh
|
||||
held
|
||||
helmed
|
||||
hep
|
||||
here
|
||||
het
|
||||
hewn
|
||||
hex
|
||||
hick
|
||||
hipped
|
||||
hit
|
||||
hoar
|
||||
hoarse
|
||||
hogged
|
||||
hoofed
|
||||
hooked
|
||||
hued
|
||||
huge
|
||||
hurt
|
||||
iced
|
||||
incog
|
||||
inter
|
||||
jade
|
||||
jimp
|
||||
kempt
|
||||
kept
|
||||
keyed
|
||||
kin
|
||||
kind
|
||||
kitsch
|
||||
knurled
|
||||
kraal
|
||||
laigh
|
||||
laith
|
||||
lame
|
||||
langued
|
||||
lank
|
||||
lashed
|
||||
lax
|
||||
leafed
|
||||
leal
|
||||
lean
|
||||
leaved
|
||||
left
|
||||
less
|
||||
lewd
|
||||
licht
|
||||
lief
|
||||
liege
|
||||
like
|
||||
limbed
|
||||
limp
|
||||
linked
|
||||
lipped
|
||||
lit
|
||||
lithe
|
||||
litho
|
||||
lived
|
||||
loath
|
||||
lobed
|
||||
lodged
|
||||
log
|
||||
lone
|
||||
looped
|
||||
lorn
|
||||
loth
|
||||
louche
|
||||
loud
|
||||
lown
|
||||
lowse
|
||||
lush
|
||||
luxe
|
||||
mad
|
||||
made
|
||||
mailed
|
||||
mair
|
||||
maned
|
||||
manned
|
||||
marked
|
||||
marled
|
||||
masked
|
||||
mat
|
||||
matte
|
||||
mauve
|
||||
meek
|
||||
meet
|
||||
mere
|
||||
mesne
|
||||
metal
|
||||
miffed
|
||||
milch
|
||||
mild
|
||||
milled
|
||||
mim
|
||||
mob
|
||||
mod
|
||||
moire
|
||||
moist
|
||||
moldy
|
||||
mooned
|
||||
moot
|
||||
mown
|
||||
much
|
||||
mum
|
||||
murk
|
||||
must
|
||||
mute
|
||||
mzee
|
||||
nae
|
||||
naught
|
||||
neap
|
||||
neaped
|
||||
near
|
||||
neat
|
||||
nesh
|
||||
nett
|
||||
next
|
||||
nigh
|
||||
ninth
|
||||
nowed
|
||||
nude
|
||||
numb
|
||||
nuts
|
||||
oared
|
||||
oke
|
||||
once
|
||||
ope
|
||||
over
|
||||
own
|
||||
paced
|
||||
paid
|
||||
pained
|
||||
pale
|
||||
paned
|
||||
passed
|
||||
peaked
|
||||
peart
|
||||
peeved
|
||||
pent
|
||||
perk
|
||||
picked
|
||||
piled
|
||||
pique
|
||||
pissed
|
||||
pitched
|
||||
plumb
|
||||
plump
|
||||
plus
|
||||
plush
|
||||
pocked
|
||||
poised
|
||||
pops
|
||||
posh
|
||||
pouched
|
||||
prest
|
||||
prim
|
||||
print
|
||||
prompt
|
||||
prone
|
||||
proud
|
||||
pseud
|
||||
puir
|
||||
punk
|
||||
pushed
|
||||
quack
|
||||
quaint
|
||||
quare
|
||||
queer
|
||||
quit
|
||||
quits
|
||||
raised
|
||||
raked
|
||||
ranged
|
||||
rapt
|
||||
rare
|
||||
rash
|
||||
rath
|
||||
rathe
|
||||
refer
|
||||
rent
|
||||
rid
|
||||
rife
|
||||
ripe
|
||||
roan
|
||||
roast
|
||||
ruffed
|
||||
runed
|
||||
rush
|
||||
sad
|
||||
said
|
||||
same
|
||||
sane
|
||||
sap
|
||||
scald
|
||||
scaled
|
||||
scalled
|
||||
scant
|
||||
scarce
|
||||
schlock
|
||||
scorched
|
||||
score
|
||||
scrap
|
||||
screwed
|
||||
scrimp
|
||||
sear
|
||||
sec
|
||||
sedged
|
||||
seen
|
||||
self
|
||||
sent
|
||||
sere
|
||||
sewn
|
||||
sexed
|
||||
sham
|
||||
shaped
|
||||
sheared
|
||||
shed
|
||||
sheer
|
||||
shelled
|
||||
shill
|
||||
shoal
|
||||
shod
|
||||
shorn
|
||||
shrewd
|
||||
shrill
|
||||
shrunk
|
||||
shut
|
||||
shy
|
||||
sixth
|
||||
size
|
||||
sized
|
||||
skeigh
|
||||
skew
|
||||
ski
|
||||
skilled
|
||||
skim
|
||||
skinned
|
||||
skint
|
||||
slain
|
||||
slant
|
||||
slate
|
||||
sleek
|
||||
slick
|
||||
slier
|
||||
sliest
|
||||
slight
|
||||
sloshed
|
||||
slub
|
||||
slum
|
||||
slung
|
||||
sly
|
||||
smashed
|
||||
smoked
|
||||
smug
|
||||
snecked
|
||||
snide
|
||||
snod
|
||||
snub
|
||||
snuff
|
||||
snug
|
||||
sold
|
||||
sole
|
||||
some
|
||||
sooth
|
||||
sore
|
||||
sought
|
||||
sown
|
||||
spare
|
||||
sparse
|
||||
spec
|
||||
spent
|
||||
spick
|
||||
spired
|
||||
splay
|
||||
spoilt
|
||||
sport
|
||||
spruce
|
||||
spry
|
||||
spurred
|
||||
squab
|
||||
squat
|
||||
squint
|
||||
stacked
|
||||
staged
|
||||
staid
|
||||
stale
|
||||
stalked
|
||||
starred
|
||||
staunch
|
||||
steep
|
||||
stemmed
|
||||
stewed
|
||||
stey
|
||||
stiff
|
||||
stoned
|
||||
stopped
|
||||
store
|
||||
strait
|
||||
straw
|
||||
stray
|
||||
stretch
|
||||
strewn
|
||||
strict
|
||||
stringed
|
||||
striped
|
||||
strung
|
||||
stuck
|
||||
stuffed
|
||||
stung
|
||||
suave
|
||||
such
|
||||
sunk
|
||||
super
|
||||
surd
|
||||
sure
|
||||
svelte
|
||||
swank
|
||||
swart
|
||||
swarth
|
||||
sweer
|
||||
swell
|
||||
swept
|
||||
swish
|
||||
sworn
|
||||
tai
|
||||
talc
|
||||
tame
|
||||
tan
|
||||
tanked
|
||||
tart
|
||||
taught
|
||||
taunt
|
||||
taut
|
||||
teen
|
||||
teind
|
||||
tenth
|
||||
terse
|
||||
thae
|
||||
then
|
||||
thick
|
||||
thin
|
||||
thraw
|
||||
thrawn
|
||||
through
|
||||
thrown
|
||||
thru
|
||||
thwart
|
||||
tied
|
||||
tierced
|
||||
tight
|
||||
tiled
|
||||
tinct
|
||||
tinned
|
||||
tired
|
||||
toe
|
||||
toed
|
||||
told
|
||||
tongued
|
||||
toom
|
||||
toothed
|
||||
tops
|
||||
torn
|
||||
touched
|
||||
tough
|
||||
trad
|
||||
treed
|
||||
tref
|
||||
tressed
|
||||
tried
|
||||
trig
|
||||
trim
|
||||
trine
|
||||
triste
|
||||
trite
|
||||
trussed
|
||||
tum
|
||||
twee
|
||||
twelfth
|
||||
twill
|
||||
twin
|
||||
twinned
|
||||
twp
|
||||
ult
|
||||
used
|
||||
vague
|
||||
vain
|
||||
vast
|
||||
veiled
|
||||
versed
|
||||
vexed
|
||||
vile
|
||||
vogue
|
||||
voiced
|
||||
vulned
|
||||
wale
|
||||
waste
|
||||
waur
|
||||
waved
|
||||
webbed
|
||||
wed
|
||||
wedged
|
||||
wee
|
||||
well
|
||||
wersh
|
||||
wheeled
|
||||
whelked
|
||||
whist
|
||||
whorled
|
||||
wide
|
||||
willed
|
||||
winged
|
||||
wired
|
||||
won
|
||||
worked
|
||||
worn
|
||||
worse
|
||||
worst
|
||||
wound
|
||||
wrapped
|
||||
wroth
|
||||
wud
|
||||
yare
|
||||
yauld
|
||||
yeld
|
||||
yon
|
||||
zonked
|
167
BeefTools/RandoCode/data/1adv.txt
Normal file
167
BeefTools/RandoCode/data/1adv.txt
Normal file
|
@ -0,0 +1,167 @@
|
|||
aft
|
||||
all
|
||||
anes
|
||||
anon
|
||||
aught
|
||||
bang
|
||||
bene
|
||||
bis
|
||||
blamed
|
||||
bolt
|
||||
but
|
||||
cheap
|
||||
chock
|
||||
clean
|
||||
cool
|
||||
course
|
||||
damn
|
||||
damned
|
||||
dang
|
||||
darn
|
||||
darned
|
||||
dash
|
||||
dashed
|
||||
days
|
||||
dern
|
||||
dooms
|
||||
dryer
|
||||
due
|
||||
e'er
|
||||
eath
|
||||
eft
|
||||
eighth
|
||||
else
|
||||
erst
|
||||
fain
|
||||
far
|
||||
firm
|
||||
flop
|
||||
flush
|
||||
fore
|
||||
forte
|
||||
foul
|
||||
fresh
|
||||
fro
|
||||
gey
|
||||
grave
|
||||
heads
|
||||
heap
|
||||
heigh
|
||||
hence
|
||||
here
|
||||
how
|
||||
incog
|
||||
laigh
|
||||
lark
|
||||
left
|
||||
less
|
||||
lest
|
||||
licht
|
||||
lief
|
||||
lieve
|
||||
like
|
||||
loads
|
||||
lots
|
||||
loud
|
||||
lowse
|
||||
mair
|
||||
mile
|
||||
mobs
|
||||
much
|
||||
nae
|
||||
natch
|
||||
naught
|
||||
nay
|
||||
ne'er
|
||||
near
|
||||
needs
|
||||
next
|
||||
nigh
|
||||
nights
|
||||
ninth
|
||||
none
|
||||
nope
|
||||
now
|
||||
o'er
|
||||
oft
|
||||
once
|
||||
ought
|
||||
over
|
||||
phut
|
||||
please
|
||||
plop
|
||||
plumb
|
||||
plump
|
||||
plunk
|
||||
posh
|
||||
prompt
|
||||
proud
|
||||
quite
|
||||
same
|
||||
scant
|
||||
scarce
|
||||
sheer
|
||||
since
|
||||
sith
|
||||
sixth
|
||||
skeigh
|
||||
slap
|
||||
slier
|
||||
smack
|
||||
smash
|
||||
some
|
||||
soon
|
||||
sore
|
||||
spang
|
||||
stiff
|
||||
such
|
||||
super
|
||||
sure
|
||||
swith
|
||||
syne
|
||||
tails
|
||||
tenth
|
||||
that
|
||||
then
|
||||
thence
|
||||
there
|
||||
thick
|
||||
thin
|
||||
this
|
||||
tho
|
||||
though
|
||||
thrice
|
||||
through
|
||||
thru
|
||||
thus
|
||||
thwart
|
||||
tight
|
||||
ton
|
||||
too
|
||||
tough
|
||||
trim
|
||||
twice
|
||||
vite
|
||||
waur
|
||||
way
|
||||
ways
|
||||
week
|
||||
well
|
||||
wham
|
||||
what
|
||||
when
|
||||
whence
|
||||
whiles
|
||||
why
|
||||
wide
|
||||
wit
|
||||
worse
|
||||
worst
|
||||
yare
|
||||
yea
|
||||
yeah
|
||||
yep
|
||||
yes
|
||||
yet
|
||||
yon
|
||||
yore
|
5855
BeefTools/RandoCode/data/1noun.txt
Normal file
5855
BeefTools/RandoCode/data/1noun.txt
Normal file
File diff suppressed because it is too large
Load diff
3714
BeefTools/RandoCode/data/1verb.txt
Normal file
3714
BeefTools/RandoCode/data/1verb.txt
Normal file
File diff suppressed because it is too large
Load diff
5187
BeefTools/RandoCode/data/2adj.txt
Normal file
5187
BeefTools/RandoCode/data/2adj.txt
Normal file
File diff suppressed because it is too large
Load diff
769
BeefTools/RandoCode/data/2adv.txt
Normal file
769
BeefTools/RandoCode/data/2adv.txt
Normal file
|
@ -0,0 +1,769 @@
|
|||
aback
|
||||
abaft
|
||||
abeam
|
||||
abed
|
||||
ablaze
|
||||
ablins
|
||||
abloom
|
||||
ably
|
||||
aboard
|
||||
about
|
||||
abreast
|
||||
abroach
|
||||
abroad
|
||||
acock
|
||||
across
|
||||
adown
|
||||
adrift
|
||||
afar
|
||||
afield
|
||||
afire
|
||||
aflame
|
||||
afloat
|
||||
afoot
|
||||
afore
|
||||
afoul
|
||||
afresh
|
||||
after
|
||||
again
|
||||
agape
|
||||
ago
|
||||
agog
|
||||
agone
|
||||
aground
|
||||
ahead
|
||||
ahold
|
||||
ahorse
|
||||
aiblins
|
||||
ajar
|
||||
ajee
|
||||
alas
|
||||
alee
|
||||
alight
|
||||
alike
|
||||
almost
|
||||
aloft
|
||||
alone
|
||||
along
|
||||
aloof
|
||||
aloud
|
||||
alow
|
||||
alright
|
||||
also
|
||||
although
|
||||
alway
|
||||
always
|
||||
amain
|
||||
amiss
|
||||
amok
|
||||
amply
|
||||
amuck
|
||||
ana
|
||||
anear
|
||||
anew
|
||||
anon
|
||||
apace
|
||||
apart
|
||||
apeak
|
||||
apiece
|
||||
aport
|
||||
aptly
|
||||
archly
|
||||
arco
|
||||
aright
|
||||
around
|
||||
ashore
|
||||
aside
|
||||
askance
|
||||
askew
|
||||
aslant
|
||||
asleep
|
||||
aslope
|
||||
asprawl
|
||||
asquint
|
||||
assai
|
||||
astern
|
||||
astray
|
||||
astride
|
||||
athwart
|
||||
atilt
|
||||
atop
|
||||
atwain
|
||||
atweel
|
||||
awa
|
||||
awash
|
||||
away
|
||||
awful
|
||||
awheel
|
||||
awhile
|
||||
awry
|
||||
backhand
|
||||
backstage
|
||||
backward
|
||||
backwards
|
||||
badly
|
||||
baldly
|
||||
bally
|
||||
bareback
|
||||
barebacked
|
||||
barefoot
|
||||
barely
|
||||
baresark
|
||||
basely
|
||||
beastly
|
||||
bedward
|
||||
before
|
||||
behind
|
||||
belike
|
||||
belive
|
||||
below
|
||||
bene
|
||||
beneath
|
||||
beside
|
||||
besides
|
||||
betimes
|
||||
between
|
||||
betwixt
|
||||
beyond
|
||||
blackly
|
||||
blandly
|
||||
blankly
|
||||
blasted
|
||||
bleakly
|
||||
blindfold
|
||||
blindly
|
||||
blinking
|
||||
blithely
|
||||
blooming
|
||||
bluely
|
||||
bluffly
|
||||
bluntly
|
||||
boldly
|
||||
brashly
|
||||
bravely
|
||||
brawly
|
||||
breadthways
|
||||
breadthwise
|
||||
briefly
|
||||
brightly
|
||||
briskly
|
||||
broadcast
|
||||
broadly
|
||||
broadside
|
||||
brusquely
|
||||
calmly
|
||||
canny
|
||||
caudad
|
||||
certain
|
||||
certes
|
||||
chastely
|
||||
cheaply
|
||||
cheerly
|
||||
chicly
|
||||
chiefly
|
||||
choicely
|
||||
churchward
|
||||
cleanly
|
||||
clearly
|
||||
clerkly
|
||||
clockwise
|
||||
closely
|
||||
closer
|
||||
closest
|
||||
coarsely
|
||||
coastward
|
||||
coastwise
|
||||
coldly
|
||||
collect
|
||||
confer
|
||||
contra
|
||||
coolly
|
||||
counter
|
||||
cousin
|
||||
coyly
|
||||
crabwise
|
||||
cracking
|
||||
crassly
|
||||
crisply
|
||||
crisscross
|
||||
crossly
|
||||
crosstown
|
||||
crossways
|
||||
crosswise
|
||||
crousely
|
||||
crudely
|
||||
curtly
|
||||
cutely
|
||||
d'accord
|
||||
daftly
|
||||
dam
|
||||
damply
|
||||
dankly
|
||||
darkling
|
||||
darkly
|
||||
daylong
|
||||
deafly
|
||||
dearly
|
||||
deathly
|
||||
deathy
|
||||
decent
|
||||
deeply
|
||||
deftly
|
||||
densely
|
||||
deuced
|
||||
dimly
|
||||
direly
|
||||
ditto
|
||||
doggo
|
||||
doggone
|
||||
doubly
|
||||
doubtless
|
||||
doucely
|
||||
dourly
|
||||
downhill
|
||||
downrange
|
||||
downright
|
||||
downstage
|
||||
downstairs
|
||||
downstate
|
||||
downstream
|
||||
downwards
|
||||
downwind
|
||||
drably
|
||||
drily
|
||||
drizzly
|
||||
drolly
|
||||
dryer
|
||||
dryly
|
||||
dully
|
||||
duly
|
||||
dumbly
|
||||
earthward
|
||||
earthwards
|
||||
eastward
|
||||
eastwards
|
||||
edgeways
|
||||
edgewise
|
||||
eftsoons
|
||||
eightfold
|
||||
eighthly
|
||||
either
|
||||
elsewhere
|
||||
endlong
|
||||
endways
|
||||
endwise
|
||||
enough
|
||||
enow
|
||||
erelong
|
||||
erenow
|
||||
erewhile
|
||||
erstwhile
|
||||
evenings
|
||||
evens
|
||||
ever
|
||||
faintly
|
||||
fairly
|
||||
falsely
|
||||
fanwise
|
||||
farther
|
||||
farthest
|
||||
fatly
|
||||
featly
|
||||
feckly
|
||||
feebly
|
||||
felly
|
||||
fiercely
|
||||
fifthly
|
||||
finely
|
||||
finest
|
||||
firmly
|
||||
firstly
|
||||
fitly
|
||||
fivefold
|
||||
flatling
|
||||
flatly
|
||||
flatways
|
||||
flatwise
|
||||
fleetly
|
||||
flipping
|
||||
fondly
|
||||
forby
|
||||
forehand
|
||||
foremost
|
||||
forsooth
|
||||
forte
|
||||
forthright
|
||||
forthwith
|
||||
forwards
|
||||
forwhy
|
||||
foully
|
||||
fourfold
|
||||
foursquare
|
||||
fourthly
|
||||
frailly
|
||||
frankly
|
||||
freely
|
||||
freest
|
||||
freshly
|
||||
frontward
|
||||
frontwards
|
||||
furthest
|
||||
gaily
|
||||
gainly
|
||||
gamely
|
||||
gauchely
|
||||
gauntly
|
||||
gently
|
||||
ghastly
|
||||
giusto
|
||||
gladly
|
||||
glibly
|
||||
glumly
|
||||
goddam
|
||||
goddamn
|
||||
goddamned
|
||||
goldarn
|
||||
grandly
|
||||
gratis
|
||||
grave
|
||||
gravely
|
||||
greatly
|
||||
greenly
|
||||
greyly
|
||||
grimly
|
||||
grossly
|
||||
gruffly
|
||||
grumly
|
||||
gummy
|
||||
haply
|
||||
hardly
|
||||
harshly
|
||||
headfirst
|
||||
headlong
|
||||
hellish
|
||||
henceforth
|
||||
here
|
||||
hereat
|
||||
hereby
|
||||
herein
|
||||
hereof
|
||||
hereon
|
||||
hereto
|
||||
herewith
|
||||
hindward
|
||||
hither
|
||||
hoarsely
|
||||
homeward
|
||||
homewards
|
||||
hooly
|
||||
hotfoot
|
||||
hotly
|
||||
hottest
|
||||
hourlong
|
||||
hourly
|
||||
howe'er
|
||||
howling
|
||||
hugely
|
||||
humbly
|
||||
idly
|
||||
illy
|
||||
inboard
|
||||
inby
|
||||
inchmeal
|
||||
incog
|
||||
indeed
|
||||
indoors
|
||||
inly
|
||||
inshore
|
||||
instead
|
||||
inward
|
||||
inwards
|
||||
ita
|
||||
iwis
|
||||
jimply
|
||||
jointly
|
||||
justly
|
||||
keenly
|
||||
kindly
|
||||
kingly
|
||||
lamely
|
||||
landward
|
||||
landwards
|
||||
lankly
|
||||
largely
|
||||
lastly
|
||||
lately
|
||||
later
|
||||
latest
|
||||
laxly
|
||||
leally
|
||||
leanly
|
||||
leastways
|
||||
leastwise
|
||||
leftward
|
||||
leftwards
|
||||
lengthways
|
||||
lengthwise
|
||||
lento
|
||||
lewdly
|
||||
lichtly
|
||||
lightly
|
||||
likely
|
||||
likewise
|
||||
limply
|
||||
lithely
|
||||
litho
|
||||
lively
|
||||
loathly
|
||||
longer
|
||||
longly
|
||||
longways
|
||||
longwise
|
||||
loosely
|
||||
loosest
|
||||
lordly
|
||||
loudly
|
||||
lushly
|
||||
madly
|
||||
mainly
|
||||
maybe
|
||||
mayhap
|
||||
meanly
|
||||
meantime
|
||||
meanwhile
|
||||
meekly
|
||||
meetly
|
||||
mellow
|
||||
merely
|
||||
mezzo
|
||||
mickle
|
||||
middling
|
||||
midmost
|
||||
midships
|
||||
mighty
|
||||
mildly
|
||||
moistly
|
||||
molto
|
||||
monthly
|
||||
mornings
|
||||
mosso
|
||||
mostly
|
||||
mucking
|
||||
muckle
|
||||
naething
|
||||
namely
|
||||
nary
|
||||
natheless
|
||||
nearly
|
||||
neatly
|
||||
neither
|
||||
never
|
||||
newly
|
||||
nicely
|
||||
nightlong
|
||||
nightly
|
||||
nimbly
|
||||
ninefold
|
||||
ninthly
|
||||
nobbut
|
||||
nohow
|
||||
northward
|
||||
northwards
|
||||
nothing
|
||||
noway
|
||||
nowhence
|
||||
nowhere
|
||||
nowise
|
||||
nudely
|
||||
numbly
|
||||
ocker
|
||||
oddly
|
||||
offhand
|
||||
offshore
|
||||
offside
|
||||
often
|
||||
okay
|
||||
only
|
||||
onshore
|
||||
onside
|
||||
onstage
|
||||
onward
|
||||
onwards
|
||||
outboard
|
||||
outdoors
|
||||
outright
|
||||
outwards
|
||||
over
|
||||
palely
|
||||
palewise
|
||||
parcel
|
||||
pardi
|
||||
pardy
|
||||
parlous
|
||||
partly
|
||||
passim
|
||||
peartly
|
||||
perchance
|
||||
perdie
|
||||
perforce
|
||||
perhaps
|
||||
pertly
|
||||
piano
|
||||
piecemeal
|
||||
pillion
|
||||
piping
|
||||
pithy
|
||||
plaguey
|
||||
plaguy
|
||||
plainly
|
||||
poorly
|
||||
presto
|
||||
pretty
|
||||
primly
|
||||
princely
|
||||
promptly
|
||||
pronely
|
||||
pronto
|
||||
proudly
|
||||
purely
|
||||
pushing
|
||||
quaintly
|
||||
queenly
|
||||
quicker
|
||||
quickly
|
||||
quiet
|
||||
rankly
|
||||
rarely
|
||||
rashly
|
||||
rather
|
||||
rattling
|
||||
raving
|
||||
rawly
|
||||
rearward
|
||||
rearwards
|
||||
redly
|
||||
retail
|
||||
richly
|
||||
rifely
|
||||
rightly
|
||||
rightward
|
||||
rightwards
|
||||
ripely
|
||||
roughly
|
||||
roundly
|
||||
rudely
|
||||
sadly
|
||||
safely
|
||||
sagely
|
||||
sanely
|
||||
scantly
|
||||
scarcely
|
||||
seaman
|
||||
seaward
|
||||
seawards
|
||||
second
|
||||
seemly
|
||||
seldom
|
||||
sempre
|
||||
sharply
|
||||
shily
|
||||
shipshape
|
||||
shoreward
|
||||
shortly
|
||||
shrewdly
|
||||
shrilly
|
||||
shyly
|
||||
sicker
|
||||
sickly
|
||||
sideling
|
||||
sidelong
|
||||
sideward
|
||||
sidewards
|
||||
sideways
|
||||
sidewise
|
||||
simply
|
||||
simul
|
||||
singly
|
||||
sixfold
|
||||
sixthly
|
||||
skyward
|
||||
skywards
|
||||
slackly
|
||||
slantly
|
||||
slantwise
|
||||
slickly
|
||||
slier
|
||||
slightly
|
||||
slily
|
||||
slowly
|
||||
slyly
|
||||
smartly
|
||||
smoothly
|
||||
smugly
|
||||
snugly
|
||||
softly
|
||||
solely
|
||||
soli
|
||||
someday
|
||||
somedeal
|
||||
somehow
|
||||
someplace
|
||||
something
|
||||
sometime
|
||||
sometimes
|
||||
someway
|
||||
someways
|
||||
somewhat
|
||||
somewhere
|
||||
somewhile
|
||||
somewhy
|
||||
somewise
|
||||
soothly
|
||||
sopping
|
||||
sorely
|
||||
soundly
|
||||
sourly
|
||||
southward
|
||||
southwards
|
||||
sparely
|
||||
sparsely
|
||||
spokewise
|
||||
sprightly
|
||||
sprucely
|
||||
spryly
|
||||
squarely
|
||||
stably
|
||||
staidly
|
||||
stalely
|
||||
staring
|
||||
starkly
|
||||
stateside
|
||||
statewide
|
||||
stepwise
|
||||
sternward
|
||||
sternwards
|
||||
stiffly
|
||||
stilly
|
||||
stoutly
|
||||
stownlins
|
||||
straightly
|
||||
straightway
|
||||
straitly
|
||||
strangely
|
||||
strictly
|
||||
suasive
|
||||
subtly
|
||||
sunward
|
||||
sunwards
|
||||
sunwise
|
||||
super
|
||||
supply
|
||||
supra
|
||||
surely
|
||||
sweetly
|
||||
swiftly
|
||||
tandem
|
||||
tangly
|
||||
tanto
|
||||
tarnal
|
||||
tartly
|
||||
tenfold
|
||||
tensely
|
||||
tenthly
|
||||
termly
|
||||
thenceforth
|
||||
thereat
|
||||
thereby
|
||||
therefor
|
||||
therefore
|
||||
therefrom
|
||||
therein
|
||||
thereof
|
||||
thereon
|
||||
thereout
|
||||
thereto
|
||||
therewith
|
||||
thickly
|
||||
thinly
|
||||
thirdly
|
||||
thither
|
||||
threefold
|
||||
throughly
|
||||
throughout
|
||||
tightly
|
||||
timely
|
||||
tiptoe
|
||||
tiptop
|
||||
today
|
||||
tonight
|
||||
toughly
|
||||
trancedly
|
||||
traverse
|
||||
trebly
|
||||
trimly
|
||||
triply
|
||||
troppo
|
||||
truly
|
||||
tutti
|
||||
twelvefold
|
||||
twofold
|
||||
upgrade
|
||||
uphill
|
||||
upsides
|
||||
upstage
|
||||
upstaged
|
||||
upstairs
|
||||
upstate
|
||||
upstream
|
||||
uptown
|
||||
upward
|
||||
upwards
|
||||
upwind
|
||||
usward
|
||||
vaguely
|
||||
vainly
|
||||
vanward
|
||||
vastly
|
||||
vilely
|
||||
vivo
|
||||
voetstoots
|
||||
warmly
|
||||
weakly
|
||||
weekdays
|
||||
weekends
|
||||
weekly
|
||||
westwards
|
||||
wetly
|
||||
whacking
|
||||
whene'er
|
||||
where'er
|
||||
whereat
|
||||
whereby
|
||||
wherefore
|
||||
wherefrom
|
||||
wherein
|
||||
whereof
|
||||
whereon
|
||||
whereto
|
||||
wherewith
|
||||
whilom
|
||||
whitely
|
||||
whither
|
||||
wholesale
|
||||
wholly
|
||||
whopping
|
||||
widely
|
||||
widthwise
|
||||
wildly
|
||||
withal
|
||||
within
|
||||
without
|
||||
worldly
|
||||
wrongly
|
||||
wryly
|
||||
yarely
|
||||
yearly
|
||||
yestreen
|
||||
yonder
|
||||
ywis
|
||||
zigzag
|
22106
BeefTools/RandoCode/data/2noun.txt
Normal file
22106
BeefTools/RandoCode/data/2noun.txt
Normal file
File diff suppressed because it is too large
Load diff
8564
BeefTools/RandoCode/data/2verb.txt
Normal file
8564
BeefTools/RandoCode/data/2verb.txt
Normal file
File diff suppressed because it is too large
Load diff
6923
BeefTools/RandoCode/data/3adj.txt
Normal file
6923
BeefTools/RandoCode/data/3adj.txt
Normal file
File diff suppressed because it is too large
Load diff
1544
BeefTools/RandoCode/data/3adv.txt
Normal file
1544
BeefTools/RandoCode/data/3adv.txt
Normal file
File diff suppressed because it is too large
Load diff
20599
BeefTools/RandoCode/data/3noun.txt
Normal file
20599
BeefTools/RandoCode/data/3noun.txt
Normal file
File diff suppressed because it is too large
Load diff
6364
BeefTools/RandoCode/data/3verb.txt
Normal file
6364
BeefTools/RandoCode/data/3verb.txt
Normal file
File diff suppressed because it is too large
Load diff
5301
BeefTools/RandoCode/data/4adj.txt
Normal file
5301
BeefTools/RandoCode/data/4adj.txt
Normal file
File diff suppressed because it is too large
Load diff
1428
BeefTools/RandoCode/data/4adv.txt
Normal file
1428
BeefTools/RandoCode/data/4adv.txt
Normal file
File diff suppressed because it is too large
Load diff
12246
BeefTools/RandoCode/data/4noun.txt
Normal file
12246
BeefTools/RandoCode/data/4noun.txt
Normal file
File diff suppressed because it is too large
Load diff
3986
BeefTools/RandoCode/data/4verb.txt
Normal file
3986
BeefTools/RandoCode/data/4verb.txt
Normal file
File diff suppressed because it is too large
Load diff
1242
BeefTools/RandoCode/src/Program.bf
Normal file
1242
BeefTools/RandoCode/src/Program.bf
Normal file
File diff suppressed because it is too large
Load diff
169
BeefTools/RunAndWait/RunAndWait.cpp
Normal file
169
BeefTools/RunAndWait/RunAndWait.cpp
Normal file
|
@ -0,0 +1,169 @@
|
|||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
#include <psapi.h>
|
||||
#include <shlobj.h>
|
||||
#include <algorithm>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
static bool CreatePipeWithSecurityAttributes(HANDLE& hReadPipe, HANDLE& hWritePipe, SECURITY_ATTRIBUTES* lpPipeAttributes, int nSize)
|
||||
{
|
||||
hReadPipe = 0;
|
||||
hWritePipe = 0;
|
||||
bool ret = ::CreatePipe(&hReadPipe, &hWritePipe, lpPipeAttributes, nSize);
|
||||
if (!ret || (hReadPipe == INVALID_HANDLE_VALUE) || (hWritePipe == INVALID_HANDLE_VALUE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Using synchronous Anonymous pipes for process input/output redirection means we would end up
|
||||
// wasting a worker threadpool thread per pipe instance. Overlapped pipe IO is desirable, since
|
||||
// it will take advantage of the NT IO completion port infrastructure. But we can't really use
|
||||
// Overlapped I/O for process input/output as it would break Console apps (managed Console class
|
||||
// methods such as WriteLine as well as native CRT functions like printf) which are making an
|
||||
// assumption that the console standard handles (obtained via GetStdHandle()) are opened
|
||||
// for synchronous I/O and hence they can work fine with ReadFile/WriteFile synchrnously!
|
||||
bool CreatePipe(HANDLE& parentHandle, HANDLE& childHandle, bool parentInputs)
|
||||
{
|
||||
SECURITY_ATTRIBUTES securityAttributesParent = { 0 };
|
||||
securityAttributesParent.bInheritHandle = 1;
|
||||
|
||||
HANDLE hTmp = INVALID_HANDLE_VALUE;
|
||||
if (parentInputs)
|
||||
CreatePipeWithSecurityAttributes(childHandle, hTmp, &securityAttributesParent, 0);
|
||||
else
|
||||
CreatePipeWithSecurityAttributes(hTmp, childHandle, &securityAttributesParent, 0);
|
||||
|
||||
HANDLE dupHandle = 0;
|
||||
|
||||
// Duplicate the parent handle to be non-inheritable so that the child process
|
||||
// doesn't have access. This is done for correctness sake, exact reason is unclear.
|
||||
// One potential theory is that child process can do something brain dead like
|
||||
// closing the parent end of the pipe and there by getting into a blocking situation
|
||||
// as parent will not be draining the pipe at the other end anymore.
|
||||
if (!::DuplicateHandle(GetCurrentProcess(), hTmp,
|
||||
GetCurrentProcess(), &dupHandle,
|
||||
0, false, DUPLICATE_SAME_ACCESS))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
parentHandle = dupHandle;
|
||||
|
||||
if (hTmp != INVALID_HANDLE_VALUE)
|
||||
::CloseHandle(hTmp);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
struct ProcParams
|
||||
{
|
||||
HANDLE mReadHandle;
|
||||
HANDLE mWriteHandle;
|
||||
};
|
||||
|
||||
DWORD WINAPI ReadProc(void* lpThreadParameter)
|
||||
{
|
||||
ProcParams* procParams = (ProcParams*)lpThreadParameter;
|
||||
while (true)
|
||||
{
|
||||
char buffer[2048];
|
||||
DWORD bytesRead = 0;
|
||||
if (::ReadFile(procParams->mReadHandle, buffer, (DWORD)2048, &bytesRead, NULL))
|
||||
{
|
||||
DWORD bytesWritten;
|
||||
::WriteFile(procParams->mWriteHandle, buffer, bytesRead, &bytesWritten, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
int err = GetLastError();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
char* cmdLineStr = ::GetCommandLineA();
|
||||
|
||||
DWORD flags = CREATE_DEFAULT_ERROR_MODE;
|
||||
void* envPtr = NULL;
|
||||
|
||||
char* useCmdLineStr = cmdLineStr;
|
||||
|
||||
if (cmdLineStr[0] != 0)
|
||||
{
|
||||
bool nameQuoted = cmdLineStr[0] == '\"';
|
||||
|
||||
std::string passedName;
|
||||
int i;
|
||||
for (i = (nameQuoted ? 1 : 0); cmdLineStr[i] != 0; i++)
|
||||
{
|
||||
wchar_t c = cmdLineStr[i];
|
||||
|
||||
if (((nameQuoted) && (c == '"')) ||
|
||||
((!nameQuoted) && (c == ' ')))
|
||||
{
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
passedName += cmdLineStr[i];
|
||||
}
|
||||
|
||||
useCmdLineStr += i;
|
||||
while (*useCmdLineStr == L' ')
|
||||
useCmdLineStr++;
|
||||
}
|
||||
|
||||
std::string cmdLine = useCmdLineStr;
|
||||
|
||||
PROCESS_INFORMATION processInfo;
|
||||
|
||||
STARTUPINFOA si;
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
memset(&processInfo, 0, sizeof(processInfo));
|
||||
|
||||
si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
|
||||
|
||||
HANDLE stdOut;
|
||||
CreatePipe(stdOut, si.hStdOutput, false);
|
||||
|
||||
HANDLE stdErr;
|
||||
CreatePipe(stdErr, si.hStdError, false);
|
||||
|
||||
si.dwFlags = STARTF_USESTDHANDLES;
|
||||
|
||||
DWORD startTick = GetTickCount();
|
||||
BOOL worked = CreateProcessA(NULL, (char*)cmdLine.c_str(), NULL, NULL, TRUE,
|
||||
flags, envPtr, NULL, &si, &processInfo);
|
||||
|
||||
::CloseHandle(si.hStdOutput);
|
||||
::CloseHandle(si.hStdError);
|
||||
|
||||
if (!worked)
|
||||
return 1;
|
||||
|
||||
DWORD threadId;
|
||||
ProcParams stdOutParams = { stdOut, GetStdHandle(STD_OUTPUT_HANDLE) };
|
||||
HANDLE stdOutThread = ::CreateThread(NULL, (SIZE_T)128*1024, (LPTHREAD_START_ROUTINE)ReadProc, (void*)&stdOutParams, 0, &threadId);
|
||||
|
||||
ProcParams stdErrParams = { stdErr, GetStdHandle(STD_ERROR_HANDLE) };
|
||||
HANDLE stdErrThread = ::CreateThread(NULL, (SIZE_T)128 * 1024, (LPTHREAD_START_ROUTINE)ReadProc, (void*)&stdErrParams, 0, &threadId);
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (::WaitForSingleObject(processInfo.hProcess, 20) == WAIT_OBJECT_0)
|
||||
break;
|
||||
}
|
||||
::WaitForSingleObject(stdOutThread, INFINITE);
|
||||
::WaitForSingleObject(stdErrThread, INFINITE);
|
||||
|
||||
DWORD exitCode = 0;
|
||||
::GetExitCodeProcess(processInfo.hProcess, &exitCode);
|
||||
|
||||
return exitCode;
|
||||
}
|
31
BeefTools/RunAndWait/RunAndWait.sln
Normal file
31
BeefTools/RunAndWait/RunAndWait.sln
Normal file
|
@ -0,0 +1,31 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.168
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RunAndWait", "RunAndWait.vcxproj", "{BE0C7160-375C-4164-8388-BFCC6DAA7828}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Debug|x64.Build.0 = Debug|x64
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Debug|x86.Build.0 = Debug|Win32
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Release|x64.ActiveCfg = Release|x64
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Release|x64.Build.0 = Release|x64
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Release|x86.ActiveCfg = Release|Win32
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {16925B56-8396-415D-90DB-C674F44DA36E}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
162
BeefTools/RunAndWait/RunAndWait.vcxproj
Normal file
162
BeefTools/RunAndWait/RunAndWait.vcxproj
Normal file
|
@ -0,0 +1,162 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{BE0C7160-375C-4164-8388-BFCC6DAA7828}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>RunAndWait</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="RunAndWait.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
24
BeefTools/RunAndWait/RunAndWait.vcxproj.filters
Normal file
24
BeefTools/RunAndWait/RunAndWait.vcxproj.filters
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="RunAndWait.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
213
BeefTools/RunWithStats/RunWithStats.cpp
Normal file
213
BeefTools/RunWithStats/RunWithStats.cpp
Normal file
|
@ -0,0 +1,213 @@
|
|||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
#include <psapi.h>
|
||||
#include <shlobj.h>
|
||||
#include <algorithm>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
std::string GetEnv(const std::string& name)
|
||||
{
|
||||
char envStr[1024];
|
||||
envStr[0] = 0;
|
||||
::GetEnvironmentVariableA(name.c_str(), envStr, sizeof(envStr));
|
||||
return envStr;
|
||||
}
|
||||
|
||||
|
||||
static bool CreatePipeWithSecurityAttributes(HANDLE& hReadPipe, HANDLE& hWritePipe, SECURITY_ATTRIBUTES* lpPipeAttributes, int nSize)
|
||||
{
|
||||
hReadPipe = 0;
|
||||
hWritePipe = 0;
|
||||
bool ret = ::CreatePipe(&hReadPipe, &hWritePipe, lpPipeAttributes, nSize);
|
||||
if (!ret || (hReadPipe == INVALID_HANDLE_VALUE) || (hWritePipe == INVALID_HANDLE_VALUE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Using synchronous Anonymous pipes for process input/output redirection means we would end up
|
||||
// wasting a worker threadpool thread per pipe instance. Overlapped pipe IO is desirable, since
|
||||
// it will take advantage of the NT IO completion port infrastructure. But we can't really use
|
||||
// Overlapped I/O for process input/output as it would break Console apps (managed Console class
|
||||
// methods such as WriteLine as well as native CRT functions like printf) which are making an
|
||||
// assumption that the console standard handles (obtained via GetStdHandle()) are opened
|
||||
// for synchronous I/O and hence they can work fine with ReadFile/WriteFile synchrnously!
|
||||
bool CreatePipe(HANDLE& parentHandle, HANDLE& childHandle, bool parentInputs)
|
||||
{
|
||||
SECURITY_ATTRIBUTES securityAttributesParent = { 0 };
|
||||
securityAttributesParent.bInheritHandle = 1;
|
||||
|
||||
HANDLE hTmp = INVALID_HANDLE_VALUE;
|
||||
if (parentInputs)
|
||||
CreatePipeWithSecurityAttributes(childHandle, hTmp, &securityAttributesParent, 0);
|
||||
else
|
||||
CreatePipeWithSecurityAttributes(hTmp, childHandle, &securityAttributesParent, 0);
|
||||
|
||||
HANDLE dupHandle = 0;
|
||||
|
||||
// Duplicate the parent handle to be non-inheritable so that the child process
|
||||
// doesn't have access. This is done for correctness sake, exact reason is unclear.
|
||||
// One potential theory is that child process can do something brain dead like
|
||||
// closing the parent end of the pipe and there by getting into a blocking situation
|
||||
// as parent will not be draining the pipe at the other end anymore.
|
||||
if (!::DuplicateHandle(GetCurrentProcess(), hTmp,
|
||||
GetCurrentProcess(), &dupHandle,
|
||||
0, false, DUPLICATE_SAME_ACCESS))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
parentHandle = dupHandle;
|
||||
|
||||
if (hTmp != INVALID_HANDLE_VALUE)
|
||||
::CloseHandle(hTmp);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
struct ProcParams
|
||||
{
|
||||
HANDLE mReadHandle;
|
||||
HANDLE mWriteHandle;
|
||||
};
|
||||
|
||||
DWORD WINAPI ReadProc(void* lpThreadParameter)
|
||||
{
|
||||
ProcParams* procParams = (ProcParams*)lpThreadParameter;
|
||||
while (true)
|
||||
{
|
||||
char buffer[2048];
|
||||
DWORD bytesRead = 0;
|
||||
if (::ReadFile(procParams->mReadHandle, buffer, (DWORD)2048, &bytesRead, NULL))
|
||||
{
|
||||
DWORD bytesWritten;
|
||||
::WriteFile(procParams->mWriteHandle, buffer, bytesRead, &bytesWritten, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
int err = GetLastError();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
std::string changeListStr = GetEnv("P4_CHANGELIST");
|
||||
std::string statsFileStr = GetEnv("STATS_FILE");
|
||||
|
||||
char* cmdLineStr = ::GetCommandLineA();
|
||||
|
||||
DWORD flags = CREATE_DEFAULT_ERROR_MODE;
|
||||
void* envPtr = NULL;
|
||||
|
||||
char* useCmdLineStr = cmdLineStr;
|
||||
|
||||
if (cmdLineStr[0] != 0)
|
||||
{
|
||||
bool nameQuoted = cmdLineStr[0] == '\"';
|
||||
|
||||
std::string passedName;
|
||||
int i;
|
||||
for (i = (nameQuoted ? 1 : 0); cmdLineStr[i] != 0; i++)
|
||||
{
|
||||
wchar_t c = cmdLineStr[i];
|
||||
|
||||
if (((nameQuoted) && (c == '"')) ||
|
||||
((!nameQuoted) && (c == ' ')))
|
||||
{
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
passedName += cmdLineStr[i];
|
||||
}
|
||||
|
||||
useCmdLineStr += i;
|
||||
while (*useCmdLineStr == L' ')
|
||||
useCmdLineStr++;
|
||||
}
|
||||
|
||||
std::string cmdLine = useCmdLineStr;
|
||||
|
||||
PROCESS_INFORMATION processInfo;
|
||||
|
||||
STARTUPINFOA si;
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
memset(&processInfo, 0, sizeof(processInfo));
|
||||
|
||||
si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
|
||||
|
||||
HANDLE stdOut;
|
||||
CreatePipe(stdOut, si.hStdOutput, false);
|
||||
|
||||
HANDLE stdErr;
|
||||
CreatePipe(stdErr, si.hStdError, false);
|
||||
|
||||
si.dwFlags = STARTF_USESTDHANDLES;
|
||||
|
||||
DWORD startTick = GetTickCount();
|
||||
BOOL worked = CreateProcessA(NULL, (char*)cmdLine.c_str(), NULL, NULL, TRUE,
|
||||
flags, envPtr, NULL, &si, &processInfo);
|
||||
|
||||
::CloseHandle(si.hStdOutput);
|
||||
::CloseHandle(si.hStdError);
|
||||
|
||||
if (!worked)
|
||||
return 1;
|
||||
|
||||
int maxWorkingSet = 0;
|
||||
|
||||
DWORD threadId;
|
||||
ProcParams stdOutParams = { stdOut, GetStdHandle(STD_OUTPUT_HANDLE) };
|
||||
HANDLE stdOutThread = ::CreateThread(NULL, (SIZE_T)128 * 1024, (LPTHREAD_START_ROUTINE)ReadProc, (void*)&stdOutParams, 0, &threadId);
|
||||
|
||||
ProcParams stdErrParams = { stdErr, GetStdHandle(STD_ERROR_HANDLE) };
|
||||
HANDLE stdErrThread = ::CreateThread(NULL, (SIZE_T)128 * 1024, (LPTHREAD_START_ROUTINE)ReadProc, (void*)&stdErrParams, 0, &threadId);
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (::WaitForSingleObject(processInfo.hProcess, 20) == WAIT_OBJECT_0)
|
||||
break;
|
||||
}
|
||||
::WaitForSingleObject(stdOutThread, INFINITE);
|
||||
::WaitForSingleObject(stdErrThread, INFINITE);
|
||||
|
||||
DWORD exitCode = 0;
|
||||
::GetExitCodeProcess(processInfo.hProcess, &exitCode);
|
||||
|
||||
int elaspedTime = (int)(GetTickCount() - startTick);
|
||||
|
||||
PROCESS_MEMORY_COUNTERS processMemCounters;
|
||||
processMemCounters.cb = sizeof(PROCESS_MEMORY_COUNTERS);
|
||||
GetProcessMemoryInfo(processInfo.hProcess, &processMemCounters, sizeof(PROCESS_MEMORY_COUNTERS));
|
||||
|
||||
time_t rawtime;
|
||||
struct tm * timeinfo;
|
||||
time(&rawtime);
|
||||
timeinfo = localtime(&rawtime);
|
||||
//printf("Current local time and date: %s", asctime(timeinfo));
|
||||
|
||||
printf("Elapsed Time : %dms\n", elaspedTime);
|
||||
printf("Working Set : %dk\n", (int)(processMemCounters.PeakWorkingSetSize / 1024));
|
||||
printf("Virtual Memory: %dk\n", (int)(processMemCounters.PeakPagefileUsage / 1024));
|
||||
|
||||
if (!statsFileStr.empty())
|
||||
{
|
||||
FILE* fp = fopen(statsFileStr.c_str(), "a+");
|
||||
if (fp == NULL)
|
||||
{
|
||||
fprintf(stderr, "Failed to open stats file: %s\n", statsFileStr.c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(fp, "%d-%d-%d %d:%02d:%02d, %s, %d, %d, %d\n",
|
||||
timeinfo->tm_year + 1900, timeinfo->tm_mon + 1, timeinfo->tm_mday, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec,
|
||||
changeListStr.c_str(), elaspedTime, (int)(processMemCounters.PeakWorkingSetSize / 1024), (int)(processMemCounters.PeakPagefileUsage / 1024));
|
||||
fclose(fp);
|
||||
}
|
||||
return exitCode;
|
||||
}
|
31
BeefTools/RunWithStats/RunWithStats.sln
Normal file
31
BeefTools/RunWithStats/RunWithStats.sln
Normal file
|
@ -0,0 +1,31 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.168
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RunWithStats", "RunWithStats.vcxproj", "{BE0C7160-375C-4164-8388-BFCC6DAA7828}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Debug|x64.Build.0 = Debug|x64
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Debug|x86.Build.0 = Debug|Win32
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Release|x64.ActiveCfg = Release|x64
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Release|x64.Build.0 = Release|x64
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Release|x86.ActiveCfg = Release|Win32
|
||||
{BE0C7160-375C-4164-8388-BFCC6DAA7828}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {16925B56-8396-415D-90DB-C674F44DA36E}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
160
BeefTools/RunWithStats/RunWithStats.vcxproj
Normal file
160
BeefTools/RunWithStats/RunWithStats.vcxproj
Normal file
|
@ -0,0 +1,160 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{BE0C7160-375C-4164-8388-BFCC6DAA7828}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>RunWithStats</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="RunWithStats.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
24
BeefTools/RunWithStats/RunWithStats.vcxproj.filters
Normal file
24
BeefTools/RunWithStats/RunWithStats.vcxproj.filters
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="RunWithStats.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
121
BeefTools/TestDLL/TestDLL.cpp
Normal file
121
BeefTools/TestDLL/TestDLL.cpp
Normal file
|
@ -0,0 +1,121 @@
|
|||
#define _ENABLE_ATOMIC_ALIGNMENT_FIX
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include <cstdio>
|
||||
#include "TestDLL.h"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
|
||||
namespace Beefy
|
||||
{
|
||||
template <typename TKey, typename TValue>
|
||||
class Dictionary
|
||||
{
|
||||
public:
|
||||
struct Entry
|
||||
{
|
||||
TKey mKey;
|
||||
TValue mValue;;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
struct FliffT
|
||||
{
|
||||
T mVal;
|
||||
};
|
||||
|
||||
bool CheckIt()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int GetA()
|
||||
{
|
||||
return 123;
|
||||
}
|
||||
|
||||
int GetB()
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
Sleep(100);
|
||||
printf("Hey %d\n", i);
|
||||
}
|
||||
return 234;
|
||||
}
|
||||
|
||||
struct StructB
|
||||
{
|
||||
std::string mStr;
|
||||
};
|
||||
|
||||
|
||||
struct [[nodiscard]] StructA
|
||||
{
|
||||
StructB* mSB;
|
||||
|
||||
int GetVal()
|
||||
{
|
||||
return 123;
|
||||
}
|
||||
|
||||
int GetWithSleep()
|
||||
{
|
||||
Sleep(5000);
|
||||
return 234;
|
||||
}
|
||||
};
|
||||
|
||||
[[nodiscard]]
|
||||
int GetVal()
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
|
||||
StructA GetSA()
|
||||
{
|
||||
return StructA();
|
||||
}
|
||||
|
||||
// THIS IS VERSION 3.
|
||||
extern "C"
|
||||
__declspec(dllexport) void Test2(int aa, int bb, int cc, int dd)
|
||||
{
|
||||
GetVal();
|
||||
GetSA();
|
||||
|
||||
//Sleep(10000);
|
||||
|
||||
StructA sa;
|
||||
sa.mSB = NULL;
|
||||
Sleep(200);
|
||||
sa.GetVal();
|
||||
sa.GetWithSleep();
|
||||
//auto val = sa.mSB->mStr;
|
||||
|
||||
std::string str = "Hey Dude";
|
||||
str.push_back((char)0x85);
|
||||
std::wstring str2 = L"Hey Dude";
|
||||
str2.push_back((wchar_t)0x85);
|
||||
str2.push_back((wchar_t)0x263a);
|
||||
|
||||
int a = 123;
|
||||
int b = 234;
|
||||
int c = 345;
|
||||
|
||||
//GetA();
|
||||
//GetB();
|
||||
}
|
||||
|
||||
extern "C"
|
||||
__declspec(dllexport) void Test3(int a, int b)
|
||||
{
|
||||
|
||||
|
||||
//printf("Hey!\n");
|
||||
}
|
10
BeefTools/TestDLL/TestDLL.h
Normal file
10
BeefTools/TestDLL/TestDLL.h
Normal file
|
@ -0,0 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
class TestMe
|
||||
{
|
||||
public:
|
||||
int GetIt(int a)
|
||||
{
|
||||
return a + 100;
|
||||
}
|
||||
};
|
31
BeefTools/TestDLL/TestDLL.sln
Normal file
31
BeefTools/TestDLL/TestDLL.sln
Normal file
|
@ -0,0 +1,31 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27625.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestDLL", "TestDLL.vcxproj", "{14700A80-0FC4-4A3D-99EF-8B78D4B070F1}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{14700A80-0FC4-4A3D-99EF-8B78D4B070F1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{14700A80-0FC4-4A3D-99EF-8B78D4B070F1}.Debug|x64.Build.0 = Debug|x64
|
||||
{14700A80-0FC4-4A3D-99EF-8B78D4B070F1}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{14700A80-0FC4-4A3D-99EF-8B78D4B070F1}.Debug|x86.Build.0 = Debug|Win32
|
||||
{14700A80-0FC4-4A3D-99EF-8B78D4B070F1}.Release|x64.ActiveCfg = Release|x64
|
||||
{14700A80-0FC4-4A3D-99EF-8B78D4B070F1}.Release|x64.Build.0 = Release|x64
|
||||
{14700A80-0FC4-4A3D-99EF-8B78D4B070F1}.Release|x86.ActiveCfg = Release|Win32
|
||||
{14700A80-0FC4-4A3D-99EF-8B78D4B070F1}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {8181F2A5-6BC1-4FD1-A6C2-43520F5824C1}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
154
BeefTools/TestDLL/TestDLL.vcxproj
Normal file
154
BeefTools/TestDLL/TestDLL.vcxproj
Normal file
|
@ -0,0 +1,154 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{14700A80-0FC4-4A3D-99EF-8B78D4B070F1}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>TestDLL</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<BaseAddress>0x1000000</BaseAddress>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>\Beef\BeefySysLib;\Beef\BeefySysLib\third_party</AdditionalIncludeDirectories>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="TestDLL.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
22
BeefTools/TestDLL/TestDLL.vcxproj.filters
Normal file
22
BeefTools/TestDLL/TestDLL.vcxproj.filters
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="TestDLL.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
8
BeefTools/TestDLL/TestDLL2.cpp
Normal file
8
BeefTools/TestDLL/TestDLL2.cpp
Normal file
|
@ -0,0 +1,8 @@
|
|||
#include "TestDLL.h"
|
||||
|
||||
extern "C"
|
||||
__declspec(dllexport) void Test4(int a, int b)
|
||||
{
|
||||
TestMe tm;
|
||||
tm.GetIt(222);
|
||||
}
|
4
BeefTools/TestDLL/store.bat
Normal file
4
BeefTools/TestDLL/store.bat
Normal file
|
@ -0,0 +1,4 @@
|
|||
call ..\..\bin\p4index.cmd -source=. -symbols=. -debug
|
||||
..\..\bin\symstore add /f x64\Debug\*.dll /s c:\BeefSyms /t TestDLL /compress
|
||||
..\..\bin\symstore add /f x64\Debug\*.pdb /s c:\BeefSyms /t TestDLL /compress
|
||||
copy x64\Debug\TestDLL.dll ..\..\IDE\dist\
|
Loading…
Add table
Add a link
Reference in a new issue