mirror of
https://github.com/vishapoberon/vipak.git
synced 2026-04-06 21:12:25 +00:00
moved Internet files to its subdirectory
This commit is contained in:
parent
12b8ca56c5
commit
6757ca74b5
4 changed files with 0 additions and 0 deletions
41
types.Mod
41
types.Mod
|
|
@ -1,41 +0,0 @@
|
|||
MODULE types; (*noch 23.2.2017 / 13.4.2017*)
|
||||
IMPORT SYS := SYSTEM;
|
||||
|
||||
|
||||
TYPE
|
||||
intarr64 = ARRAY 8 OF SYS.BYTE; (* to emulate int16 on x86_64; -- noch *)
|
||||
intarr32 = ARRAY 4 OF SYS.BYTE;
|
||||
intarr16 = ARRAY 2 OF SYS.BYTE;
|
||||
Int16* = INTEGER; (* INTEGER on 32 bit platform *)
|
||||
Int32* = LONGINT;
|
||||
Int64* = HUGEINT;
|
||||
String* = ARRAY 256 OF CHAR;
|
||||
|
||||
PROCEDURE HugeintToInt16*(in: HUGEINT; VAR out: Int16);
|
||||
VAR
|
||||
int64 : intarr64;
|
||||
int16 : intarr16;
|
||||
BEGIN
|
||||
int64 := SYS.VAL(intarr64, in);
|
||||
int16[0] := int64[0];
|
||||
int16[1] := int64[1];
|
||||
out := SYS.VAL(Int16, int16)
|
||||
END HugeintToInt16;
|
||||
|
||||
PROCEDURE LongintToInt16*(int: LONGINT; VAR int16: Int16);
|
||||
BEGIN
|
||||
int16 := SYS.VAL(Int16, int)
|
||||
END LongintToInt16;
|
||||
|
||||
PROCEDURE htons*(in: Int16; VAR out : Int16);
|
||||
VAR
|
||||
tmpin, tmpout : intarr16;
|
||||
BEGIN
|
||||
tmpin := SYS.VAL(intarr16, in);
|
||||
tmpout := SYS.VAL(intarr16, out);
|
||||
tmpout[0] := tmpin[1];
|
||||
tmpout[1] := tmpin[0];
|
||||
out := SYS.VAL(Int16, tmpout)
|
||||
END htons;
|
||||
|
||||
END types.
|
||||
Loading…
Add table
Add a link
Reference in a new issue