From: Alexander Shiryaev Date: Tue, 15 Nov 2016 21:18:09 +0000 (+0300) Subject: BlackBox @ OpenBSD: 1.6 -> 1.7 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=70a3562c0ad2b415f21357415ca6087e0bd12f92;p=bbcp.git BlackBox @ OpenBSD: 1.6 -> 1.7 --- diff --git a/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-LibW/LibW.txt.templ b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-LibW/LibW.txt.templ new file mode 100644 index 0000000..df05285 --- /dev/null +++ b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-LibW/LibW.txt.templ @@ -0,0 +1,47 @@ +MODULE LinLibW ["libc.so%%libver%%"]; + + (* + %%osname%% + %%machine%% + *) + + IMPORT Libc := LinLibc; + + CONST +%%defs-lc%% + TYPE + (* int, wchar_t, wint_t, size_t, mbstate_t *) +%%defs-basictypes%% + PtrWSTR* = POINTER [untagged] TO ARRAY [untagged] OF wchar_t; + + PROCEDURE [ccall] setlocale* (category: int; locale: Libc.PtrSTR): Libc.PtrSTR; + + PROCEDURE [ccall] mbsinit* (VAR [nil] ps: mbstate_t): int; + + PROCEDURE [ccall] wctomb* (s: Libc.PtrSTR; wchar: wchar_t): int; + PROCEDURE [ccall] wcstombs* (s: Libc.PtrSTR; pwcs: PtrWSTR; n: size_t): size_t; + + PROCEDURE [ccall] wcrtomb* (s: Libc.PtrSTR; wc: wchar_t; VAR [nil] ps: mbstate_t): size_t; + PROCEDURE [ccall] wcsrtombs* (dst: Libc.PtrSTR; VAR src: PtrWSTR; len: size_t; VAR [nil] ps: mbstate_t): size_t; + PROCEDURE [ccall] wcsnrtombs* (dst: Libc.PtrSTR; VAR src: PtrWSTR; nwc: size_t; len: size_t; VAR [nil] ps: mbstate_t): size_t; + + PROCEDURE [ccall] mbtowc* (pwc: PtrWSTR; s: Libc.PtrSTR; n: size_t): int; + PROCEDURE [ccall] mbstowcs* (pwcs: PtrWSTR; s: Libc.PtrSTR; n: size_t): size_t; + PROCEDURE [ccall] mblen* (s: Libc.PtrSTR; n: size_t): int; + + PROCEDURE [ccall] mbrtowc* (wc: PtrWSTR; s: Libc.PtrSTR; n: size_t; VAR [nil] mbs: mbstate_t): size_t; + PROCEDURE [ccall] mbsrtowcs* (dst: PtrWSTR; VAR src: Libc.PtrSTR; len: size_t; VAR [nil] ps: mbstate_t): size_t; + PROCEDURE [ccall] mbsnrtowcs* (dst: PtrWSTR; VAR src: Libc.PtrSTR; nmc: size_t; len: size_t; VAR [nil] ps: mbstate_t): size_t; + PROCEDURE [ccall] mbrlen* (s: Libc.PtrSTR; n: size_t; VAR [nil] ps: mbstate_t): size_t; + + PROCEDURE [ccall] iswalpha* (wc: wint_t): int; + PROCEDURE [ccall] iswlower* (wc: wint_t): int; + PROCEDURE [ccall] iswupper* (wc: wint_t): int; + PROCEDURE [ccall] towlower* (wc: wint_t): wint_t; + PROCEDURE [ccall] towupper* (wc: wint_t): wint_t; + + PROCEDURE [ccall] wprintf* (fmt: PtrWSTR): int; + PROCEDURE [ccall] fputws* (ws: PtrWSTR; fp: Libc.PtrFILE): int; + PROCEDURE [ccall] fgetws* (ws: PtrWSTR; n: int; fp: Libc.PtrFILE): PtrWSTR; + +END LinLibW. \ No newline at end of file diff --git a/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-LibW/sizeofs.c b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-LibW/sizeofs.c new file mode 100644 index 0000000..0a510c3 --- /dev/null +++ b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-LibW/sizeofs.c @@ -0,0 +1,61 @@ +#include +#include +#include +#include +#include + +#define TABS "\t\t" + +#define FALSE (0) +#define TRUE (1) + +static void D (const char *s, int sz, int set, int export) +{ + int res; + + res = printf("%s%s", TABS, s); + if (export) { + res = printf("*"); + } + res = printf(" = "); + if (sz == 1) { + res = printf("SHORTCHAR"); + } else if (sz == 2) { + res = printf("SHORTINT"); + } else if (sz == 4) { + if (set) { + res = printf("SET"); + } else { + res = printf("INTEGER"); + } + } else if (sz == 8) { + if (set) { + res = printf("ARRAY [untagged] 2 OF SET"); + } else { + res = printf("LONGINT"); + } + } else { + res = printf("ARRAY [untagged] "); + if (sz % 4 == 0) { + if (set) { + res = printf("%d OF SET", sz / 4); + } else { + res = printf("%d OF INTEGER", sz / 4); + } + } else { + res = printf("%d OF SHORTCHAR", sz); + } + } + res = printf(";\n"); +} + +int main () +{\ + D("int", sizeof(int), FALSE, TRUE); + D("wchar_t", sizeof(wchar_t), FALSE, TRUE); + D("wint_t", sizeof(wint_t), FALSE, TRUE); + D("size_t", sizeof(size_t), FALSE, TRUE); + D("mbstate_t", sizeof(mbstate_t), FALSE, TRUE); + + return 0; +} diff --git a/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Build-Tool.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Build-Tool.odc index 08a0d8f..165169f 100644 Binary files a/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Build-Tool.odc and b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Build-Tool.odc differ diff --git a/BlackBox/_FreeBSDLinuxOpenBSD_GUI/build b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/build index 8643434..cbd67bd 100755 --- a/BlackBox/_FreeBSDLinuxOpenBSD_GUI/build +++ b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/build @@ -3,6 +3,7 @@ ./run-dev0 < ${.TARGET} + +defs-lc: + ./dumpdefs.py 2 1 i ${INCDIR}/locale.h | grep " LC_" > ${.TARGET} + +clean: + rm -f ${DEFS} Net.txt sizeofs diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/dumpdefs.py b/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/dumpdefs.py new file mode 120000 index 0000000..1730591 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/dumpdefs.py @@ -0,0 +1 @@ +../gen-Libc/dumpdefs.py \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/libver b/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/libver new file mode 100644 index 0000000..01f9f66 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/libver @@ -0,0 +1 @@ +.89.2 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/machine b/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/machine new file mode 100644 index 0000000..fd32fa4 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/machine @@ -0,0 +1 @@ +i386 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/osname b/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/osname new file mode 100644 index 0000000..6fcf4b6 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/osname @@ -0,0 +1 @@ +OpenBSD 6.0 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/untempl.py b/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/untempl.py new file mode 120000 index 0000000..5800713 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/untempl.py @@ -0,0 +1 @@ +../gen-Libc/untempl.py \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/System/Mod/Kernel.odc b/BlackBox/_OpenBSD_/System/Mod/Kernel.odc index d754e3d..e24dba9 100644 Binary files a/BlackBox/_OpenBSD_/System/Mod/Kernel.odc and b/BlackBox/_OpenBSD_/System/Mod/Kernel.odc differ diff --git a/BlackBox/_OpenBSD_/System/Mod/Kernel16.odc b/BlackBox/_OpenBSD_/System/Mod/Kernel16.odc new file mode 100644 index 0000000..d754e3d Binary files /dev/null and b/BlackBox/_OpenBSD_/System/Mod/Kernel16.odc differ diff --git a/BlackBox/_OpenBSD_/libBB.so b/BlackBox/_OpenBSD_/libBB.so index 2f57f6b..da82cdd 100644 Binary files a/BlackBox/_OpenBSD_/libBB.so and b/BlackBox/_OpenBSD_/libBB.so differ diff --git a/BlackBox/_OpenBSD_/libBB0.so b/BlackBox/_OpenBSD_/libBB0.so index 8c5cfb0..ed0f377 100644 Binary files a/BlackBox/_OpenBSD_/libBB0.so and b/BlackBox/_OpenBSD_/libBB0.so differ