X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/e27ef2c6aab3a2a8051314bd37bb3b2386775f36..968c333d05db5d5ecf3599f8e304c67e64f21159:/binipstuff.pas?ds=inline diff --git a/binipstuff.pas b/binipstuff.pas index ae3d23a..93363e2 100644 --- a/binipstuff.pas +++ b/binipstuff.pas @@ -4,25 +4,28 @@ ----------------------------------------------------------------------------- } unit binipstuff; +{$ifdef fpc} +{$mode delphi} +{$endif} + interface {$include lcoreconfig.inc} uses - {$ifndef win32}{$ifdef ipv6}sockets,{$endif}{$endif} +{$ifndef mswindows} + sockets, +{$endif} pgtypes; -{$ifdef fpc} - {$mode delphi} -{$endif} -{$ifdef cpu386}{$define i386}{$endif} -{$ifdef i386}{$define ENDIAN_LITTLE}{$endif} + +{$include pgtypes.inc} {$include uint32.inc} const hexchars:array[0..15] of ansichar='0123456789abcdef'; - {$ifdef win32} + {$ifdef mswindows} AF_INET=2; AF_INET6=23; {$else} @@ -36,7 +39,7 @@ const type {$ifdef ipv6} - {$ifdef win32} + {$ifdef mswindows} {$define want_Tin6_addr} {$endif} {$ifdef ver1_0} @@ -67,7 +70,7 @@ type {$endif} end; - {$ifdef win32} + {$ifdef mswindows} TInetSockAddr = packed Record family:Word; port :Word; @@ -382,6 +385,13 @@ begin end; end; end; + + {run length atleast 2 0 words} + if (runlength = 1) then begin + runlength := 0; + runbegin := 0; + end; + result := ''; for a := 0 to runbegin-1 do begin if (a <> 0) then result := result + ':';