mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
Obsolete packages moved to archive
git-svn-id: svn://ultimatepp.org/upp/trunk@15690 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d27ccabff5
commit
da5f9a4251
24 changed files with 0 additions and 1438 deletions
|
|
@ -1,118 +0,0 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
#include <winver.h>
|
||||
#include <imagehlp.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#define DLLFILENAME "imagehlp.dll"
|
||||
#define DLIHEADER "imagehlp.dli"
|
||||
#define DLIMODULE Imagehlp
|
||||
#include <Core/dli.h>
|
||||
|
||||
String AnalyzeMap(String fn)
|
||||
{
|
||||
Vector<unsigned> len;
|
||||
Vector<String> name;
|
||||
String map = LoadFile(fn);
|
||||
if(IsNull(map))
|
||||
return "can't open " + fn;
|
||||
const char *p = map;
|
||||
while(*p)
|
||||
if(*p++ == '\n' && !memcmp(p, " 0001:", 6)) {
|
||||
p += 5;
|
||||
while(IsXDigit(*++p))
|
||||
;
|
||||
while(*p == ' ')
|
||||
p++;
|
||||
const char *b = p;
|
||||
while((byte)*p > ' ')
|
||||
p++;
|
||||
const char *e = p;
|
||||
while(*p == ' ')
|
||||
p++;
|
||||
if(e > b && IsXDigit(*p)) {
|
||||
unsigned addr = strtoul(p, 0, 16);
|
||||
if(len.GetCount())
|
||||
len.Top() = addr - len.Top();
|
||||
len.Add(addr);
|
||||
name.Add(String(b, e));
|
||||
}
|
||||
|
||||
}
|
||||
// if(len.GetCount())
|
||||
// len.Top() -= addr;
|
||||
IndexSort(len, name, StdGreater<unsigned>());
|
||||
String r;
|
||||
for(int i = 0; i < len.GetCount(); i++) {
|
||||
r << Sprintf("%5d: ", len[i]);
|
||||
if(Imagehlp()) {
|
||||
char nm[1024];
|
||||
Imagehlp().UnDecorateSymbolName(name[i], nm, 1024, UNDNAME_NO_ACCESS_SPECIFIERS|
|
||||
UNDNAME_NO_MEMBER_TYPE|UNDNAME_NO_MS_KEYWORDS);
|
||||
r << nm;
|
||||
}
|
||||
else
|
||||
r << name[i];
|
||||
r << '\n';
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
class MapAnalyzer : public TopWindow {
|
||||
public:
|
||||
typedef MapAnalyzer CLASSNAME;
|
||||
MapAnalyzer();
|
||||
|
||||
void Run();
|
||||
|
||||
bool OpenFile();
|
||||
|
||||
virtual bool Key(dword key, int repcnt);
|
||||
|
||||
void LoadCrashFile();
|
||||
|
||||
private:
|
||||
LineEdit map;
|
||||
};
|
||||
|
||||
MapAnalyzer::MapAnalyzer()
|
||||
{
|
||||
Sizeable().Zoomable();
|
||||
Add(map.SizePos());
|
||||
}
|
||||
|
||||
void MapAnalyzer::Run()
|
||||
{
|
||||
if(!OpenFile())
|
||||
return;
|
||||
TopWindow::Run();
|
||||
}
|
||||
|
||||
bool MapAnalyzer::Key(dword key, int repcnt)
|
||||
{
|
||||
if(key == K_CTRL_O) {
|
||||
OpenFile();
|
||||
return true;
|
||||
}
|
||||
return TopWindow::Key(key, repcnt);
|
||||
}
|
||||
|
||||
bool MapAnalyzer::OpenFile()
|
||||
{
|
||||
FileSel fs;
|
||||
LoadFromFile(fs);
|
||||
fs.Type("Map file", "*.map");
|
||||
fs.DefaultExt("map");
|
||||
fs.Multi();
|
||||
if(!fs.ExecuteOpen()) return false;
|
||||
StoreToFile(fs);
|
||||
map <<= AnalyzeMap(~fs);
|
||||
return true;
|
||||
}
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
SetDefaultCharset(CHARSET_WIN1250);
|
||||
MapAnalyzer viewer;
|
||||
viewer.Run();
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
description "Utility to analyze .map files\377";
|
||||
|
||||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
imagehlp.dli,
|
||||
Analyze.cpp,
|
||||
Info readonly separator,
|
||||
Copying;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
Copyright (c) 1998, 2020, The U++ Project
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 974 B |
|
|
@ -1,313 +0,0 @@
|
|||
# Microsoft Developer Studio Generated NMAKE File, Based on crash.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=crash - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to crash - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "crash - Win32 Release" && "$(CFG)" != "crash - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "crash.mak" CFG="crash - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "crash - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "crash - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "crash - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
|
||||
!IF "$(RECURSE)" == "0"
|
||||
|
||||
ALL : "c:\tools\crash.exe"
|
||||
|
||||
!ELSE
|
||||
|
||||
ALL : "VLib - Win32 Release" "tlib - Win32 Release" "tgui - Win32 Release" "CtrlLib - Win32 Release" "c:\tools\crash.exe"
|
||||
|
||||
!ENDIF
|
||||
|
||||
!IF "$(RECURSE)" == "1"
|
||||
CLEAN :"CtrlLib - Win32 ReleaseCLEAN" "tgui - Win32 ReleaseCLEAN" "tlib - Win32 ReleaseCLEAN" "VLib - Win32 ReleaseCLEAN"
|
||||
!ELSE
|
||||
CLEAN :
|
||||
!ENDIF
|
||||
-@erase "$(INTDIR)\crash.obj"
|
||||
-@erase "$(INTDIR)\crash.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "c:\tools\crash.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP_PROJ=/nologo /MT /W3 /GR /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\crash.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC_PROJ=/l 0x405 /fo"$(INTDIR)\crash.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\crash.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=/nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\crash.pdb" /machine:I386 /out:"c:/tools/crash.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\crash.obj" \
|
||||
"$(INTDIR)\crash.res" \
|
||||
"..\CtrlLib\Release\CtrlLib.lib" \
|
||||
"E:\build\tgui\Release\tgui.lib" \
|
||||
"E:\build\tlib\Release\tlib.lib" \
|
||||
"..\VLib\Release\VLib.lib"
|
||||
|
||||
"c:\tools\crash.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
!IF "$(RECURSE)" == "0"
|
||||
|
||||
ALL : "$(OUTDIR)\crash.exe"
|
||||
|
||||
!ELSE
|
||||
|
||||
ALL : "VLib - Win32 Debug" "tlib - Win32 Debug" "tgui - Win32 Debug" "CtrlLib - Win32 Debug" "$(OUTDIR)\crash.exe"
|
||||
|
||||
!ENDIF
|
||||
|
||||
!IF "$(RECURSE)" == "1"
|
||||
CLEAN :"CtrlLib - Win32 DebugCLEAN" "tgui - Win32 DebugCLEAN" "tlib - Win32 DebugCLEAN" "VLib - Win32 DebugCLEAN"
|
||||
!ELSE
|
||||
CLEAN :
|
||||
!ENDIF
|
||||
-@erase "$(INTDIR)\crash.obj"
|
||||
-@erase "$(INTDIR)\crash.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\crash.exe"
|
||||
-@erase "$(OUTDIR)\crash.ilk"
|
||||
-@erase "$(OUTDIR)\crash.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP_PROJ=/nologo /MTd /W3 /Gm /GR /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\crash.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC_PROJ=/l 0x405 /fo"$(INTDIR)\crash.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\crash.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=/nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\crash.pdb" /debug /machine:I386 /out:"$(OUTDIR)\crash.exe" /pdbtype:sept
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\crash.obj" \
|
||||
"$(INTDIR)\crash.res" \
|
||||
"..\CtrlLib\Debug\CtrlLib.lib" \
|
||||
"E:\build\tgui\Debug\tgui.lib" \
|
||||
"E:\build\tlib\Debug\tlib.lib" \
|
||||
"..\VLib\Debug\VLib.lib"
|
||||
|
||||
"$(OUTDIR)\crash.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("crash.dep")
|
||||
!INCLUDE "crash.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "crash.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "crash - Win32 Release" || "$(CFG)" == "crash - Win32 Debug"
|
||||
SOURCE=.\crash.cpp
|
||||
|
||||
"$(INTDIR)\crash.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\crash.rc
|
||||
|
||||
"$(INTDIR)\crash.res" : $(SOURCE) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!IF "$(CFG)" == "crash - Win32 Release"
|
||||
|
||||
"CtrlLib - Win32 Release" :
|
||||
cd "\SOURCE\CtrlLib"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\CtrlLib.mak CFG="CtrlLib - Win32 Release"
|
||||
cd "..\crash"
|
||||
|
||||
"CtrlLib - Win32 ReleaseCLEAN" :
|
||||
cd "\SOURCE\CtrlLib"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\CtrlLib.mak CFG="CtrlLib - Win32 Release" RECURSE=1 CLEAN
|
||||
cd "..\crash"
|
||||
|
||||
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
|
||||
|
||||
"CtrlLib - Win32 Debug" :
|
||||
cd "\SOURCE\CtrlLib"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\CtrlLib.mak CFG="CtrlLib - Win32 Debug"
|
||||
cd "..\crash"
|
||||
|
||||
"CtrlLib - Win32 DebugCLEAN" :
|
||||
cd "\SOURCE\CtrlLib"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\CtrlLib.mak CFG="CtrlLib - Win32 Debug" RECURSE=1 CLEAN
|
||||
cd "..\crash"
|
||||
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "crash - Win32 Release"
|
||||
|
||||
"tgui - Win32 Release" :
|
||||
E:
|
||||
cd "E:\V\TLIB"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\tgui.mak CFG="tgui - Win32 Release"
|
||||
F:
|
||||
cd "F:\SOURCE\crash"
|
||||
|
||||
"tgui - Win32 ReleaseCLEAN" :
|
||||
E:
|
||||
cd "E:\V\TLIB"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\tgui.mak CFG="tgui - Win32 Release" RECURSE=1 CLEAN
|
||||
F:
|
||||
cd "F:\SOURCE\crash"
|
||||
|
||||
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
|
||||
|
||||
"tgui - Win32 Debug" :
|
||||
E:
|
||||
cd "E:\V\TLIB"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\tgui.mak CFG="tgui - Win32 Debug"
|
||||
F:
|
||||
cd "F:\SOURCE\crash"
|
||||
|
||||
"tgui - Win32 DebugCLEAN" :
|
||||
E:
|
||||
cd "E:\V\TLIB"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\tgui.mak CFG="tgui - Win32 Debug" RECURSE=1 CLEAN
|
||||
F:
|
||||
cd "F:\SOURCE\crash"
|
||||
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "crash - Win32 Release"
|
||||
|
||||
"tlib - Win32 Release" :
|
||||
E:
|
||||
cd "E:\V\TLIB"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\tlib.mak CFG="tlib - Win32 Release"
|
||||
F:
|
||||
cd "F:\SOURCE\crash"
|
||||
|
||||
"tlib - Win32 ReleaseCLEAN" :
|
||||
E:
|
||||
cd "E:\V\TLIB"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\tlib.mak CFG="tlib - Win32 Release" RECURSE=1 CLEAN
|
||||
F:
|
||||
cd "F:\SOURCE\crash"
|
||||
|
||||
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
|
||||
|
||||
"tlib - Win32 Debug" :
|
||||
E:
|
||||
cd "E:\V\TLIB"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\tlib.mak CFG="tlib - Win32 Debug"
|
||||
F:
|
||||
cd "F:\SOURCE\crash"
|
||||
|
||||
"tlib - Win32 DebugCLEAN" :
|
||||
E:
|
||||
cd "E:\V\TLIB"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\tlib.mak CFG="tlib - Win32 Debug" RECURSE=1 CLEAN
|
||||
F:
|
||||
cd "F:\SOURCE\crash"
|
||||
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "crash - Win32 Release"
|
||||
|
||||
"VLib - Win32 Release" :
|
||||
cd "\SOURCE\VLib"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\VLib.mak CFG="VLib - Win32 Release"
|
||||
cd "..\crash"
|
||||
|
||||
"VLib - Win32 ReleaseCLEAN" :
|
||||
cd "\SOURCE\VLib"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\VLib.mak CFG="VLib - Win32 Release" RECURSE=1 CLEAN
|
||||
cd "..\crash"
|
||||
|
||||
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
|
||||
|
||||
"VLib - Win32 Debug" :
|
||||
cd "\SOURCE\VLib"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\VLib.mak CFG="VLib - Win32 Debug"
|
||||
cd "..\crash"
|
||||
|
||||
"VLib - Win32 DebugCLEAN" :
|
||||
cd "\SOURCE\VLib"
|
||||
$(MAKE) /$(MAKEFLAGS) /F .\VLib.mak CFG="VLib - Win32 Debug" RECURSE=1 CLEAN
|
||||
cd "..\crash"
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
|
@ -1 +0,0 @@
|
|||
FN_C(DWORD, __stdcall, UnDecorateSymbolName, (PCSTR dn, PSTR udn, DWORD len, DWORD Flags))
|
||||
|
|
@ -1,125 +0,0 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
// This is diagnostic package:
|
||||
// It compiles all U++ examples using MSC8 and MINGW build methods
|
||||
// or methods listed on commandline
|
||||
|
||||
String input = "c:/upp.src";
|
||||
String output = "c:/upp/all";
|
||||
String umk = "c:\\upp\\umk.exe ";
|
||||
Vector<String> bm;
|
||||
|
||||
bool failed;
|
||||
|
||||
const char *exclude[] = {
|
||||
"SDLEXAMPLE", "OLECALC", // REACTIVATE LATER
|
||||
"LOG:R",
|
||||
"WINFB", "LINUXFB", "FRAMEBUFFER", "COUNTER", "REGEXPEXT",
|
||||
#ifdef PLATFORM_WIN32
|
||||
"SQL_MYSQL",
|
||||
#endif
|
||||
#ifdef PLATFORM_LINUX
|
||||
"SQL_MSSQL", "CAPTURESCREENDLL", "UWORD_FB", "ODBCTST", "WMF"
|
||||
#endif
|
||||
};
|
||||
|
||||
bool IsIgnored(const String& name)
|
||||
{
|
||||
return Find(exclude, exclude + __countof(exclude), ToUpper(name));
|
||||
}
|
||||
|
||||
void Build(const char *nest, const char *bm, bool release)
|
||||
{
|
||||
String flags = release ? "r" : "b";
|
||||
String mn = release ? "R" : "D";
|
||||
String n = String().Cat() << nest << '-' << bm << '-' << mn;
|
||||
Cout() << n << '\n';
|
||||
String outdir = AppendFileName(output, n);
|
||||
DeleteFolderDeep(outdir);
|
||||
RealizeDirectory(outdir);
|
||||
FindFile ff(AppendFileName(AppendFileName(input, nest), "*.*"));
|
||||
bool first = true;
|
||||
while(ff) {
|
||||
String name = ff.GetName();
|
||||
if(ff.IsFolder() && !ff.IsHidden() &&
|
||||
!IsIgnored(name) && !IsIgnored(name + ":" + mn) && !IsIgnored(String(nest) + ':' + name + ':' + mn)) {
|
||||
String txt;
|
||||
txt << nest << ' ' << name << ' ' << bm << ' ' << mn;
|
||||
String c;
|
||||
c << umk << nest << ' ' << name << ' ' << bm << " -" << flags;
|
||||
if(first)
|
||||
c << 'a';
|
||||
#ifdef PLATFORM_POSIX
|
||||
c << 's';
|
||||
#endif
|
||||
c << ' ' << outdir;
|
||||
Cout() << c;
|
||||
String out;
|
||||
if(Sys(c, out)) {
|
||||
Cout() << " *** FAILED *** !\n";
|
||||
failed = true;
|
||||
LOG("FAILED: " << txt);
|
||||
LOG(c);
|
||||
LOG(out);
|
||||
}
|
||||
else {
|
||||
Cout() << " ok\n";
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
DeleteFile(AppendFileName(outdir, ff.GetName() + ".ilk"));
|
||||
DeleteFile(AppendFileName(outdir, ff.GetName() + ".pdb"));
|
||||
ff.Next();
|
||||
}
|
||||
}
|
||||
|
||||
void Build(const char *nest, bool release)
|
||||
{
|
||||
for(int i = 0; i < bm.GetCount(); i++)
|
||||
Build(nest, bm[i], release);
|
||||
}
|
||||
|
||||
void Build(const char *nest)
|
||||
{
|
||||
Build(nest, false);
|
||||
// Build(nest, true);
|
||||
}
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
#ifdef PLATFORM_POSIX
|
||||
input = GetHomeDirFile("upp.src");
|
||||
output = GetHomeDirFile("tstout");
|
||||
umk = GetHomeDirFile("bin/umk") + ' ';
|
||||
#endif
|
||||
|
||||
LOG("BuildAll started");
|
||||
const Vector<String>& arg = CommandLine();
|
||||
input = GetFileFolder(GetFileFolder(GetFileFolder(GetDataFile("BuildAll.cpp"))));
|
||||
for(int i = 0; i < arg.GetCount(); i++)
|
||||
bm.Add(arg[i]);
|
||||
if(bm.GetCount() == 0) {
|
||||
// bm.Add("MSC71cdb");
|
||||
#ifdef PLATFORM_POSIX
|
||||
bm.Add("GCC");
|
||||
#else
|
||||
bm.Add("MSC9");
|
||||
#endif
|
||||
// bm.Add("MINGWI2");
|
||||
}
|
||||
Build("examples");
|
||||
Build("reference");
|
||||
Build("tutorial");
|
||||
Build("upptst", false);
|
||||
if(failed) {
|
||||
Cout() << "THERE WERE ERRORS!\n";
|
||||
SetExitCode(1);
|
||||
}
|
||||
else {
|
||||
Cout() << "OK.\n";
|
||||
LOG("OK");
|
||||
}
|
||||
// RDUMPC(failed);
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
description "Utility that builds all U++ examples\377";
|
||||
|
||||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
BuildAll.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
description "Utility to generate (long and repetitive) callback C++ source files\377";
|
||||
|
||||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
CppGen.cpp,
|
||||
Info readonly separator,
|
||||
Copying;
|
||||
|
||||
mainconfig
|
||||
"Normal" = "";
|
||||
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
Copyright (c) 1998, 2020, The U++ Project
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
@ -1,401 +0,0 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
String If(String s, String txt)
|
||||
{
|
||||
return IsNull(s) ? String() : txt;
|
||||
}
|
||||
|
||||
void CallbackGen(String name, String rettype, int n, String extension, String atest = Null)
|
||||
{
|
||||
LOG("// -----------------------------------------------------------");
|
||||
String classdef, classlist, paramdef, paramlist;
|
||||
for(int i = 1; i <= n; i++) {
|
||||
if(i > 1) {
|
||||
classdef << ", ";
|
||||
classlist << ", ";
|
||||
paramdef << ", ";
|
||||
paramlist << ", ";
|
||||
}
|
||||
classdef << Format("class P%d", i);
|
||||
classlist << Format("P%d", i);
|
||||
paramdef << Format("P%d p%d", i, i);
|
||||
paramlist << Format("p%d", i);
|
||||
}
|
||||
String cl_list = If(classlist, "<" + classlist + ">");
|
||||
String cl_temp = String("template <class OBJECT, class METHOD").Cat() << If(classdef, ", " + classdef) << ">";
|
||||
String return_ = rettype == "void" ? "" : "return ";
|
||||
String name_cl = name + cl_list;
|
||||
LOG("");
|
||||
if(!IsNull(classdef))
|
||||
LOG("template <" << classdef << ">");
|
||||
LOG("struct " << name << "Action {");
|
||||
LOGBEGIN();
|
||||
LOG("Atomic count;");
|
||||
LOG("");
|
||||
LOG("virtual " << rettype << " Execute(" + paramdef + ") = 0;");
|
||||
LOG("virtual bool IsValid() const { return true; }");
|
||||
// LOG("virtual bool IsEqual(const " << name << "Action *other) const = 0;");
|
||||
// LOG("virtual unsigned GetHashValue() const = 0;");
|
||||
LOG("");
|
||||
LOG(name << "Action() { count = 1; }");
|
||||
LOG("virtual ~" << name << "Action() {}");
|
||||
LOGEND();
|
||||
LOG("};");
|
||||
LOG("");
|
||||
|
||||
LOG("#ifdef HAS_LAMBDA");
|
||||
if(!IsNull(classdef))
|
||||
LOG("template <" << classdef << ">");
|
||||
LOG("struct Lambda" << name << " : public " << name << "Action" << cl_list + " {");
|
||||
LOGBEGIN();
|
||||
LOG("std::function<" << rettype << " (" << classlist << ")> fn;");
|
||||
if(rettype == "void")
|
||||
LOG("virtual void Execute(" << paramdef << ") { fn(" << paramlist << "); }");
|
||||
else
|
||||
LOG("virtual " << rettype << " Execute(" << paramdef << ") { return fn(" << paramlist << "); }");
|
||||
LOG("");
|
||||
LOG("Lambda" << name << "(std::function<" << rettype << " (" << classlist << ")> fn) : fn(fn) {}");
|
||||
LOGEND();
|
||||
LOG("};");
|
||||
LOG("#endif");
|
||||
LOG("");
|
||||
|
||||
#if 0
|
||||
LOG(cl_temp);
|
||||
LOG("struct " << name << "MethodActionPte : public " << name << "Action" << cl_list + " {");
|
||||
LOGBEGIN();
|
||||
LOG("Ptr<OBJECT> object;");
|
||||
LOG("METHOD method;");
|
||||
LOG("");
|
||||
if(rettype == "void")
|
||||
LOG(rettype << " Execute(" << paramdef << ") { if(object) (object->*method)(" << paramlist << "); }");
|
||||
else
|
||||
LOG(rettype << " Execute(" << paramdef << ") { return object ? (object->*method)(" << paramlist << ") : false; }");
|
||||
LOG("bool IsValid() const { return object; }");
|
||||
// LOG("bool IsEqual(const " << name << "Action" << cl_list << " *other) const {");
|
||||
// LOGBEGIN();
|
||||
// LOG("const " << name << "MethodActionPte *q = dynamic_cast<const " << name <<
|
||||
// "MethodActionPte *>(other);");
|
||||
// LOG("return q ? q->object == object && q->method == method : false;");
|
||||
// LOGEND();
|
||||
// LOG("}");
|
||||
// LOG("unsigned GetHashValue() const {");
|
||||
// LOG("\treturn (unsigned)(uintptr_t)~object ^ (unsigned)brutal_cast<uintptr_t>(method);");
|
||||
// LOG("}");
|
||||
LOG("");
|
||||
LOG(name << "MethodActionPte(OBJECT *object, METHOD method) "
|
||||
": object(object), method(method) {}");
|
||||
LOGEND();
|
||||
LOG("};");
|
||||
LOG("");
|
||||
|
||||
LOG(cl_temp);
|
||||
LOG("struct " << name << "MethodAction : public " << name << "Action" << cl_list + " {");
|
||||
LOGBEGIN();
|
||||
LOG("OBJECT *object;");
|
||||
LOG("METHOD method;");
|
||||
LOG("");
|
||||
LOG(rettype << " Execute(" << paramdef << ") { " <<
|
||||
return_ << "(object->*method)(" << paramlist << "); }");
|
||||
/* LOG("bool IsEqual(const " << name << "Action" << cl_list << " *other) const {");
|
||||
LOGBEGIN();
|
||||
LOG("const " << name << "MethodAction *q = dynamic_cast<const " << name <<
|
||||
"MethodAction *>(other);");
|
||||
LOG("return q ? q->object == object && q->method == method : false;");
|
||||
LOGEND();
|
||||
LOG("}");
|
||||
LOG("unsigned GetHashValue() const {");
|
||||
LOG("\treturn (unsigned)(uintptr_t)object ^ (unsigned)brutal_cast<uintptr_t>(method);");
|
||||
LOG("}");
|
||||
*/ LOG("");
|
||||
LOG(name << "MethodAction(OBJECT *object, METHOD method) "
|
||||
": object(object), method(method) {}");
|
||||
LOGEND();
|
||||
LOG("};");
|
||||
LOG("");
|
||||
|
||||
if(!IsNull(classdef))
|
||||
LOG("template <" << classdef << ">");
|
||||
LOG("struct " << name << "FnAction : public " << name << "Action" << cl_list << " {");
|
||||
LOGBEGIN();
|
||||
LOG(rettype << " (*fn)(" << paramdef << ");");
|
||||
LOG("");
|
||||
LOG(rettype << " Execute(" << paramdef << ") { " << return_ << "(*fn)(" <<
|
||||
paramlist << "); }");
|
||||
/* LOG("bool IsEqual(const " << name << "Action" << cl_list << " *other) const {");
|
||||
LOGBEGIN();
|
||||
LOG("const " << name << "FnAction *q = dynamic_cast<const " << name <<
|
||||
"FnAction *>(other);");
|
||||
LOG("return q ? q->fn == fn : false;");
|
||||
LOGEND();
|
||||
LOG("}");
|
||||
LOG("unsigned GetHashValue() const {");
|
||||
LOG("\treturn (unsigned)(uintptr_t)fn;");
|
||||
LOG("}");
|
||||
*/ LOG("");
|
||||
LOG(name << "FnAction(" << rettype << " (*fn)(" << paramdef << ")) : fn(fn) {}");
|
||||
LOGEND();
|
||||
LOG("};");
|
||||
LOG("");
|
||||
#endif
|
||||
|
||||
if(!IsNull(classdef))
|
||||
LOG("template <" << classdef << ">");
|
||||
LOG("class " << name << " : Moveable< " << name_cl << " > {");
|
||||
LOGBEGIN();
|
||||
LOG(name << "Action" << cl_list << " *action;");
|
||||
LOG("");
|
||||
LOG("void Retain() const { if(action " << atest << ") AtomicInc(action->count); }");
|
||||
LOG("void Release() { if(action " << atest << " && AtomicDec(action->count) == 0) delete action; }");
|
||||
LOG("");
|
||||
LOG("bool operator==(const " << name << "&);");
|
||||
LOG("bool operator!=(const " << name << "&);");
|
||||
LOG("");
|
||||
LOGEND();
|
||||
LOG("public:");
|
||||
LOGBEGIN();
|
||||
LOG("typedef " << name << " CLASSNAME;");
|
||||
LOG("");
|
||||
LOG(name << "& operator=(const " << name << "& c);");
|
||||
LOG(name << "(const " << name << "& c);");
|
||||
LOG("void Clear() { Release(); action = NULL; }");
|
||||
LOG("");
|
||||
// LOG("unsigned GetHashValue() const { return action->GetHashValue(); }");
|
||||
LOG("");
|
||||
LOG(extension);
|
||||
LOG("");
|
||||
LOG("explicit " << name << "(" << name << "Action " << cl_list <<
|
||||
" *newaction) { action = newaction; }");
|
||||
// LOG(name << "& operator=(" << name << "Action" << cl_list <<
|
||||
// " *newaction) { action = newaction; return *this; }");
|
||||
LOG(name << "() { action = NULL; }");
|
||||
LOG(name << "(_CNULL) { action = NULL; }");
|
||||
LOG("~" << name << "();");
|
||||
LOGEND();
|
||||
LOG("#ifdef HAS_LAMBDA");
|
||||
LOGBEGIN();
|
||||
LOG(name << "& operator=(std::function<" << rettype << " (" << classlist << ")> l) { Clear(); action = new Lambda" << name << "<" << classlist << ">(l); return *this; }");
|
||||
LOGEND();
|
||||
LOG("#endif");
|
||||
LOGBEGIN();
|
||||
LOG("");
|
||||
LOG("static " << name << " Empty() { return CNULL; }");
|
||||
LOG("");
|
||||
// LOG("friend bool operator==(const " << name << "& a, const " << name << "& b)");
|
||||
// LOG("\t{ return a.action ? a.action->IsEqual(b.action) : !b.action; }");
|
||||
// LOG("friend bool operator!=(const " << name << "& a, const " << name << " & b)");
|
||||
// LOG("\t{ return !(a == b); }");
|
||||
LOGEND();
|
||||
LOG("};");
|
||||
LOG("");
|
||||
|
||||
#if 0
|
||||
LOG(cl_temp);
|
||||
LOG(name_cl << " pteback(OBJECT *object, " << rettype <<
|
||||
" (METHOD::*method)(" << paramdef << ")) {");
|
||||
LOG("\treturn " << name_cl <<
|
||||
"(new " << name << "MethodActionPte<OBJECT, " << rettype << " (METHOD::*)(" <<
|
||||
paramdef << ")" << If(classlist, ", " + classlist) << ">(object, method));");
|
||||
LOG("}");
|
||||
LOG("");
|
||||
|
||||
LOG(cl_temp);
|
||||
LOG(name_cl << " callback(OBJECT *object, " << rettype <<
|
||||
" (METHOD::*method)(" << paramdef << ")) {");
|
||||
LOG("\treturn " << name_cl <<
|
||||
"(new " << name << "MethodAction<OBJECT, " << rettype << " (METHOD::*)(" <<
|
||||
paramdef << ")" << If(classlist, ", " + classlist) << ">(object, method));");
|
||||
LOG("}");
|
||||
LOG("");
|
||||
|
||||
LOG(cl_temp);
|
||||
LOG(name_cl << " callback(const OBJECT *object, " << rettype <<
|
||||
" (METHOD::*method)(" << paramdef << ") const) {");
|
||||
LOG("\treturn " << name_cl <<
|
||||
"(new " << name << "MethodAction<const OBJECT, " << rettype << " (METHOD::*)("
|
||||
<< paramdef << ") const" << If(classlist, ", " + classlist) << ">(object, method));");
|
||||
LOG("}");
|
||||
LOG("");
|
||||
|
||||
if(!IsNull(classdef))
|
||||
LOG("template <" << classdef << ">");
|
||||
LOG("inline " << name_cl << " callback(" << rettype << " (*fn)(" << paramdef << ")) {");
|
||||
LOG("\treturn " << name_cl << "(new " << name << "FnAction " << cl_list << "(fn));");
|
||||
LOG("}");
|
||||
LOG("");
|
||||
|
||||
|
||||
if(!IsNull(classdef))
|
||||
LOG("template <" << classdef << ">");
|
||||
LOG("struct " << name << "ForkAction : public " << name << "Action" << cl_list << " {");
|
||||
LOGBEGIN();
|
||||
LOG(name_cl << " cb1, cb2;");
|
||||
LOG("");
|
||||
LOG(rettype << " Execute(" << paramdef << ") { cb1(" << paramlist <<
|
||||
"); " << return_ << "cb2(" << paramlist << "); }");
|
||||
// LOG("bool IsEqual(const " << name << "Action " << cl_list << " *other) const {");
|
||||
// LOG("\tconst " << name << "ForkAction *q = dynamic_cast<const " << name
|
||||
// << "ForkAction *>(other);");
|
||||
// LOG("\treturn q ? q->cb1 == cb1 && q->cb2 == cb2 : false;");
|
||||
// LOG("}");
|
||||
// LOG("unsigned GetHashValue() const {");
|
||||
// LOG("\treturn ::GetHashValue(cb1) ^ ::GetHashValue(cb2);");
|
||||
// LOG("}");
|
||||
LOG("");
|
||||
LOG(name << "ForkAction(" << name_cl << " cb1, " << name_cl << " cb2)"
|
||||
"\n\t : cb1(cb1), cb2(cb2) {}");
|
||||
LOGEND();
|
||||
LOG("};");
|
||||
LOG("");
|
||||
|
||||
if(!IsNull(classdef))
|
||||
LOG("template <" << classdef << ">");
|
||||
LOG("inline " << name_cl << " Proxy(" << name_cl << "& cb)");
|
||||
LOG("{");
|
||||
LOG("\treturn callback(&cb, &" << name_cl << "::Execute);");
|
||||
LOG("}");
|
||||
LOG("");
|
||||
|
||||
if(IsNull(classdef)) {
|
||||
LOG(name_cl << " callback(" << name_cl << " cb1, " << name_cl << " cb2);");
|
||||
LOG(name_cl << "& operator<<(" << name_cl << "& a, " << name_cl << " b);");
|
||||
LOG("");
|
||||
LOG("#endif");
|
||||
LOG("#ifdef CPP_PART__");
|
||||
LOG("");
|
||||
}
|
||||
|
||||
if(!IsNull(classdef))
|
||||
LOG("template <" << classdef << ">");
|
||||
LOG(name_cl << " callback(" << name_cl << " cb1, " << name_cl << " cb2)");
|
||||
LOG("{");
|
||||
LOG("\treturn " << name_cl << "(new " << name << "ForkAction " << cl_list << "(cb1, cb2));");
|
||||
LOG("}");
|
||||
LOG("");
|
||||
|
||||
if(!IsNull(classdef))
|
||||
LOG("template <" << classdef << ">");
|
||||
LOG(name_cl << "& operator<<(" << name_cl << "& a, " << name_cl << " b)");
|
||||
LOG("{");
|
||||
LOG("\tif(a)");
|
||||
LOG("\t\ta = callback(a, b);");
|
||||
LOG("\telse");
|
||||
LOG("\t\ta = b;");
|
||||
LOG("\treturn a;");
|
||||
LOG("}");
|
||||
LOG("");
|
||||
|
||||
if(!IsNull(classdef))
|
||||
LOG("template <" << classdef << ">");
|
||||
LOG(name_cl << "& " << name_cl << "::operator=(const " << name << "& c)");
|
||||
LOG("{");
|
||||
LOG("\tc.Retain();");
|
||||
LOG("\tRelease();");
|
||||
LOG("\taction = c.action;");
|
||||
LOG("\treturn *this;");
|
||||
LOG("}");
|
||||
LOG("");
|
||||
if(!IsNull(classdef))
|
||||
LOG("template <" << classdef << ">");
|
||||
LOG(name_cl << "::" << name << "(const " << name << "& c)");
|
||||
LOG("{");
|
||||
LOG("\taction = c.action;");
|
||||
LOG("\tRetain();");
|
||||
LOG("}");
|
||||
LOG("");
|
||||
if(!IsNull(classdef))
|
||||
LOG("template <" << classdef << ">");
|
||||
LOG(name_cl << "::~" << name << "()");
|
||||
LOG("{");
|
||||
LOG("\tRelease();");
|
||||
LOG("}");
|
||||
LOG("");
|
||||
if(IsNull(classdef)) {
|
||||
LOG("#endif");
|
||||
LOG("#ifndef CPP_PART__");
|
||||
LOG("");
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
LOG("#ifndef CPP_PART__");
|
||||
LOG("");
|
||||
|
||||
CallbackGen("Callback", "void", 0,
|
||||
"operator bool() const { return action && action->IsValid(); }\n"
|
||||
"void Execute() const;\n"
|
||||
"void operator()() const { Execute(); }"
|
||||
);
|
||||
CallbackGen("Callback1", "void", 1,
|
||||
"operator bool() const { return action && action->IsValid(); }\n"
|
||||
"void Execute(P1 p1) const { if(action) action->Execute(p1); }\n"
|
||||
"void operator()(P1 p1) const { Execute(p1); }"
|
||||
);
|
||||
CallbackGen("Callback2", "void", 2,
|
||||
"operator bool() const { return action && action->IsValid(); }\n"
|
||||
"void Execute(P1 p1, P2 p2) const { if(action) action->Execute(p1, p2); }\n"
|
||||
"void operator()(P1 p1, P2 p2) const { Execute(p1, p2); }"
|
||||
);
|
||||
CallbackGen("Callback3", "void", 3,
|
||||
"operator bool() const { return action && action->IsValid(); }\n"
|
||||
"void Execute(P1 p1, P2 p2, P3 p3) const { if(action) action->Execute(p1, p2, p3); }\n"
|
||||
"void operator()(P1 p1, P2 p2, P3 p3) const { Execute(p1, p2, p3); }"
|
||||
);
|
||||
CallbackGen("Callback4", "void", 4,
|
||||
"operator bool() const { return action && action->IsValid(); }\n"
|
||||
"void Execute(P1 p1, P2 p2, P3 p3, P4 p4) const { if(action) action->Execute(p1, p2, p3, p4); }\n"
|
||||
"void operator()(P1 p1, P2 p2, P3 p3, P4 p4) const { Execute(p1, p2, p3, p4); }"
|
||||
);
|
||||
|
||||
CallbackGen("Gate", "bool", 0,
|
||||
"operator bool() const { return (void *)action != (void *)1 && action && action->IsValid(); }\n"
|
||||
"bool Execute() const;\n"
|
||||
"bool operator()() const { return Execute(); }\n"
|
||||
"void ClearTrue() { Clear(); action = (GateAction *)1; }\n"
|
||||
"void ClearFalse() { Clear(); }\n\n"
|
||||
"Gate(bool b) { action = (GateAction *)(int)b; }",
|
||||
"&& (void *)action != (void *)1"
|
||||
);
|
||||
CallbackGen("Gate1", "bool", 1,
|
||||
"operator bool() const { return (void *)action != (void *)1 && action && action->IsValid(); }\n"
|
||||
"bool Execute(P1 p1) const;\n"
|
||||
"bool operator()(P1 p1) const { return Execute(p1); }\n"
|
||||
"void ClearTrue() { Clear(); action = (Gate1Action<P1> *)1; }\n"
|
||||
"void ClearFalse() { Clear(); }\n\n"
|
||||
"Gate1(bool b) { action = (Gate1Action<P1> *)(uintptr_t)b; }",
|
||||
"&& (void *)action != (void *)1"
|
||||
);
|
||||
CallbackGen("Gate2", "bool", 2,
|
||||
"operator bool() const { return (void *)action != (void *)1 && action && action->IsValid(); }\n"
|
||||
"bool Execute(P1 p1, P2 p2) const;\n"
|
||||
"bool operator()(P1 p1, P2 p2) const { return Execute(p1, p2); }\n"
|
||||
"void ClearTrue() { Clear(); action = (Gate2Action<P1, P2> *)1; }\n"
|
||||
"void ClearFalse() { Clear(); }\n\n"
|
||||
"Gate2(bool b) { action = (Gate2Action<P1, P2> *)(uintptr_t)b; }",
|
||||
"&& (void *)action != (void *)1"
|
||||
);
|
||||
CallbackGen("Gate3", "bool", 3,
|
||||
"operator bool() const { return (void *)action != (void *)1 && action && action->IsValid(); }\n"
|
||||
"bool Execute(P1 p1, P2 p2, P3 p3) const;\n"
|
||||
"bool operator()(P1 p1, P2 p2, P3 p3) const { return Execute(p1, p2, p3); }\n"
|
||||
"void ClearTrue() { Clear(); action = (Gate3Action<P1, P2, P3> *)1; }\n"
|
||||
"void ClearFalse() { Clear(); }\n\n"
|
||||
"Gate3(bool b) { action = (Gate3Action<P1, P2, P3> *)(uintptr_t)b; }",
|
||||
"&& (void *)action != (void *)1"
|
||||
);
|
||||
CallbackGen("Gate4", "bool", 4,
|
||||
"operator bool() const { return (void *)action != (void *)1 && action && action->IsValid(); }\n"
|
||||
"bool Execute(P1 p1, P2 p2, P3 p3, P4 p4) const;\n"
|
||||
"bool operator()(P1 p1, P2 p2, P3 p3, P4 p4) const { return Execute(p1, p2, p3, p4); }\n"
|
||||
"void ClearTrue() { Clear(); action = (Gate4Action<P1, P2, P3, P4> *)1; }\n"
|
||||
"void ClearFalse() { Clear(); }\n\n"
|
||||
"Gate4(bool b) { action = (Gate4Action<P1, P2, P3, P4> *)(uintptr_t)b; }",
|
||||
"&& (void *)action != (void *)1"
|
||||
);
|
||||
LOG("");
|
||||
LOG("#endif");
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
Copyright (c) 1998, 2020, The U++ Project
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
@ -1,201 +0,0 @@
|
|||
#include <SqlCtrl/SqlCtrl.h>
|
||||
|
||||
#define HAVE_ORACLE
|
||||
|
||||
#ifndef flagNOSQLLITE
|
||||
#define HAVE_SQLLITE
|
||||
#include <plugin/sqlite3/Sqlite3.h>
|
||||
#endif
|
||||
|
||||
#ifndef flagNOMYSQL
|
||||
#define HAVE_MYSQL
|
||||
#endif
|
||||
|
||||
#ifndef flagNOPOSTGRESQL
|
||||
#define HAVE_POSTGRESQL
|
||||
#include <PostgreSQL/PostgreSQL.h>
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WIN32) && defined(COMPILER_MSC)
|
||||
#define HAVE_OLEDB
|
||||
#include <OleDB/OleDB.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ORACLE
|
||||
#include <Oracle/Oracle7.h>
|
||||
#include <Oracle/Oracle8.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MYSQL
|
||||
#ifndef flagMT
|
||||
#error Must compile MySQL in multithreaded mode!
|
||||
#endif
|
||||
#include <MySql/MySql.h>
|
||||
#endif
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#define LAYOUTFILE <SqlCommander/login.lay>
|
||||
#include <CtrlCore/lay.h>
|
||||
|
||||
class SqlCommanderApp {
|
||||
public:
|
||||
SqlCommanderApp();
|
||||
|
||||
void Run();
|
||||
void Serialize(Stream& s);
|
||||
|
||||
private:
|
||||
WithLoginLayout<TopWindow> login;
|
||||
enum SERVER_TYPE
|
||||
{
|
||||
SERVER_ORACLE,
|
||||
#ifdef HAVE_MYSQL
|
||||
SERVER_MYSQL
|
||||
#endif
|
||||
};
|
||||
One<SqlSession> session;
|
||||
};
|
||||
|
||||
SqlCommanderApp::SqlCommanderApp() {
|
||||
CtrlLayoutOKCancel(login, "Connect to server");
|
||||
login.password.Password();
|
||||
login.save_password = true;
|
||||
#ifdef HAVE_ORACLE
|
||||
login.connection.Add("OCI7");
|
||||
login.connection.Add("OCI8");
|
||||
#endif
|
||||
#ifdef HAVE_MYSQL
|
||||
login.connection.Add("MYSQL");
|
||||
#endif
|
||||
#ifdef HAVE_POSTGRESQL
|
||||
login.connection.Add("POSTGRESQL");
|
||||
#endif
|
||||
#ifdef HAVE_SQLLITE
|
||||
login.connection.Add("SQLLITE");
|
||||
#endif
|
||||
#ifdef HAVE_OLEDB
|
||||
Array<OleDBSession::Provider> providers = OleDBSession::EnumProviders();
|
||||
for(int i = 0; i < providers.GetCount(); i++)
|
||||
login.connection.Add("OLEDB:" + providers[i].name);
|
||||
#endif
|
||||
}
|
||||
|
||||
void SqlCommanderApp::Serialize(Stream& s) {
|
||||
int version = 3;
|
||||
s / version;
|
||||
if(version < 3)
|
||||
{
|
||||
s.SetError();
|
||||
return;
|
||||
}
|
||||
String pwd;
|
||||
if(s.IsStoring() && login.save_password)
|
||||
pwd = Garble(~login.password);
|
||||
s % login.username % login.database % login.server % login.connection % login.save_password % pwd;
|
||||
if(s.IsLoading() && login.save_password)
|
||||
login.password <<= Garble(pwd);
|
||||
}
|
||||
|
||||
void SqlCommanderApp::Run() {
|
||||
|
||||
LoadFromFile(*this);
|
||||
|
||||
do {
|
||||
if(login.Run() != IDOK) return;
|
||||
String un = ~login.username;
|
||||
String pw = ~login.password;
|
||||
String db = ~login.database;
|
||||
String sv = ~login.server;
|
||||
String co = ~login.connection;
|
||||
String connect = un;
|
||||
if(!pw.IsEmpty()) connect << '/' << pw;
|
||||
if(!sv.IsEmpty()) connect << '@' << sv;
|
||||
#ifdef HAVE_ORACLE
|
||||
if(co == "OCI7") {
|
||||
One<Oracle7> oci7 = new Oracle7;
|
||||
if(!oci7->Open(connect)) {
|
||||
Exclamation(NFormat("OCI7 login failed: [* \1%s\1].", oci7->GetLastError()));
|
||||
continue;
|
||||
}
|
||||
session = pick(oci7);
|
||||
}
|
||||
if(co == "OCI8") {
|
||||
One<Oracle8> oci8 = new Oracle8;
|
||||
if(!oci8->Open(connect, false)) {
|
||||
Exclamation(NFormat("OCI8 login failed: [* \1%s\1].", oci8->GetLastError()));
|
||||
continue;
|
||||
}
|
||||
session = pick(oci8);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_MYSQL
|
||||
if(co == "MYSQL") {
|
||||
One<MySqlSession> mysql = new MySqlSession;
|
||||
if(!mysql->Connect(un, pw, db, sv)) {
|
||||
Exclamation(NFormat("MySql login failed: [* \1%s\1].", mysql->GetLastError()));
|
||||
continue;
|
||||
}
|
||||
session = pick(mysql);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_POSTGRESQL
|
||||
if(co == "POSTGRESQL") {
|
||||
One<PostgreSQLSession> postgres = new PostgreSQLSession;
|
||||
String conninfo;
|
||||
conninfo << "user='" << un << "' password='" << pw << "' ";
|
||||
if(!IsNull(sv)) {
|
||||
String port;
|
||||
int f = sv.Find(':');
|
||||
if(f >= 0) {
|
||||
port = sv.Mid(f + 1);
|
||||
sv.Trim(f);
|
||||
}
|
||||
if(!IsNull(sv))
|
||||
conninfo << "host='" << sv << "' ";
|
||||
if(!IsNull(port))
|
||||
conninfo << "port=" << port << ' ';
|
||||
}
|
||||
if(!IsNull(db))
|
||||
conninfo << "dbname='" << db << "' ";
|
||||
postgres->Open(conninfo);
|
||||
session = pick(postgres);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_SQLLITE
|
||||
if(co == "SQLLITE") {
|
||||
One<Sqlite3Session> sqlite = new Sqlite3Session;
|
||||
if(!sqlite->Open(db)) {
|
||||
Exclamation(NFormat("SQLite3 open failed, (db file = [* \1%s\1]): [* \1%s\1].", db, sqlite->GetLastError()));
|
||||
continue;
|
||||
}
|
||||
session = pick(sqlite);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_OLEDB
|
||||
if(!memcmp(co, "OLEDB:", 6)) {
|
||||
String conn = co.Mid(6);
|
||||
One<OleDBSession> oledb = new OleDBSession;
|
||||
if(!oledb->Open(un, pw, sv, conn)) {
|
||||
Exclamation(NFormat("OleDB login failed: [* \1%s\1].", oledb->GetLastError()));
|
||||
continue;
|
||||
}
|
||||
session = pick(oledb);
|
||||
}
|
||||
#endif
|
||||
if(!session)
|
||||
Exclamation(NFormat("Unsupported connection type: [* \1%s\1].", co));
|
||||
}
|
||||
while(!session);
|
||||
login.Close();
|
||||
SQLCommander(*session);
|
||||
StoreToFile(*this);
|
||||
}
|
||||
|
||||
#ifdef flagMAIN
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
SetLanguage(LNGC_('C', 'S', 'C', 'Z', CHARSET_WIN1250));
|
||||
SqlCommanderApp().Run();
|
||||
}
|
||||
#endif//flagMAIN
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
// SqlCommander.h : main header file for the SQLCOMMANDER application
|
||||
//
|
||||
|
||||
#if !defined(AFX_SQLCOMMANDER_H__CA1A67E7_56E3_11D3_A9AA_00C0DF48A075__INCLUDED_)
|
||||
#define AFX_SQLCOMMANDER_H__CA1A67E7_56E3_11D3_A9AA_00C0DF48A075__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CSqlCommanderApp:
|
||||
// See SqlCommander.cpp for the implementation of this class
|
||||
//
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_SQLCOMMANDER_H__CA1A67E7_56E3_11D3_A9AA_00C0DF48A075__INCLUDED_)
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
description "Simple SQL console utility\377";
|
||||
|
||||
uses
|
||||
SqlCtrl,
|
||||
Oracle,
|
||||
OleDB,
|
||||
plugin\sqlite3,
|
||||
PostgreSQL;
|
||||
|
||||
uses(!NOMYSQL) MySql;
|
||||
|
||||
link(WIN32 DEBUG MSC) /NODEFAULTLIB:libcmt;
|
||||
|
||||
link(WIN32 !DEBUG MSC) /NODEFAULTLIB:libcmtd;
|
||||
|
||||
file
|
||||
SqlCommander.cpp,
|
||||
login.lay,
|
||||
Info readonly separator,
|
||||
Copying;
|
||||
|
||||
mainconfig
|
||||
"" = ".NOMYSQL GUI .NOAPPSQL",
|
||||
"" = "GUI MT .NOAPPSQL",
|
||||
"" = ".NOMYSQL GUI .NOAPPSQL .NOPOSTGRESQL";
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// SqlCommander.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
LAYOUT(LoginLayout, 398, 106)
|
||||
ITEM(Label, dv___0, SetLabel(t_("&User name:")).LeftPosZ(4, 62).TopPosZ(4, 19))
|
||||
ITEM(EditField, username, LeftPosZ(68, 120).TopPosZ(4, 19))
|
||||
ITEM(Label, dv___2, SetLabel(t_("&Password:")).LeftPosZ(4, 62).TopPosZ(26, 19))
|
||||
ITEM(EditField, password, LeftPosZ(68, 120).TopPosZ(26, 19))
|
||||
ITEM(Label, dv___4, SetLabel(t_("&Database:")).LeftPosZ(208, 62).TopPosZ(4, 19))
|
||||
ITEM(EditField, database, LeftPosZ(274, 120).TopPosZ(4, 19))
|
||||
ITEM(Label, dv___6, SetLabel(t_("&Server:")).LeftPosZ(208, 62).TopPosZ(26, 19))
|
||||
ITEM(EditField, server, LeftPosZ(274, 120).TopPosZ(26, 19))
|
||||
ITEM(Label, dv___8, SetLabel(t_("&Connection:")).LeftPosZ(4, 62).TopPosZ(48, 19))
|
||||
ITEM(DropList, connection, HSizePosZ(68, 4).TopPosZ(48, 19))
|
||||
ITEM(Option, save_password, SetLabel(t_("S&ave password (unsafe!)")).LeftPosZ(8, 140).TopPosZ(82, 19))
|
||||
ITEM(Button, ok, SetLabel(t_("OK")).RightPosZ(88, 80).BottomPosZ(5, 21))
|
||||
ITEM(Button, cancel, SetLabel(t_("Cancel")).RightPosZ(4, 80).BottomPosZ(4, 22))
|
||||
END_LAYOUT
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
Copyright (c) 1998, 2020, The U++ Project
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by UPDATER.RC
|
||||
//
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_UPDATER_DIALOG 102
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
#define _APS_NEXT_RESOURCE_VALUE 129
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
const Vector<String>& cmdline = CommandLine();
|
||||
SetDefaultCharset(CHARSET_WIN1250);
|
||||
if(cmdline.IsEmpty())
|
||||
{
|
||||
Exclamation("[* UPDATER] should be run from another applications");
|
||||
return;
|
||||
}
|
||||
String name = cmdline[0];
|
||||
UpdateFile(name);
|
||||
String exec = GetExeDirFile(name);
|
||||
for(int i = 1; i < cmdline.GetCount(); i++)
|
||||
if(cmdline[i].Find(' ') >= 0)
|
||||
exec << " \"" << cmdline[i] << "\"";
|
||||
else
|
||||
exec << " " << cmdline[i];
|
||||
WinExec(exec, SW_SHOWNORMAL);
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
#if !defined(AFX_UPDATER_H__DA682885_AD16_11D1_AE92_444553540000__INCLUDED_)
|
||||
#define AFX_UPDATER_H__DA682885_AD16_11D1_AE92_444553540000__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
class CUpdaterApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CUpdaterApp();
|
||||
virtual BOOL InitInstance();
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_UPDATER_H__DA682885_AD16_11D1_AE92_444553540000__INCLUDED_)
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
|
|
@ -1 +0,0 @@
|
|||
100 ICON DISCARDABLE "Updater.ico"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
description "Utility for U++ enterprise application update system\377";
|
||||
|
||||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
Updater.rc,
|
||||
Updater.cpp,
|
||||
Info readonly separator,
|
||||
Copying;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue