-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Изменено название файла раннера на coreas_runner_c.
Добавлен неконсольный раннер coreas_runner_w.
- Loading branch information
Showing
18 changed files
with
482 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#define F_VERSION 1,0,0,8 | ||
#define P_VERSION "1.0.0.8" | ||
#define F_VERSION 1,0,0,9 | ||
#define P_VERSION "1.0.0.9" | ||
#define COPY_RIGHT "© Àëåêñàíäð Îðåôêîâ, 2021" |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//{{NO_DEPENDENCIES}} | ||
// Microsoft Visual C++ generated include file. | ||
// Used by runner.rc | ||
// | ||
#define VS_VERSION_INFO1 2 | ||
|
||
// Next default values for new objects | ||
// | ||
#ifdef APSTUDIO_INVOKED | ||
#ifndef APSTUDIO_READONLY_SYMBOLS | ||
#define _APS_NEXT_RESOURCE_VALUE 101 | ||
#define _APS_NEXT_COMMAND_VALUE 40001 | ||
#define _APS_NEXT_CONTROL_VALUE 1001 | ||
#define _APS_NEXT_SYMED_VALUE 101 | ||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/* | ||
* (c) Проект "Core.As", Александр Орефков [email protected] | ||
* Отдельно выполняемый gui запускальщик модулей Core.As | ||
* | ||
*/ | ||
//#define WIN32_LEAN_AND_MEAN | ||
#include <Windows.h> | ||
// std | ||
#include <unordered_map> | ||
#include <unordered_set> | ||
#include <vector> | ||
#include <atomic> | ||
#include <locale> | ||
#include <clocale> | ||
#include <cwchar> | ||
using namespace std; | ||
|
||
#include "core_as/core_as.h" | ||
void* operator new(size_t size) { | ||
return core_as_malloc(size); | ||
} | ||
|
||
void operator delete(void* ptr) { | ||
core_as_free(ptr); | ||
} | ||
|
||
int showUsage() { | ||
MessageBox(0, LR"aaa(Core.As Runner. Программа для запуска модулей Core.As. | ||
Используйте одну из команд: | ||
run <ИмяМодуля> [параметры] - Запуск модуля | ||
check <ИмяМодуля> [параметры] - Проверка модуля | ||
Параметры передаются запускаемому модулю в виде: | ||
Параметр /f - задаёт папку с модулем | ||
Каждый аргумент '/d строка' или '-d строка' передается как определение | ||
для препроцессора модуля, например: | ||
/d IDE=1 /d USECOOLFEATURE -D "POWER = 100" | ||
Все параметры после /c или -c - передаются модулю как аргументы его запуска. | ||
Параметры с пробелами заключайте в кавычки. Кавычки внутри параметров удваивайте. | ||
Например: | ||
coreas_runner_w run sendfile /c -subj "Мой корабль плывёт как ""Титаник""" | ||
Также модуль может сам получать дополнительные настройки из переменных окружения | ||
вида COREAS_ИмяНастройки=значение настройки | ||
и аргументов командной строки вида -coreas-ИмяНастройки "значение настройки" | ||
Имена настроек регистронезависимые. | ||
)aaa", L"Core.As", MB_OK); | ||
|
||
return 1; | ||
} | ||
|
||
// Выяснилось, что процедура разбора командных аргументов штатного консольного cruntime при наличии слэша перед | ||
// закрывающей кавычкой "проглатывает" её и прихватывает соседние аргументы. Это, во-первых, отличается | ||
// от поведения моих разборщиков командной строки в других частях программы, во-вторых, делает неудобным | ||
// передачу директорий в командной строке. Поэтому будем разбирать командную строку сами. | ||
void processArgs(lstringw<300>& defines, lstringw<300>& commands, lstringw<MAX_PATH>& folder, const vector<ssw>& argv) { | ||
uint argc = uint(argv.size()); | ||
vector<ssw> vdef, vcmd; | ||
if (argc > 4) { | ||
vdef.reserve((argc - 3) / 2); | ||
vcmd.reserve(argc - 4); | ||
} | ||
for (uint i = 3; i < argc - 1; i++) { | ||
if (argv[i].isEqualia(L"/d") || argv[i].isEqualia(L"-d")) | ||
vdef.emplace_back(argv[++i]); | ||
else if (argv[i].isEqualia(L"/f") || argv[i].isEqualia(L"-f")) | ||
folder = argv[++i]; | ||
else if (argv[i].isEqualia(L"/c") || argv[i].isEqualia(L"-c")) { | ||
while (++i < argc) | ||
vcmd.emplace_back(argv[i]); | ||
} | ||
} | ||
defines.s_join(vdef, L"\v").s_replace(L"\"\"", L"\""); | ||
commands.s_join(vcmd, L"\v").s_replace(L"\"\"", L"\""); | ||
} | ||
|
||
int run(const vector<ssw>& argv, HINSTANCE hInst, int nCmdShow) { | ||
lstringw<300> defines, commands; | ||
lstringw<MAX_PATH> folder; | ||
processArgs(defines, commands, folder, argv); | ||
lstringw<MAX_PATH> modName(argv[2]); | ||
CoreAsModule* pModule = core_as_getModule(modName, folder); | ||
if (!pModule) | ||
return 2; | ||
commands.s_append(+L" hInst "_ss & size_t(hInst) & L" nCmdShow " & nCmdShow); | ||
return pModule->run(commands, defines, GetStdHandle(STD_OUTPUT_HANDLE)) ? 0 : 1; | ||
} | ||
|
||
int check(const vector<ssw>& argv) { | ||
lstringw<300> defines, commands; | ||
lstringw<MAX_PATH> folder; | ||
processArgs(defines, commands, folder, argv); | ||
lstringw<MAX_PATH> modName(argv[2]); | ||
CoreAsModule* pModule = core_as_getModule(modName, folder); | ||
if (!pModule) | ||
return 2; | ||
return pModule->check(defines, GetStdHandle(STD_OUTPUT_HANDLE)) ? 0 : 1; | ||
} | ||
|
||
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR lpCmdLine, int nShowCmd) { | ||
setlocale(LC_ALL, "ru_RU.utf8"); | ||
vector<ssw> argv = core_as_parseArguments(e_s(lpCmdLine)); | ||
if (argv.size() > 2) { | ||
if (argv[1] == L"run") { | ||
return run(argv, hInstance, nShowCmd); | ||
} else if (argv[1]== L"check") { | ||
return check(argv); | ||
} | ||
} | ||
return showUsage(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
// Microsoft Visual C++ generated resource script. | ||
// | ||
#include "resource.h" | ||
|
||
#define APSTUDIO_READONLY_SYMBOLS | ||
///////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Generated from the TEXTINCLUDE 2 resource. | ||
// | ||
#include "winres.h" | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
#undef APSTUDIO_READONLY_SYMBOLS | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
// Russian (Russia) resources | ||
|
||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) | ||
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT | ||
#pragma code_page(1251) | ||
|
||
#ifdef APSTUDIO_INVOKED | ||
///////////////////////////////////////////////////////////////////////////// | ||
// | ||
// TEXTINCLUDE | ||
// | ||
|
||
1 TEXTINCLUDE | ||
BEGIN | ||
"resource.h\0" | ||
END | ||
|
||
2 TEXTINCLUDE | ||
BEGIN | ||
"#include ""winres.h""\r\n" | ||
"\0" | ||
END | ||
|
||
3 TEXTINCLUDE | ||
BEGIN | ||
"\r\n" | ||
"\0" | ||
END | ||
|
||
#endif // APSTUDIO_INVOKED | ||
|
||
#include "../include/core_as/version.h" | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Version | ||
// | ||
|
||
VS_VERSION_INFO VERSIONINFO | ||
FILEVERSION F_VERSION | ||
PRODUCTVERSION F_VERSION | ||
FILEFLAGSMASK 0x3fL | ||
#ifdef _DEBUG | ||
FILEFLAGS 0x1L | ||
#else | ||
FILEFLAGS 0x0L | ||
#endif | ||
FILEOS 0x40004L | ||
FILETYPE 0x1L | ||
FILESUBTYPE 0x0L | ||
BEGIN | ||
BLOCK "StringFileInfo" | ||
BEGIN | ||
BLOCK "041904b0" | ||
BEGIN | ||
VALUE "CompanyName", "��������� �������" | ||
VALUE "FileDescription", "���������� ������� Core.As" | ||
VALUE "FileVersion", P_VERSION | ||
VALUE "InternalName", "runner.exe" | ||
VALUE "LegalCopyright", COPY_RIGHT | ||
VALUE "OriginalFilename", "runner.exe" | ||
VALUE "ProductName", "������ ""Core.As""" | ||
VALUE "ProductVersion", P_VERSION | ||
END | ||
END | ||
BLOCK "VarFileInfo" | ||
BEGIN | ||
VALUE "Translation", 0x419, 1200 | ||
END | ||
END | ||
|
||
#endif // Russian (Russia) resources | ||
///////////////////////////////////////////////////////////////////////////// | ||
|
||
|
||
|
||
#ifndef APSTUDIO_INVOKED | ||
///////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Generated from the TEXTINCLUDE 3 resource. | ||
// | ||
|
||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
#endif // not APSTUDIO_INVOKED | ||
|
Oops, something went wrong.