소스 검색

BlackBox @ OpenBSD: 1.6 -> 1.7

Alexander Shiryaev 8 년 전
부모
커밋
70a3562c0a

+ 47 - 0
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.

+ 61 - 0
BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-LibW/sizeofs.c

@@ -0,0 +1,61 @@
+#include <sys/types.h>
+#include <wctype.h>
+#include <wchar.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#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;
+}

BIN
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Build-Tool.odc


+ 1 - 0
BlackBox/_FreeBSDLinuxOpenBSD_GUI/build

@@ -3,6 +3,7 @@
 ./run-dev0 <<DATA
 ConsCompiler.Compile('Lin/Mod', 'Dl.txt')
 ConsCompiler.Compile('Lin/Mod', 'Libc.txt')
+ConsCompiler.Compile('Lin/Mod', 'LibW.txt')
 ConsCompiler.Compile('Lin/Mod', 'Iconv.txt')
 
 # Linux only

+ 1 - 0
BlackBox/_FreeBSDLinuxOpenBSD_Interp/build

@@ -3,6 +3,7 @@
 ./run-dev0 <<DATA
 ConsCompiler.Compile('Lin/Mod', 'Dl.txt')
 ConsCompiler.Compile('Lin/Mod', 'Libc.txt')
+ConsCompiler.Compile('Lin/Mod', 'LibW.txt')
 ConsCompiler.Compile('Lin/Mod', 'Iconv.txt')
 
 # Linux only

BIN
BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/GLib.odc


BIN
BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/Gdk.odc


BIN
BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/Gtk.odc


BIN
BlackBox/_OpenBSD_/Host/Mod/Files.odc


BIN
BlackBox/_OpenBSD_/Host/Mod/Files16.odc


+ 25 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/Makefile

@@ -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

+ 1 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/dumpdefs.py

@@ -0,0 +1 @@
+../gen-Libc/dumpdefs.py

+ 1 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/libver

@@ -0,0 +1 @@
+.89.2

+ 1 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/machine

@@ -0,0 +1 @@
+i386

+ 1 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/osname

@@ -0,0 +1 @@
+OpenBSD 6.0

+ 1 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/untempl.py

@@ -0,0 +1 @@
+../gen-Libc/untempl.py

BIN
BlackBox/_OpenBSD_/System/Mod/Kernel.odc


BIN
BlackBox/_OpenBSD_/System/Mod/Kernel16.odc


BIN
BlackBox/_OpenBSD_/libBB.so


BIN
BlackBox/_OpenBSD_/libBB0.so