]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/windows/iphlpapi/iphlpapi.factor
factor: trim using lists
[factor.git] / basis / windows / iphlpapi / iphlpapi.factor
index 8f910e0d269f4dce59d1c7865c256a5f98ab33af..90bc278730165c63db0215105afc1a72004978d1 100644 (file)
@@ -1,11 +1,10 @@
 ! Copyright (C) 2010 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien alien.c-types alien.data alien.strings
-alien.syntax arrays byte-arrays classes.struct combinators
-combinators.smart destructors io.encodings.string
-io.encodings.utf8 io.sockets io.sockets.private kernel libc
-make refs sequences sequences.extras windows.errors
-windows.kernel32 windows.types windows.winsock fry ;
+USING: accessors alien alien.c-types alien.data alien.syntax
+classes.struct combinators combinators.smart destructors
+io.encodings.string io.encodings.utf8 io.sockets.private kernel
+libc make sequences windows.errors windows.kernel32
+windows.types windows.winsock ;
 IN: windows.iphlpapi
 
 LIBRARY: iphlpapi
@@ -386,7 +385,7 @@ FUNCTION: DWORD GetAdaptersInfo (
 FUNCTION: DWORD GetNetworkParams ( PFIXED_INFO pFixedInfo, PULONG pOutBufLen )
 
 : get-fixed-info ( -- FIXED_INFO )
-    FIXED_INFO <struct> dup byte-length ulong <ref>
+    FIXED_INFO new dup byte-length ulong <ref>
     [ GetNetworkParams n>win32-error-check ] keepd ;
 
 : dns-server-ips ( -- sequence )
@@ -404,7 +403,7 @@ FUNCTION: DWORD GetNetworkParams ( PFIXED_INFO pFixedInfo, PULONG pOutBufLen )
 <PRIVATE
 
 : loop-list ( obj -- seq )
-    [ [ dup [ Next>> ] when ] keep ] loop>array nip ;
+    [ Next>> ] follow ;
 
 ! Don't use this, use each/map-adapters
 : iterate-interfaces ( -- seq )