X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/954f0e552e0d08f00fe962dd3bc9c1a324841aa2..6dc5aa808483fdb8531afc990f26f1138bf2ddac:/binipstuff.pas?ds=inline diff --git a/binipstuff.pas b/binipstuff.pas index 94a0c03..93363e2 100644 --- a/binipstuff.pas +++ b/binipstuff.pas @@ -4,27 +4,28 @@ ----------------------------------------------------------------------------- } unit binipstuff; +{$ifdef fpc} +{$mode delphi} +{$endif} + interface {$include lcoreconfig.inc} uses -{$ifndef win32} +{$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} @@ -38,7 +39,7 @@ const type {$ifdef ipv6} - {$ifdef win32} + {$ifdef mswindows} {$define want_Tin6_addr} {$endif} {$ifdef ver1_0} @@ -69,7 +70,7 @@ type {$endif} end; - {$ifdef win32} + {$ifdef mswindows} TInetSockAddr = packed Record family:Word; port :Word; @@ -384,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 + ':';