Browse Source

txt → odc

Alexander Shiryaev 5 years ago
parent
commit
a782e2df28
69 changed files with 168 additions and 3912 deletions
  1. 2 8
      BlackBox/_FreeBSDLinuxOpenBSD_GUI/build
  2. 2 9
      BlackBox/_FreeBSDLinuxOpenBSD_Interp/build
  3. 5 2
      BlackBox/_FreeBSDOpenBSD_/Lin/Mod/gen-Ioctl/Makefile
  4. BIN
      BlackBox/_FreeBSD_/Lin/Mod/Dl.odc
  5. 0 32
      BlackBox/_FreeBSD_/Lin/Mod/Dl.txt
  6. BIN
      BlackBox/_FreeBSD_/Lin/Mod/Iconv.odc
  7. 0 22
      BlackBox/_FreeBSD_/Lin/Mod/Iconv.txt
  8. BIN
      BlackBox/_FreeBSD_/Lin/Mod/Ioctl.odc
  9. 0 43
      BlackBox/_FreeBSD_/Lin/Mod/Ioctl.txt
  10. BIN
      BlackBox/_FreeBSD_/Lin/Mod/LibW.odc
  11. 0 59
      BlackBox/_FreeBSD_/Lin/Mod/LibW.txt
  12. BIN
      BlackBox/_FreeBSD_/Lin/Mod/Libc.odc
  13. 0 708
      BlackBox/_FreeBSD_/Lin/Mod/Libc.txt
  14. BIN
      BlackBox/_FreeBSD_/Lin/Mod/Net.odc
  15. 0 241
      BlackBox/_FreeBSD_/Lin/Mod/Net.txt
  16. 1 0
      BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/txt2odc.py
  17. 5 2
      BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/Makefile
  18. 1 0
      BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/txt2odc.py
  19. 5 2
      BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/Makefile
  20. 1 0
      BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/txt2odc.py
  21. 5 2
      BlackBox/_FreeBSD_/Lin/Mod/gen-Net/Makefile
  22. 1 0
      BlackBox/_FreeBSD_/Lin/Mod/gen-Net/txt2odc.py
  23. 0 30
      BlackBox/_Linux_/Lin/Mod/Dl.txt
  24. 0 22
      BlackBox/_Linux_/Lin/Mod/Iconv.txt
  25. BIN
      BlackBox/_Linux_/Lin/Mod/Ioctl.odc
  26. 0 37
      BlackBox/_Linux_/Lin/Mod/Ioctl.txt
  27. BIN
      BlackBox/_Linux_/Lin/Mod/LibW.odc
  28. 0 65
      BlackBox/_Linux_/Lin/Mod/LibW.txt
  29. BIN
      BlackBox/_Linux_/Lin/Mod/Libc.odc
  30. 0 698
      BlackBox/_Linux_/Lin/Mod/Libc.txt
  31. BIN
      BlackBox/_Linux_/Lin/Mod/Net.odc
  32. 0 361
      BlackBox/_Linux_/Lin/Mod/Net.txt
  33. BIN
      BlackBox/_Linux_/Lin/Mod/Rt.odc
  34. 0 26
      BlackBox/_Linux_/Lin/Mod/Rt.txt
  35. BIN
      BlackBox/_Linux_/Lin/Mod/Termios.odc
  36. 0 148
      BlackBox/_Linux_/Lin/Mod/Termios.txt
  37. 5 2
      BlackBox/_Linux_/Lin/Mod/gen-Ioctl/Makefile
  38. 1 0
      BlackBox/_Linux_/Lin/Mod/gen-Ioctl/txt2odc.py
  39. 5 2
      BlackBox/_Linux_/Lin/Mod/gen-LibW/Makefile
  40. 1 0
      BlackBox/_Linux_/Lin/Mod/gen-LibW/txt2odc.py
  41. 5 2
      BlackBox/_Linux_/Lin/Mod/gen-Libc/Makefile
  42. 1 0
      BlackBox/_Linux_/Lin/Mod/gen-Libc/txt2odc.py
  43. 5 2
      BlackBox/_Linux_/Lin/Mod/gen-Net/Makefile
  44. 1 0
      BlackBox/_Linux_/Lin/Mod/gen-Net/txt2odc.py
  45. 5 2
      BlackBox/_Linux_/Lin/Mod/gen-Termios/Makefile
  46. 1 0
      BlackBox/_Linux_/Lin/Mod/gen-Termios/txt2odc.py
  47. BIN
      BlackBox/_OpenBSD_/Lin/Mod/Dl.odc
  48. 0 33
      BlackBox/_OpenBSD_/Lin/Mod/Dl.txt
  49. BIN
      BlackBox/_OpenBSD_/Lin/Mod/Iconv.odc
  50. 0 22
      BlackBox/_OpenBSD_/Lin/Mod/Iconv.txt
  51. BIN
      BlackBox/_OpenBSD_/Lin/Mod/Ioctl.odc
  52. 0 43
      BlackBox/_OpenBSD_/Lin/Mod/Ioctl.txt
  53. BIN
      BlackBox/_OpenBSD_/Lin/Mod/LibW.odc
  54. 0 59
      BlackBox/_OpenBSD_/Lin/Mod/LibW.txt
  55. BIN
      BlackBox/_OpenBSD_/Lin/Mod/Libc.odc
  56. 0 746
      BlackBox/_OpenBSD_/Lin/Mod/Libc.txt
  57. BIN
      BlackBox/_OpenBSD_/Lin/Mod/Net.odc
  58. 0 320
      BlackBox/_OpenBSD_/Lin/Mod/Net.txt
  59. BIN
      BlackBox/_OpenBSD_/Lin/Mod/Termios.odc
  60. 0 154
      BlackBox/_OpenBSD_/Lin/Mod/Termios.txt
  61. 1 0
      BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/txt2odc.py
  62. 5 2
      BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/Makefile
  63. 1 0
      BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/txt2odc.py
  64. 5 2
      BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/Makefile
  65. 86 0
      BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/txt2odc.py
  66. 5 2
      BlackBox/_OpenBSD_/Lin/Mod/gen-Net/Makefile
  67. 1 0
      BlackBox/_OpenBSD_/Lin/Mod/gen-Net/txt2odc.py
  68. 5 2
      BlackBox/_OpenBSD_/Lin/Mod/gen-Termios/Makefile
  69. 1 0
      BlackBox/_OpenBSD_/Lin/Mod/gen-Termios/txt2odc.py

+ 2 - 8
BlackBox/_FreeBSDLinuxOpenBSD_GUI/build

@@ -1,16 +1,10 @@
 #!/bin/sh
 
 ./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')
-ConsCompiler.Compile('Lin/Mod', 'Termios.txt')
-ConsCompiler.Compile('Lin/Mod', 'Ioctl.txt')
-ConsCompiler.Compile('Lin/Mod', 'Net.txt')
+DevCompiler.CompileThis LinDl LinLibc LinLibW LinIconv LinTermios LinIoctl LinNet
 
 # Linux only
-ConsCompiler.Compile('Lin/Mod', 'Rt.txt')
+DevCompiler.CompileThis LinRt
 
 DevCompiler.CompileSubs System Gtk2 Std Cons Host Text Form Dev Xhtml Comm Obx
 

+ 2 - 9
BlackBox/_FreeBSDLinuxOpenBSD_Interp/build

@@ -1,16 +1,10 @@
 #!/bin/sh
 
 ./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')
-ConsCompiler.Compile('Lin/Mod', 'Termios.txt')
-ConsCompiler.Compile('Lin/Mod', 'Ioctl.txt')
-ConsCompiler.Compile('Lin/Mod', 'Net.txt')
+DevCompiler.CompileThis LinDl LinLibc LinLibW LinIconv LinTermios LinIoctl LinNet
 
 # Linux only
-ConsCompiler.Compile('Lin/Mod', 'Rt.txt')
+DevCompiler.CompileThis LinRt
 
 DevCompiler.CompileSubs System Std Host Cons Text Form Dev Xhtml Comm Obx
 
@@ -21,4 +15,3 @@ DevCompiler.CompileThis Dev2LnkChmod
 Dev2Linker1.LinkElfExe `uname -s` blackbox := Kernel$+ Files HostFiles StdLoader
 
 DATA
-

+ 5 - 2
BlackBox/_FreeBSDOpenBSD_/Lin/Mod/gen-Ioctl/Makefile

@@ -6,7 +6,10 @@
 
 INCDIR ?= /usr/include
 
-all: mkioctl Ioctl.txt
+all: mkioctl Ioctl.odc
+
+Ioctl.odc: Ioctl.txt
+	./txt2odc.py Ioctl.txt Ioctl.odc
 
 PY = python2.7
 DEFS = defs-tiocm defs-ioctl
@@ -21,4 +24,4 @@ defs-tiocm:
 	./dumpdefs.py 2 1 s ${INCDIR}/sys/ttycom.h | grep TIOCM_ > ${.TARGET}
 
 clean:
-	rm -f mkioctl Ioctl.txt ${DEFS}
+	rm -f mkioctl Ioctl.txt Ioctl.odc ${DEFS}

BIN
BlackBox/_FreeBSD_/Lin/Mod/Dl.odc


+ 0 - 32
BlackBox/_FreeBSD_/Lin/Mod/Dl.txt

@@ -1,32 +0,0 @@
-MODULE LinDl ["libc.so.7"];
-
-	(*
-		A. V. Shiryaev, 2012.11
-
-		FreeBSD 9.0
-		32-bit
-	*)
-
-	CONST
-		NULL* = 0H;
-
-		(* from FreeBSD 9.0 /usr/include/dlfcn.h *)
-			RTLD_LAZY* = 1;
-			RTLD_NOW* = 2;
-
-			RTLD_GLOBAL* = 100H;
-			RTLD_LOCAL* = 000H;
-			RTLD_TRACE* = 200H;
-
-	TYPE
-		PtrVoid* = INTEGER;
-		HANDLE* = PtrVoid;
-		PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR;
-
-	PROCEDURE [ccall] dlopen* (file: PtrSTR; mode: INTEGER): HANDLE;
-	PROCEDURE [ccall] dlclose* (handle: HANDLE): INTEGER;
-	PROCEDURE [ccall] dlsym* (handle: HANDLE; symbol: PtrSTR): HANDLE;
-
-	PROCEDURE [ccall] dlerror* (): PtrSTR;
-
-END LinDl.

BIN
BlackBox/_FreeBSD_/Lin/Mod/Iconv.odc


+ 0 - 22
BlackBox/_FreeBSD_/Lin/Mod/Iconv.txt

@@ -1,22 +0,0 @@
-MODULE LinIconv ["libiconv.so.3"];
-
-	IMPORT Libc := LinLibc;
-
-	TYPE
-		PtrVoid = Libc.PtrVoid;
-		PtrSTR* = Libc.PtrSTR;
-		PtrLSTR* = POINTER TO ARRAY [untagged] OF CHAR;
-		size_t* = Libc.size_t;
-
-		iconv_t* = PtrVoid;
-
-	PROCEDURE [ccall] iconv_open* ["libiconv_open"] (tocode, fromcode: PtrSTR): iconv_t;
-	PROCEDURE [ccall] iconv_close* ["libiconv_close"] (cd: iconv_t): INTEGER;
-
-	PROCEDURE [ccall] iconv* ["libiconv"] (cd: iconv_t; VAR [nil] inbuf: PtrSTR; VAR inbytesleft: size_t; VAR [nil] outbuf: PtrSTR; VAR outbytesleft: size_t): size_t;
-
-	PROCEDURE [ccall] iconv_encode* ["libiconv"] (cd: iconv_t; VAR [nil] inbuf: PtrLSTR; VAR inbytesleft: size_t; VAR [nil] outbuf: PtrSTR; VAR outbytesleft: size_t): size_t;
-
-	PROCEDURE [ccall] iconv_decode* ["libiconv"] (cd: iconv_t; VAR [nil] inbuf: PtrSTR; VAR inbytesleft: size_t; VAR [nil] outbuf: PtrLSTR; VAR outbytesleft: size_t): size_t;
-
-END LinIconv.

BIN
BlackBox/_FreeBSD_/Lin/Mod/Ioctl.odc


+ 0 - 43
BlackBox/_FreeBSD_/Lin/Mod/Ioctl.txt

@@ -1,43 +0,0 @@
-MODULE LinIoctl ["libc.so.7"];
-
-	(*
-		FreeBSD 11.0
-		i386
-	*)
-
-	CONST
-		TIOCM_LE* = {0}; (* line enable *)
-		TIOCM_DTR* = {1}; (* data terminal ready *)
-		TIOCM_RTS* = {2}; (* request to send *)
-		TIOCM_ST* = {3}; (* secondary transmit *)
-		TIOCM_SR* = {4}; (* secondary receive *)
-		TIOCM_CTS* = {5}; (* clear to send *)
-		TIOCM_DCD* = {6}; (* data carrier detect *)
-		TIOCM_RI* = {7}; (* ring indicate *)
-		TIOCM_DSR* = {8}; (* data set ready *)
-
-		FIOCLEX* = 536897025;
-		FIONCLEX* = 536897026;
-		FIONREAD* = 1074030207;
-		FIONBIO* = -2147195266;
-		FIOASYNC* = -2147195267;
-		FIOSETOWN* = -2147195268;
-		FIOGETOWN* = 1074030203;
-		TIOCMGET* = 1074033770;
-		TIOCMSET* = -2147191699;
-		TIOCEXCL* = 536900621;
-		TIOCNXCL* = 536900622;
-		TIOCFLUSH* = -2147191792;
-		TIOCDRAIN* = 536900702;
-		TIOCOUTQ* = 1074033779;
-		TIOCSBRK* = 536900731;
-		TIOCCBRK* = 536900730;
-		TIOCSDTR* = 536900729;
-		TIOCCDTR* = 536900728;
-		TIOCMBIS* = -2147191700;
-		TIOCMBIC* = -2147191701;
-
-	PROCEDURE [ccall] ioctl0* ["ioctl"] (d: INTEGER; req: INTEGER): INTEGER;
-	PROCEDURE [ccall] ioctl1* ["ioctl"] (d: INTEGER; req: INTEGER; VAR arg: INTEGER): INTEGER;
-
-END LinIoctl.

BIN
BlackBox/_FreeBSD_/Lin/Mod/LibW.odc


+ 0 - 59
BlackBox/_FreeBSD_/Lin/Mod/LibW.txt

@@ -1,59 +0,0 @@
-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.

BIN
BlackBox/_FreeBSD_/Lin/Mod/Libc.odc


+ 0 - 708
BlackBox/_FreeBSD_/Lin/Mod/Libc.txt

@@ -1,708 +0,0 @@
-MODULE LinLibc ["libc.so.7"];
-
-	(*
-		FreeBSD 11.0
-		i386
-	*)
-
-	CONST
-		NULL* = 0H;
-		FALSE* = 0;
-		TRUE* = 1;
-
-		CLOCKS_PER_SEC* = 128;
-
-		MAP_FAILED* = -1;
-
-		(* MAP_PRIVATE, MAP_ANON (intFlags) *)
-		MAP_SHARED* = {0}; (* share changes *)
-		MAP_PRIVATE* = {1}; (* changes are private *)
-		MAP_FIXED* = {4}; (* map addr must be exactly as requested *)
-		MAP_RESERVED0020* = {5}; (* previously unimplemented MAP_RENAME *)
-		MAP_RESERVED0040* = {6}; (* previously unimplemented MAP_NORESERVE *)
-		MAP_RESERVED0080* = {7}; (* previously misimplemented MAP_INHERIT *)
-		MAP_RESERVED0100* = {8}; (* previously unimplemented MAP_NOEXTEND *)
-		MAP_HASSEMAPHORE* = {9}; (* region may contain semaphores *)
-		MAP_STACK* = {10}; (* region grows down, like a stack *)
-		MAP_NOSYNC* = {11}; (* page to but do not sync underlying file *)
-		MAP_FILE* = {}; (* map from file (default) *)
-		MAP_ANON* = {12}; (* allocated from memory, swap space *)
-		MAP_EXCL* = {14}; (* for MAP_FIXED, fail if address is used *)
-		MAP_NOCORE* = {17}; (* dont include these pages in a coredump *)
-		MAP_PREFAULT_READ* = {18}; (* prefault mapping for reading *)
-		MAP_ALIGNMENT_SHIFT* = {3,4};
-
-
-		(* PROT_READ, PROT_WRITE, PROT_EXEC (intFlags) *)
-		PROT_NONE* = {}; (* no permissions *)
-		PROT_READ* = {0}; (* pages can be read *)
-		PROT_WRITE* = {1}; (* pages can be written *)
-		PROT_EXEC* = {2}; (* pages can be executed *)
-
-
-		(* SIG_UNBLOCK, SIG_SETMASK (int) *)
-		SIG_BLOCK* = 1; (* block specified signal set *)
-		SIG_UNBLOCK* = 2; (* unblock specified signal set *)
-		SIG_SETMASK* = 3; (* set specified signal set *)
-
-
-		(* FPE_INTDIV, FPE_INTOVF, FPE_FLTDIV, FPE_FLTOVF, FPE_FLTUND, FPE_FLTRES, FPE_FLTINV, FPE_FLTSUB (int) *)
-		FPE_INTOVF* = 1; (* Integer overflow. *)
-		FPE_INTDIV* = 2; (* Integer divide by zero. *)
-		FPE_FLTDIV* = 3; (* Floating point divide by zero. *)
-		FPE_FLTOVF* = 4; (* Floating point overflow. *)
-		FPE_FLTUND* = 5; (* Floating point underflow. *)
-		FPE_FLTRES* = 6; (* Floating point inexact result. *)
-		FPE_FLTINV* = 7; (* Invalid floating point operation. *)
-		FPE_FLTSUB* = 8; (* Subscript out of range. *)
-
-
-		(* SA_SIGINFO (intFlags) *)
-		SA_NOCLDSTOP* = {3}; (* do not generate SIGCHLD on child stop *)
-		SA_ONSTACK* = {0}; (* take signal on signal stack *)
-		SA_RESTART* = {1}; (* restart system call on signal return *)
-		SA_RESETHAND* = {2}; (* reset to SIG_DFL when taking signal *)
-		SA_NODEFER* = {4}; (* don't mask the signal we're delivering *)
-		SA_NOCLDWAIT* = {5}; (* don't keep zombies around *)
-		SA_SIGINFO* = {6}; (* signal handler with SA_SIGINFO args *)
-
-
-		(* SIGINT, SIGILL, SIGFPE, SIGSEGV, SIGKILL, SIGSTOP, SIGWINCH, SIGTHR (int) *)
-		SIGINT* = 2; (* interrupt *)
-		SIGILL* = 4; (* illegal instr. (not reset when caught) *)
-		SIGABRT* = 6; (* abort() *)
-		SIGFPE* = 8; (* floating point exception *)
-		SIGSEGV* = 11; (* segmentation violation *)
-		SIGTERM* = 15; (* software termination signal from kill *)
-		SIGRTMIN* = 65;
-		SIGRTMAX* = 126;
-		SIGHUP* = 1; (* hangup *)
-		SIGQUIT* = 3; (* quit *)
-		SIGTRAP* = 5; (* trace trap (not reset when caught) *)
-		SIGIOT* = SIGABRT; (* compatibility *)
-		SIGEMT* = 7; (* EMT instruction *)
-		SIGKILL* = 9; (* kill (cannot be caught or ignored) *)
-		SIGBUS* = 10; (* bus error *)
-		SIGSYS* = 12; (* non-existent system call invoked *)
-		SIGPIPE* = 13; (* write on a pipe with no one to read it *)
-		SIGALRM* = 14; (* alarm clock *)
-		SIGURG* = 16; (* urgent condition on IO channel *)
-		SIGSTOP* = 17; (* sendable stop signal not from tty *)
-		SIGTSTP* = 18; (* stop signal from tty *)
-		SIGCONT* = 19; (* continue a stopped process *)
-		SIGCHLD* = 20; (* to parent on child stop or exit *)
-		SIGTTIN* = 21; (* to readers pgrp upon background tty read *)
-		SIGTTOU* = 22; (* like TTIN if (tp->t_local&LTOSTOP) *)
-		SIGIO* = 23; (* input/output possible signal *)
-		SIGXCPU* = 24; (* exceeded CPU time limit *)
-		SIGXFSZ* = 25; (* exceeded file size limit *)
-		SIGVTALRM* = 26; (* virtual time alarm *)
-		SIGPROF* = 27; (* profiling time alarm *)
-		SIGWINCH* = 28; (* window size changes *)
-		SIGINFO* = 29; (* information request *)
-		SIGUSR1* = 30; (* user defined signal 1 *)
-		SIGUSR2* = 31; (* user defined signal 2 *)
-		SIGTHR* = 32; (* reserved by thread library. *)
-		SIGLWP* = SIGTHR;
-		SIGLIBRT* = 33; (* reserved by real-time library. *)
-		SIGEV_NONE* = 0; (* No async notification. *)
-		SIGEV_SIGNAL* = 1; (* Generate a queued signal. *)
-		SIGEV_THREAD* = 2; (* Call back from another pthread. *)
-
-		_NSIG* = SIGTHR + 1;
-
-(*
-		PAGE_SIZE* = 4096;
-*)
-		_SC_ASYNCHRONOUS_IO* = 28;
-		_SC_MAPPED_FILES* = 29;
-		_SC_MEMLOCK* = 30;
-		_SC_MEMLOCK_RANGE* = 31;
-		_SC_MEMORY_PROTECTION* = 32;
-		_SC_MESSAGE_PASSING* = 33;
-		_SC_PRIORITIZED_IO* = 34;
-		_SC_PRIORITY_SCHEDULING* = 35;
-		_SC_REALTIME_SIGNALS* = 36;
-		_SC_SEMAPHORES* = 37;
-		_SC_FSYNC* = 38;
-		_SC_SHARED_MEMORY_OBJECTS* = 39;
-		_SC_SYNCHRONIZED_IO* = 40;
-		_SC_TIMERS* = 41;
-		_SC_AIO_LISTIO_MAX* = 42;
-		_SC_AIO_MAX* = 43;
-		_SC_AIO_PRIO_DELTA_MAX* = 44;
-		_SC_DELAYTIMER_MAX* = 45;
-		_SC_MQ_OPEN_MAX* = 46;
-		_SC_PAGESIZE* = 47;
-		_SC_RTSIG_MAX* = 48;
-		_SC_SEM_NSEMS_MAX* = 49;
-		_SC_SEM_VALUE_MAX* = 50;
-		_SC_SIGQUEUE_MAX* = 51;
-		_SC_TIMER_MAX* = 52;
-		_SC_2_PBS* = 59; (* user *)
-		_SC_2_PBS_ACCOUNTING* = 60; (* user *)
-		_SC_2_PBS_CHECKPOINT* = 61; (* user *)
-		_SC_2_PBS_LOCATE* = 62; (* user *)
-		_SC_2_PBS_MESSAGE* = 63; (* user *)
-		_SC_2_PBS_TRACK* = 64; (* user *)
-		_SC_ADVISORY_INFO* = 65;
-		_SC_BARRIERS* = 66; (* user *)
-		_SC_CLOCK_SELECTION* = 67;
-		_SC_CPUTIME* = 68;
-		_SC_FILE_LOCKING* = 69;
-		_SC_GETGR_R_SIZE_MAX* = 70; (* user *)
-		_SC_GETPW_R_SIZE_MAX* = 71; (* user *)
-		_SC_HOST_NAME_MAX* = 72;
-		_SC_LOGIN_NAME_MAX* = 73;
-		_SC_MONOTONIC_CLOCK* = 74;
-		_SC_MQ_PRIO_MAX* = 75;
-		_SC_READER_WRITER_LOCKS* = 76; (* user *)
-		_SC_REGEXP* = 77; (* user *)
-		_SC_SHELL* = 78; (* user *)
-		_SC_SPAWN* = 79; (* user *)
-		_SC_SPIN_LOCKS* = 80; (* user *)
-		_SC_SPORADIC_SERVER* = 81;
-		_SC_THREAD_ATTR_STACKADDR* = 82; (* user *)
-		_SC_THREAD_ATTR_STACKSIZE* = 83; (* user *)
-		_SC_THREAD_CPUTIME* = 84; (* user *)
-		_SC_THREAD_DESTRUCTOR_ITERATIONS* = 85; (* user *)
-		_SC_THREAD_KEYS_MAX* = 86; (* user *)
-		_SC_THREAD_PRIO_INHERIT* = 87; (* user *)
-		_SC_THREAD_PRIO_PROTECT* = 88; (* user *)
-		_SC_THREAD_PRIORITY_SCHEDULING* = 89; (* user *)
-		_SC_THREAD_PROCESS_SHARED* = 90; (* user *)
-		_SC_THREAD_SAFE_FUNCTIONS* = 91; (* user *)
-		_SC_THREAD_SPORADIC_SERVER* = 92; (* user *)
-		_SC_THREAD_STACK_MIN* = 93; (* user *)
-		_SC_THREAD_THREADS_MAX* = 94; (* user *)
-		_SC_TIMEOUTS* = 95; (* user *)
-		_SC_THREADS* = 96; (* user *)
-		_SC_TRACE* = 97; (* user *)
-		_SC_TRACE_EVENT_FILTER* = 98; (* user *)
-		_SC_TRACE_INHERIT* = 99; (* user *)
-		_SC_TRACE_LOG* = 100; (* user *)
-		_SC_TTY_NAME_MAX* = 101; (* user *)
-		_SC_TYPED_MEMORY_OBJECTS* = 102;
-		_SC_V6_ILP32_OFF32* = 103; (* user *)
-		_SC_V6_ILP32_OFFBIG* = 104; (* user *)
-		_SC_V6_LP64_OFF64* = 105; (* user *)
-		_SC_V6_LPBIG_OFFBIG* = 106; (* user *)
-		_SC_IPV6* = 118;
-		_SC_RAW_SOCKETS* = 119;
-		_SC_SYMLOOP_MAX* = 120;
-		_SC_ATEXIT_MAX* = 107; (* user *)
-		_SC_IOV_MAX* = 56;
-		_SC_XOPEN_CRYPT* = 108; (* user *)
-		_SC_XOPEN_ENH_I18N* = 109; (* user *)
-		_SC_XOPEN_LEGACY* = 110; (* user *)
-		_SC_XOPEN_REALTIME* = 111;
-		_SC_XOPEN_REALTIME_THREADS* = 112;
-		_SC_XOPEN_SHM* = 113;
-		_SC_XOPEN_STREAMS* = 114;
-		_SC_XOPEN_UNIX* = 115;
-		_SC_XOPEN_VERSION* = 116;
-		_SC_XOPEN_XCU_VERSION* = 117; (* user *)
-		_SC_NPROCESSORS_CONF* = 57;
-		_SC_NPROCESSORS_ONLN* = 58;
-		_SC_CPUSET_SIZE* = 122;
-
-
-		SIGSTKSZ* = 512 * 4 + 32768 (* FreeBSD 9.0 /usr/include/sys/signal.h *);
-
-		(* ENOENT, EEXIST, EACCES, ENOMEM, EDQUOT, EMFILE, ENOTDIR (int) *)
-		EPERM* = 1; (* Operation not permitted *)
-		ENOENT* = 2; (* No such file or directory *)
-		ESRCH* = 3; (* No such process *)
-		EINTR* = 4; (* Interrupted system call *)
-		EIO* = 5; (* Input/output error *)
-		ENXIO* = 6; (* Device not configured *)
-		E2BIG* = 7; (* Argument list too long *)
-		ENOEXEC* = 8; (* Exec format error *)
-		EBADF* = 9; (* Bad file descriptor *)
-		ECHILD* = 10; (* No child processes *)
-		EDEADLK* = 11; (* Resource deadlock avoided *)
-		ENOMEM* = 12; (* Cannot allocate memory *)
-		EACCES* = 13; (* Permission denied *)
-		EFAULT* = 14; (* Bad address *)
-		EBUSY* = 16; (* Device busy *)
-		EEXIST* = 17; (* File exists *)
-		EXDEV* = 18; (* Cross-device link *)
-		ENODEV* = 19; (* Operation not supported by device *)
-		ENOTDIR* = 20; (* Not a directory *)
-		EISDIR* = 21; (* Is a directory *)
-		EINVAL* = 22; (* Invalid argument *)
-		ENFILE* = 23; (* Too many open files in system *)
-		EMFILE* = 24; (* Too many open files *)
-		ENOTTY* = 25; (* Inappropriate ioctl for device *)
-		EFBIG* = 27; (* File too large *)
-		ENOSPC* = 28; (* No space left on device *)
-		ESPIPE* = 29; (* Illegal seek *)
-		EROFS* = 30; (* Read-only filesystem *)
-		EMLINK* = 31; (* Too many links *)
-		EPIPE* = 32; (* Broken pipe *)
-		EDOM* = 33; (* Numerical argument out of domain *)
-		ERANGE* = 34; (* Result too large *)
-		EAGAIN* = 35; (* Resource temporarily unavailable *)
-		ENAMETOOLONG* = 63; (* File name too long *)
-		ENOTEMPTY* = 66; (* Directory not empty *)
-		ENOLCK* = 77; (* No locks available *)
-		ENOSYS* = 78; (* Function not implemented *)
-		EBADMSG* = 89; (* Bad message *)
-		EMULTIHOP* = 90; (* Multihop attempted *)
-		ENOLINK* = 91; (* Link has been severed *)
-		EPROTO* = 92; (* Protocol error *)
-		ENOTBLK* = 15; (* Block device required *)
-		ETXTBSY* = 26; (* Text file busy *)
-		EWOULDBLOCK* = EAGAIN; (* Operation would block *)
-		EINPROGRESS* = 36; (* Operation now in progress *)
-		EALREADY* = 37; (* Operation already in progress *)
-		ENOTSOCK* = 38; (* Socket operation on non-socket *)
-		EDESTADDRREQ* = 39; (* Destination address required *)
-		EMSGSIZE* = 40; (* Message too long *)
-		EPROTOTYPE* = 41; (* Protocol wrong type for socket *)
-		ENOPROTOOPT* = 42; (* Protocol not available *)
-		EPROTONOSUPPORT* = 43; (* Protocol not supported *)
-		ESOCKTNOSUPPORT* = 44; (* Socket type not supported *)
-		EOPNOTSUPP* = 45; (* Operation not supported *)
-		ENOTSUP* = EOPNOTSUPP; (* Operation not supported *)
-		EPFNOSUPPORT* = 46; (* Protocol family not supported *)
-		EAFNOSUPPORT* = 47; (* Address family not supported by protocol family *)
-		EADDRINUSE* = 48; (* Address already in use *)
-		EADDRNOTAVAIL* = 49; (* Can't assign requested address *)
-		ENETDOWN* = 50; (* Network is down *)
-		ENETUNREACH* = 51; (* Network is unreachable *)
-		ENETRESET* = 52; (* Network dropped connection on reset *)
-		ECONNABORTED* = 53; (* Software caused connection abort *)
-		ECONNRESET* = 54; (* Connection reset by peer *)
-		ENOBUFS* = 55; (* No buffer space available *)
-		EISCONN* = 56; (* Socket is already connected *)
-		ENOTCONN* = 57; (* Socket is not connected *)
-		ESHUTDOWN* = 58; (* Can't send after socket shutdown *)
-		ETOOMANYREFS* = 59; (* Too many references: can't splice *)
-		ETIMEDOUT* = 60; (* Operation timed out *)
-		ECONNREFUSED* = 61; (* Connection refused *)
-		ELOOP* = 62; (* Too many levels of symbolic links *)
-		EHOSTDOWN* = 64; (* Host is down *)
-		EHOSTUNREACH* = 65; (* No route to host *)
-		EPROCLIM* = 67; (* Too many processes *)
-		EUSERS* = 68; (* Too many users *)
-		EDQUOT* = 69; (* Disc quota exceeded *)
-		ESTALE* = 70; (* Stale NFS file handle *)
-		EREMOTE* = 71; (* Too many levels of remote in path *)
-		EBADRPC* = 72; (* RPC struct is bad *)
-		ERPCMISMATCH* = 73; (* RPC version wrong *)
-		EPROGUNAVAIL* = 74; (* RPC prog. not avail *)
-		EPROGMISMATCH* = 75; (* Program version wrong *)
-		EPROCUNAVAIL* = 76; (* Bad procedure for program *)
-		EFTYPE* = 79; (* Inappropriate file type or format *)
-		EAUTH* = 80; (* Authentication error *)
-		ENEEDAUTH* = 81; (* Need authenticator *)
-		EIDRM* = 82; (* Identifier removed *)
-		ENOMSG* = 83; (* No message of desired type *)
-		EOVERFLOW* = 84; (* Value too large to be stored in data type *)
-		ECANCELED* = 85; (* Operation canceled *)
-		EILSEQ* = 86; (* Illegal byte sequence *)
-		ENOATTR* = 87; (* Attribute not found *)
-		EDOOFUS* = 88; (* Programming error *)
-		ENOTCAPABLE* = 93; (* Capabilities insufficient *)
-		ECAPMODE* = 94; (* Not permitted in capability mode *)
-		ENOTRECOVERABLE* = 95; (* State not recoverable *)
-		EOWNERDEAD* = 96; (* Previous owner died *)
-		ELAST* = 96; (* Must be equal largest errno *)
-
-
-		NAME_MAX* = 255;
-
-		SEEK_SET* = 0;
-		SEEK_CUR* = 1;
-		SEEK_END* = 2;
-
-		STDIN_FILENO* = 0;
-		STDOUT_FILENO* = 1;
-		STDERR_FILENO* = 2;
-
-		P_tmpdir* = "/tmp";
-
-		(* O_RDWR, O_NONBLOCK (intFlags) *)
-		O_SHLOCK* = {4}; (* open with shared file lock *)
-		O_EXLOCK* = {5}; (* open with exclusive file lock *)
-		O_ASYNC* = {6}; (* signal pgrp when data ready *)
-		O_FSYNC* = {7}; (* synchronous writes *)
-		O_NOFOLLOW* = {8}; (* don't follow symlinks *)
-		O_DIRECT* = {16};
-		O_DIRECTORY* = {17}; (* Fail if not directory *)
-		O_EXEC* = {18}; (* Open for execute only *)
-		O_TTY_INIT* = {19}; (* Restore default termios attributes *)
-		O_CLOEXEC* = {20};
-		O_VERIFY* = {21}; (* open only after verification *)
-		O_RDONLY* = {}; (* open for reading only *)
-		O_WRONLY* = {0}; (* open for writing only *)
-		O_RDWR* = {1}; (* open for reading and writing *)
-		O_ACCMODE* = {0,1}; (* mask for above modes *)
-		O_NONBLOCK* = {2}; (* no delay *)
-		O_APPEND* = {3}; (* set append mode *)
-		O_SYNC* = {7}; (* POSIX synonym for O_FSYNC *)
-		O_CREAT* = {9}; (* create if nonexistent *)
-		O_TRUNC* = {10}; (* truncate to zero length *)
-		O_EXCL* = {11}; (* error if already exists *)
-		O_NOCTTY* = {15}; (* don't assign controlling terminal *)
-
-
-		(* FreeBSD 11.0 /usr/include/time.h *)
-			CLOCK_REALTIME* = 0;
-			CLOCK_VIRTUAL* = 1;
-			CLOCK_PROF* = 2;
-			CLOCK_MONOTONIC* = 4;
-			CLOCK_UPTIME* = 5; (* FreeBSD-specific *)
-			CLOCK_UPTIME_PRECISE* = 7; (* FreeBSD-specific *)
-			CLOCK_UPTIME_FAST* = 8; (* FreeBSD-specific *)
-			CLOCK_REALTIME_PRECISE* = 9; (* FreeBSD-specific *)
-			CLOCK_REALTIME_FAST* = 10; (* FreeBSD-specific *)
-			CLOCK_MONOTONIC_PRECISE* = 11; (* FreeBSD-specific *)
-			CLOCK_MONOTONIC_FAST* = 12; (* FreeBSD-specific *)
-			CLOCK_SECOND* = 13; (* FreeBSD-specific *)
-			CLOCK_THREAD_CPUTIME_ID* = 14;
-			CLOCK_PROCESS_CPUTIME_ID* = 15;
-
-	TYPE
-		StrArray* = POINTER TO ARRAY [untagged] OF PtrSTR;
-		PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR;
-
-		(* PtrVoid, int, long, size_t, ssize_t, off_t, time_t, clock_t, sigjmp_buf *)
-		(* mode_t, intFlags, sigset_t (set) *)
-		PtrVoid* = INTEGER;
-		int* = INTEGER;
-		long* = INTEGER;
-		ulong* = INTEGER;
-		size_t* = INTEGER;
-		ssize_t* = INTEGER;
-		off_t* = LONGINT;
-		clock_t* = INTEGER;
-		clockid_t* = INTEGER;
-		time_t* = INTEGER;
-		mode_t* = SHORTINT;
-		pid_t* = INTEGER;
-		uid_t* = INTEGER;
-		gid_t* = INTEGER;
-		dev_t* = INTEGER;
-		ino_t* = INTEGER;
-		nlink_t* = SHORTINT;
-		int8_t* = SHORTCHAR;
-		uint8_t* = SHORTCHAR;
-		int16_t* = SHORTINT;
-		uint16_t* = SHORTINT;
-		int32_t* = INTEGER;
-		uint32_t* = INTEGER;
-		int64_t* = LONGINT;
-		uint64_t* = LONGINT;
-		wchar_t* = INTEGER;
-		sigset_t* = ARRAY [untagged] 4 OF SET;
-		sigjmp_buf* = ARRAY [untagged] 12 OF INTEGER;
-		intFlags* = SET;
-		blkcnt_t* = LONGINT;
-		blksize_t* = INTEGER;
-		fflags_t* = SET;
-
-
-		tm* = POINTER TO tmDesc;
-		tmDesc* = RECORD [untagged]
-			(* NOTE: check record size *)
-			(* tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday [ , tm_gmtoff ] *)
-			(* FreeBSD 9.0 /usr/include/time.h *)
-				tm_sec*: int; (* seconds after the minute [0-60] *)
-				tm_min*: int; (* minutes after the hour [0-59] *)
-				tm_hour*: int; (* hours since midnight [0-23] *)
-				tm_mday*: int; (* day of the month [1-31] *)
-				tm_mon*: int; (* months since January [0-11] *)
-				tm_year*: int; (* years since 1900 *)
-				tm_wday*: int; (* days since Sunday [0-6] *)
-				tm_yday*: int; (* days since January 1 [0-365] *)
-				tm_isdst*: int; (* Daylight Savings Time flag *)
-				tm_gmtoff*: long; (* offset from UTC in seconds *)
-				tm_zone*: PtrSTR; (* timezone abbreviation *)
-		END;
-
-		Ptrsiginfo_t* = POINTER TO siginfo_t;
-		siginfo_t = RECORD [untagged]
-			(* si_code, fault address *)
-			(* FreeBSD 9.0 /usr/include/sys/signal.h *)
-				si_signo*: int; (* signal number *)
-				si_errno*: int; (* errno association *)
-				si_code*: int; (* signal code *)
-				si_pid*: pid_t; (* sending process *)
-				si_uid*: uid_t; (* sender's ruid *)
-				si_status*: int; (* exit value *)
-				si_addr*: PtrVoid; (* faulting instruction *)
-(*
-				si_value*: sigval; (* signal value *)
-*)
-				si_value*: PtrVoid;
-				_reason*: RECORD [union]
-					_fault*: RECORD [untagged]
-						_trapno*: int; (* machine specific trap code *)
-					END;
-					_timer*: RECORD [untagged]
-						_timerid*: int;
-						_overrun*: int;
-					END;
-					_mesgq*: RECORD [untagged]
-						_mqd*: int;
-					END;
-					_poll*: RECORD [untagged]
-						_band*: long; (* band event for SIGPOLL *)
-					END;
-					__spare__: RECORD [untagged]
-						__spare1__: long;
-						__spare2__: ARRAY [untagged] 7 OF int;
-					END;
-				END;
-		END;
-
-		Ptrucontext_t* = POINTER TO ucontext_t;
-		ucontext_t = RECORD [untagged]
-			(* IP, SP, FP *)
-			(* FreeBSD 9.0 /usr/include/machine/signal.h *)
-				sc_mask*: sigset_t; (* signal mask to restore *)
-				sc_onstack*: int; (* sigstack state to restore *)
-				sc_gs*: int;  (* machine state (struct trapframe) *)
-				sc_fs*: int;
-				sc_es*: int;
-				sc_ds*: int;
-				sc_edi*: int;
-				sc_esi*: int;
-				sc_ebp*: int;
-				sc_isp*: int;
-				sc_ebx*: int;
-				sc_edx*: int;
-				sc_ecx*: int;
-				sc_eax*: int;
-				sc_trapno*: int;
-				sc_err*: int;
-				sc_eip*: int;
-				sc_cs*: int;
-				sc_efl*: int;
-				sc_esp*: int;
-				sc_ss*: int;
-				sc_len*: int; (* sizeof(mcontext_t) *)
-				
-				(*
-				 * XXX - See <machine/ucontext.h> and <machine/npx.h> for
-				 *       the following fields.
-				 *)
-				sc_fpformat: int;
-				sc_ownedfp: int;
-				sc_spare1: ARRAY [untagged] 1 OF int;
-				sc_fpstate: ARRAY [untagged] 128 OF int; (* FIXME: __aligned(16) *)
-				sc_fsbase: int;
-				sc_gsbase: int;
-				sc_spare2: ARRAY 6 OF int;
-		END;
-
-		sa_sigaction_t* = PROCEDURE [ccall] (sig: int; siginfo: Ptrsiginfo_t; context: Ptrucontext_t);
-		sigaction_t* = RECORD [untagged]
-(*
-			sa_sigaction*: sa_sigaction_t,
-			sa_flags*: intFlags, sa_mask*: sigset_t
-*)
-			(* FreeBSD 9.0 /usr/include/sys/signal.h *)
-				sa_sigaction*: sa_sigaction_t; (* signal handler *)
-				sa_flags*: intFlags; (* see options *)
-				sa_mask*: sigset_t; (* signal mask to apply *)
-		END;
-
-		stack_t* = RECORD [untagged]
-(*
-			ss_sp*: PtrVoid, ss_size*: size_t, ss_flags*: intFlags
-*)
-			(* FreeBSD 9.0 /usr/include/sys/signal.h *)
-				ss_sp*: PtrVoid; (* signal stack base *)
-				ss_size*: size_t; (* signal stack length *)
-				ss_flags*: intFlags; (* SS_DISABLE and/or SS_ONSTACK *)
-		END;
-
-		stat_t* = RECORD [untagged]
-(*
-			NOTE: check record size
-			st_mode*: mode_t, st_size*: off_t, st_mtime*: time_t
-*)
-			(* FreeBSD 9.0 /usr/include/sys/stat.h *)
-				st_dev*: dev_t; (* inode's device *)
-				st_ino*: ino_t; (* inode's number *)
-				st_mode*: mode_t; (* inode protection mode *)
-				st_nlink*: nlink_t; (* number of hard links *)
-				st_uid*: uid_t; (* user ID of the file's owner *)
-				st_gid*: gid_t; (* group ID of the file's group *)
-				st_rdev*: dev_t; (* device type *)
-
-(*
-				st_atim: timespec_t; (* time of last access *)
-				st_mtim: timespec_t; (* time of last data modification *)
-				st_ctim: timespec_t; (* time of last file status change *)
-*)
-				st_atime*: time_t;
-				st_atimensec*: long;
-				st_mtime*: time_t;
-				st_mtimensec*: long;
-				st_ctime*: time_t;
-				st_ctimensec*: long;
-
-				st_size*: off_t; (* file size, in bytes *)
-				st_blocks*: blkcnt_t; (* blocks allocated for file *)
-				st_blksize*: blksize_t; (* optimal blocksize for I/O *)
-				st_flags*: fflags_t; (* user defined flags for file *)
-				st_gen*: uint32_t; (* file generation number *)
-				st_lspare*: int32_t;
-
-(*
-				st_birthtim: timespec_t; (* time of file creation *)
-*)
-				__st_birthtime*: time_t;
-				__st_birthtimensec*: long;
-
-				___pad: ARRAY [untagged] 2 OF INTEGER; (* FreeBSD 9.0: sizeof(struct stat) = 96 B *)
-		END;
-
-		PtrFILE* = PtrVoid;
-		PtrDIR* = PtrVoid;
-
-		PtrDirent* = POINTER TO Dirent;
-		Dirent = RECORD [untagged]
-(*
-			d_name*: ARRAY [untagged] NAME_MAX + 1 OF SHORTCHAR
-*)
-			(* FreeBSD 9.0 /usr/include/sys/dirent.h *)
-				d_fileno*: uint32_t; (* file number of entry *)
-				d_reclen*: uint16_t; (* length of this record *)
-				d_type*: uint8_t; (* file type, see below *)
-				d_namlen*: uint8_t; (* length of string in d_name *)
-				d_name*: ARRAY [untagged] 255 + 1 (* 256 *) OF SHORTCHAR;
-		END;
-
-		timespec_t* = RECORD [untagged]
-			(* FreeBSD 11.0 /usr/include/sys/_timespec.h *)
-				tv_sec*: time_t; (* seconds *)
-				tv_nsec*: long; (* and nanoseconds *)
-		END;
-
-(*
-	VAR
-		stdin*: INTEGER;
-		timezone*: INTEGER; (* or tm.tm_gmtoff *)
-*)
-(*
-	PROCEDURE [ccall] __errno_location* (): PtrVoid;
-*)
-(*
-	(* POSIX.1 *)
-		PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int;
-*)
-(*
-	VAR
-		errno*: INTEGER;
-		stdin* ["__stdinp"]: PtrFILE;
-*)
-
-	PROCEDURE [ccall] __errno_location* ["__error"] (): PtrVoid;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int;
-
-
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] clock* (): clock_t;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] clock_gettime* (clock_id: clockid_t; VAR tp: timespec_t): int;
-
-	PROCEDURE [ccall] mmap* (adr: PtrVoid; len: size_t; prot: intFlags; flags: intFlags; fd: int; offset: off_t): PtrVoid;
-	(* BSD *)
-		PROCEDURE [ccall] munmap* (adr: PtrVoid; len: size_t): int;
-		PROCEDURE [ccall] mprotect* (adr: PtrVoid; len: size_t; prot: intFlags): int;
-
-(*
-	PROCEDURE [ccall] calloc* (nmemb: size_t; size: size_t): PtrVoid;
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] malloc* (size: size_t): PtrVoid;
-*)
-		PROCEDURE [ccall] free* (ptr: PtrVoid);
-
-	(* AT&T *)
-		PROCEDURE [ccall] time* (VAR [nil] t: time_t): time_t;
-	PROCEDURE [ccall] gmtime* (VAR [nil] t: time_t): tm;
-	PROCEDURE [ccall] localtime* (VAR [nil] t: time_t): tm;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] sigsetjmp* (VAR env: sigjmp_buf; savemask: int): int;
-		PROCEDURE [ccall] siglongjmp* (VAR env: sigjmp_buf; val: int);
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] sigemptyset* (VAR set: sigset_t): int;
-		PROCEDURE [ccall] sigfillset* (VAR set: sigset_t): int;
-		PROCEDURE [ccall] sigaddset* (VAR set: sigset_t; signo: int): int;
-		PROCEDURE [ccall] sigprocmask* (how: int; VAR [nil] set: sigset_t; VAR [nil] oset: sigset_t): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] sigaction* (sig: int; VAR [nil] act: sigaction_t; VAR [nil] oact: sigaction_t): int;
-
-	(* BSD *)
-		PROCEDURE [ccall] sigaltstack* (VAR [nil] ss: stack_t; VAR [nil] oss: stack_t): int;
-
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] getenv* (s: PtrSTR): PtrSTR;
-
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] fopen* (path, mode: PtrSTR): PtrFILE;
-		PROCEDURE [ccall] fdopen* (fildes: int; mode: PtrSTR): PtrFILE;
-		PROCEDURE [ccall] fclose* (stream: PtrFILE): int;
-		PROCEDURE [ccall] fread* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t;
-		PROCEDURE [ccall] fwrite* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t;
-		PROCEDURE [ccall] fflush* (s: PtrFILE): int;
-		PROCEDURE [ccall] printf* (s: PtrSTR): int;
-	(* ANSI C 89, XPG4 *)
-		PROCEDURE [ccall] fseek* (stream: PtrFILE; offset: long; whence: int): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] fileno* (stream: PtrFILE): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] rename* (from, to: PtrSTR): int;
-		PROCEDURE [ccall] mkdir* (path: PtrSTR; mode: mode_t): int;
-		PROCEDURE [ccall] opendir* (filename: PtrSTR): PtrDIR;
-		PROCEDURE [ccall] readdir* (dirp: PtrDIR): PtrDirent;
-		PROCEDURE [ccall] closedir* (dirp: PtrDIR): int;
-	(* ANSI C 89, XPG4.2 *)
-		PROCEDURE [ccall] remove* (path: PtrSTR): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] getcwd* (buf: PtrSTR; size: size_t): PtrSTR;
-
-	(* ANSI C 99 *)
-		PROCEDURE [ccall] exit* (status: int);
-
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] strftime* (buf: PtrSTR; maxsize: size_t; format: PtrSTR; timeptr: tm): size_t;
-
-	(* XXX: use fread instead *)
-		PROCEDURE [ccall] fgets* (str: PtrSTR; size: int; stream: PtrFILE): PtrSTR;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] open* (path: PtrSTR; flags: intFlags; mode: mode_t): int;
-		PROCEDURE [ccall] write* (d: int; buf: PtrVoid; nbytes: size_t): ssize_t;
-		PROCEDURE [ccall] read* (d: int; buf: PtrVoid; nbytes: size_t): ssize_t;
-		PROCEDURE [ccall] close* (d: int): int;
-		PROCEDURE [ccall] lseek* (d: int; offset: off_t; whence: int): off_t;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] chmod* (path: PtrSTR; mode: mode_t): int;
-		PROCEDURE [ccall] fchmod* (fd: int; mode: mode_t): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] sysconf* (name: int): long;
-
-	(* POSIX.2 *)
-		PROCEDURE [ccall] system* (string: PtrSTR): int;
-
-	PROCEDURE [ccall] popen* (command, type: PtrSTR): PtrFILE;
-	PROCEDURE [ccall] pclose* (stream: PtrFILE): int;
-
-END LinLibc.

BIN
BlackBox/_FreeBSD_/Lin/Mod/Net.odc


+ 0 - 241
BlackBox/_FreeBSD_/Lin/Mod/Net.txt

@@ -1,241 +0,0 @@
-MODULE LinNet ["libc.so.7"];
-
-	(*
-		FreeBSD 11.0
-		i386
-	*)
-
-	CONST
-		NULL* = 0H;
-
-		SOCKET_ERROR* = -1;
-		INVALID_SOCKET* = -1;
-
-		INADDR_NONE* = -1;
-		INADDR_ANY* = 0;
-
-		(* socket domains *)
-			AF_UNSPEC* = 0; (* unspecified *)
-			AF_UNIX* = 1; (* standardized name for AF_LOCAL *)
-			AF_INET* = 2; (* internetwork: UDP, TCP, etc. *)
-			AF_INET6* = 28; (* IPv6 *)
-
-		(* socket types *)
-			SOCK_STREAM* = 1; (* stream socket *)
-			SOCK_DGRAM* = 2; (* datagram socket *)
-			SOCK_RAW* = 3; (* raw-protocol interface *)
-			SOCK_SEQPACKET* = 5; (* sequenced packet stream *)
-
-		(* socket protocols *)
-			IPPROTO_IP* = 0; (* dummy for IP *)
-			IPPROTO_ICMP* = 1; (* control message protocol *)
-			IPPROTO_TCP* = 6; (* tcp *)
-			IPPROTO_UDP* = 17; (* user datagram protocol *)
-
-		(* socket options *)
-			SO_DEBUG* = {0}; (* turn on debugging info recording *)
-			SO_ACCEPTCONN* = {1}; (* socket has had listen() *)
-			SO_REUSEADDR* = {2}; (* allow local address reuse *)
-			SO_KEEPALIVE* = {3}; (* keep connections alive *)
-			SO_DONTROUTE* = {4}; (* just use interface addresses *)
-			SO_BROADCAST* = {5}; (* permit sending of broadcast msgs *)
-			SO_LINGER* = {7}; (* linger on close if data present *)
-			SO_OOBINLINE* = {8}; (* leave received OOB data in line *)
-			SO_NO_OFFLOAD* = {14}; (* socket cannot be offloaded *)
-			SO_NO_DDP* = {15}; (* disable direct data placement *)
-			SO_SNDBUF* = {0,12}; (* send buffer size *)
-			SO_RCVBUF* = {1,12}; (* receive buffer size *)
-			SO_SNDLOWAT* = {0,1,12}; (* send low-water mark *)
-			SO_RCVLOWAT* = {2,12}; (* receive low-water mark *)
-			SO_SNDTIMEO* = {0,2,12}; (* send timeout *)
-			SO_RCVTIMEO* = {1,2,12}; (* receive timeout *)
-			SO_ERROR* = {0..2,12}; (* get error status and clear *)
-			SO_TYPE* = {3,12}; (* get socket type *)
-
-		SHUT_RD* = 0; (* shut down the reading side *)
-		SHUT_WR* = 1; (* shut down the writing side *)
-		SHUT_RDWR* = 2; (* shut down both sides *)
-
-		SOL_SOCKET* = 0FFFFH; (* {0..15} *) (* options for socket level *)
-
-		MSG_OOB* = {0}; (* process out-of-band data *)
-		MSG_PEEK* = {1}; (* peek at incoming message *)
-		MSG_DONTROUTE* = {2}; (* send without using routing tables *)
-		MSG_EOR* = {3}; (* data completes record *)
-		MSG_TRUNC* = {4}; (* data discarded before delivery *)
-		MSG_CTRUNC* = {5}; (* control data lost before delivery *)
-		MSG_WAITALL* = {6}; (* wait for full request or error *)
-
-		SOMAXCONN* = 128;
-
-		(* addrinfo.ai_flags *)
-			AI_PASSIVE* = {0}; (* get address to use bind() *)
-			AI_CANONNAME* = {1}; (* fill ai_canonname *)
-			AI_NUMERICHOST* = {2}; (* prevent host name resolution *)
-			AI_NUMERICSERV* = {3}; (* prevent service name resolution *)
-			AI_ALL* = {8}; (* IPv6 and IPv4-mapped (with AI_V4MAPPED) *)
-			AI_V4MAPPED_CFG* = {9}; (* accept IPv4-mapped if kernel supports *)
-			AI_ADDRCONFIG* = {10}; (* only if any address is assigned *)
-			AI_V4MAPPED* = {11}; (* accept IPv4-mapped IPv6 address *)
-
-		(* getaddrinfo/getnameinfo/gai_strerror error codes *)
-			EAI_AGAIN* = 2; (* temporary failure in name resolution *)
-			EAI_BADFLAGS* = 3; (* invalid value for ai_flags *)
-			EAI_FAIL* = 4; (* non-recoverable failure in name resolution *)
-			EAI_FAMILY* = 5; (* ai_family not supported *)
-			EAI_MEMORY* = 6; (* memory allocation failure *)
-			EAI_NONAME* = 8; (* hostname nor servname provided, or not known *)
-			EAI_SERVICE* = 9; (* servname not supported for ai_socktype *)
-			EAI_SOCKTYPE* = 10; (* ai_socktype not supported *)
-			EAI_SYSTEM* = 11; (* system error returned in errno *)
-			EAI_BADHINTS* = 12; (* invalid value for hints *)
-			EAI_PROTOCOL* = 13; (* resolved protocol is unknown *)
-			EAI_OVERFLOW* = 14; (* argument buffer overflow *)
-			EAI_MAX* = 15;
-
-		(* FreeBSD 11.0 /usr/include/sys/select.h *)
-			FD_SETSIZE = 1024;
-			_NFDBITS = 8 * 4;
-
-	TYPE
-		u_int8_t = SHORTCHAR;
-		int8_t = SHORTCHAR;
-		uint16_t = SHORTINT;
-		(* PtrVoid, int, intFlags, short, socklen_t, size_t, ssize_t, in_addr_t, in_port_t, time_t, suseconds_t, nfds_t, sa_family_t *)
-		PtrVoid* = INTEGER;
-		short* = SHORTINT;
-		int* = INTEGER;
-		intFlags* = SET;
-		size_t* = INTEGER;
-		ssize_t* = INTEGER;
-		time_t* = INTEGER;
-		suseconds_t* = INTEGER;
-		socklen_t* = INTEGER;
-		in_addr_t* = INTEGER;
-		in_port_t* = SHORTINT;
-		nfds_t* = INTEGER;
-		sa_family_t* = SHORTCHAR;
-
-		PtrSTR* = POINTER [untagged] TO ARRAY [untagged] OF SHORTCHAR;
-
-		SOCKET* = int;
-
-(*
-		in_addr* = RECORD [untagged]
-			s_addr*: in_addr_t;
-		END;
-*)
-		in_addr* = RECORD [untagged]
-			S_un*: RECORD [union]
-				S_un_b*: RECORD [untagged]
-					s_b1*: SHORTCHAR;
-					s_b2*: SHORTCHAR;
-					s_b3*: SHORTCHAR;
-					s_b4*: SHORTCHAR;
-				END;
-				S_un_w*: RECORD [untagged]
-					s_w1*: SHORTINT;
-					s_w2*: SHORTINT;
-				END;
-				S_addr*: in_addr_t;
-			END;
-		END;
-
-		Ptrsockaddr* = POINTER [untagged] TO sockaddr;
-		sockaddr* = RECORD [untagged]
-			(* FreeBSD 11.0 /usr/include/sys/socket.h *)
-				sa_len*: SHORTCHAR; (* total length *)
-				sa_family*: sa_family_t; (* address family *)
-				sa_data*: ARRAY [untagged] 14 OF SHORTCHAR; (* actually longer; address value *)
-		END;
-
-		Ptrsockaddr_storage = POINTER [untagged] TO sockaddr_storage;
-		sockaddr_storage* = RECORD [untagged]
-			(* FreeBSD 11.0 /usr/include/sys/_sockaddr_storage.h *)
-				ss_len*: SHORTCHAR; (* address length *)
-				ss_family*: sa_family_t; (* address family *)
-				__ss_pad1: ARRAY [untagged] 8 - 2 OF SHORTCHAR;
-				__ss_align: LONGINT; (* force desired struct alignment *)
-				__ss_pad2: ARRAY [untagged] 128 - 1 - 1 - (8 - 2) - 8 OF SHORTCHAR;
-		END;
-
-		Ptrsockaddr_in* = POINTER [untagged] TO sockaddr_in;
-		sockaddr_in* = RECORD [untagged]
-			(* FreeBSD 11.0 /usr/include/netinet/in.h *)
-				sin_len*: SHORTCHAR;
-				sin_family*: sa_family_t;
-				sin_port*: in_port_t;
-				sin_addr*: in_addr;
-				sin_zero*: ARRAY [untagged] 8 OF SHORTCHAR;
-		END;
-
-		Ptraddrinfo* = POINTER [untagged] TO addrinfo;
-		addrinfo* = RECORD [untagged]
-			(* FreeBSD 11.0 /usr/include/netdb.h *)
-				ai_flags*: intFlags;
-				ai_family*: int;
-				ai_socktype*: int;
-				ai_protocol*: int;
-				ai_addrlen*: socklen_t;
-				ai_canonname*: PtrSTR;
-				ai_addr*: Ptrsockaddr;
-				ai_next*: Ptraddrinfo;
-		END;
-
-		timeval* = RECORD [untagged]
-			(* Linux, FreeBSD, OpenBSD *)
-				tv_sec*: time_t; (* seconds *)
-				tv_usec*: suseconds_t; (* and microseconds *)
-		END;
-
-		pollfd* = RECORD [untagged]
-			(* Linux, FreeBSD, OpenBSD *)
-				fd*: int;
-				events*: short;
-				revents*: short;
-		END;
-
-		(* FreeBSD 11.0 /usr/include/sys/select.h *)
-			__fd_mask = SET;
-			fd_set* = ARRAY [untagged] (FD_SETSIZE + (_NFDBITS - 1)) DIV _NFDBITS OF __fd_mask;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] socket* (domain: int; type: int; protocol: int): SOCKET;
-		PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET;
-		PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int;
-		PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int;
-		PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): int;
-		PROCEDURE [ccall] listen* (s: SOCKET; backlog: int): int;
-		PROCEDURE [ccall] recv* (s: SOCKET; buf: PtrVoid; len: size_t; flags: intFlags): ssize_t;
-		PROCEDURE [ccall] send* (s: SOCKET; msg: PtrVoid; len: size_t; flags: intFlags): ssize_t;
-		PROCEDURE [ccall] shutdown* (s: SOCKET; how: int): int;
-		PROCEDURE [ccall] getsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; VAR [nil] optlen: socklen_t): int;
-		PROCEDURE [ccall] setsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; optlen: socklen_t): int;
-
-		PROCEDURE [ccall] inet_addr* (cp: PtrSTR): in_addr_t;
-		PROCEDURE [ccall] htons* (host16: uint16_t): uint16_t;
-
-		PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): int;
-
-		PROCEDURE [ccall] poll* (VAR fds: ARRAY [untagged] OF pollfd; nfds: nfds_t; timeout: int): int;
-
-(*
-	PROCEDURE FD_ZERO (VAR set: Net.fd_set);
-		VAR i: INTEGER;
-	BEGIN
-		i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0
-	END FD_ZERO;
-
-	PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set);
-	BEGIN
-		INCL(set[fd DIV 32], fd MOD 32)
-	END FD_SET;
-*)
-
-	(* POSIX.1g *)
-		PROCEDURE [ccall] getaddrinfo* (hostname: PtrSTR; servname: PtrSTR; VAR [nil] hints: addrinfo; VAR res: Ptraddrinfo): int;
-		PROCEDURE [ccall] freeaddrinfo* (ai: Ptraddrinfo);
-
-		PROCEDURE [ccall] gai_strerror* (ecode: int): PtrSTR;
-
-END LinNet.

+ 1 - 0
BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/txt2odc.py

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

+ 5 - 2
BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/Makefile

@@ -10,7 +10,10 @@ PY = python2.7
 
 DEFS = defs-basictypes defs-lc
 
-all: LibW.txt ${DEFS}
+all: LibW.odc ${DEFS}
+
+LibW.odc: LibW.txt
+	./txt2odc.py LibW.txt LibW.odc
 
 LibW.txt: LibW.txt.templ ${DEFS} libver osname machine
 	${PY} ./untempl.py LibW.txt.templ ${.TARGET}
@@ -22,4 +25,4 @@ defs-lc:
 	./dumpdefs.py 2 1 i ${INCDIR}/locale.h | grep "	LC_" > ${.TARGET}
 
 clean:
-	rm -f ${DEFS} LibW.txt sizeofs
+	rm -f ${DEFS} LibW.txt LibW.odc sizeofs

+ 1 - 0
BlackBox/_FreeBSD_/Lin/Mod/gen-LibW/txt2odc.py

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

+ 5 - 2
BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/Makefile

@@ -10,7 +10,10 @@ PY = python2.7
 
 DEFS = clockspersec defs-map defs-prot defs-sigmask defs-signo defs-fpe defs-sa defs-errno namemax defs-fcntlo defs-basictypes defs-sc
 
-all: Libc.txt ${DEFS} strerrnocase.txt
+all: Libc.odc ${DEFS} strerrnocase.txt
+
+Libc.odc: Libc.txt
+	./txt2odc.py Libc.txt Libc.odc
 
 Libc.txt: Libc.txt.templ ${DEFS} libver osname machine custom fields-dirent fields-sigaction fields-siginfo fields-stack fields-stat fields-tm fields-ucontext
 	${PY} ./untempl.py Libc.txt.templ ${.TARGET}
@@ -73,4 +76,4 @@ strerrnocase.txt: dumpstrerrno
 	./dumpstrerrno | ./mkstrerrnocase.py > ${.TARGET}
 
 clean:
-	rm -f ${DEFS} Libc.txt dumpstrerrno dumpstrerrno.c strerrnocase.txt sizeofs
+	rm -f ${DEFS} Libc.txt Libc.odc dumpstrerrno dumpstrerrno.c strerrnocase.txt sizeofs

+ 1 - 0
BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/txt2odc.py

@@ -0,0 +1 @@
+../../../../_OpenBSD_/Lin/Mod/gen-Libc/txt2odc.py

+ 5 - 2
BlackBox/_FreeBSD_/Lin/Mod/gen-Net/Makefile

@@ -10,7 +10,10 @@ PY = python2.7
 
 DEFS = defs-basictypes defs-af defs-sock defs-proto defs-shut defs-so defs-sol defs-msg defs-ai defs-eai defs-somaxconn
 
-all: Net.txt ${DEFS}
+all: Net.odc ${DEFS}
+
+Net.odc: Net.txt
+	./txt2odc.py Net.txt Net.odc
 
 Net.txt: Net.txt.templ ${DEFS} libver osname machine fields-sockaddr fields-sockaddr_in fields-sockaddr_storage fields-addrinfo defs-fd_set-const defs-fd_set-type
 	${PY} ./untempl.py Net.txt.templ ${.TARGET}
@@ -49,4 +52,4 @@ defs-eai:
 	./dumpdefs.py 3 1 i ${INCDIR}/netdb.h | grep "	EAI_" > ${.TARGET}
 
 clean:
-	rm -f ${DEFS} Net.txt sizeofs
+	rm -f ${DEFS} Net.txt Net.odc sizeofs

+ 1 - 0
BlackBox/_FreeBSD_/Lin/Mod/gen-Net/txt2odc.py

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

+ 0 - 30
BlackBox/_Linux_/Lin/Mod/Dl.txt

@@ -1,30 +0,0 @@
-MODULE LinDl ["libdl.so.2"];
-
-	(* THIS IS TEXT COPY OF OpenBUGS Lin/Mod/Dl.odc *)
-	(* DO NOT EDIT *)
-
-	IMPORT SYSTEM;
-
-	CONST
-		(* dlOpen mode parameters *)
-		RTLD_LAZY* = 01H;	(* Lazy function call binding. *)
-		RTLD_NOW* = 02H;	(* Immediate function call binding. *)
-		RTLD_BINDING_MASK* = 03H;	(* Mask of binding time value. *)
-		RTLD_NOLOAD* = 04H;	(* Do not load the object. *)
-		RTLD_LOCAL* = 0;
-		RTLD_GLOBAL* = 100H;
-		RTDL_NODELETE* = 1000H;
-		
-		NULL* = 0;
-
-	TYPE
-		PtrVoid* = INTEGER;
-		HANDLE* = PtrVoid;
-		PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR;
-
-	PROCEDURE [ccall] dlopen* (file: PtrSTR; mode: INTEGER): HANDLE; 
-	PROCEDURE [ccall] dlsym* (handle: HANDLE; name: PtrSTR): HANDLE; 
-	PROCEDURE [ccall] dlclose* (handle: HANDLE): INTEGER;
-	PROCEDURE [ccall] dlerror* (): PtrSTR;
-
-END LinDl.

+ 0 - 22
BlackBox/_Linux_/Lin/Mod/Iconv.txt

@@ -1,22 +0,0 @@
-MODULE LinIconv ["libc.so.6"];
-
-	IMPORT Libc := LinLibc;
-
-	TYPE
-		PtrVoid = Libc.PtrVoid;
-		PtrSTR* = Libc.PtrSTR;
-		PtrLSTR* = POINTER TO ARRAY [untagged] OF CHAR;
-		size_t* = Libc.size_t;
-
-		iconv_t* = PtrVoid;
-
-	PROCEDURE [ccall] iconv_open* (tocode, fromcode: PtrSTR): iconv_t;
-	PROCEDURE [ccall] iconv_close* (cd: iconv_t): INTEGER;
-
-	PROCEDURE [ccall] iconv* (cd: iconv_t; VAR [nil] inbuf: PtrSTR; VAR inbytesleft: size_t; VAR [nil] outbuf: PtrSTR; VAR outbytesleft: size_t): size_t;
-
-	PROCEDURE [ccall] iconv_encode* ["iconv"] (cd: iconv_t; VAR [nil] inbuf: PtrLSTR; VAR inbytesleft: size_t; VAR [nil] outbuf: PtrSTR; VAR outbytesleft: size_t): size_t;
-
-	PROCEDURE [ccall] iconv_decode* ["iconv"] (cd: iconv_t; VAR [nil] inbuf: PtrSTR; VAR inbytesleft: size_t; VAR [nil] outbuf: PtrLSTR; VAR outbytesleft: size_t): size_t;
-
-END LinIconv.

BIN
BlackBox/_Linux_/Lin/Mod/Ioctl.odc


+ 0 - 37
BlackBox/_Linux_/Lin/Mod/Ioctl.txt

@@ -1,37 +0,0 @@
-MODULE LinIoctl ["libc.so.6"];
-
-	(*
-		GNU/Linux
-		i386
-	*)
-
-	CONST
-		TIOCM_LE* = {0};
-		TIOCM_DTR* = {1};
-		TIOCM_RTS* = {2};
-		TIOCM_ST* = {3};
-		TIOCM_SR* = {4};
-		TIOCM_CTS* = {5};
-		TIOCM_CAR* = {6};
-		TIOCM_RNG* = {7};
-		TIOCM_DSR* = {8};
-
-		FIOCLEX* = 21585;
-		FIONCLEX* = 21584;
-		FIONREAD* = 21531;
-		FIONBIO* = 21537;
-		FIOASYNC* = 21586;
-		TIOCMGET* = 21525;
-		TIOCMSET* = 21528;
-		TIOCEXCL* = 21516;
-		TIOCNXCL* = 21517;
-		TIOCOUTQ* = 21521;
-		TIOCSBRK* = 21543;
-		TIOCCBRK* = 21544;
-		TIOCMBIS* = 21526;
-		TIOCMBIC* = 21527;
-
-	PROCEDURE [ccall] ioctl0* ["ioctl"] (d: INTEGER; req: INTEGER): INTEGER;
-	PROCEDURE [ccall] ioctl1* ["ioctl"] (d: INTEGER; req: INTEGER; VAR arg: INTEGER): INTEGER;
-
-END LinIoctl.

BIN
BlackBox/_Linux_/Lin/Mod/LibW.odc


+ 0 - 65
BlackBox/_Linux_/Lin/Mod/LibW.txt

@@ -1,65 +0,0 @@
-MODULE LinLibW ["libc.so.6"];
-
-	(*
-		GNU/Linux
-		i386
-	*)
-
-	IMPORT Libc := LinLibc;
-
-	CONST
-		LC_CTYPE* = 0;
-		LC_NUMERIC* = 1;
-		LC_TIME* = 2;
-		LC_COLLATE* = 3;
-		LC_MONETARY* = 4;
-		LC_MESSAGES* = 5;
-		LC_ALL* = 6;
-		LC_PAPER* = 7;
-		LC_NAME* = 8;
-		LC_ADDRESS* = 9;
-		LC_TELEPHONE* = 10;
-		LC_MEASUREMENT* = 11;
-		LC_IDENTIFICATION* = 12;
-
-	TYPE
-		(* int, wchar_t, wint_t, size_t, mbstate_t *)
-		int* = INTEGER;
-		wchar_t* = INTEGER;
-		wint_t* = INTEGER;
-		size_t* = INTEGER;
-		mbstate_t* = LONGINT;
-
-		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.

BIN
BlackBox/_Linux_/Lin/Mod/Libc.odc


+ 0 - 698
BlackBox/_Linux_/Lin/Mod/Libc.txt

@@ -1,698 +0,0 @@
-MODULE LinLibc ["libc.so.6"];
-
-	(*
-		GNU/Linux (Ubuntu 17.10)
-		i386
-	*)
-
-	CONST
-		NULL* = 0H;
-		FALSE* = 0;
-		TRUE* = 1;
-
-		CLOCKS_PER_SEC* = 1000000;
-
-		MAP_FAILED* = -1;
-
-		(* MAP_PRIVATE, MAP_ANON (intFlags) *)
-		MAP_SHARED* = {0}; (* Share changes *)
-		MAP_PRIVATE* = {1}; (* Changes are private *)
-		MAP_SHARED_VALIDATE* = {0,1}; (* share + validate extension flags *)
-		MAP_TYPE* = {0..3}; (* Mask for type of mapping *)
-		MAP_FIXED* = {4}; (* Interpret addr exactly *)
-		MAP_ANONYMOUS* = {5}; (* don't use a file *)
-		MAP_FILE* = {};
-		MAP_ANON* = MAP_ANONYMOUS;
-
-
-		(* PROT_READ, PROT_WRITE, PROT_EXEC (intFlags) *)
-		PROT_READ* = {0}; (* page can be read *)
-		PROT_WRITE* = {1}; (* page can be written *)
-		PROT_EXEC* = {2}; (* page can be executed *)
-		PROT_SEM* = {3}; (* page may be used for atomic ops *)
-		PROT_NONE* = {}; (* page can not be accessed *)
-		PROT_GROWSDOWN* = {24}; (* mprotect flag: extend change to start of growsdown vma *)
-		PROT_GROWSUP* = {25}; (* mprotect flag: extend change to end of growsup vma *)
-
-
-		(* SIG_UNBLOCK, SIG_SETMASK (int) *)
-		SIG_BLOCK* = 0; (* for blocking signals *)
-		SIG_UNBLOCK* = 1; (* for unblocking signals *)
-		SIG_SETMASK* = 2; (* for setting the signal mask *)
-
-
-		(* FPE_INTDIV, FPE_INTOVF, FPE_FLTDIV, FPE_FLTOVF, FPE_FLTUND, FPE_FLTRES, FPE_FLTINV, FPE_FLTSUB (int) *)
-		FPE_INTDIV* = 1; (* integer divide by zero *)
-		FPE_INTOVF* = 2; (* integer overflow *)
-		FPE_FLTDIV* = 3; (* floating point divide by zero *)
-		FPE_FLTOVF* = 4; (* floating point overflow *)
-		FPE_FLTUND* = 5; (* floating point underflow *)
-		FPE_FLTRES* = 6; (* floating point inexact result *)
-		FPE_FLTINV* = 7; (* floating point invalid operation *)
-		FPE_FLTSUB* = 8; (* subscript out of range *)
-
-
-		(* SA_SIGINFO (intFlags) *)
-		SA_NOCLDSTOP* = {0};
-		SA_NOCLDWAIT* = {1};
-		SA_SIGINFO* = {2};
-		SA_ONSTACK* = {27};
-		SA_RESTART* = {28};
-		SA_NODEFER* = {30};
-		SA_RESETHAND* = {31};
-
-
-		(* SIGINT, SIGILL, SIGFPE, SIGSEGV, SIGKILL, SIGSTOP, SIGWINCH, SIGTHR (int) *)
-		SIGHUP* = 1;
-		SIGINT* = 2;
-		SIGQUIT* = 3;
-		SIGILL* = 4;
-		SIGTRAP* = 5;
-		SIGABRT* = 6;
-		SIGIOT* = 6;
-		SIGBUS* = 7;
-		SIGFPE* = 8;
-		SIGKILL* = 9;
-		SIGUSR1* = 10;
-		SIGSEGV* = 11;
-		SIGUSR2* = 12;
-		SIGPIPE* = 13;
-		SIGALRM* = 14;
-		SIGTERM* = 15;
-		SIGSTKFLT* = 16;
-		SIGCHLD* = 17;
-		SIGCONT* = 18;
-		SIGSTOP* = 19;
-		SIGTSTP* = 20;
-		SIGTTIN* = 21;
-		SIGTTOU* = 22;
-		SIGURG* = 23;
-		SIGXCPU* = 24;
-		SIGXFSZ* = 25;
-		SIGVTALRM* = 26;
-		SIGPROF* = 27;
-		SIGWINCH* = 28;
-		SIGIO* = 29;
-		SIGPOLL* = SIGIO;
-		SIGLOST* = 29;
-		SIGPWR* = 30;
-		SIGSYS* = 31;
-		SIGUNUSED* = 31;
-		SIGRTMIN* = 32;
-
-		_NSIG* = 64;
-
-		(* SIG_DFL, SIG_IGN, SIG_ERR *)
-			SIG_DFL* = 0;
-			SIG_IGN* = 1;
-			SIG_ERR* = -1;
-
-(*
-		PAGE_SIZE* = 4096;
-*)
-		_SC_PAGESIZE* = 30;
-
-
-		SIGSTKSZ* = 8192;
-
-		(* ENOENT, EEXIST, EACCES, ENOMEM, EDQUOT, EMFILE, ENOTDIR (int) *)
-		EPERM* = 1; (* Operation not permitted *)
-		ENOENT* = 2; (* No such file or directory *)
-		ESRCH* = 3; (* No such process *)
-		EINTR* = 4; (* Interrupted system call *)
-		EIO* = 5; (* I/O error *)
-		ENXIO* = 6; (* No such device or address *)
-		E2BIG* = 7; (* Argument list too long *)
-		ENOEXEC* = 8; (* Exec format error *)
-		EBADF* = 9; (* Bad file number *)
-		ECHILD* = 10; (* No child processes *)
-		EAGAIN* = 11; (* Try again *)
-		ENOMEM* = 12; (* Out of memory *)
-		EACCES* = 13; (* Permission denied *)
-		EFAULT* = 14; (* Bad address *)
-		ENOTBLK* = 15; (* Block device required *)
-		EBUSY* = 16; (* Device or resource busy *)
-		EEXIST* = 17; (* File exists *)
-		EXDEV* = 18; (* Cross-device link *)
-		ENODEV* = 19; (* No such device *)
-		ENOTDIR* = 20; (* Not a directory *)
-		EISDIR* = 21; (* Is a directory *)
-		EINVAL* = 22; (* Invalid argument *)
-		ENFILE* = 23; (* File table overflow *)
-		EMFILE* = 24; (* Too many open files *)
-		ENOTTY* = 25; (* Not a typewriter *)
-		ETXTBSY* = 26; (* Text file busy *)
-		EFBIG* = 27; (* File too large *)
-		ENOSPC* = 28; (* No space left on device *)
-		ESPIPE* = 29; (* Illegal seek *)
-		EROFS* = 30; (* Read-only file system *)
-		EMLINK* = 31; (* Too many links *)
-		EPIPE* = 32; (* Broken pipe *)
-		EDOM* = 33; (* Math argument out of domain of func *)
-		ERANGE* = 34; (* Math result not representable *)
-		EDEADLK* = 35; (* Resource deadlock would occur *)
-		ENAMETOOLONG* = 36; (* File name too long *)
-		ENOLCK* = 37; (* No record locks available *)
-		ENOSYS* = 38; (* Invalid system call number *)
-		ENOTEMPTY* = 39; (* Directory not empty *)
-		ELOOP* = 40; (* Too many symbolic links encountered *)
-		EWOULDBLOCK* = EAGAIN; (* Operation would block *)
-		ENOMSG* = 42; (* No message of desired type *)
-		EIDRM* = 43; (* Identifier removed *)
-		ECHRNG* = 44; (* Channel number out of range *)
-		EL2NSYNC* = 45; (* Level 2 not synchronized *)
-		EL3HLT* = 46; (* Level 3 halted *)
-		EL3RST* = 47; (* Level 3 reset *)
-		ELNRNG* = 48; (* Link number out of range *)
-		EUNATCH* = 49; (* Protocol driver not attached *)
-		ENOCSI* = 50; (* No CSI structure available *)
-		EL2HLT* = 51; (* Level 2 halted *)
-		EBADE* = 52; (* Invalid exchange *)
-		EBADR* = 53; (* Invalid request descriptor *)
-		EXFULL* = 54; (* Exchange full *)
-		ENOANO* = 55; (* No anode *)
-		EBADRQC* = 56; (* Invalid request code *)
-		EBADSLT* = 57; (* Invalid slot *)
-		EDEADLOCK* = EDEADLK;
-		EBFONT* = 59; (* Bad font file format *)
-		ENOSTR* = 60; (* Device not a stream *)
-		ENODATA* = 61; (* No data available *)
-		ETIME* = 62; (* Timer expired *)
-		ENOSR* = 63; (* Out of streams resources *)
-		ENONET* = 64; (* Machine is not on the network *)
-		ENOPKG* = 65; (* Package not installed *)
-		EREMOTE* = 66; (* Object is remote *)
-		ENOLINK* = 67; (* Link has been severed *)
-		EADV* = 68; (* Advertise error *)
-		ESRMNT* = 69; (* Srmount error *)
-		ECOMM* = 70; (* Communication error on send *)
-		EPROTO* = 71; (* Protocol error *)
-		EMULTIHOP* = 72; (* Multihop attempted *)
-		EDOTDOT* = 73; (* RFS specific error *)
-		EBADMSG* = 74; (* Not a data message *)
-		EOVERFLOW* = 75; (* Value too large for defined data type *)
-		ENOTUNIQ* = 76; (* Name not unique on network *)
-		EBADFD* = 77; (* File descriptor in bad state *)
-		EREMCHG* = 78; (* Remote address changed *)
-		ELIBACC* = 79; (* Can not access a needed shared library *)
-		ELIBBAD* = 80; (* Accessing a corrupted shared library *)
-		ELIBSCN* = 81; (* .lib section in a.out corrupted *)
-		ELIBMAX* = 82; (* Attempting to link in too many shared libraries *)
-		ELIBEXEC* = 83; (* Cannot exec a shared library directly *)
-		EILSEQ* = 84; (* Illegal byte sequence *)
-		ERESTART* = 85; (* Interrupted system call should be restarted *)
-		ESTRPIPE* = 86; (* Streams pipe error *)
-		EUSERS* = 87; (* Too many users *)
-		ENOTSOCK* = 88; (* Socket operation on non-socket *)
-		EDESTADDRREQ* = 89; (* Destination address required *)
-		EMSGSIZE* = 90; (* Message too long *)
-		EPROTOTYPE* = 91; (* Protocol wrong type for socket *)
-		ENOPROTOOPT* = 92; (* Protocol not available *)
-		EPROTONOSUPPORT* = 93; (* Protocol not supported *)
-		ESOCKTNOSUPPORT* = 94; (* Socket type not supported *)
-		EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *)
-		EPFNOSUPPORT* = 96; (* Protocol family not supported *)
-		EAFNOSUPPORT* = 97; (* Address family not supported by protocol *)
-		EADDRINUSE* = 98; (* Address already in use *)
-		EADDRNOTAVAIL* = 99; (* Cannot assign requested address *)
-		ENETDOWN* = 100; (* Network is down *)
-		ENETUNREACH* = 101; (* Network is unreachable *)
-		ENETRESET* = 102; (* Network dropped connection because of reset *)
-		ECONNABORTED* = 103; (* Software caused connection abort *)
-		ECONNRESET* = 104; (* Connection reset by peer *)
-		ENOBUFS* = 105; (* No buffer space available *)
-		EISCONN* = 106; (* Transport endpoint is already connected *)
-		ENOTCONN* = 107; (* Transport endpoint is not connected *)
-		ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *)
-		ETOOMANYREFS* = 109; (* Too many references: cannot splice *)
-		ETIMEDOUT* = 110; (* Connection timed out *)
-		ECONNREFUSED* = 111; (* Connection refused *)
-		EHOSTDOWN* = 112; (* Host is down *)
-		EHOSTUNREACH* = 113; (* No route to host *)
-		EALREADY* = 114; (* Operation already in progress *)
-		EINPROGRESS* = 115; (* Operation now in progress *)
-		ESTALE* = 116; (* Stale file handle *)
-		EUCLEAN* = 117; (* Structure needs cleaning *)
-		ENOTNAM* = 118; (* Not a XENIX named type file *)
-		ENAVAIL* = 119; (* No XENIX semaphores available *)
-		EISNAM* = 120; (* Is a named type file *)
-		EREMOTEIO* = 121; (* Remote I/O error *)
-		EDQUOT* = 122; (* Quota exceeded *)
-		ENOMEDIUM* = 123; (* No medium found *)
-		EMEDIUMTYPE* = 124; (* Wrong medium type *)
-		ECANCELED* = 125; (* Operation Canceled *)
-		ENOKEY* = 126; (* Required key not available *)
-		EKEYEXPIRED* = 127; (* Key has expired *)
-		EKEYREVOKED* = 128; (* Key has been revoked *)
-		EKEYREJECTED* = 129; (* Key was rejected by service *)
-		EOWNERDEAD* = 130; (* Owner died *)
-		ENOTRECOVERABLE* = 131; (* State not recoverable *)
-		ERFKILL* = 132; (* Operation not possible due to RF-kill *)
-		EHWPOISON* = 133; (* Memory page has hardware error *)
-
-
-		WAIT_ANY* = -1;
-		WCONTINUED* = {3};
-		WNOHANG* = {0};
-		WUNTRACED* = {1};
-
-
-		NAME_MAX* = 255;
-
-		SEEK_SET* = 0;
-		SEEK_CUR* = 1;
-		SEEK_END* = 2;
-
-		STDIN_FILENO* = 0;
-		STDOUT_FILENO* = 1;
-		STDERR_FILENO* = 2;
-
-		P_tmpdir* = "/tmp";
-
-		(* O_RDWR, O_NONBLOCK (intFlags) *)
-		O_ACCMODE* = {0,1};
-		O_RDONLY* = {};
-		O_WRONLY* = {0};
-		O_RDWR* = {1};
-		O_CREAT* = {6}; (* not fcntl *)
-		O_EXCL* = {7}; (* not fcntl *)
-		O_NOCTTY* = {8}; (* not fcntl *)
-		O_TRUNC* = {9}; (* not fcntl *)
-		O_APPEND* = {10};
-		O_NONBLOCK* = {11};
-		O_DSYNC* = {12}; (* used to be O_SYNC, see below *)
-		O_DIRECT* = {14}; (* direct disk access hint *)
-		O_LARGEFILE* = {15};
-		O_DIRECTORY* = {16}; (* must be a directory *)
-		O_NOFOLLOW* = {17}; (* don't follow links *)
-		O_NOATIME* = {18};
-		O_CLOEXEC* = {19}; (* set close_on_exec *)
-		O_PATH* = {21};
-
-
-		CLOCK_REALTIME* = 0;
-		CLOCK_MONOTONIC* = 1;
-		CLOCK_PROCESS_CPUTIME_ID* = 2;
-		CLOCK_THREAD_CPUTIME_ID* = 3;
-		CLOCK_MONOTONIC_RAW* = 4;
-		CLOCK_REALTIME_COARSE* = 5;
-		CLOCK_MONOTONIC_COARSE* = 6;
-		CLOCK_BOOTTIME* = 7;
-		CLOCK_REALTIME_ALARM* = 8;
-		CLOCK_BOOTTIME_ALARM* = 9;
-		CLOCK_SGI_CYCLE* = 10;
-		CLOCK_TAI* = 11;
-
-
-	TYPE
-		StrArray* = POINTER TO ARRAY [untagged] OF PtrSTR;
-		PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR;
-
-		(* PtrVoid, int, long, size_t, ssize_t, off_t, time_t, clock_t, sigjmp_buf *)
-		(* mode_t, intFlags, sigset_t (set) *)
-		PtrVoid* = INTEGER;
-		int* = INTEGER;
-		long* = INTEGER;
-		ulong* = INTEGER;
-		size_t* = INTEGER;
-		ssize_t* = INTEGER;
-		off_t* = INTEGER;
-		clock_t* = INTEGER;
-		clockid_t* = INTEGER;
-		time_t* = INTEGER;
-		mode_t* = SET;
-		pid_t* = INTEGER;
-		uid_t* = INTEGER;
-		gid_t* = INTEGER;
-		dev_t* = LONGINT;
-		ino_t* = INTEGER;
-		nlink_t* = INTEGER;
-		blkcnt_t = INTEGER;
-		blksize_t = INTEGER;
-		int8_t* = SHORTCHAR;
-		u_int8_t* = SHORTCHAR;
-		int16_t* = SHORTINT;
-		u_int16_t* = SHORTINT;
-		int32_t* = INTEGER;
-		u_int32_t* = INTEGER;
-		int64_t* = LONGINT;
-		u_int64_t* = LONGINT;
-		wchar_t* = INTEGER;
-		sigjmp_buf* = ARRAY [untagged] 39 OF INTEGER;
-		intFlags* = SET;
-		FILE = ARRAY [untagged] 37 OF INTEGER;
-		sigset_t* = ARRAY [untagged] 128 OF BYTE;
-		PtrSigset_t* = POINTER [untagged] TO sigset_t;
-
-
-		tm* = POINTER TO tmDesc;
-		tmDesc* = RECORD [untagged]
-			(* NOTE: check record size *)
-			(* tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday [ , tm_gmtoff ] *)
-			(* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/struct_tm.h: *)
-				tm_sec*: int; (* Seconds.     [0-60] (1 leap second) *)
-				tm_min*: int; (* Minutes.     [0-59] *)
-				tm_hour*: int; (* Hours.       [0-23] *)
-				tm_mday*: int; (* Day.         [1-31] *)
-				tm_mon*: int; (* Month.       [0-11] *)
-				tm_year*: int; (* Year - 1900.  *)
-				tm_wday*: int; (* Day of week. [0-6] *)
-				tm_yday*: int; (* Days in year.[0-365] *)
-				tm_isdst*: int; (* DST.         [-1/0/1] *)
-
-				tm_gmtoff*: int; (* long int *) (* Seconds east of UTC *)
-				tm_zone*: PtrSTR; (* Timezone abbreviation *)
-		END;
-
-		Ptrsiginfo_t* = POINTER TO siginfo_t;
-		siginfo_t = RECORD [untagged]
-			(* si_code, fault address *)
-			(* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/siginfo_t.h: *)
-				si_signo*: int; 	(* Signal number *)
-				si_errno*: int;  	(* An errno value *)
-				si_code*: int;   	(* Signal code *)
-
-				_sifields*: RECORD [union]
-					_pad: ARRAY [untagged] 29 OF int;
-					_kill*: RECORD [untagged]
-						si_pid*: pid_t;
-						si_uid*: uid_t
-					END;
-					_timer*: RECORD [untagged]
-						si_tid*: int;
-						si_overrun*: int;
-						si_sigval*: sigval_t
-					END;
-					_rt*: RECORD [untagged]
-						si_pid*: pid_t;
-						si_uid*: uid_t;
-						si_sigval*: sigval_t
-					END;
-					_sigchild*: RECORD [untagged]
-						si_pid: pid_t;
-						si_uid*: uid_t;
-						si_status*: int;
-						si_utime*: clock_t;
-						si_stime*: clock_t
-					END;
-					_sigfault*: RECORD [untagged]
-						si_addr*: PtrVoid;
-						si_addr_lsb*: SHORTINT;
-						_bounds*: RECORD [union]
-							_addr_bnd*: RECORD [untagged]
-								_lower*: PtrVoid;
-								_upper*: PtrVoid
-							END;
-							_pkey: INTEGER
-						END
-					END;
-					_sigpoll: RECORD [untagged]
-						si_band*: int; (* long int *);
-						si_fd*: int
-					END;
-					_sigsys*: RECORD [untagged]
-						_call_addr*: PtrVoid;
-						_syscall*: int;
-						_arch*: int (* unsigned int *)
-					END
-				END;
-		END;
-
-		Ptrucontext_t* = POINTER TO ucontext_t;
-		ucontext_t = RECORD [untagged]
-			(* IP, SP, FP *)
-				uc_flags*: INTEGER;	(* unsigned long int *)
-				uc_link*: Ptrucontext_t;
-				uc_stack*: stack_t;
-				uc_mcontext*: RECORD [untagged] (* mcontext_t *)
-					gregs*: gregset_t;
-					fpregs*: fpregset_t;
-					oldmask*: INTEGER; (* unsigned long int *)
-					cr2*: INTEGER; (* unsigned long int *)
-				END;
-				uc_sigmask: sigset_t;
-				__fpregs_mem*: fpstate;
-
-		END;
-
-		sa_sigaction_t* = PROCEDURE [ccall] (sig: int; siginfo: Ptrsiginfo_t; context: Ptrucontext_t);
-		sigaction_t* = RECORD [untagged]
-(*
-			sa_sigaction*: sa_sigaction_t,
-			sa_flags*: intFlags, sa_mask*: sigset_t
-*)
-			(* Ubuntu 17.10 /usr/include/i386-linux-gnu/asm/signal.h, /usr/include/i386-linux-gnu/bits/sigaction.h *)
-				sa_sigaction*: sa_sigaction_t; (* union with sa_handler*: PtrProc; *)
-				sa_mask*: sigset_t;
-				sa_flags*: intFlags;
-				sa_restorer*: PROCEDURE [ccall];
-		END;
-
-		stack_t* = RECORD [untagged]
-(*
-			ss_sp*: PtrVoid, ss_size*: size_t, ss_flags*: intFlags
-*)
-			(* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/stack_t.h: *)
-				ss_sp*: PtrVoid;
-				ss_flags*: intFlags;
-				ss_size*: size_t;
-		END;
-
-		stat_t* = RECORD [untagged]
-(*
-			NOTE: check record size
-			st_mode*: mode_t, st_size*: off_t, st_mtime*: time_t
-*)
-			(* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/stat.h: *)
-				st_dev*: dev_t;
-				__pad1: SHORTINT;
-				st_ino*: ino_t;
-				st_mode*: mode_t;
-				st_nlink*: nlink_t;
-				st_uid*: uid_t;
-				st_gid*: gid_t;
-				st_rdev*: dev_t;
-				__pad2: SHORTINT;
-				st_size*: off_t;
-				st_blksize*: blksize_t;
-				st_blocks*: blkcnt_t;
-				st_atim*: timespec_t;
-				st_mtim*: timespec_t;
-				st_ctim*: timespec_t;
-				__glibc_reserved4: INTEGER; (* long int *)
-				__glibc_reserved5: INTEGER; (* long int *)
-		END;
-
-		PtrFILE* = PtrVoid;
-		PtrDIR* = PtrVoid;
-
-		PtrDirent* = POINTER TO Dirent;
-		Dirent = RECORD [untagged]
-(*
-			d_name*: ARRAY [untagged] NAME_MAX + 1 OF SHORTCHAR
-*)
-			(* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/dirent.h: *)
-				d_ino*: ino_t; (* inode number *)
-				d_off*: off_t; (* offset to this dirent *)
-				d_reclen*: SHORTINT; (* length of this d_name *)
-				d_type*: BYTE;
-				d_name*: ARRAY [untagged] 256 OF SHORTCHAR;
-		END;
-
-		timespec_t* = RECORD [untagged]
-			(* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/struct_timespec.h: *)
-				tv_sec*: time_t;
-				tv_nsec*: INTEGER;
-		END;
-
-(*
-	VAR
-		stdin*: INTEGER;
-		timezone*: INTEGER; (* or tm.tm_gmtoff *)
-*)
-(*
-	PROCEDURE [ccall] __errno_location* (): PtrVoid;
-*)
-(*
-	(* POSIX.1 *)
-		PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int;
-*)
-	CONST
-		(* Ubuntu 18.04 /usr/include/i386-linux-gnu/bits/stat.h *)
-			_STAT_VER_LINUX* = 3;
-
-	TYPE
-		off64_t* = LONGINT;
-		blkcnt64_t* = LONGINT;
-		ino64_t* = LONGINT;
-
-		(* Ubuntu 18.04 /usr/include/i386-linux-gnu/bits/stat.h: *)
-			stat64_t* = RECORD [untagged]
-				st_dev*: dev_t;
-				__pad1: int; (* unsigned int *)
-				__st_ino: ino_t;
-				st_mode*: mode_t;
-				st_nlink*: nlink_t;
-				st_uid*: uid_t;
-				st_gid*: gid_t;
-				st_rdev*: dev_t;
-				__pad2: int; (* unsigned int *)
-				st_size*: off64_t;
-				st_blksize*: blksize_t;
-				st_blocks*: blkcnt64_t;
-				st_atim*: timespec_t;
-				st_mtim*: timespec_t;
-				st_ctim*: timespec_t;
-				st_ino*: ino64_t;
-			END;
-
-		(* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/sigval_t.h: *)
-			sigval_t* = RECORD [union]
-				sival_int*: int;
-				sival_ptr*: PtrVoid
-			END;
-
-		(* Ubuntu 17.10 /usr/include/i386-linux-gnu/sys/ucontext.h: *)
-			greg_t* = int;
-			gregset_t* = ARRAY [untagged] 19 OF greg_t;
-			fpregset_t* = POINTER [untagged] TO fpstate;
-			fpreg* = RECORD [untagged]
-				significand*: ARRAY [untagged] 4 OF SHORTINT; (* unsigned short int *)
-				exponent*: SHORTINT; (* unsigned short int *)
-			END;
-			fpstate* = RECORD [untagged]
-				cw*: INTEGER; (* unsigned long int *)
-				sw*: INTEGER; (* unsigned long int *)
-				tag*: INTEGER; (* unsigned long int *)
-				ipoff*: INTEGER; (* unsigned long int *)
-				cssel*: INTEGER; (* unsigned long int *)
-				dataoff*: INTEGER; (* unsigned long int *)
-				datasel*: INTEGER; (* unsigned long int *)
-				_st: ARRAY [untagged] 8 OF fpreg;
-				status*: INTEGER; (* unsigned long int *)
-			END;
-
-(*
-	VAR
-		timezone*: INTEGER; (* seconds from GMT *)
-		stdin*, stdout*, stderr* : PtrFILE;
-*)
-
-	PROCEDURE [ccall] __errno_location*(): PtrVoid;
-
-	PROCEDURE [ccall] __xstat* (version: int; filename: PtrSTR; VAR buf: stat_t): int;
-	PROCEDURE [ccall] __xstat64* (version: int; filename: PtrSTR; VAR buf: stat64_t): int;
-	PROCEDURE [ccall] fopen64* (path, mode: PtrSTR): PtrFILE;
-	PROCEDURE [ccall] lseek64* (fd: int; offset: off64_t; whence: int): off64_t;
-	PROCEDURE [ccall] fseeko64* (stream: PtrFILE; off: off64_t; whence: int): int;
-
-	PROCEDURE [ccall] sigsetjmp* ["__sigsetjmp"] (VAR env: sigjmp_buf; savemask: int): int;
-
-
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] clock* (): clock_t;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] clock_gettime* (clock_id: clockid_t; VAR tp: timespec_t): int;
-
-	PROCEDURE [ccall] mmap* (adr: PtrVoid; len: size_t; prot: intFlags; flags: intFlags; fd: int; offset: off_t): PtrVoid;
-	(* BSD *)
-		PROCEDURE [ccall] munmap* (adr: PtrVoid; len: size_t): int;
-		PROCEDURE [ccall] mprotect* (adr: PtrVoid; len: size_t; prot: intFlags): int;
-
-(*
-	PROCEDURE [ccall] calloc* (nmemb: size_t; size: size_t): PtrVoid;
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] malloc* (size: size_t): PtrVoid;
-*)
-		PROCEDURE [ccall] free* (ptr: PtrVoid);
-
-	(* AT&T *)
-		PROCEDURE [ccall] time* (VAR [nil] t: time_t): time_t;
-	PROCEDURE [ccall] gmtime* (VAR [nil] t: time_t): tm;
-	PROCEDURE [ccall] localtime* (VAR [nil] t: time_t): tm;
-
-	(* POSIX.1 *)
-(*
-		PROCEDURE [ccall] sigsetjmp* (VAR env: sigjmp_buf; savemask: int): int;
-*)
-		PROCEDURE [ccall] siglongjmp* (VAR env: sigjmp_buf; val: int);
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] sigemptyset* (set: PtrSigset_t): int;
-		PROCEDURE [ccall] sigfillset* (set: PtrSigset_t): int;
-		PROCEDURE [ccall] sigaddset* (set: PtrSigset_t; signo: int): int;
-		PROCEDURE [ccall] sigprocmask* (how: int; set: PtrSigset_t; oset: PtrSigset_t): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] sigaction* (sig: int; VAR [nil] act: sigaction_t; VAR [nil] oact: sigaction_t): int;
-
-	(* BSD *)
-		PROCEDURE [ccall] sigaltstack* (VAR [nil] ss: stack_t; VAR [nil] oss: stack_t): int;
-
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] getenv* (s: PtrSTR): PtrSTR;
-
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] fopen* (path, mode: PtrSTR): PtrFILE;
-		PROCEDURE [ccall] fdopen* (fildes: int; mode: PtrSTR): PtrFILE;
-		PROCEDURE [ccall] fclose* (stream: PtrFILE): int;
-		PROCEDURE [ccall] fread* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t;
-		PROCEDURE [ccall] fwrite* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t;
-		PROCEDURE [ccall] fflush* (s: PtrFILE): int;
-		PROCEDURE [ccall] printf* (s: PtrSTR): int;
-	(* ANSI C 89, XPG4 *)
-		PROCEDURE [ccall] fseek* (stream: PtrFILE; offset: long; whence: int): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] fileno* (stream: PtrFILE): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] rename* (from, to: PtrSTR): int;
-		PROCEDURE [ccall] mkdir* (path: PtrSTR; mode: mode_t): int;
-		PROCEDURE [ccall] opendir* (filename: PtrSTR): PtrDIR;
-		PROCEDURE [ccall] readdir* (dirp: PtrDIR): PtrDirent;
-		PROCEDURE [ccall] closedir* (dirp: PtrDIR): int;
-	(* ANSI C 89, XPG4.2 *)
-		PROCEDURE [ccall] remove* (path: PtrSTR): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] getcwd* (buf: PtrSTR; size: size_t): PtrSTR;
-
-	(* ANSI C 99 *)
-		PROCEDURE [ccall] exit* (status: int);
-
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] strftime* (buf: PtrSTR; maxsize: size_t; format: PtrSTR; timeptr: tm): size_t;
-
-	(* XXX: use fread instead *)
-		PROCEDURE [ccall] fgets* (str: PtrSTR; size: int; stream: PtrFILE): PtrSTR;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] open* (path: PtrSTR; flags: intFlags; mode: mode_t): int;
-		PROCEDURE [ccall] write* (d: int; buf: PtrVoid; nbytes: size_t): ssize_t;
-		PROCEDURE [ccall] read* (d: int; buf: PtrVoid; nbytes: size_t): ssize_t;
-		PROCEDURE [ccall] close* (d: int): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] chmod* (path: PtrSTR; mode: mode_t): int;
-		PROCEDURE [ccall] fchmod* (fd: int; mode: mode_t): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] fork* (): pid_t;
-		PROCEDURE [ccall] waitpid* (wpid: pid_t; VAR [nil] status: int; options: intFlags): pid_t;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] execv* (path: PtrSTR; argv: POINTER [untagged] TO ARRAY [untagged] OF PtrSTR): int;
-		PROCEDURE [ccall] execvp* (file: PtrSTR; argv: POINTER [untagged] TO ARRAY [untagged] OF PtrSTR): int;
-
-	(* POSIX.2 *)
-		PROCEDURE [ccall] system* (string: PtrSTR): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] sysconf* (name: int): long;
-
-	PROCEDURE [ccall] popen* (command, type: PtrSTR): PtrFILE;
-	PROCEDURE [ccall] pclose* (stream: PtrFILE): int;
-
-END LinLibc.

BIN
BlackBox/_Linux_/Lin/Mod/Net.odc


+ 0 - 361
BlackBox/_Linux_/Lin/Mod/Net.txt

@@ -1,361 +0,0 @@
-MODULE LinNet ["libc.so.6"];
-
-	(*
-		GNU/Linux
-		i386
-	*)
-
-	CONST
-		NULL* = 0H;
-
-		SOCKET_ERROR* = -1;
-		INVALID_SOCKET* = -1;
-
-		INADDR_NONE* = -1;
-		INADDR_ANY* = 0;
-
-		(* socket domains *)
-			PF_UNSPEC* = 0; (* Unspecified. *)
-			PF_LOCAL* = 1; (* Local to host (pipes and file-domain). *)
-			PF_UNIX* = PF_LOCAL; (* POSIX name for PF_LOCAL. *)
-			PF_FILE* = PF_LOCAL; (* Another non-standard name for PF_LOCAL. *)
-			PF_INET* = 2; (* IP protocol family. *)
-			PF_AX25* = 3; (* Amateur Radio AX.25. *)
-			PF_IPX* = 4; (* Novell Internet Protocol. *)
-			PF_APPLETALK* = 5; (* Appletalk DDP. *)
-			PF_NETROM* = 6; (* Amateur radio NetROM. *)
-			PF_BRIDGE* = 7; (* Multiprotocol bridge. *)
-			PF_ATMPVC* = 8; (* ATM PVCs. *)
-			PF_X25* = 9; (* Reserved for X.25 project. *)
-			PF_INET6* = 10; (* IP version 6. *)
-			PF_ROSE* = 11; (* Amateur Radio X.25 PLP. *)
-			PF_DECnet* = 12; (* Reserved for DECnet project. *)
-			PF_NETBEUI* = 13; (* Reserved for 802.2LLC project. *)
-			PF_SECURITY* = 14; (* Security callback pseudo AF. *)
-			PF_KEY* = 15; (* PF_KEY key management API. *)
-			PF_NETLINK* = 16;
-			PF_ROUTE* = PF_NETLINK; (* Alias to emulate 4.4BSD. *)
-			PF_PACKET* = 17; (* Packet family. *)
-			PF_ASH* = 18; (* Ash. *)
-			PF_ECONET* = 19; (* Acorn Econet. *)
-			PF_ATMSVC* = 20; (* ATM SVCs. *)
-			PF_RDS* = 21; (* RDS sockets. *)
-			PF_SNA* = 22; (* Linux SNA Project *)
-			PF_IRDA* = 23; (* IRDA sockets. *)
-			PF_PPPOX* = 24; (* PPPoX sockets. *)
-			PF_WANPIPE* = 25; (* Wanpipe API sockets. *)
-			PF_LLC* = 26; (* Linux LLC. *)
-			PF_IB* = 27; (* Native InfiniBand address. *)
-			PF_MPLS* = 28; (* MPLS. *)
-			PF_CAN* = 29; (* Controller Area Network. *)
-			PF_TIPC* = 30; (* TIPC sockets. *)
-			PF_BLUETOOTH* = 31; (* Bluetooth sockets. *)
-			PF_IUCV* = 32; (* IUCV sockets. *)
-			PF_RXRPC* = 33; (* RxRPC sockets. *)
-			PF_ISDN* = 34; (* mISDN sockets. *)
-			PF_PHONET* = 35; (* Phonet sockets. *)
-			PF_IEEE802154* = 36; (* IEEE 802.15.4 sockets. *)
-			PF_CAIF* = 37; (* CAIF sockets. *)
-			PF_ALG* = 38; (* Algorithm sockets. *)
-			PF_NFC* = 39; (* NFC sockets. *)
-			PF_VSOCK* = 40; (* vSockets. *)
-			PF_KCM* = 41; (* Kernel Connection Multiplexor. *)
-			PF_QIPCRTR* = 42; (* Qualcomm IPC Router. *)
-			PF_SMC* = 43; (* SMC sockets. *)
-			PF_MAX* = 44; (* For now.. *)
-
-		(* socket types *)
-			(* /usr/include/i386-linux-gnu/bits/socket_type.h *)
-				SOCK_STREAM* = 1;
-				SOCK_DGRAM* = 2;
-				SOCK_RAW* = 3;
-				SOCK_RDM* = 4;
-				SOCK_SEQPACKET* = 5;
-				SOCK_DCCP* = 6;
-				SOCK_PACKET* = 10;
-
-		(* socket protocols *)
-			IPPROTO_IP = 0; (* Dummy protocol for TCP. *)
-			IPPROTO_HOPOPTS* = 0; (* IPv6 Hop-by-Hop options. *)
-			IPPROTO_ICMP* = 1; (* Internet Control Message Protocol. *)
-			IPPROTO_IGMP* = 2; (* Internet Group Management Protocol. *)
-			IPPROTO_IPIP* = 4; (* IPIP tunnels (older KA9Q tunnels use 94). *)
-			IPPROTO_TCP* = 6; (* Transmission Control Protocol. *)
-			IPPROTO_EGP* = 8; (* Exterior Gateway Protocol. *)
-			IPPROTO_PUP* = 12; (* PUP protocol. *)
-			IPPROTO_UDP* = 17; (* User Datagram Protocol. *)
-			IPPROTO_IDP* = 22; (* XNS IDP protocol. *)
-			IPPROTO_TP* = 29; (* SO Transport Protocol Class 4. *)
-			IPPROTO_DCCP* = 33; (* Datagram Congestion Control Protocol. *)
-			IPPROTO_IPV6* = 41; (* IPv6 header. *)
-			IPPROTO_ROUTING* = 43; (* IPv6 routing header. *)
-			IPPROTO_FRAGMENT* = 44; (* IPv6 fragmentation header. *)
-			IPPROTO_RSVP* = 46; (* Reservation Protocol. *)
-			IPPROTO_GRE* = 47; (* General Routing Encapsulation. *)
-			IPPROTO_ESP* = 50; (* encapsulating security payload. *)
-			IPPROTO_AH* = 51; (* authentication header. *)
-			IPPROTO_ICMPV6* = 58; (* ICMPv6. *)
-			IPPROTO_NONE* = 59; (* IPv6 no next header. *)
-			IPPROTO_DSTOPTS* = 60; (* IPv6 destination options. *)
-			IPPROTO_MTP* = 92; (* Multicast Transport Protocol. *)
-			IPPROTO_ENCAP* = 98; (* Encapsulation Header. *)
-			IPPROTO_PIM* = 103; (* Protocol Independent Multicast. *)
-			IPPROTO_COMP* = 108; (* Compression Header Protocol. *)
-			IPPROTO_SCTP* = 132; (* Stream Control Transmission Protocol. *)
-			IPPROTO_UDPLITE* = 136; (* UDP-Lite protocol. *)
-			IPPROTO_RAW* = 255; (* Raw IP packets. *)
-
-		(* socket options *)
-			SO_DEBUG* = {0};
-			SO_REUSEADDR* = {1};
-			SO_TYPE* = {0,1};
-			SO_ERROR* = {2};
-			SO_DONTROUTE* = {0,2};
-			SO_BROADCAST* = {1,2};
-			SO_SNDBUF* = {0..2};
-			SO_RCVBUF* = {3};
-			SO_SNDBUFFORCE* = {5};
-			SO_RCVBUFFORCE* = {0,5};
-			SO_KEEPALIVE* = {0,3};
-			SO_OOBINLINE* = {1,3};
-			SO_NO_CHECK* = {0,1,3};
-			SO_PRIORITY* = {2,3};
-			SO_LINGER* = {0,2,3};
-			SO_BSDCOMPAT* = {1..3};
-			SO_REUSEPORT* = {0..3};
-			SO_SECURITY_AUTHENTICATION* = {1,2,4};
-			SO_SECURITY_ENCRYPTION_TRANSPORT* = {0..2,4};
-			SO_SECURITY_ENCRYPTION_NETWORK* = {3,4};
-			SO_BINDTODEVICE* = {0,3,4};
-			SO_ATTACH_FILTER* = {1,3,4};
-			SO_DETACH_FILTER* = {0,1,3,4};
-			SO_PEERNAME* = {2..4};
-			SO_TIMESTAMP* = {0,2..4};
-			SO_ACCEPTCONN* = {1..4};
-			SO_PEERSEC* = {0..4};
-			SO_PASSSEC* = {1,5};
-			SO_TIMESTAMPNS* = {0,1,5};
-			SO_MARK* = {2,5};
-			SO_TIMESTAMPING* = {0,2,5};
-			SO_PROTOCOL* = {1,2,5};
-			SO_DOMAIN* = {0..2,5};
-			SO_RXQ_OVFL* = {3,5};
-			SO_WIFI_STATUS* = {0,3,5};
-			SO_PEEK_OFF* = {1,3,5};
-			SO_NOFCS* = {0,1,3,5};
-			SO_LOCK_FILTER* = {2,3,5};
-			SO_SELECT_ERR_QUEUE* = {0,2,3,5};
-			SO_BUSY_POLL* = {1..3,5};
-			SO_MAX_PACING_RATE* = {0..3,5};
-			SO_BPF_EXTENSIONS* = {4,5};
-			SO_INCOMING_CPU* = {0,4,5};
-			SO_ATTACH_BPF* = {1,4,5};
-			SO_ATTACH_REUSEPORT_CBPF* = {0,1,4,5};
-			SO_ATTACH_REUSEPORT_EBPF* = {2,4,5};
-			SO_CNX_ADVICE* = {0,2,4,5};
-			SO_MEMINFO* = {0..2,4,5};
-			SO_INCOMING_NAPI_ID* = {3..5};
-			SO_COOKIE* = {0,3..5};
-			SO_PEERGROUPS* = {0,1,3..5};
-			SO_ZEROCOPY* = {2..5};
-
-		(* /usr/include/i386-linux-gnu/sys/socket.h *)
-			SHUT_RD* = 0;
-			SHUT_WR* = 1;
-			SHUT_RDWR* = 2;
-
-		SOL_SOCKET* = 1;
-
-		(* /usr/include/i386-linux-gnu/bits/socket.h *)
-			MSG_OOB* = {0};
-			MSG_PEEK* = {1};
-			MSG_DONTROUTE* = {2};
-			MSG_CTRUNC* = {3};
-			MSG_PROXY* = {4};
-			MSG_TRUNC* = {5};
-			MSG_DONTWAIT* = {6};
-			MSG_EOR* = {7};
-			MSG_WAITALL* = {8};
-			MSG_FIN* = {9};
-			MSG_SYN* = {10};
-			MSG_CONFIRM* = {11};
-			MSG_RST* = {12};
-			MSG_ERRQUEUE* = {13};
-			MSG_NOSIGNAL* = {14};
-			MSG_MORE* = {15};
-			MSG_WAITFORONE* = {16};
-
-		SOMAXCONN* = 128;
-
-		(* addrinfo.ai_flags *)
-			AI_PASSIVE* = {0}; (* Socket address is intended for `bind'. *)
-			AI_CANONNAME* = {1}; (* Request for canonical name. *)
-			AI_NUMERICHOST* = {2}; (* Don't use name resolution. *)
-			AI_V4MAPPED* = {3}; (* IPv4 mapped addresses are acceptable. *)
-			AI_ALL* = {4}; (* Return IPv4 mapped and IPv6 addresses. *)
-			AI_CANONIDN* = {7}; (* Translate canonical name from IDN format. *)
-			AI_NUMERICSERV* = {10}; (* Don't use name resolution. *)
-
-		(* getaddrinfo/getnameinfo/gai_strerror error codes *)
-			EAI_BADFLAGS* = -1; (* Invalid value for `ai_flags' field. *)
-			EAI_NONAME* = -2; (* NAME or SERVICE is unknown. *)
-			EAI_AGAIN* = -3; (* Temporary failure in name resolution. *)
-			EAI_FAIL* = -4; (* Non-recoverable failure in name res. *)
-			EAI_FAMILY* = -6; (* `ai_family' not supported. *)
-			EAI_SOCKTYPE* = -7; (* `ai_socktype' not supported. *)
-			EAI_SERVICE* = -8; (* SERVICE not supported for `ai_socktype'. *)
-			EAI_MEMORY* = -10; (* Memory allocation failure. *)
-			EAI_SYSTEM* = -11; (* System error returned in `errno'. *)
-			EAI_OVERFLOW* = -12; (* Argument buffer overflow. *)
-			EAI_NODATA* = -5; (* No address associated with NAME. *)
-			EAI_ADDRFAMILY* = -9; (* Address family for NAME not supported. *)
-			EAI_INPROGRESS* = -100; (* Processing request in progress. *)
-			EAI_CANCELED* = -101; (* Request canceled. *)
-			EAI_NOTCANCELED* = -102; (* Request not canceled. *)
-			EAI_ALLDONE* = -103; (* All requests done. *)
-			EAI_INTR* = -104; (* Interrupted by a signal. *)
-			EAI_IDN_ENCODE* = -105; (* IDN encoding failed. *)
-
-		(* /usr/include/i386-linux-gnu/bits/typesizes.h *)
-			__FD_SETSIZE = 1024;
-
-	TYPE
-		u_int8_t = SHORTCHAR;
-		int8_t = SHORTCHAR;
-		uint16_t = SHORTINT;
-		(* PtrVoid, int, intFlags, short, socklen_t, size_t, ssize_t, in_addr_t, in_port_t, time_t, suseconds_t, nfds_t, sa_family_t *)
-		PtrVoid* = INTEGER;
-		short* = SHORTINT;
-		int* = INTEGER;
-		intFlags* = SET;
-		size_t* = INTEGER;
-		ssize_t* = INTEGER;
-		time_t* = INTEGER;
-		suseconds_t* = INTEGER;
-		socklen_t* = INTEGER;
-		in_addr_t* = INTEGER;
-		in_port_t* = SHORTINT;
-		nfds_t* = INTEGER;
-		sa_family_t* = SHORTINT;
-
-		PtrSTR* = POINTER [untagged] TO ARRAY [untagged] OF SHORTCHAR;
-
-		SOCKET* = int;
-
-(*
-		in_addr* = RECORD [untagged]
-			s_addr*: in_addr_t;
-		END;
-*)
-		in_addr* = RECORD [untagged]
-			S_un*: RECORD [union]
-				S_un_b*: RECORD [untagged]
-					s_b1*: SHORTCHAR;
-					s_b2*: SHORTCHAR;
-					s_b3*: SHORTCHAR;
-					s_b4*: SHORTCHAR;
-				END;
-				S_un_w*: RECORD [untagged]
-					s_w1*: SHORTINT;
-					s_w2*: SHORTINT;
-				END;
-				S_addr*: in_addr_t;
-			END;
-		END;
-
-		Ptrsockaddr* = POINTER [untagged] TO sockaddr;
-		sockaddr* = RECORD [untagged]
-			(* /usr/include/i386-linux-gnu/bits/socket.h *)
-				sa_family: sa_family_t;
-				sa_data: ARRAY [untagged] 14 OF SHORTCHAR;
-		END;
-
-		Ptrsockaddr_storage = POINTER [untagged] TO sockaddr_storage;
-		sockaddr_storage* = RECORD [untagged]
-			(* /usr/include/i386-linux-gnu/bits/socket.h *)
-				sa_family: sa_family_t;
-				__ss_align: INTEGER;
-				__ss_padding: ARRAY [untagged] 128 - 2 * 4 OF SHORTCHAR;
-		END;
-
-		Ptrsockaddr_in* = POINTER [untagged] TO sockaddr_in;
-		sockaddr_in* = RECORD [untagged]
-			(* /usr/include/linux/in.h *)
-				sin_family*: sa_family_t; (* address family *)
-				sin_port*: SHORTINT; (* port number *)
-				sin_addr*: in_addr; (* internet address *)
-				__pad: ARRAY [untagged] 8 OF SHORTCHAR;
-		END;
-
-		Ptraddrinfo* = POINTER [untagged] TO addrinfo;
-		addrinfo* = RECORD [untagged]
-			(* /usr/include/netdb.h *)
-				ai_flags*: intFlags; (* input flags *)
-				ai_family*: int; (* protocol family for socket *)
-				ai_socktype*: int; (* socket type *)
-				ai_protocol*: int; (* protocol for socket *)
-				ai_addrlen*: socklen_t; (* length of socket-address *)
-				ai_addr*: Ptrsockaddr; (* socket-address for socket *)
-				ai_canonname*: PtrSTR; (* canonical name for service location (iff req) *)
-				ai_next*: Ptraddrinfo; (* pointer to next in list *)
-		END;
-
-		timeval* = RECORD [untagged]
-			(* Linux, FreeBSD, OpenBSD *)
-				tv_sec*: time_t; (* seconds *)
-				tv_usec*: suseconds_t; (* and microseconds *)
-		END;
-
-		pollfd* = RECORD [untagged]
-			(* Linux, FreeBSD, OpenBSD *)
-				fd*: int;
-				events*: short;
-				revents*: short;
-		END;
-
-		(* /usr/include/i386-linux-gnu/sys/select.h *)
-			__fd_mask = SET;
-			fd_set* = ARRAY [untagged] __FD_SETSIZE DIV (SIZE(__fd_mask) * 8) OF __fd_mask;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] socket* (domain: int; type: int; protocol: int): SOCKET;
-		PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET;
-		PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int;
-		PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int;
-		PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): int;
-		PROCEDURE [ccall] listen* (s: SOCKET; backlog: int): int;
-		PROCEDURE [ccall] recv* (s: SOCKET; buf: PtrVoid; len: size_t; flags: intFlags): ssize_t;
-		PROCEDURE [ccall] recvfrom* (s: SOCKET; buf: PtrVoid; len: size_t; flags: intFlags; VAR from: sockaddr; VAR fromlen: socklen_t): ssize_t;
-		PROCEDURE [ccall] send* (s: SOCKET; msg: PtrVoid; len: size_t; flags: intFlags): ssize_t;
-		PROCEDURE [ccall] sendto* (s: SOCKET; msg: PtrVoid; len: size_t; flags: intFlags; VAR to: sockaddr; tolen: socklen_t): ssize_t;
-		PROCEDURE [ccall] shutdown* (s: SOCKET; how: int): int;
-		PROCEDURE [ccall] getsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; VAR [nil] optlen: socklen_t): int;
-		PROCEDURE [ccall] setsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; optlen: socklen_t): int;
-
-		PROCEDURE [ccall] inet_addr* (cp: PtrSTR): in_addr_t;
-		PROCEDURE [ccall] htons* (host16: uint16_t): uint16_t;
-
-		PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): int;
-
-		PROCEDURE [ccall] poll* (VAR fds: ARRAY [untagged] OF pollfd; nfds: nfds_t; timeout: int): int;
-
-(*
-	PROCEDURE FD_ZERO (VAR set: Net.fd_set);
-		VAR i: INTEGER;
-	BEGIN
-		i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0
-	END FD_ZERO;
-
-	PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set);
-	BEGIN
-		INCL(set[fd DIV 32], fd MOD 32)
-	END FD_SET;
-*)
-
-	(* POSIX.1g *)
-		PROCEDURE [ccall] getaddrinfo* (hostname: PtrSTR; servname: PtrSTR; VAR [nil] hints: addrinfo; VAR res: Ptraddrinfo): int;
-		PROCEDURE [ccall] freeaddrinfo* (ai: Ptraddrinfo);
-
-		PROCEDURE [ccall] gai_strerror* (ecode: int): PtrSTR;
-
-END LinNet.

BIN
BlackBox/_Linux_/Lin/Mod/Rt.odc


+ 0 - 26
BlackBox/_Linux_/Lin/Mod/Rt.txt

@@ -1,26 +0,0 @@
-MODULE LinRt ["librt.so.1"];
-
-	(*
-		A. V. Shiryaev, 2013.12
-
-		GNU/Linux
-		32-bit
-	*)
-
-	CONST
-		CLOCK_REALTIME* = 0;
-		CLOCK_MONOTONIC* = 1;
-	
-	TYPE
-		time_t* = INTEGER;
-
-		timespec_t* = RECORD [untagged]
-			tv_sec*: time_t; (* seconds *)
-			tv_nsec*: INTEGER (* nanoseconds *)
-		END;
-
-		clockid_t* = INTEGER;
-
-	PROCEDURE [ccall] clock_gettime* (clock_id: clockid_t; VAR tp: timespec_t): INTEGER;
-
-END LinRt.

BIN
BlackBox/_Linux_/Lin/Mod/Termios.odc


+ 0 - 148
BlackBox/_Linux_/Lin/Mod/Termios.txt

@@ -1,148 +0,0 @@
-MODULE LinTermios ["libc.so.6"];
-
-	(*
-		A. V. Shiryaev, 2012.11
-
-		GNU/Linux
-		i386
-	*)
-
-	CONST
-		NCCS* = 32;
-		_HAVE_STRUCT_TERMIOS_C_ISPEED* = 1;
-		_HAVE_STRUCT_TERMIOS_C_OSPEED* = 1;
-		VINTR* = 0;
-		VQUIT* = 1;
-		VERASE* = 2;
-		VKILL* = 3;
-		VEOF* = 4;
-		VTIME* = 5;
-		VMIN* = 6;
-		VSWTC* = 7;
-		VSTART* = 8;
-		VSTOP* = 9;
-		VSUSP* = 10;
-		VEOL* = 11;
-		VREPRINT* = 12;
-		VDISCARD* = 13;
-		VWERASE* = 14;
-		VLNEXT* = 15;
-		VEOL2* = 16;
-		IGNBRK* = 1; (* {0} *)
-		BRKINT* = 2; (* {1} *)
-		IGNPAR* = 4; (* {2} *)
-		PARMRK* = 8; (* {3} *)
-		INPCK* = 16; (* {4} *)
-		ISTRIP* = 32; (* {5} *)
-		INLCR* = 64; (* {6} *)
-		IGNCR* = 128; (* {7} *)
-		ICRNL* = 256; (* {8} *)
-		IUCLC* = 512; (* {9} *)
-		IXON* = 1024; (* {10} *)
-		IXANY* = 2048; (* {11} *)
-		IXOFF* = 4096; (* {12} *)
-		IMAXBEL* = 8192; (* {13} *)
-		IUTF8* = 16384; (* {14} *)
-		OPOST* = 1; (* {0} *)
-		OLCUC* = 2; (* {1} *)
-		ONLCR* = 4; (* {2} *)
-		OCRNL* = 8; (* {3} *)
-		ONOCR* = 16; (* {4} *)
-		ONLRET* = 32; (* {5} *)
-		OFILL* = 64; (* {6} *)
-		OFDEL* = 128; (* {7} *)
-		VTDLY* = 16384; (* {14} *)
-		VT0* = 0; (* {} *)
-		VT1* = 16384; (* {14} *)
-		B0* = 0; (* {} *) (* hang up *)
-		B50* = 1; (* {0} *)
-		B75* = 2; (* {1} *)
-		B110* = 3; (* {0,1} *)
-		B134* = 4; (* {2} *)
-		B150* = 5; (* {0,2} *)
-		B200* = 6; (* {1,2} *)
-		B300* = 7; (* {0..2} *)
-		B600* = 8; (* {3} *)
-		B1200* = 9; (* {0,3} *)
-		B1800* = 10; (* {1,3} *)
-		B2400* = 11; (* {0,1,3} *)
-		B4800* = 12; (* {2,3} *)
-		B9600* = 13; (* {0,2,3} *)
-		B19200* = 14; (* {1..3} *)
-		B38400* = 15; (* {0..3} *)
-		CSIZE* = 48; (* {4,5} *)
-		CS5* = 0; (* {} *)
-		CS6* = 16; (* {4} *)
-		CS7* = 32; (* {5} *)
-		CS8* = 48; (* {4,5} *)
-		CSTOPB* = 64; (* {6} *)
-		CREAD* = 128; (* {7} *)
-		PARENB* = 256; (* {8} *)
-		PARODD* = 512; (* {9} *)
-		HUPCL* = 1024; (* {10} *)
-		CLOCAL* = 2048; (* {11} *)
-		B57600* = 4097; (* {0,12} *)
-		B115200* = 4098; (* {1,12} *)
-		B230400* = 4099; (* {0,1,12} *)
-		B460800* = 4100; (* {2,12} *)
-		B500000* = 4101; (* {0,2,12} *)
-		B576000* = 4102; (* {1,2,12} *)
-		B921600* = 4103; (* {0..2,12} *)
-		B1000000* = 4104; (* {3,12} *)
-		B1152000* = 4105; (* {0,3,12} *)
-		B1500000* = 4106; (* {1,3,12} *)
-		B2000000* = 4107; (* {0,1,3,12} *)
-		B2500000* = 4108; (* {2,3,12} *)
-		B3000000* = 4109; (* {0,2,3,12} *)
-		B3500000* = 4110; (* {1..3,12} *)
-		B4000000* = 4111; (* {0..3,12} *)
-		__MAX_BAUD* = B4000000;
-		ISIG* = 1; (* {0} *)
-		ICANON* = 2; (* {1} *)
-		ECHO* = 8; (* {3} *)
-		ECHOE* = 16; (* {4} *)
-		ECHOK* = 32; (* {5} *)
-		ECHONL* = 64; (* {6} *)
-		NOFLSH* = 128; (* {7} *)
-		TOSTOP* = 256; (* {8} *)
-		IEXTEN* = 32768; (* {15} *)
-		TCOOFF* = 0;
-		TCOON* = 1;
-		TCIOFF* = 2;
-		TCION* = 3;
-		TCIFLUSH* = 0;
-		TCOFLUSH* = 1;
-		TCIOFLUSH* = 2;
-		TCSANOW* = 0;
-		TCSADRAIN* = 1;
-		TCSAFLUSH* = 2;
-
-	TYPE
-		tcflag_t* = INTEGER; (* unsigned int *)
-		cc_t* = SHORTCHAR; (* unsigned char *)
-		speed_t* = INTEGER; (* unsigned int *)
-		termios* = RECORD [untagged]
-			c_iflag*: tcflag_t; (* input mode flags *)
-			c_oflag*: tcflag_t; (* output mode flags *)
-			c_cflag*: tcflag_t; (* control mode flags *)
-			c_lflag*: tcflag_t; (* local mode flags *)
-			c_line*: cc_t; (* line discipline *)
-			cc_c*: ARRAY [untagged] NCCS OF cc_t; (* control chars *)
-			c_ispeed*: INTEGER; (* input speed *)
-			c_ospeed*: INTEGER; (* output speed *)
-		END;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] cfgetispeed* (VAR tp: termios): speed_t;
-		PROCEDURE [ccall] cfsetispeed* (VAR tp: termios; ispeed: speed_t): INTEGER;
-		PROCEDURE [ccall] cfgetospeed* (VAR tp: termios): speed_t;
-		PROCEDURE [ccall] cfsetospeed* (VAR tp: termios; ospeed: speed_t): INTEGER;
-		PROCEDURE [ccall] tcgetattr* (fd: INTEGER; VAR tp: termios): INTEGER;
-		PROCEDURE [ccall] tcsetattr* (fd: INTEGER; action: INTEGER; VAR tp: termios): INTEGER;
-
-		PROCEDURE [ccall] tcdrain* (fd: INTEGER): INTEGER;
-		PROCEDURE [ccall] tcflow* (fd: INTEGER; action: INTEGER): INTEGER;
-		PROCEDURE [ccall] tcflush* (fd: INTEGER; action: INTEGER): INTEGER;
-		PROCEDURE [ccall] tcsendbreak* (fd: INTEGER; len: INTEGER): INTEGER;
-
-END LinTermios.

+ 5 - 2
BlackBox/_Linux_/Lin/Mod/gen-Ioctl/Makefile

@@ -6,7 +6,10 @@
 
 INCDIR ?= /usr/include
 
-all: mkioctl Ioctl.txt
+all: mkioctl Ioctl.odc
+
+Ioctl.odc: Ioctl.txt
+	./txt2odc.py Ioctl.txt Ioctl.odc
 
 PY = python2.7
 DEFS = defs-tiocm defs-ioctl
@@ -21,4 +24,4 @@ defs-tiocm:
 	./dumpdefs.py 2 0 s ${INCDIR}/i386-linux-gnu/bits/ioctl-types.h | grep TIOCM_ > $@
 
 clean:
-	rm -f mkioctl Ioctl.txt ${DEFS}
+	rm -f mkioctl Ioctl.txt Ioctl.odc ${DEFS}

+ 1 - 0
BlackBox/_Linux_/Lin/Mod/gen-Ioctl/txt2odc.py

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

+ 5 - 2
BlackBox/_Linux_/Lin/Mod/gen-LibW/Makefile

@@ -12,7 +12,10 @@ CFLAGS += -m32
 
 DEFS = defs-basictypes defs-lc
 
-all: LibW.txt ${DEFS}
+all: LibW.odc ${DEFS}
+
+LibW.odc: LibW.txt
+	./txt2odc.py LibW.txt LibW.odc
 
 LibW.txt: LibW.txt.templ ${DEFS} libver osname machine
 	${PY} ./untempl.py LibW.txt.templ $@
@@ -24,4 +27,4 @@ defs-lc: mklc
 	./mklc > $@
 
 clean:
-	rm -f ${DEFS} LibW.txt sizeofs mklc
+	rm -f ${DEFS} LibW.txt LibW.odc sizeofs mklc

+ 1 - 0
BlackBox/_Linux_/Lin/Mod/gen-LibW/txt2odc.py

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

+ 5 - 2
BlackBox/_Linux_/Lin/Mod/gen-Libc/Makefile

@@ -11,7 +11,10 @@ PY = python2.7
 
 DEFS = clockspersec sigstksz defs-map defs-prot defs-sigmask nsig defs-signo defs-fpe defs-sa defs-errno namemax defs-fcntlo defs-basictypes defs-sc defs-clockid defs-wait
 
-all: Libc.txt ${DEFS} strerrnocase.txt
+all: Libc.odc ${DEFS} strerrnocase.txt
+
+Libc.odc: Libc.txt
+	./txt2odc.py Libc.txt Libc.odc
 
 Libc.txt: Libc.txt.templ ${DEFS} libver osname machine custom fields-dirent fields-sigaction fields-siginfo fields-stack fields-stat fields-tm fields-ucontext fields-timespec
 	${PY} ./untempl.py Libc.txt.templ $@
@@ -83,4 +86,4 @@ sizeofs: sizeofs.c
 	${CC} -m32 sizeofs.c -o $@
 
 clean:
-	rm -f ${DEFS} Libc.txt dumpstrerrno dumpstrerrno.c strerrnocase.txt sizeofs scs
+	rm -f ${DEFS} Libc.txt Libc.odc dumpstrerrno dumpstrerrno.c strerrnocase.txt sizeofs scs

+ 1 - 0
BlackBox/_Linux_/Lin/Mod/gen-Libc/txt2odc.py

@@ -0,0 +1 @@
+../../../../_OpenBSD_/Lin/Mod/gen-Libc/txt2odc.py

+ 5 - 2
BlackBox/_Linux_/Lin/Mod/gen-Net/Makefile

@@ -12,7 +12,10 @@ CFLAGS += -m32
 
 DEFS = defs-basictypes defs-af defs-so defs-sol defs-ai defs-eai defs-somaxconn
 
-all: Net.txt ${DEFS}
+all: Net.odc ${DEFS}
+
+Net.odc: Net.txt
+	./txt2odc.py Net.txt Net.odc
 
 Net.txt: Net.txt.templ ${DEFS} libver osname machine fields-sockaddr fields-sockaddr_in fields-sockaddr_storage fields-addrinfo defs-fd_set-const defs-fd_set-type
 	${PY} ./untempl.py Net.txt.templ $@
@@ -39,4 +42,4 @@ defs-eai:
 	./dumpdefs.py 3 2 i ${INCDIR}/netdb.h | grep "	EAI_" > $@
 
 clean:
-	rm -f ${DEFS} Net.txt sizeofs
+	rm -f ${DEFS} Net.txt Net.odc sizeofs

+ 1 - 0
BlackBox/_Linux_/Lin/Mod/gen-Net/txt2odc.py

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

+ 5 - 2
BlackBox/_Linux_/Lin/Mod/gen-Termios/Makefile

@@ -6,7 +6,10 @@
 
 INCDIR ?= /usr/include
 
-all: Termios.txt
+all: Termios.odc
+
+Termios.odc: Termios.txt
+	./txt2odc.py Termios.txt Termios.odc
 
 PY = python2.7
 DEFS = defs-termios
@@ -18,4 +21,4 @@ defs-termios:
 	./dumpdefs.py 2 0 i ${INCDIR}/i386-linux-gnu/bits/termios.h > $@
 
 clean:
-	rm -f Termios.txt ${DEFS}
+	rm -f Termios.txt Termios.odc ${DEFS}

+ 1 - 0
BlackBox/_Linux_/Lin/Mod/gen-Termios/txt2odc.py

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

BIN
BlackBox/_OpenBSD_/Lin/Mod/Dl.odc


+ 0 - 33
BlackBox/_OpenBSD_/Lin/Mod/Dl.txt

@@ -1,33 +0,0 @@
-MODULE LinDl ["libc.so.96"];
-
-	(*
-		A. V. Shiryaev, 2012.09, 2013.08
-
-		OpenBSD 6.6
-		32-bit
-	*)
-
-	CONST
-		NULL* = 0H;
-
-		(* from OpenBSD 6.2 /usr/include/dlfcn.h *)
-			RTLD_LAZY* = 1;
-			(* DL_LAZY* = RTLD_LAZY; *) (* compat *)
-			RTLD_NOW* = 2;
-
-			RTLD_GLOBAL* = 100H;
-			RTLD_LOCAL* = 000H;
-			RTLD_TRACE* = 200H;
-
-	TYPE
-		PtrVoid* = INTEGER;
-		HANDLE* = PtrVoid;
-		PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR;
-
-	PROCEDURE [ccall] dlopen* (file: PtrSTR; mode: INTEGER): HANDLE;
-	PROCEDURE [ccall] dlclose* (handle: HANDLE): INTEGER;
-	PROCEDURE [ccall] dlsym* (handle: HANDLE; symbol: PtrSTR): HANDLE;
-
-	PROCEDURE [ccall] dlerror* (): PtrSTR;
-
-END LinDl.

BIN
BlackBox/_OpenBSD_/Lin/Mod/Iconv.odc


+ 0 - 22
BlackBox/_OpenBSD_/Lin/Mod/Iconv.txt

@@ -1,22 +0,0 @@
-MODULE LinIconv ["libiconv.so.7"];
-
-	IMPORT Libc := LinLibc;
-
-	TYPE
-		PtrVoid = Libc.PtrVoid;
-		PtrSTR* = Libc.PtrSTR;
-		PtrLSTR* = POINTER TO ARRAY [untagged] OF CHAR;
-		size_t* = Libc.size_t;
-
-		iconv_t* = PtrVoid;
-
-	PROCEDURE [ccall] iconv_open* ["libiconv_open"] (tocode, fromcode: PtrSTR): iconv_t;
-	PROCEDURE [ccall] iconv_close* ["libiconv_close"] (cd: iconv_t): INTEGER;
-
-	PROCEDURE [ccall] iconv* ["libiconv"] (cd: iconv_t; VAR [nil] inbuf: PtrSTR; VAR inbytesleft: size_t; VAR [nil] outbuf: PtrSTR; VAR outbytesleft: size_t): size_t;
-
-	PROCEDURE [ccall] iconv_encode* ["libiconv"] (cd: iconv_t; VAR [nil] inbuf: PtrLSTR; VAR inbytesleft: size_t; VAR [nil] outbuf: PtrSTR; VAR outbytesleft: size_t): size_t;
-
-	PROCEDURE [ccall] iconv_decode* ["libiconv"] (cd: iconv_t; VAR [nil] inbuf: PtrSTR; VAR inbytesleft: size_t; VAR [nil] outbuf: PtrLSTR; VAR outbytesleft: size_t): size_t;
-
-END LinIconv.

BIN
BlackBox/_OpenBSD_/Lin/Mod/Ioctl.odc


+ 0 - 43
BlackBox/_OpenBSD_/Lin/Mod/Ioctl.txt

@@ -1,43 +0,0 @@
-MODULE LinIoctl ["libc.so.96"];
-
-	(*
-		OpenBSD 6.6
-		i386
-	*)
-
-	CONST
-		TIOCM_LE* = {0}; (* line enable *)
-		TIOCM_DTR* = {1}; (* data terminal ready *)
-		TIOCM_RTS* = {2}; (* request to send *)
-		TIOCM_ST* = {3}; (* secondary transmit *)
-		TIOCM_SR* = {4}; (* secondary receive *)
-		TIOCM_CTS* = {5}; (* clear to send *)
-		TIOCM_CAR* = {6}; (* carrier detect *)
-		TIOCM_RNG* = {7}; (* ring *)
-		TIOCM_DSR* = {8}; (* data set ready *)
-
-		FIOCLEX* = 536897025;
-		FIONCLEX* = 536897026;
-		FIONREAD* = 1074030207;
-		FIONBIO* = -2147195266;
-		FIOASYNC* = -2147195267;
-		FIOSETOWN* = -2147195268;
-		FIOGETOWN* = 1074030203;
-		TIOCMGET* = 1074033770;
-		TIOCMSET* = -2147191699;
-		TIOCEXCL* = 536900621;
-		TIOCNXCL* = 536900622;
-		TIOCFLUSH* = -2147191792;
-		TIOCDRAIN* = 536900702;
-		TIOCOUTQ* = 1074033779;
-		TIOCSBRK* = 536900731;
-		TIOCCBRK* = 536900730;
-		TIOCSDTR* = 536900729;
-		TIOCCDTR* = 536900728;
-		TIOCMBIS* = -2147191700;
-		TIOCMBIC* = -2147191701;
-
-	PROCEDURE [ccall] ioctl0* ["ioctl"] (d: INTEGER; req: INTEGER): INTEGER;
-	PROCEDURE [ccall] ioctl1* ["ioctl"] (d: INTEGER; req: INTEGER; VAR arg: INTEGER): INTEGER;
-
-END LinIoctl.

BIN
BlackBox/_OpenBSD_/Lin/Mod/LibW.odc


+ 0 - 59
BlackBox/_OpenBSD_/Lin/Mod/LibW.txt

@@ -1,59 +0,0 @@
-MODULE LinLibW ["libc.so.96"];
-
-	(*
-		OpenBSD 6.6
-		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.

BIN
BlackBox/_OpenBSD_/Lin/Mod/Libc.odc


+ 0 - 746
BlackBox/_OpenBSD_/Lin/Mod/Libc.txt

@@ -1,746 +0,0 @@
-MODULE LinLibc ["libc.so.96"];
-
-	(*
-		OpenBSD 6.6
-		i386
-	*)
-
-	CONST
-		NULL* = 0H;
-		FALSE* = 0;
-		TRUE* = 1;
-
-		CLOCKS_PER_SEC* = 100;
-
-		MAP_FAILED* = -1;
-
-		(* MAP_PRIVATE, MAP_ANON (intFlags) *)
-		MAP_SHARED* = {0}; (* share changes *)
-		MAP_PRIVATE* = {1}; (* changes are private *)
-		MAP_FIXED* = {4}; (* map addr must be exactly as requested *)
-		MAP_ANON* = {12}; (* allocated from memory, swap space *)
-		MAP_ANONYMOUS* = MAP_ANON; (* alternate POSIX spelling *)
-		MAP_STACK* = {14}; (* mapping is used for a stack *)
-		MAP_CONCEAL* = {15}; (* omit from dumps *)
-		MAP_FLAGMASK* = {0..2,4..15};
-		MAP_INHERIT_SHARE* = {}; (* share with child *)
-		MAP_INHERIT_COPY* = {0}; (* copy into child *)
-		MAP_INHERIT_NONE* = {1}; (* absent from child *)
-		MAP_INHERIT_ZERO* = {0,1}; (* zero in child *)
-
-
-		(* PROT_READ, PROT_WRITE, PROT_EXEC (intFlags) *)
-		PROT_NONE* = {}; (* no permissions *)
-		PROT_READ* = {0}; (* pages can be read *)
-		PROT_WRITE* = {1}; (* pages can be written *)
-		PROT_EXEC* = {2}; (* pages can be executed *)
-
-
-		(* SIG_UNBLOCK, SIG_SETMASK (int) *)
-		SIG_BLOCK* = 1; (* block specified signal set *)
-		SIG_UNBLOCK* = 2; (* unblock specified signal set *)
-		SIG_SETMASK* = 3; (* set specified signal set *)
-
-
-		(* FPE_INTDIV, FPE_INTOVF, FPE_FLTDIV, FPE_FLTOVF, FPE_FLTUND, FPE_FLTRES, FPE_FLTINV, FPE_FLTSUB (int) *)
-		FPE_INTDIV* = 1; (* integer divide by zero *)
-		FPE_INTOVF* = 2; (* integer overflow *)
-		FPE_FLTDIV* = 3; (* floating point divide by zero *)
-		FPE_FLTOVF* = 4; (* floating point overflow *)
-		FPE_FLTUND* = 5; (* floating point underflow *)
-		FPE_FLTRES* = 6; (* floating point inexact result *)
-		FPE_FLTINV* = 7; (* invalid floating point operation *)
-		FPE_FLTSUB* = 8; (* subscript out of range *)
-
-
-		(* SA_SIGINFO (intFlags) *)
-		SA_NOCLDSTOP* = {3}; (* do not generate SIGCHLD on child stop *)
-		SA_ONSTACK* = {0}; (* take signal on signal stack *)
-		SA_RESTART* = {1}; (* restart system on signal return *)
-		SA_RESETHAND* = {2}; (* reset to SIG_DFL when taking signal *)
-		SA_NODEFER* = {4}; (* don't mask the signal we're delivering *)
-		SA_NOCLDWAIT* = {5}; (* don't create zombies (assign to pid 1) *)
-		SA_SIGINFO* = {6}; (* generate siginfo_t *)
-
-
-		(* SIGINT, SIGILL, SIGFPE, SIGSEGV, SIGKILL, SIGSTOP, SIGWINCH, SIGTHR (int) *)
-		SIGHUP* = 1; (* hangup *)
-		SIGINT* = 2; (* interrupt *)
-		SIGQUIT* = 3; (* quit *)
-		SIGILL* = 4; (* illegal instruction (not reset when caught) *)
-		SIGTRAP* = 5; (* trace trap (not reset when caught) *)
-		SIGABRT* = 6; (* abort() *)
-		SIGFPE* = 8; (* floating point exception *)
-		SIGKILL* = 9; (* kill (cannot be caught or ignored) *)
-		SIGBUS* = 10; (* bus error *)
-		SIGSEGV* = 11; (* segmentation violation *)
-		SIGSYS* = 12; (* bad argument to system call *)
-		SIGPIPE* = 13; (* write on a pipe with no one to read it *)
-		SIGALRM* = 14; (* alarm clock *)
-		SIGTERM* = 15; (* software termination signal from kill *)
-		SIGURG* = 16; (* urgent condition on IO channel *)
-		SIGSTOP* = 17; (* sendable stop signal not from tty *)
-		SIGTSTP* = 18; (* stop signal from tty *)
-		SIGCONT* = 19; (* continue a stopped process *)
-		SIGCHLD* = 20; (* to parent on child stop or exit *)
-		SIGTTIN* = 21; (* to readers pgrp upon background tty read *)
-		SIGTTOU* = 22; (* like TTIN for output if (tp->t_local&LTOSTOP) *)
-		SIGXCPU* = 24; (* exceeded CPU time limit *)
-		SIGXFSZ* = 25; (* exceeded file size limit *)
-		SIGVTALRM* = 26; (* virtual time alarm *)
-		SIGPROF* = 27; (* profiling time alarm *)
-		SIGUSR1* = 30; (* user defined signal 1 *)
-		SIGUSR2* = 31; (* user defined signal 2 *)
-		SIGWINCH* = 28; (* window size changes *)
-		SIGTHR* = 32; (* thread library AST *)
-
-		_NSIG* = 33;
-
-		(* SIG_DFL, SIG_IGN, SIG_ERR *)
-			SIG_DFL* = 0;
-			SIG_IGN* = 1;
-			SIG_ERR* = -1;
-
-
-(*
-		PAGE_SIZE* = 4096;
-*)
-		_SC_ARG_MAX* = 1;
-		_SC_CHILD_MAX* = 2;
-		_SC_CLK_TCK* = 3;
-		_SC_NGROUPS_MAX* = 4;
-		_SC_OPEN_MAX* = 5;
-		_SC_JOB_CONTROL* = 6;
-		_SC_SAVED_IDS* = 7;
-		_SC_VERSION* = 8;
-		_SC_BC_BASE_MAX* = 9;
-		_SC_BC_DIM_MAX* = 10;
-		_SC_BC_SCALE_MAX* = 11;
-		_SC_BC_STRING_MAX* = 12;
-		_SC_COLL_WEIGHTS_MAX* = 13;
-		_SC_EXPR_NEST_MAX* = 14;
-		_SC_LINE_MAX* = 15;
-		_SC_RE_DUP_MAX* = 16;
-		_SC_2_VERSION* = 17;
-		_SC_2_C_BIND* = 18;
-		_SC_2_C_DEV* = 19;
-		_SC_2_CHAR_TERM* = 20;
-		_SC_2_FORT_DEV* = 21;
-		_SC_2_FORT_RUN* = 22;
-		_SC_2_LOCALEDEF* = 23;
-		_SC_2_SW_DEV* = 24;
-		_SC_2_UPE* = 25;
-		_SC_STREAM_MAX* = 26;
-		_SC_TZNAME_MAX* = 27;
-		_SC_PAGESIZE* = 28;
-		_SC_PAGE_SIZE* = _SC_PAGESIZE; (* 1170 compatibility *)
-		_SC_FSYNC* = 29;
-		_SC_XOPEN_SHM* = 30;
-		_SC_SEM_NSEMS_MAX* = 31;
-		_SC_SEM_VALUE_MAX* = 32;
-		_SC_HOST_NAME_MAX* = 33;
-		_SC_MONOTONIC_CLOCK* = 34;
-		_SC_2_PBS* = 35;
-		_SC_2_PBS_ACCOUNTING* = 36;
-		_SC_2_PBS_CHECKPOINT* = 37;
-		_SC_2_PBS_LOCATE* = 38;
-		_SC_2_PBS_MESSAGE* = 39;
-		_SC_2_PBS_TRACK* = 40;
-		_SC_ADVISORY_INFO* = 41;
-		_SC_AIO_LISTIO_MAX* = 42;
-		_SC_AIO_MAX* = 43;
-		_SC_AIO_PRIO_DELTA_MAX* = 44;
-		_SC_ASYNCHRONOUS_IO* = 45;
-		_SC_ATEXIT_MAX* = 46;
-		_SC_BARRIERS* = 47;
-		_SC_CLOCK_SELECTION* = 48;
-		_SC_CPUTIME* = 49;
-		_SC_DELAYTIMER_MAX* = 50;
-		_SC_IOV_MAX* = 51;
-		_SC_IPV6* = 52;
-		_SC_MAPPED_FILES* = 53;
-		_SC_MEMLOCK* = 54;
-		_SC_MEMLOCK_RANGE* = 55;
-		_SC_MEMORY_PROTECTION* = 56;
-		_SC_MESSAGE_PASSING* = 57;
-		_SC_MQ_OPEN_MAX* = 58;
-		_SC_MQ_PRIO_MAX* = 59;
-		_SC_PRIORITIZED_IO* = 60;
-		_SC_PRIORITY_SCHEDULING* = 61;
-		_SC_RAW_SOCKETS* = 62;
-		_SC_READER_WRITER_LOCKS* = 63;
-		_SC_REALTIME_SIGNALS* = 64;
-		_SC_REGEXP* = 65;
-		_SC_RTSIG_MAX* = 66;
-		_SC_SEMAPHORES* = 67;
-		_SC_SHARED_MEMORY_OBJECTS* = 68;
-		_SC_SHELL* = 69;
-		_SC_SIGQUEUE_MAX* = 70;
-		_SC_SPAWN* = 71;
-		_SC_SPIN_LOCKS* = 72;
-		_SC_SPORADIC_SERVER* = 73;
-		_SC_SS_REPL_MAX* = 74;
-		_SC_SYNCHRONIZED_IO* = 75;
-		_SC_SYMLOOP_MAX* = 76;
-		_SC_THREAD_ATTR_STACKADDR* = 77;
-		_SC_THREAD_ATTR_STACKSIZE* = 78;
-		_SC_THREAD_CPUTIME* = 79;
-		_SC_THREAD_DESTRUCTOR_ITERATIONS* = 80;
-		_SC_THREAD_KEYS_MAX* = 81;
-		_SC_THREAD_PRIO_INHERIT* = 82;
-		_SC_THREAD_PRIO_PROTECT* = 83;
-		_SC_THREAD_PRIORITY_SCHEDULING* = 84;
-		_SC_THREAD_PROCESS_SHARED* = 85;
-		_SC_THREAD_ROBUST_PRIO_INHERIT* = 86;
-		_SC_THREAD_ROBUST_PRIO_PROTECT* = 87;
-		_SC_THREAD_SPORADIC_SERVER* = 88;
-		_SC_THREAD_STACK_MIN* = 89;
-		_SC_THREAD_THREADS_MAX* = 90;
-		_SC_THREADS* = 91;
-		_SC_TIMEOUTS* = 92;
-		_SC_TIMER_MAX* = 93;
-		_SC_TIMERS* = 94;
-		_SC_TRACE* = 95;
-		_SC_TRACE_EVENT_FILTER* = 96;
-		_SC_TRACE_EVENT_NAME_MAX* = 97;
-		_SC_TRACE_INHERIT* = 98;
-		_SC_TRACE_LOG* = 99;
-		_SC_GETGR_R_SIZE_MAX* = 100;
-		_SC_GETPW_R_SIZE_MAX* = 101;
-		_SC_LOGIN_NAME_MAX* = 102;
-		_SC_THREAD_SAFE_FUNCTIONS* = 103;
-		_SC_TRACE_NAME_MAX* = 104;
-		_SC_TRACE_SYS_MAX* = 105;
-		_SC_TRACE_USER_EVENT_MAX* = 106;
-		_SC_TTY_NAME_MAX* = 107;
-		_SC_TYPED_MEMORY_OBJECTS* = 108;
-		_SC_V6_ILP32_OFF32* = 109;
-		_SC_V6_ILP32_OFFBIG* = 110;
-		_SC_V6_LP64_OFF64* = 111;
-		_SC_V6_LPBIG_OFFBIG* = 112;
-		_SC_V7_ILP32_OFF32* = 113;
-		_SC_V7_ILP32_OFFBIG* = 114;
-		_SC_V7_LP64_OFF64* = 115;
-		_SC_V7_LPBIG_OFFBIG* = 116;
-		_SC_XOPEN_CRYPT* = 117;
-		_SC_XOPEN_ENH_I18N* = 118;
-		_SC_XOPEN_LEGACY* = 119;
-		_SC_XOPEN_REALTIME* = 120;
-		_SC_XOPEN_REALTIME_THREADS* = 121;
-		_SC_XOPEN_STREAMS* = 122;
-		_SC_XOPEN_UNIX* = 123;
-		_SC_XOPEN_UUCP* = 124;
-		_SC_XOPEN_VERSION* = 125;
-		_SC_PHYS_PAGES* = 500;
-		_SC_AVPHYS_PAGES* = 501;
-		_SC_NPROCESSORS_CONF* = 502;
-		_SC_NPROCESSORS_ONLN* = 503;
-
-
-		SIGSTKSZ* = 8192 + 32768;
-
-		(* ENOENT, EEXIST, EACCES, ENOMEM, EDQUOT, EMFILE, ENOTDIR (int) *)
-		EPERM* = 1; (* Operation not permitted *)
-		ENOENT* = 2; (* No such file or directory *)
-		ESRCH* = 3; (* No such process *)
-		EINTR* = 4; (* Interrupted system call *)
-		EIO* = 5; (* Input/output error *)
-		ENXIO* = 6; (* Device not configured *)
-		E2BIG* = 7; (* Argument list too long *)
-		ENOEXEC* = 8; (* Exec format error *)
-		EBADF* = 9; (* Bad file descriptor *)
-		ECHILD* = 10; (* No child processes *)
-		EDEADLK* = 11; (* Resource deadlock avoided *)
-		ENOMEM* = 12; (* Cannot allocate memory *)
-		EACCES* = 13; (* Permission denied *)
-		EFAULT* = 14; (* Bad address *)
-		EBUSY* = 16; (* Device busy *)
-		EEXIST* = 17; (* File exists *)
-		EXDEV* = 18; (* Cross-device link *)
-		ENODEV* = 19; (* Operation not supported by device *)
-		ENOTDIR* = 20; (* Not a directory *)
-		EISDIR* = 21; (* Is a directory *)
-		EINVAL* = 22; (* Invalid argument *)
-		ENFILE* = 23; (* Too many open files in system *)
-		EMFILE* = 24; (* Too many open files *)
-		ENOTTY* = 25; (* Inappropriate ioctl for device *)
-		ETXTBSY* = 26; (* Text file busy *)
-		EFBIG* = 27; (* File too large *)
-		ENOSPC* = 28; (* No space left on device *)
-		ESPIPE* = 29; (* Illegal seek *)
-		EROFS* = 30; (* Read-only file system *)
-		EMLINK* = 31; (* Too many links *)
-		EPIPE* = 32; (* Broken pipe *)
-		EDOM* = 33; (* Numerical argument out of domain *)
-		ERANGE* = 34; (* Result too large *)
-		EAGAIN* = 35; (* Resource temporarily unavailable *)
-		EWOULDBLOCK* = EAGAIN; (* Operation would block *)
-		EINPROGRESS* = 36; (* Operation now in progress *)
-		EALREADY* = 37; (* Operation already in progress *)
-		ENOTSOCK* = 38; (* Socket operation on non-socket *)
-		EDESTADDRREQ* = 39; (* Destination address required *)
-		EMSGSIZE* = 40; (* Message too long *)
-		EPROTOTYPE* = 41; (* Protocol wrong type for socket *)
-		ENOPROTOOPT* = 42; (* Protocol not available *)
-		EPROTONOSUPPORT* = 43; (* Protocol not supported *)
-		EOPNOTSUPP* = 45; (* Operation not supported *)
-		EAFNOSUPPORT* = 47; (* Address family not supported by protocol family *)
-		EADDRINUSE* = 48; (* Address already in use *)
-		EADDRNOTAVAIL* = 49; (* Can't assign requested address *)
-		ENETDOWN* = 50; (* Network is down *)
-		ENETUNREACH* = 51; (* Network is unreachable *)
-		ENETRESET* = 52; (* Network dropped connection on reset *)
-		ECONNABORTED* = 53; (* Software caused connection abort *)
-		ECONNRESET* = 54; (* Connection reset by peer *)
-		ENOBUFS* = 55; (* No buffer space available *)
-		EISCONN* = 56; (* Socket is already connected *)
-		ENOTCONN* = 57; (* Socket is not connected *)
-		ETIMEDOUT* = 60; (* Operation timed out *)
-		ECONNREFUSED* = 61; (* Connection refused *)
-		ELOOP* = 62; (* Too many levels of symbolic links *)
-		ENAMETOOLONG* = 63; (* File name too long *)
-		EHOSTUNREACH* = 65; (* No route to host *)
-		ENOTEMPTY* = 66; (* Directory not empty *)
-		EDQUOT* = 69; (* Disk quota exceeded *)
-		ESTALE* = 70; (* Stale NFS file handle *)
-		ENOLCK* = 77; (* No locks available *)
-		ENOSYS* = 78; (* Function not implemented *)
-		EILSEQ* = 84; (* Illegal byte sequence *)
-		EOVERFLOW* = 87; (* Value too large to be stored in data type *)
-		ECANCELED* = 88; (* Operation canceled *)
-		EIDRM* = 89; (* Identifier removed *)
-		ENOMSG* = 90; (* No message of desired type *)
-		ENOTSUP* = 91; (* Not supported *)
-		EBADMSG* = 92; (* Bad message *)
-		ENOTRECOVERABLE* = 93; (* State not recoverable *)
-		EOWNERDEAD* = 94; (* Previous owner died *)
-		EPROTO* = 95; (* Protocol error *)
-		ENOTBLK* = 15; (* Block device required *)
-		ESOCKTNOSUPPORT* = 44; (* Socket type not supported *)
-		EPFNOSUPPORT* = 46; (* Protocol family not supported *)
-		ESHUTDOWN* = 58; (* Can't send after socket shutdown *)
-		ETOOMANYREFS* = 59; (* Too many references: can't splice *)
-		EHOSTDOWN* = 64; (* Host is down *)
-		EPROCLIM* = 67; (* Too many processes *)
-		EUSERS* = 68; (* Too many users *)
-		EREMOTE* = 71; (* Too many levels of remote in path *)
-		EBADRPC* = 72; (* RPC struct is bad *)
-		ERPCMISMATCH* = 73; (* RPC version wrong *)
-		EPROGUNAVAIL* = 74; (* RPC program not available *)
-		EPROGMISMATCH* = 75; (* Program version wrong *)
-		EPROCUNAVAIL* = 76; (* Bad procedure for program *)
-		EFTYPE* = 79; (* Inappropriate file type or format *)
-		EAUTH* = 80; (* Authentication error *)
-		ENEEDAUTH* = 81; (* Need authenticator *)
-		EIPSEC* = 82; (* IPsec processing failure *)
-		ENOATTR* = 83; (* Attribute not found *)
-		ENOMEDIUM* = 85; (* No medium found *)
-		EMEDIUMTYPE* = 86; (* Wrong medium type *)
-		ELAST* = 95; (* Must be equal largest errno *)
-		ERESTART* = -1; (* restart syscall *)
-		EJUSTRETURN* = -2; (* don't modify regs, just return *)
-
-
-		WAIT_ANY* = -1; (* any process *)
-		WAIT_MYPGRP* = 0; (* any process in my process group *)
-		WCONTINUED* = {3}; (* report a job control continued process *)
-		WNOHANG* = {0}; (* don't hang in wait *)
-		WUNTRACED* = {1}; (* tell about stopped, untraced children *)
-
-
-		NAME_MAX* = 255;
-
-		SEEK_SET* = 0;
-		SEEK_CUR* = 1;
-		SEEK_END* = 2;
-
-		STDIN_FILENO* = 0;
-		STDOUT_FILENO* = 1;
-		STDERR_FILENO* = 2;
-
-		P_tmpdir* = "/tmp";
-
-		(* O_RDWR, O_NONBLOCK (intFlags) *)
-		O_SHLOCK* = {4}; (* open with shared file lock *)
-		O_EXLOCK* = {5}; (* open with exclusive file lock *)
-		O_ASYNC* = {6}; (* signal pgrp when data ready *)
-		O_NOFOLLOW* = {8}; (* if path is a symlink, don't follow *)
-		O_SYNC* = {7}; (* synchronous writes *)
-		O_RDONLY* = {}; (* open for reading only *)
-		O_WRONLY* = {0}; (* open for writing only *)
-		O_RDWR* = {1}; (* open for reading and writing *)
-		O_ACCMODE* = {0,1}; (* mask for above modes *)
-		O_NONBLOCK* = {2}; (* no delay *)
-		O_APPEND* = {3}; (* set append mode *)
-		O_CREAT* = {9}; (* create if nonexistent *)
-		O_TRUNC* = {10}; (* truncate to zero length *)
-		O_EXCL* = {11}; (* error if already exists *)
-		O_DSYNC* = O_SYNC; (* synchronous data writes *)
-		O_RSYNC* = O_SYNC; (* synchronous reads *)
-		O_NOCTTY* = {15}; (* don't assign controlling terminal *)
-		O_CLOEXEC* = {16}; (* atomically set FD_CLOEXEC *)
-		O_DIRECTORY* = {17}; (* fail if not a directory *)
-
-
-		CLOCK_REALTIME* = 0;
-		CLOCK_PROCESS_CPUTIME_ID* = 2;
-		CLOCK_MONOTONIC* = 3;
-		CLOCK_THREAD_CPUTIME_ID* = 4;
-		CLOCK_UPTIME* = 5;
-		CLOCK_BOOTTIME* = 6;
-
-
-	TYPE
-		StrArray* = POINTER TO ARRAY [untagged] OF PtrSTR;
-		PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR;
-
-		(* PtrVoid, int, long, size_t, ssize_t, off_t, time_t, clock_t, sigjmp_buf *)
-		(* mode_t, intFlags, sigset_t (set) *)
-		PtrVoid* = INTEGER;
-		int* = INTEGER;
-		long* = INTEGER;
-		ulong* = INTEGER;
-		size_t* = INTEGER;
-		ssize_t* = INTEGER;
-		off_t* = LONGINT;
-		clock_t* = LONGINT;
-		clockid_t* = INTEGER;
-		time_t* = LONGINT;
-		mode_t* = SET;
-		pid_t* = INTEGER;
-		uid_t* = INTEGER;
-		gid_t* = INTEGER;
-		dev_t* = INTEGER;
-		ino_t* = LONGINT;
-		nlink_t* = INTEGER;
-		blkcnt_t = LONGINT;
-		blksize_t = INTEGER;
-		int8_t* = SHORTCHAR;
-		u_int8_t* = SHORTCHAR;
-		int16_t* = SHORTINT;
-		u_int16_t* = SHORTINT;
-		int32_t* = INTEGER;
-		u_int32_t* = INTEGER;
-		int64_t* = LONGINT;
-		u_int64_t* = LONGINT;
-		wchar_t* = INTEGER;
-		sigjmp_buf* = ARRAY [untagged] 11 OF INTEGER;
-		intFlags* = SET;
-		FILE = ARRAY [untagged] 22 OF INTEGER;
-		sigset_t* = ARRAY [untagged] 4 OF BYTE;
-		PtrSigset_t* = POINTER [untagged] TO sigset_t;
-
-
-		tm* = POINTER TO tmDesc;
-		tmDesc* = RECORD [untagged]
-			(* NOTE: check record size *)
-			(* tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday [ , tm_gmtoff ] *)
-			(* OpenBSD 6.0 /usr/include/time.h *)
-				tm_sec*: int; (* seconds after the minute [0-60] *)
-				tm_min*: int; (* minutes after the hour [0-59] *)
-				tm_hour*: int; (* hours since midnight [0-23] *)
-				tm_mday*: int; (* day of the month [1-31] *)
-				tm_mon*: int; (* months since January [0-11] *)
-				tm_year*: int; (* years since 1900 *)
-				tm_wday*: int; (* days since Sunday [0-6] *)
-				tm_yday*: int; (* days since January 1 [0-365] *)
-				tm_isdst*: int; (* Daylight Saving Time flag *)
-				tm_gmtoff*: long; (* offset from UTC in seconds *)
-				tm_zone*: PtrSTR; (* timezone abbreviation *)
-		END;
-
-		Ptrsiginfo_t* = POINTER TO siginfo_t;
-		siginfo_t = RECORD [untagged]
-			(* si_code, fault address *)
-			(* OpenBSD 5.9 /usr/include/sys/siginfo.h *)
-				si_signo*: int; (* signal from signal.h *)
-				si_code*: int; (* code from above *)
-				si_errno*: int; (* error from errno.h *)
-				_data*: RECORD [union]
-					_pad*: ARRAY [untagged] 29 (* SI_PAD *) OF int; (* for future growth *)
-					_proc*: RECORD [untagged] (* kill(), SIGCLD, siqqueue() *)
-						_pid*: pid_t; (* process ID *)
-						_pdata*: RECORD [union]
-							_kill*: RECORD [untagged]
-								_uid*: uid_t;
-(*
-								_value*: sigval;
-*)
-								_value*: int
-							END;
-							_cld*: RECORD [untagged]
-								_utime*: clock_t;
-								_stime*: clock_t;
-								_status*: int;
-							END;
-						END;
-					END;
-					_fault*: RECORD [untagged] (* SIGSEGV, SIGBUS, SIGILL and SIGFPE *)
-						_addr*: PtrVoid; (* faulting address *)
-						_trapno*: int; (* illegal trap number *)
-					END;
-				END;
-		END;
-
-		Ptrucontext_t* = POINTER TO ucontext_t;
-		ucontext_t = RECORD [untagged]
-			(* IP, SP, FP *)
-			(* OpenBSD 5.9 /usr/include/i386/signal.h struct sigcontext *)
-				sc_gs*: int;
-				sc_fs*: int;
-				sc_es*: int;
-				sc_ds*: int;
-				sc_edi*: int;
-				sc_esi*: int;
-				sc_ebp*: int;
-				sc_ebx*: int;
-				sc_edx*: int;
-				sc_ecx*: int;
-				sc_eax*: int;
-				(* XXX *)
-				sc_eip*: int;
-				sc_cs*: int;
-				sc_eflags*: int;
-				sc_esp*: int;
-				sc_ss*: int;
-
-				__sc_unused: int;
-				sc_mask*: int; (* signal mask to restore *)
-
-				sc_trapno*: int; (* XXX should be above *)
-				sc_err*: int;
-
-				sc_fpstate*: RECORD [union]
-					(* OpenBSD 5.9 /usr/include/i386/npx.h union savefpu *)
-(*
-						sv_87*: RECORD [untagged]
-							...
-						END;
-						sv_xmm*: RECORD [untagged]
-							...
-						END;
-*)
-				END;
-		END;
-
-		sa_sigaction_t* = PROCEDURE [ccall] (sig: int; siginfo: Ptrsiginfo_t; context: Ptrucontext_t);
-		sigaction_t* = RECORD [untagged]
-(*
-			sa_sigaction*: sa_sigaction_t,
-			sa_flags*: intFlags, sa_mask*: sigset_t
-*)
-			(* OpenBSD 5.9 /usr/include/sys/signal.h *)
-				sa_sigaction*: sa_sigaction_t;
-				sa_mask*: sigset_t;
-				sa_flags*: intFlags;
-		END;
-
-		stack_t* = RECORD [untagged]
-(*
-			ss_sp*: PtrVoid, ss_size*: size_t, ss_flags*: intFlags
-*)
-			(* OpenBSD 5.9 /usr/include/sys/signal.h *)
-				ss_sp*: PtrVoid; (* signal stack base *)
-				ss_size*: size_t; (* signal stack length *)
-				ss_flags*: intFlags; (* SS_DISABLE and/or SS_ONSTACK *)
-		END;
-
-		stat_t* = RECORD [untagged]
-(*
-			NOTE: check record size
-			st_mode*: mode_t, st_size*: off_t, st_mtime*: time_t
-*)
-			(* OpenBSD 5.9 /usr/include/sys/stat.h *)
-				st_mode*: mode_t;
-				st_dev*: dev_t;
-				st_ino*: ino_t;
-				st_nlink*: nlink_t;
-				st_uid*: uid_t;
-				st_gid*: gid_t;
-				st_rdev*: dev_t;
-
-				st_atime*: time_t;
-				st_atimensec*: long;
-				st_mtime*: time_t;
-				st_mtimensec*: long;
-				st_ctime*: time_t;
-				st_ctimensec*: long;
-
-				st_size*: off_t;
-				st_blocks*: blkcnt_t;
-				st_blksize*: blksize_t;
-				st_flags*: u_int32_t;
-				st_gen*: u_int32_t;
-
-				__st_birthtime*: time_t;
-				__st_birthtimensec*: long;
-		END;
-
-		PtrFILE* = PtrVoid;
-		PtrDIR* = PtrVoid;
-
-		PtrDirent* = POINTER TO Dirent;
-		Dirent = RECORD [untagged]
-(*
-			d_name*: ARRAY [untagged] NAME_MAX + 1 OF SHORTCHAR
-*)
-			(* OpenBSD 5.9 /usr/include/sys/dirent.h *)
-				d_fileno*: ino_t; (* file number of entry *)
-				d_off*: off_t; (* offset after this entry *)
-				d_reclen*: u_int16_t; (* length of this record *)
-				d_type*: u_int8_t; (* file type, see below *)
-				d_namlen*: u_int8_t; (* length of string in d_name *)
-				__d_padding: ARRAY [untagged] 4 OF u_int8_t; (* suppress padding after d_name *)
-				d_name*: ARRAY [untagged] 255 + 1 OF SHORTCHAR;
-		END;
-
-		timespec_t* = RECORD [untagged]
-			(* OpenBSD 5.9 /usr/include/time.h *)
-				tv_sec*: time_t; (* seconds *)
-				tv_nsec*: long; (* and nanoseconds *)
-		END;
-
-(*
-	VAR
-		stdin*: INTEGER;
-		timezone*: INTEGER; (* or tm.tm_gmtoff *)
-*)
-(*
-	PROCEDURE [ccall] __errno_location* (): PtrVoid;
-*)
-(*
-	(* POSIX.1 *)
-		PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int;
-*)
-(*
-	VAR
-		(* OpenBSD: stdin, stdout, stderr *)
-			__sF*: ARRAY [untagged] 3 OF FILE; (* OpenBSD 5.8 /usr/include/stdio.h *)
-				(*
-					stdin = SYSTEM.ADR(__sF[0])
-					stdout = SYSTEM.ADR(__sF[1])
-					stderr = SYSTEM.ADR(__sF[2])
-				*)
-*)
-
-	PROCEDURE [ccall] __errno_location* ["__errno"] (): PtrVoid;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int;
-
-		PROCEDURE [ccall] lseek* (d: int; offset: off_t; whence: int): off_t;
-
-	(* XPG4 *)
-		PROCEDURE [ccall] fseeko* (stream: PtrFILE; offset: off_t; whence: int): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] sigsetjmp* (VAR env: sigjmp_buf; savemask: int): int;
-
-
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] clock* (): clock_t;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] clock_gettime* (clock_id: clockid_t; VAR tp: timespec_t): int;
-
-	PROCEDURE [ccall] mmap* (adr: PtrVoid; len: size_t; prot: intFlags; flags: intFlags; fd: int; offset: off_t): PtrVoid;
-	(* BSD *)
-		PROCEDURE [ccall] munmap* (adr: PtrVoid; len: size_t): int;
-		PROCEDURE [ccall] mprotect* (adr: PtrVoid; len: size_t; prot: intFlags): int;
-
-(*
-	PROCEDURE [ccall] calloc* (nmemb: size_t; size: size_t): PtrVoid;
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] malloc* (size: size_t): PtrVoid;
-*)
-		PROCEDURE [ccall] free* (ptr: PtrVoid);
-
-	(* AT&T *)
-		PROCEDURE [ccall] time* (VAR [nil] t: time_t): time_t;
-	PROCEDURE [ccall] gmtime* (VAR [nil] t: time_t): tm;
-	PROCEDURE [ccall] localtime* (VAR [nil] t: time_t): tm;
-
-	(* POSIX.1 *)
-(*
-		PROCEDURE [ccall] sigsetjmp* (VAR env: sigjmp_buf; savemask: int): int;
-*)
-		PROCEDURE [ccall] siglongjmp* (VAR env: sigjmp_buf; val: int);
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] sigemptyset* (set: PtrSigset_t): int;
-		PROCEDURE [ccall] sigfillset* (set: PtrSigset_t): int;
-		PROCEDURE [ccall] sigaddset* (set: PtrSigset_t; signo: int): int;
-		PROCEDURE [ccall] sigprocmask* (how: int; set: PtrSigset_t; oset: PtrSigset_t): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] sigaction* (sig: int; VAR [nil] act: sigaction_t; VAR [nil] oact: sigaction_t): int;
-
-	(* BSD *)
-		PROCEDURE [ccall] sigaltstack* (VAR [nil] ss: stack_t; VAR [nil] oss: stack_t): int;
-
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] getenv* (s: PtrSTR): PtrSTR;
-
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] fopen* (path, mode: PtrSTR): PtrFILE;
-		PROCEDURE [ccall] fdopen* (fildes: int; mode: PtrSTR): PtrFILE;
-		PROCEDURE [ccall] fclose* (stream: PtrFILE): int;
-		PROCEDURE [ccall] fread* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t;
-		PROCEDURE [ccall] fwrite* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t;
-		PROCEDURE [ccall] fflush* (s: PtrFILE): int;
-		PROCEDURE [ccall] printf* (s: PtrSTR): int;
-	(* ANSI C 89, XPG4 *)
-		PROCEDURE [ccall] fseek* (stream: PtrFILE; offset: long; whence: int): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] fileno* (stream: PtrFILE): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] rename* (from, to: PtrSTR): int;
-		PROCEDURE [ccall] mkdir* (path: PtrSTR; mode: mode_t): int;
-		PROCEDURE [ccall] opendir* (filename: PtrSTR): PtrDIR;
-		PROCEDURE [ccall] readdir* (dirp: PtrDIR): PtrDirent;
-		PROCEDURE [ccall] closedir* (dirp: PtrDIR): int;
-	(* ANSI C 89, XPG4.2 *)
-		PROCEDURE [ccall] remove* (path: PtrSTR): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] getcwd* (buf: PtrSTR; size: size_t): PtrSTR;
-
-	(* ANSI C 99 *)
-		PROCEDURE [ccall] exit* (status: int);
-
-	(* ANSI C 89 *)
-		PROCEDURE [ccall] strftime* (buf: PtrSTR; maxsize: size_t; format: PtrSTR; timeptr: tm): size_t;
-
-	(* XXX: use fread instead *)
-		PROCEDURE [ccall] fgets* (str: PtrSTR; size: int; stream: PtrFILE): PtrSTR;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] open* (path: PtrSTR; flags: intFlags; mode: mode_t): int;
-		PROCEDURE [ccall] write* (d: int; buf: PtrVoid; nbytes: size_t): ssize_t;
-		PROCEDURE [ccall] read* (d: int; buf: PtrVoid; nbytes: size_t): ssize_t;
-		PROCEDURE [ccall] close* (d: int): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] chmod* (path: PtrSTR; mode: mode_t): int;
-		PROCEDURE [ccall] fchmod* (fd: int; mode: mode_t): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] fork* (): pid_t;
-		PROCEDURE [ccall] waitpid* (wpid: pid_t; VAR [nil] status: int; options: intFlags): pid_t;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] execv* (path: PtrSTR; argv: POINTER [untagged] TO ARRAY [untagged] OF PtrSTR): int;
-		PROCEDURE [ccall] execvp* (file: PtrSTR; argv: POINTER [untagged] TO ARRAY [untagged] OF PtrSTR): int;
-
-	(* POSIX.2 *)
-		PROCEDURE [ccall] system* (string: PtrSTR): int;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] sysconf* (name: int): long;
-
-	PROCEDURE [ccall] popen* (command, type: PtrSTR): PtrFILE;
-	PROCEDURE [ccall] pclose* (stream: PtrFILE): int;
-
-END LinLibc.

BIN
BlackBox/_OpenBSD_/Lin/Mod/Net.odc


+ 0 - 320
BlackBox/_OpenBSD_/Lin/Mod/Net.txt

@@ -1,320 +0,0 @@
-MODULE LinNet ["libc.so.96"];
-
-	(*
-		OpenBSD 6.6
-		i386
-	*)
-
-	CONST
-		NULL* = 0H;
-
-		SOCKET_ERROR* = -1;
-		INVALID_SOCKET* = -1;
-
-		INADDR_NONE* = -1;
-		INADDR_ANY* = 0;
-
-		(* socket domains *)
-			AF_UNSPEC* = 0; (* unspecified *)
-			AF_UNIX* = 1; (* local to host *)
-			AF_LOCAL* = AF_UNIX; (* draft POSIX compatibility *)
-			AF_INET* = 2; (* internetwork: UDP, TCP, etc. *)
-			AF_IMPLINK* = 3; (* arpanet imp addresses *)
-			AF_PUP* = 4; (* pup protocols: e.g. BSP *)
-			AF_CHAOS* = 5; (* mit CHAOS protocols *)
-			AF_NS* = 6; (* XEROX NS protocols *)
-			AF_ISO* = 7; (* ISO protocols *)
-			AF_ECMA* = 8; (* european computer manufacturers *)
-			AF_DATAKIT* = 9; (* datakit protocols *)
-			AF_CCITT* = 10; (* CCITT protocols, X.25 etc *)
-			AF_SNA* = 11; (* IBM SNA *)
-			AF_DECnet* = 12; (* DECnet *)
-			AF_DLI* = 13; (* DEC Direct data link interface *)
-			AF_LAT* = 14; (* LAT *)
-			AF_HYLINK* = 15; (* NSC Hyperchannel *)
-			AF_APPLETALK* = 16; (* Apple Talk *)
-			AF_ROUTE* = 17; (* Internal Routing Protocol *)
-			AF_LINK* = 18; (* Link layer interface *)
-			AF_COIP* = 20; (* connection-oriented IP, aka ST II *)
-			AF_CNT* = 21; (* Computer Network Technology *)
-			AF_IPX* = 23; (* Novell Internet Protocol *)
-			AF_INET6* = 24; (* IPv6 *)
-			AF_ISDN* = 26; (* Integrated Services Digital Network *)
-			AF_E164* = AF_ISDN; (* CCITT E.164 recommendation *)
-			AF_NATM* = 27; (* native ATM access *)
-			AF_ENCAP* = 28;
-			AF_SIP* = 29; (* Simple Internet Protocol *)
-			AF_KEY* = 30;
-			AF_BLUETOOTH* = 32; (* Bluetooth *)
-			AF_MPLS* = 33; (* MPLS *)
-			AF_MAX* = 36;
-
-		(* socket types *)
-			SOCK_STREAM* = 1; (* stream socket *)
-			SOCK_DGRAM* = 2; (* datagram socket *)
-			SOCK_RAW* = 3; (* raw-protocol interface *)
-			SOCK_RDM* = 4; (* reliably-delivered message *)
-			SOCK_SEQPACKET* = 5; (* sequenced packet stream *)
-
-		(* socket protocols *)
-			IPPROTO_IP* = 0; (* dummy for IP *)
-			IPPROTO_HOPOPTS* = IPPROTO_IP; (* Hop-by-hop option header *)
-			IPPROTO_ICMP* = 1; (* control message protocol *)
-			IPPROTO_IGMP* = 2; (* group mgmt protocol *)
-			IPPROTO_GGP* = 3; (* gateway^2 (deprecated) *)
-			IPPROTO_IPIP* = 4; (* IP inside IP *)
-			IPPROTO_IPV4* = IPPROTO_IPIP; (* IP inside IP *)
-			IPPROTO_TCP* = 6; (* tcp *)
-			IPPROTO_EGP* = 8; (* exterior gateway protocol *)
-			IPPROTO_PUP* = 12; (* pup *)
-			IPPROTO_UDP* = 17; (* user datagram protocol *)
-			IPPROTO_IDP* = 22; (* xns idp *)
-			IPPROTO_TP* = 29; (* tp-4 w/ class negotiation *)
-			IPPROTO_IPV6* = 41; (* IPv6 in IPv6 *)
-			IPPROTO_ROUTING* = 43; (* Routing header *)
-			IPPROTO_FRAGMENT* = 44; (* Fragmentation/reassembly header *)
-			IPPROTO_RSVP* = 46; (* resource reservation *)
-			IPPROTO_GRE* = 47; (* GRE encap, RFCs 1701/1702 *)
-			IPPROTO_ESP* = 50; (* Encap. Security Payload *)
-			IPPROTO_AH* = 51; (* Authentication header *)
-			IPPROTO_MOBILE* = 55; (* IP Mobility, RFC 2004 *)
-			IPPROTO_ICMPV6* = 58; (* ICMP for IPv6 *)
-			IPPROTO_NONE* = 59; (* No next header *)
-			IPPROTO_DSTOPTS* = 60; (* Destination options header *)
-			IPPROTO_EON* = 80; (* ISO cnlp *)
-			IPPROTO_ETHERIP* = 97; (* Ethernet in IPv4 *)
-			IPPROTO_ENCAP* = 98; (* encapsulation header *)
-			IPPROTO_PIM* = 103; (* Protocol indep. multicast *)
-			IPPROTO_IPCOMP* = 108; (* IP Payload Comp. Protocol *)
-			IPPROTO_CARP* = 112; (* CARP *)
-			IPPROTO_UDPLITE* = 136; (* UDP-Lite, RFC 3828 *)
-			IPPROTO_MPLS* = 137; (* unicast MPLS packet *)
-			IPPROTO_PFSYNC* = 240; (* PFSYNC *)
-			IPPROTO_RAW* = 255; (* raw IP packet *)
-			IPPROTO_MAX* = 256;
-			IPPROTO_DIVERT* = 258; (* Divert sockets *)
-			IPPROTO_DONE* = 257;
-
-		(* socket options *)
-			SO_DEBUG* = {0}; (* turn on debugging info recording *)
-			SO_ACCEPTCONN* = {1}; (* socket has had listen() *)
-			SO_REUSEADDR* = {2}; (* allow local address reuse *)
-			SO_KEEPALIVE* = {3}; (* keep connections alive *)
-			SO_DONTROUTE* = {4}; (* just use interface addresses *)
-			SO_BROADCAST* = {5}; (* permit sending of broadcast msgs *)
-			SO_USELOOPBACK* = {6}; (* bypass hardware when possible *)
-			SO_LINGER* = {7}; (* linger on close if data present *)
-			SO_OOBINLINE* = {8}; (* leave received OOB data in line *)
-			SO_REUSEPORT* = {9}; (* allow local address & port reuse *)
-			SO_TIMESTAMP* = {11}; (* timestamp received dgram traffic *)
-			SO_BINDANY* = {12}; (* allow bind to any address *)
-			SO_ZEROIZE* = {13}; (* zero out all mbufs sent over socket *)
-			SO_SNDBUF* = {0,12}; (* send buffer size *)
-			SO_RCVBUF* = {1,12}; (* receive buffer size *)
-			SO_SNDLOWAT* = {0,1,12}; (* send low-water mark *)
-			SO_RCVLOWAT* = {2,12}; (* receive low-water mark *)
-			SO_SNDTIMEO* = {0,2,12}; (* send timeout *)
-			SO_RCVTIMEO* = {1,2,12}; (* receive timeout *)
-			SO_ERROR* = {0..2,12}; (* get error status and clear *)
-			SO_TYPE* = {3,12}; (* get socket type *)
-			SO_NETPROC* = {5,12}; (* multiplex; network processing *)
-			SO_RTABLE* = {0,5,12}; (* routing table to be used *)
-			SO_PEERCRED* = {1,5,12}; (* get connect-time credentials *)
-			SO_SPLICE* = {0,1,5,12}; (* splice data to other socket *)
-			SO_DOMAIN* = {2,5,12}; (* get socket domain *)
-			SO_PROTOCOL* = {0,2,5,12}; (* get socket protocol *)
-
-		SHUT_RD* = 0;
-		SHUT_WR* = 1;
-		SHUT_RDWR* = 2;
-
-		SOL_SOCKET* = 0FFFFH; (* {0..15} *) (* options for socket level *)
-
-		MSG_OOB* = {0}; (* process out-of-band data *)
-		MSG_PEEK* = {1}; (* peek at incoming message *)
-		MSG_DONTROUTE* = {2}; (* send without using routing tables *)
-		MSG_EOR* = {3}; (* data completes record *)
-		MSG_TRUNC* = {4}; (* data discarded before delivery *)
-		MSG_CTRUNC* = {5}; (* control data lost before delivery *)
-		MSG_WAITALL* = {6}; (* wait for full request or error *)
-		MSG_DONTWAIT* = {7}; (* this message should be nonblocking *)
-		MSG_BCAST* = {8}; (* this message rec'd as broadcast *)
-		MSG_MCAST* = {9}; (* this message rec'd as multicast *)
-		MSG_NOSIGNAL* = {10}; (* do not send SIGPIPE *)
-		MSG_CMSG_CLOEXEC* = {11}; (* set FD_CLOEXEC on received fds *)
-
-		SOMAXCONN* = 128;
-
-		(* addrinfo.ai_flags *)
-			AI_PASSIVE* = {0}; (* socket address is intended for bind() *)
-			AI_CANONNAME* = {1}; (* request for canonical name *)
-			AI_NUMERICHOST* = {2}; (* don't ever try hostname lookup *)
-			AI_EXT* = {3}; (* enable non-portable extensions *)
-			AI_NUMERICSERV* = {4}; (* don't ever try servname lookup *)
-			AI_FQDN* = {5}; (* return the FQDN that was resolved *)
-			AI_ADDRCONFIG* = {6}; (* return configured address families only *)
-
-		(* getaddrinfo/getnameinfo/gai_strerror error codes *)
-			EAI_BADFLAGS* = -1; (* invalid value for ai_flags *)
-			EAI_NONAME* = -2; (* name or service is not known *)
-			EAI_AGAIN* = -3; (* temporary failure in name resolution *)
-			EAI_FAIL* = -4; (* non-recoverable failure in name resolution *)
-			EAI_NODATA* = -5; (* no address associated with name *)
-			EAI_FAMILY* = -6; (* ai_family not supported *)
-			EAI_SOCKTYPE* = -7; (* ai_socktype not supported *)
-			EAI_SERVICE* = -8; (* service not supported for ai_socktype *)
-			EAI_ADDRFAMILY* = -9; (* address family for name not supported *)
-			EAI_MEMORY* = -10; (* memory allocation failure *)
-			EAI_SYSTEM* = -11; (* system error (code indicated in errno) *)
-			EAI_BADHINTS* = -12; (* invalid value for hints *)
-			EAI_PROTOCOL* = -13; (* resolved protocol is unknown *)
-			EAI_OVERFLOW* = -14; (* argument buffer overflow *)
-
-		(* OpenBSD 6.0 /usr/include/sys/select.h *)
-			FD_SETSIZE = 1024;
-			__NBBY = 8;
-
-	TYPE
-		u_int8_t = SHORTCHAR;
-		int8_t = SHORTCHAR;
-		uint16_t = SHORTINT;
-		(* PtrVoid, int, intFlags, short, socklen_t, size_t, ssize_t, in_addr_t, in_port_t, time_t, suseconds_t, nfds_t, sa_family_t *)
-		PtrVoid* = INTEGER;
-		short* = SHORTINT;
-		int* = INTEGER;
-		intFlags* = SET;
-		size_t* = INTEGER;
-		ssize_t* = INTEGER;
-		time_t* = LONGINT;
-		suseconds_t* = INTEGER;
-		socklen_t* = INTEGER;
-		in_addr_t* = INTEGER;
-		in_port_t* = SHORTINT;
-		nfds_t* = INTEGER;
-		sa_family_t* = SHORTCHAR;
-
-		PtrSTR* = POINTER [untagged] TO ARRAY [untagged] OF SHORTCHAR;
-
-		SOCKET* = int;
-
-(*
-		in_addr* = RECORD [untagged]
-			s_addr*: in_addr_t;
-		END;
-*)
-		in_addr* = RECORD [untagged]
-			S_un*: RECORD [union]
-				S_un_b*: RECORD [untagged]
-					s_b1*: SHORTCHAR;
-					s_b2*: SHORTCHAR;
-					s_b3*: SHORTCHAR;
-					s_b4*: SHORTCHAR;
-				END;
-				S_un_w*: RECORD [untagged]
-					s_w1*: SHORTINT;
-					s_w2*: SHORTINT;
-				END;
-				S_addr*: in_addr_t;
-			END;
-		END;
-
-		Ptrsockaddr* = POINTER [untagged] TO sockaddr;
-		sockaddr* = RECORD [untagged]
-			(* OpenBSD /usr/include/sys/socket.h *)
-				sa_len*: SHORTCHAR; (* total length *)
-				sa_family*: sa_family_t; (* address family *)
-				sa_data*: ARRAY [untagged] 14 OF SHORTCHAR; (* actually longer; address value *)
-		END;
-
-		Ptrsockaddr_storage = POINTER [untagged] TO sockaddr_storage;
-		sockaddr_storage* = RECORD [untagged]
-			(* OpenBSD 6.0 /usr/include/sys/socket.h *)
-				ss_len*: SHORTCHAR; (* total length *)
-				ss_family*: sa_family_t; (* address family *)
-				__ss_pad1: ARRAY [untagged] 6 OF SHORTCHAR; (* align to quad *)
-				__ss_pad2: LONGINT; (* force alignment for stupid compilers *)
-				__ss_pad3: ARRAY [untagged] 240 OF SHORTCHAR; (* pad to a total of 256 bytes *)
-		END;
-
-		Ptrsockaddr_in* = POINTER [untagged] TO sockaddr_in;
-		sockaddr_in* = RECORD [untagged]
-			(* OpenBSD /usr/include/netinet/in.h *)
-				sin_len*: u_int8_t;
-				sin_family*: sa_family_t;
-				sin_port*: in_port_t;
-				sin_addr*: in_addr;
-				sin_zero*: ARRAY [untagged] 8 OF int8_t;
-		END;
-
-		Ptraddrinfo* = POINTER [untagged] TO addrinfo;
-		addrinfo* = RECORD [untagged]
-			(* OpenBSD 6.0 /usr/include/netdb.h *)
-				ai_flags*: intFlags; (* input flags *)
-				ai_family*: int; (* protocol family for socket *)
-				ai_socktype*: int; (* socket type *)
-				ai_protocol*: int; (* protocol for socket *)
-				ai_addrlen*: socklen_t; (* length of socket-address *)
-				ai_addr*: Ptrsockaddr; (* socket-address for socket *)
-				ai_canonname*: PtrSTR; (* canonical name for service location (iff req) *)
-				ai_next*: Ptraddrinfo; (* pointer to next in list *)
-		END;
-
-		timeval* = RECORD [untagged]
-			(* Linux, FreeBSD, OpenBSD *)
-				tv_sec*: time_t; (* seconds *)
-				tv_usec*: suseconds_t; (* and microseconds *)
-		END;
-
-		pollfd* = RECORD [untagged]
-			(* Linux, FreeBSD, OpenBSD *)
-				fd*: int;
-				events*: short;
-				revents*: short;
-		END;
-
-		(* OpenBSD 6.0 /usr/include/sys/select.h *)
-			__fd_mask = SET;
-			fd_set* = ARRAY [untagged] (FD_SETSIZE + (SIZE(__fd_mask) * __NBBY - 1)) DIV (SIZE(__fd_mask) * __NBBY) OF __fd_mask;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] socket* (domain: int; type: int; protocol: int): SOCKET;
-		PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET;
-		PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int;
-		PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int;
-		PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): int;
-		PROCEDURE [ccall] listen* (s: SOCKET; backlog: int): int;
-		PROCEDURE [ccall] recv* (s: SOCKET; buf: PtrVoid; len: size_t; flags: intFlags): ssize_t;
-		PROCEDURE [ccall] recvfrom* (s: SOCKET; buf: PtrVoid; len: size_t; flags: intFlags; VAR from: sockaddr; VAR fromlen: socklen_t): ssize_t;
-		PROCEDURE [ccall] send* (s: SOCKET; msg: PtrVoid; len: size_t; flags: intFlags): ssize_t;
-		PROCEDURE [ccall] sendto* (s: SOCKET; msg: PtrVoid; len: size_t; flags: intFlags; VAR to: sockaddr; tolen: socklen_t): ssize_t;
-		PROCEDURE [ccall] shutdown* (s: SOCKET; how: int): int;
-		PROCEDURE [ccall] getsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; VAR [nil] optlen: socklen_t): int;
-		PROCEDURE [ccall] setsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; optlen: socklen_t): int;
-
-		PROCEDURE [ccall] inet_addr* (cp: PtrSTR): in_addr_t;
-		PROCEDURE [ccall] htons* (host16: uint16_t): uint16_t;
-
-		PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): int;
-
-		PROCEDURE [ccall] poll* (VAR fds: ARRAY [untagged] OF pollfd; nfds: nfds_t; timeout: int): int;
-
-(*
-	PROCEDURE FD_ZERO (VAR set: Net.fd_set);
-		VAR i: INTEGER;
-	BEGIN
-		i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0
-	END FD_ZERO;
-
-	PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set);
-	BEGIN
-		INCL(set[fd DIV 32], fd MOD 32)
-	END FD_SET;
-*)
-
-	(* POSIX.1g *)
-		PROCEDURE [ccall] getaddrinfo* (hostname: PtrSTR; servname: PtrSTR; VAR [nil] hints: addrinfo; VAR res: Ptraddrinfo): int;
-		PROCEDURE [ccall] freeaddrinfo* (ai: Ptraddrinfo);
-
-		PROCEDURE [ccall] gai_strerror* (ecode: int): PtrSTR;
-
-END LinNet.

BIN
BlackBox/_OpenBSD_/Lin/Mod/Termios.odc


+ 0 - 154
BlackBox/_OpenBSD_/Lin/Mod/Termios.txt

@@ -1,154 +0,0 @@
-MODULE LinTermios ["libc.so.96"];
-
-	(*
-		A. V. Shiryaev, 2012.11, 2013.08, 2015.09
-
-		OpenBSD 6.6
-		32-bit
-	*)
-
-	CONST
-		VEOF* = 0; (* ICANON *)
-		VEOL* = 1; (* ICANON *)
-		VERASE* = 3; (* ICANON *)
-		VKILL* = 5; (* ICANON *)
-		VINTR* = 8; (* ISIG *)
-		VQUIT* = 9; (* ISIG *)
-		VSUSP* = 10; (* ISIG *)
-		VSTART* = 12; (* IXON, IXOFF *)
-		VSTOP* = 13; (* IXON, IXOFF *)
-		VMIN* = 16; (* !ICANON *)
-		VTIME* = 17; (* !ICANON *)
-		NCCS* = 20;
-		IGNBRK* = 00000001H; (* {0} *) (* ignore BREAK condition *)
-		BRKINT* = 00000002H; (* {1} *) (* map BREAK to SIGINT *)
-		IGNPAR* = 00000004H; (* {2} *) (* ignore (discard) parity errors *)
-		PARMRK* = 00000008H; (* {3} *) (* mark parity and framing errors *)
-		INPCK* = 00000010H; (* {4} *) (* enable checking of parity errors *)
-		ISTRIP* = 00000020H; (* {5} *) (* strip 8th bit off chars *)
-		INLCR* = 00000040H; (* {6} *) (* map NL into CR *)
-		IGNCR* = 00000080H; (* {7} *) (* ignore CR *)
-		ICRNL* = 00000100H; (* {8} *) (* map CR to NL (ala CRMOD) *)
-		IXON* = 00000200H; (* {9} *) (* enable output flow control *)
-		IXOFF* = 00000400H; (* {10} *) (* enable input flow control *)
-		OPOST* = 00000001H; (* {0} *) (* enable following output processing *)
-		CSIZE* = 00000300H; (* {8,9} *) (* character size mask *)
-		CS5* = 00000000H; (* {} *) (* 5 bits (pseudo) *)
-		CS6* = 00000100H; (* {8} *) (* 6 bits *)
-		CS7* = 00000200H; (* {9} *) (* 7 bits *)
-		CS8* = 00000300H; (* {8,9} *) (* 8 bits *)
-		CSTOPB* = 00000400H; (* {10} *) (* send 2 stop bits *)
-		CREAD* = 00000800H; (* {11} *) (* enable receiver *)
-		PARENB* = 00001000H; (* {12} *) (* parity enable *)
-		PARODD* = 00002000H; (* {13} *) (* odd parity, else even *)
-		HUPCL* = 00004000H; (* {14} *) (* hang up on last close *)
-		CLOCAL* = 00008000H; (* {15} *) (* ignore modem status lines *)
-		ECHOE* = 00000002H; (* {1} *) (* visually erase chars *)
-		ECHOK* = 00000004H; (* {2} *) (* echo NL after line kill *)
-		ECHO* = 00000008H; (* {3} *) (* enable echoing *)
-		ECHONL* = 00000010H; (* {4} *) (* echo NL even if ECHO is off *)
-		ISIG* = 00000080H; (* {7} *) (* enable signals INTR, QUIT, [D]SUSP *)
-		ICANON* = 00000100H; (* {8} *) (* canonicalize input lines *)
-		IEXTEN* = 00000400H; (* {10} *) (* enable DISCARD and LNEXT *)
-		EXTPROC* = 00000800H; (* {11} *) (* external processing *)
-		TOSTOP* = 00400000H; (* {22} *) (* stop background jobs from output *)
-		NOFLSH* = 80000000H; (* {31} *) (* don't flush after interrupt *)
-		TCSANOW* = 0; (* make change immediate *)
-		TCSADRAIN* = 1; (* drain output, then change *)
-		TCSAFLUSH* = 2; (* drain output, flush input *)
-		B0* = 0;
-		B50* = 50;
-		B75* = 75;
-		B110* = 110;
-		B134* = 134;
-		B150* = 150;
-		B200* = 200;
-		B300* = 300;
-		B600* = 600;
-		B1200* = 1200;
-		B1800* = 1800;
-		B2400* = 2400;
-		B4800* = 4800;
-		B9600* = 9600;
-		B19200* = 19200;
-		B38400* = 38400;
-		VEOL2* = 2; (* ICANON *)
-		VWERASE* = 4; (* ICANON *)
-		VREPRINT* = 6; (* ICANON *)
-		VDSUSP* = 11; (* ISIG *)
-		VLNEXT* = 14; (* IEXTEN *)
-		VDISCARD* = 15; (* IEXTEN *)
-		VSTATUS* = 18; (* ICANON *)
-		IXANY* = 00000800H; (* {11} *) (* any char will restart after stop *)
-		IUCLC* = 00001000H; (* {12} *) (* translate upper to lower case *)
-		IMAXBEL* = 00002000H; (* {13} *) (* ring bell on input queue full *)
-		ONLCR* = 00000002H; (* {1} *) (* map NL to CR-NL (ala CRMOD) *)
-		OXTABS* = 00000004H; (* {2} *) (* expand tabs to spaces *)
-		ONOEOT* = 00000008H; (* {3} *) (* discard EOT's (^D) on output *)
-		OCRNL* = 00000010H; (* {4} *) (* map CR to NL *)
-		OLCUC* = 00000020H; (* {5} *) (* translate lower case to upper case *)
-		ONOCR* = 00000040H; (* {6} *) (* No CR output at column 0 *)
-		ONLRET* = 00000080H; (* {7} *) (* NL performs the CR function *)
-		CIGNORE* = 00000001H; (* {0} *) (* ignore control flags *)
-		CRTSCTS* = 00010000H; (* {16} *) (* RTS/CTS full-duplex flow control *)
-		MDMBUF* = 00100000H; (* {20} *) (* DTR/DCD hardware flow control *)
-		ECHOKE* = 00000001H; (* {0} *) (* visual erase for line kill *)
-		ECHOPRT* = 00000020H; (* {5} *) (* visual erase mode for hardcopy *)
-		ECHOCTL* = 00000040H; (* {6} *) (* echo control chars as ^(Char) *)
-		ALTWERASE* = 00000200H; (* {9} *) (* use alternate WERASE algorithm *)
-		FLUSHO* = 00800000H; (* {23} *) (* output being flushed (state) *)
-		XCASE* = 01000000H; (* {24} *) (* canonical upper/lower case *)
-		NOKERNINFO* = 02000000H; (* {25} *) (* no kernel output from VSTATUS *)
-		PENDIN* = 20000000H; (* {29} *) (* XXX retype pending input (state) *)
-		TCSASOFT* = 10H; (* {4} *) (* flag - don't alter h.w. state *)
-		B7200* = 7200;
-		B14400* = 14400;
-		B28800* = 28800;
-		B57600* = 57600;
-		B76800* = 76800;
-		B115200* = 115200;
-		B230400* = 230400;
-		EXTA* = 19200;
-		EXTB* = 38400;
-		TCIFLUSH* = 1;
-		TCOFLUSH* = 2;
-		TCIOFLUSH* = 3;
-		TCOOFF* = 1;
-		TCOON* = 2;
-		TCIOFF* = 3;
-		TCION* = 4;
-
-	TYPE
-		tcflag_t* = INTEGER; (* unsigned int *)
-		cc_t* = SHORTCHAR; (* unsigned char *)
-		speed_t* = INTEGER; (* unsigned int *)
-		termios* = RECORD [untagged]
-			c_iflag*: tcflag_t; (* input flags *)
-			c_oflag*: tcflag_t; (* output flags *)
-			c_cflag*: tcflag_t; (* control flags *)
-			c_lflag*: tcflag_t; (* local flags *)
-			c_cc*: ARRAY [untagged] NCCS OF cc_t; (* control chars *)
-			c_ispeed*: INTEGER; (* input speed *)
-			c_ospeed*: INTEGER; (* output speed *)
-		END;
-
-	(* POSIX.1 *)
-		PROCEDURE [ccall] cfgetispeed* (VAR tp: termios): speed_t;
-		PROCEDURE [ccall] cfsetispeed* (VAR tp: termios; ispeed: speed_t): INTEGER;
-		PROCEDURE [ccall] cfgetospeed* (VAR tp: termios): speed_t;
-		PROCEDURE [ccall] cfsetospeed* (VAR tp: termios; ospeed: speed_t): INTEGER;
-		PROCEDURE [ccall] tcgetattr* (fd: INTEGER; VAR tp: termios): INTEGER;
-		PROCEDURE [ccall] tcsetattr* (fd: INTEGER; action: INTEGER; VAR tp: termios): INTEGER;
-
-		PROCEDURE [ccall] tcdrain* (fd: INTEGER): INTEGER;
-		PROCEDURE [ccall] tcflow* (fd: INTEGER; action: INTEGER): INTEGER;
-		PROCEDURE [ccall] tcflush* (fd: INTEGER; action: INTEGER): INTEGER;
-		PROCEDURE [ccall] tcsendbreak* (fd: INTEGER; len: INTEGER): INTEGER;
-
-	(* extensions *)
-(*
-		PROCEDURE [ccall] cfsetspeed* (VAR tp: termios; speed: speed_t): INTEGER;
-		PROCEDURE [ccall] cfmakeraw* (VAR tp: termios);
-*)
-
-END LinTermios.

+ 1 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/txt2odc.py

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

+ 5 - 2
BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/Makefile

@@ -10,7 +10,10 @@ PY = python2.7
 
 DEFS = defs-basictypes defs-lc
 
-all: LibW.txt ${DEFS}
+all: LibW.odc ${DEFS}
+
+LibW.odc: LibW.txt
+	./txt2odc.py LibW.txt LibW.odc
 
 LibW.txt: LibW.txt.templ ${DEFS} libver osname machine
 	${PY} ./untempl.py LibW.txt.templ ${.TARGET}
@@ -22,4 +25,4 @@ defs-lc:
 	./dumpdefs.py 2 1 i ${INCDIR}/locale.h | grep "	LC_" > ${.TARGET}
 
 clean:
-	rm -f ${DEFS} LibW.txt sizeofs
+	rm -f ${DEFS} LibW.txt LibW.odc sizeofs

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

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

+ 5 - 2
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/Makefile

@@ -10,7 +10,10 @@ PY = python2.7
 
 DEFS = clockspersec defs-map defs-prot defs-sigmask nsig defs-signo defs-fpe defs-sa defs-errno namemax defs-fcntlo defs-basictypes defs-sc defs-clockid defs-wait
 
-all: Libc.txt ${DEFS} strerrnocase.txt
+all: Libc.odc ${DEFS} strerrnocase.txt
+
+Libc.odc: Libc.txt
+	./txt2odc.py Libc.txt Libc.odc
 
 Libc.txt: Libc.txt.templ ${DEFS} libver osname machine custom fields-dirent fields-sigaction fields-siginfo fields-stack fields-stat fields-tm fields-ucontext fields-timespec
 	${PY} ./untempl.py Libc.txt.templ ${.TARGET}
@@ -84,4 +87,4 @@ strerrnocase.txt: dumpstrerrno
 	./dumpstrerrno | ./mkstrerrnocase.py > ${.TARGET}
 
 clean:
-	rm -f ${DEFS} Libc.txt dumpstrerrno dumpstrerrno.c strerrnocase.txt sizeofs
+	rm -f ${DEFS} Libc.txt Libc.odc dumpstrerrno dumpstrerrno.c strerrnocase.txt sizeofs

+ 86 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/txt2odc.py

@@ -0,0 +1,86 @@
+#! /usr/bin/env python2.7
+# -*- coding: utf-8 -*-
+#
+# Alexander Shiryaev, 2020.01
+#
+# Documents.ExportDocument
+#
+# ASCII only
+
+import sys, re
+
+def Int (x):
+	assert x >= 0
+	assert x < 0x100000000
+	return chr(x % 0x100) + chr((x >> 8) % 0x100) + chr((x >> 16) % 0x100) + chr((x >> 24) % 0x100)
+
+hdr0 = "CDOo" + Int(0) + \
+	"\x82\xf1" + "Documents.StdDocumentDesc" + \
+	"\x00\xf1" + "Documents.DocumentDesc" + \
+	"\x00\xf1" + "Containers.ViewDesc" + \
+	"\x00\xf1" + "Views.ViewDesc" + \
+	"\x00\xf0" + "Stores.StoreDesc" + \
+	"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00"
+
+hdr1 = "\x00\x00\x00\x83\xf1" + "Documents.ModelDesc" + \
+	"\x00\xf1" + "Containers.ModelDesc" + \
+	"\x00\xf1" + "Models.ModelDesc" + \
+	"\x00\xf1" + "Stores.ElemDesc" + \
+	"\x00\xf2\x04\x00\x00\x00\x00\x00\x00\x00"
+
+hdr2 = "\x09\x00\x00\x00"
+
+hdr3 = "\x00\x00\x00\x00\x00\x82\xf1" + "TextViews.StdViewDesc" + \
+	"\x00\xf1" + "TextViews.ViewDesc" + \
+	"\x00\xf2\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00"
+
+hdr4 = "\x00\x00\x00\x83\xf1" + "TextModels.StdModelDesc" + \
+	"\x00\xf1" + "TextModels.ModelDesc" + \
+	"\x00\xf2\x06\x00\x00\x00\x00\x00\x00\x00"
+
+hdr5 = "\x0f\x00\x00\x00"
+
+hdr6 = "\x00\x00\x00\x00\x00\x00\x51\x00\x00\x00\x00\x82\xf1" + "TextModels.AttributesDesc" + \
+	"\x00\xf2\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x2a\x00\x18\xf0\x01\x00\x00\x00\x00\x00\x90\x01\x00\x00\x00\x00"
+
+hdr7 = "\xff"
+
+trl = "\x82\xf1" + "TextControllers.StdCtrlDesc" + \
+	"\x00\xf1" + "TextControllers.ControllerDesc" + \
+	"\x00\xf1" + "Containers.ControllerDesc" + \
+	"\x00\xf1" + "Controllers.ControllerDesc" + \
+	"\x00\xf2\x04\x00\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x82\xf1" + "TextRulers.StdRulerDesc" + \
+	"\x00\xf1" + "TextRulers.RulerDesc" + \
+	"\x00\xf2\x03\x00\x00\x00\x00\x00\x00\x00\xab\x00\x00\x00\x07\x00\x00\x00\xa3\x00\x00\x00\x00\x00\x00\x83\xf1" + "TextRulers.StdStyleDesc" + \
+	"\x00\xf1" + "TextRulers.StyleDesc" + \
+	"\x00\xf2\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x5a\x00\x00\x00\x00\x00\x00\x00\x82\xf1" + "TextRulers.AttributesDesc" + \
+	"\x00\xf2\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x20\xa3\x5a\x00\x00\x00\x00\x00\xbb\xf2\x01\x00\x2c\x68\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x82\xf2\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x2a\x00\x18\xf0\x01\x00\x00\x00\x00\x00\x90\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\xf8\x00\x00\x0c\xf8\x00\x00\x2c\x9b\x5b\x00\x0b\xf8\x00\x40\x82\xf1" + "Documents.ControllerDesc" + \
+	"\x00\xf2\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x40\x5b\x73\x00\x00\x99\xa2\x00\x80\xfc\x0a\x00\x80\xfc\x0a\x00\xc0\x5e\x68\x00\x80\x9c\x97\x00\x00"
+
+def splitToLines (text):
+	lines = []
+	[ [ lines.append(l1) for l1 in re.split( '[\r\n]', l ) ] for l in text.split('\r\n') ]
+	return lines
+
+def txt2odc (text):
+	# text = text.replace('\n', chr(0x0d))
+	text = chr(0x0d).join(splitToLines(text))
+
+	l = len(text)
+
+	return hdr0 + Int(l + 873) + hdr1 + Int(l + 695) + hdr2 + Int(l + 687) + hdr3 + Int(l + 601) + hdr4 + Int(l + 99) + hdr5 + Int(l + 91) + hdr6 + Int(l) + hdr7 + text + trl
+
+def main ():
+	if len(sys.argv) == 3:
+		fh = open(sys.argv[1], 'rb')
+		text = fh.read()
+		fh.close()
+
+		fh = open(sys.argv[2], 'wb')
+		fh.write(txt2odc(text))
+		fh.close()
+	else:
+		print("usage: %s file.txt file.odc" % (sys.argv[0],))
+
+if __name__ == '__main__':
+	main()

+ 5 - 2
BlackBox/_OpenBSD_/Lin/Mod/gen-Net/Makefile

@@ -10,7 +10,10 @@ PY = python2.7
 
 DEFS = defs-basictypes defs-af defs-sock defs-proto defs-shut defs-so defs-sol defs-msg defs-ai defs-eai defs-somaxconn
 
-all: Net.txt ${DEFS}
+all: Net.odc ${DEFS}
+
+Net.odc: Net.txt
+	./txt2odc.py Net.txt Net.odc
 
 Net.txt: Net.txt.templ ${DEFS} libver osname machine fields-sockaddr fields-sockaddr_in fields-sockaddr_storage fields-addrinfo defs-fd_set-const defs-fd_set-type
 	${PY} ./untempl.py Net.txt.templ ${.TARGET}
@@ -49,4 +52,4 @@ defs-eai:
 	./dumpdefs.py 3 1 i ${INCDIR}/netdb.h | grep "	EAI_" > ${.TARGET}
 
 clean:
-	rm -f ${DEFS} Net.txt sizeofs
+	rm -f ${DEFS} Net.txt Net.odc sizeofs

+ 1 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-Net/txt2odc.py

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

+ 5 - 2
BlackBox/_OpenBSD_/Lin/Mod/gen-Termios/Makefile

@@ -6,7 +6,10 @@
 
 INCDIR ?= /usr/include
 
-all: Termios.txt
+all: Termios.odc
+
+Termios.odc: Termios.txt
+	./txt2odc.py Termios.txt Termios.odc
 
 PY = python2.7
 DEFS = defs-termios
@@ -20,4 +23,4 @@ defs-termios:
 	./dumpdefs.py 2 2 i ${INCDIR}/termios.h | grep -v compat | grep -v CHWFLOW >> ${.TARGET}
 
 clean:
-	rm -f Termios.txt ${DEFS}
+	rm -f Termios.txt Termios.odc ${DEFS}

+ 1 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-Termios/txt2odc.py

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