mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 08:42:24 +00:00
parent
ffbd45b735
commit
99d0d1c0db
2 changed files with 7 additions and 8 deletions
|
|
@ -26,13 +26,6 @@ BEGIN
|
||||||
|
|
||||||
END DoSmth;
|
END DoSmth;
|
||||||
|
|
||||||
PROCEDURE htons(in: Int16; VAR out : Int16);
|
|
||||||
BEGIN
|
|
||||||
out[0] := in[1];
|
|
||||||
out[1] := in[0];
|
|
||||||
END htons;
|
|
||||||
|
|
||||||
|
|
||||||
PROCEDURE ZeroByteArr(VAR a : ARRAY OF S.BYTE);
|
PROCEDURE ZeroByteArr(VAR a : ARRAY OF S.BYTE);
|
||||||
VAR i : LONGINT;
|
VAR i : LONGINT;
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
@ -61,7 +54,7 @@ BEGIN
|
||||||
|
|
||||||
types.IntegerToInt16(sockets.AfInet, afinet);
|
types.IntegerToInt16(sockets.AfInet, afinet);
|
||||||
types.IntegerToInt16(Port, port);
|
types.IntegerToInt16(Port, port);
|
||||||
htons(port, port0); (* only necessary on little endian computers *)
|
types.htons(port, port0); (* only necessary on little endian computers *)
|
||||||
ServAddr.SinFamily := afinet;
|
ServAddr.SinFamily := afinet;
|
||||||
ServAddr.SinPort := port0;
|
ServAddr.SinPort := port0;
|
||||||
ZeroByteArr(ServAddr.SinZero);
|
ZeroByteArr(ServAddr.SinZero);
|
||||||
|
|
|
||||||
|
|
@ -29,4 +29,10 @@ TYPE
|
||||||
int16[1] := intarr[1];*) (* this will work for little endian -- noch *)
|
int16[1] := intarr[1];*) (* this will work for little endian -- noch *)
|
||||||
END IntegerToInt16;
|
END IntegerToInt16;
|
||||||
|
|
||||||
|
PROCEDURE htons*(in: Int16; VAR out : Int16);
|
||||||
|
BEGIN
|
||||||
|
out[0] := in[1];
|
||||||
|
out[1] := in[0];
|
||||||
|
END htons;
|
||||||
|
|
||||||
END types.
|
END types.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue