|
@@ -137,21 +137,44 @@ Var
|
|
{ ---------------------------------------------------------------------
|
|
{ ---------------------------------------------------------------------
|
|
Auxiliary functions.
|
|
Auxiliary functions.
|
|
---------------------------------------------------------------------}
|
|
---------------------------------------------------------------------}
|
|
|
|
+
|
|
|
|
+function htonl(i:integer):integer;
|
|
|
|
+begin
|
|
|
|
+ {$ifdef ENDIAN_LITTLE}
|
|
|
|
+ result := (i shr 24) or (i shr 8 and $ff00) or (i shl 8 and $ff0000) or (i shl 24 and $ff000000);
|
|
|
|
+ {$else}
|
|
|
|
+ result := i;
|
|
|
|
+ {$endif}
|
|
|
|
+end
|
|
|
|
|
|
Function htons(var W : Word) : word;
|
|
Function htons(var W : Word) : word;
|
|
|
|
|
|
begin
|
|
begin
|
|
- w:=Swap(w);
|
|
|
|
- Result:=W;
|
|
|
|
|
|
+ {$ifdef ENDIAN_LITTLE}
|
|
|
|
+ result := ((w and $ff00) shr 8) or ((w and $ff) shl 8);
|
|
|
|
+ {$else}
|
|
|
|
+ result := w;
|
|
|
|
+ {$endif}
|
|
end;
|
|
end;
|
|
|
|
|
|
Function ntohs(var W : Word) : Word;
|
|
Function ntohs(var W : Word) : Word;
|
|
|
|
|
|
begin
|
|
begin
|
|
- w:=Swap(w);
|
|
|
|
- Result:=W;
|
|
|
|
|
|
+ {$ifdef ENDIAN_LITTLE}
|
|
|
|
+ result := ((w and $ff00) shr 8) or ((w and $ff) shl 8);
|
|
|
|
+ {$else}
|
|
|
|
+ result := w;
|
|
|
|
+ {$endif}
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function ntohl(i:integer):integer;
|
|
|
|
+begin
|
|
|
|
+ {$ifdef ENDIAN_LITTLE}
|
|
|
|
+ result := (i shr 24) or (i shr 8 and $ff00) or (i shl 8 and $ff0000) or (i shl 24 and $ff000000);
|
|
|
|
+ {$else}
|
|
|
|
+ result := i;
|
|
|
|
+ {$endif}
|
|
|
|
+end;
|
|
|
|
|
|
{ ---------------------------------------------------------------------
|
|
{ ---------------------------------------------------------------------
|
|
Resolve.conf handling
|
|
Resolve.conf handling
|
|
@@ -955,7 +978,10 @@ end.
|
|
|
|
|
|
{
|
|
{
|
|
$Log$
|
|
$Log$
|
|
- Revision 1.5 2003-09-28 09:34:02 peter
|
|
|
|
|
|
+ Revision 1.6 2003-09-29 07:44:11 michael
|
|
|
|
+ + Endian patch from bas [email protected]
|
|
|
|
+
|
|
|
|
+ Revision 1.5 2003/09/28 09:34:02 peter
|
|
* unix fix for 1.0.x
|
|
* unix fix for 1.0.x
|
|
|
|
|
|
Revision 1.4 2003/09/18 16:30:23 marco
|
|
Revision 1.4 2003/09/18 16:30:23 marco
|
|
@@ -964,4 +990,4 @@ end.
|
|
Revision 1.3 2003/05/17 20:54:03 michael
|
|
Revision 1.3 2003/05/17 20:54:03 michael
|
|
+ uriparser unit added. Header/Footer blocks added
|
|
+ uriparser unit added. Header/Footer blocks added
|
|
|
|
|
|
-}
|
|
|
|
|
|
+}
|