DEADSOFTWARE

FreeBSD LibW
authorAlexander Shiryaev <aixp@mail.ru>
Tue, 15 Nov 2016 21:59:29 +0000 (00:59 +0300)
committerAlexander Shiryaev <aixp@mail.ru>
Tue, 15 Nov 2016 21:59:29 +0000 (00:59 +0300)
BlackBox/_FreeBSD_/Lin/Mod/LibW.txt [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/Makefile [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/dumpdefs.py [new symlink]
BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/libver [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/machine [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/osname [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/untempl.py [new symlink]

diff --git a/BlackBox/_FreeBSD_/Lin/Mod/LibW.txt b/BlackBox/_FreeBSD_/Lin/Mod/LibW.txt
new file mode 100644 (file)
index 0000000..06af63f
--- /dev/null
@@ -0,0 +1,59 @@
+MODULE LinLibW ["libc.so.7"];
+
+       (*
+               FreeBSD 11.0
+               i386
+       *)
+
+       IMPORT Libc := LinLibc;
+
+       CONST
+               LC_ALL* = 0;
+               LC_COLLATE* = 1;
+               LC_CTYPE* = 2;
+               LC_MONETARY* = 3;
+               LC_NUMERIC* = 4;
+               LC_TIME* = 5;
+               LC_MESSAGES* = 6;
+
+       TYPE
+               (* int, wchar_t, wint_t, size_t, mbstate_t *)
+               int* = INTEGER;
+               wchar_t* = INTEGER;
+               wint_t* = INTEGER;
+               size_t* = INTEGER;
+               mbstate_t* = ARRAY [untagged] 32 OF INTEGER;
+
+               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/_FreeBSD_/Lin/Mod/gen-LibW/Makefile b/BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/Makefile
new file mode 100644 (file)
index 0000000..28bde3a
--- /dev/null
@@ -0,0 +1,25 @@
+# This is BSD Makefile
+#    BSD       GNU
+# ${.TARGET}    $@
+# ${.ALLSRC}    $^
+# ${.IMPSRC}    $<
+
+INCDIR ?= /usr/include
+
+PY = python2.7
+
+DEFS = defs-basictypes defs-lc
+
+all: LibW.txt ${DEFS}
+
+LibW.txt: LibW.txt.templ ${DEFS} libver osname machine
+       ${PY} ./untempl.py LibW.txt.templ ${.TARGET}
+
+defs-basictypes: sizeofs
+       ./sizeofs > ${.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/_FreeBSD_/Lin/Mod/gen-LibW/dumpdefs.py b/BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/dumpdefs.py
new file mode 120000 (symlink)
index 0000000..1730591
--- /dev/null
@@ -0,0 +1 @@
+../gen-Libc/dumpdefs.py
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/libver b/BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/libver
new file mode 100644 (file)
index 0000000..127fc98
--- /dev/null
@@ -0,0 +1 @@
+.7
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/machine b/BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/machine
new file mode 100644 (file)
index 0000000..fd32fa4
--- /dev/null
@@ -0,0 +1 @@
+i386
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/osname b/BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/osname
new file mode 100644 (file)
index 0000000..64f5283
--- /dev/null
@@ -0,0 +1 @@
+FreeBSD 11.0
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/untempl.py b/BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/untempl.py
new file mode 120000 (symlink)
index 0000000..5800713
--- /dev/null
@@ -0,0 +1 @@
+../gen-Libc/untempl.py
\ No newline at end of file