]> gitweb.factorcode.org Git - factor.git/commitdiff
Move win32-handle to windows.handles and update using lists to avoid pulling in the...
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 16 Sep 2010 20:40:36 +0000 (15:40 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 16 Sep 2010 20:40:36 +0000 (15:40 -0500)
basis/io/backend/windows/nt/nt.factor
basis/io/backend/windows/windows.factor
basis/io/launcher/windows/nt/nt.factor
basis/io/mmap/windows/windows.factor
basis/io/sockets/windows/windows.factor
basis/random/windows/windows.factor
basis/windows/handles/authors.txt [new file with mode: 0644]
basis/windows/handles/handles.factor [new file with mode: 0644]
basis/windows/time/time.factor

index aa8a61b87ac8455599b6e8b3a1a7f57cb463d611..3114073c9d220416cc53dbc42880e26eb3254851 100755 (executable)
@@ -1,11 +1,10 @@
-USING: alien alien.c-types alien.data alien.syntax arrays assocs
-combinators continuations destructors io io.backend io.ports
-io.timeouts io.backend.windows io.files.windows
-io.files.windows.nt io.files io.pathnames io.buffers
-io.streams.c io.streams.null libc kernel math namespaces
-sequences threads windows windows.errors windows.kernel32
-strings splitting ascii system accessors locals classes.struct
-combinators.short-circuit ;
+USING: accessors alien alien.c-types alien.data alien.syntax
+arrays assocs classes.struct combinators
+combinators.short-circuit destructors io io.backend
+io.backend.windows io.buffers io.files.windows io.ports
+io.streams.c io.streams.null io.timeouts kernel libc locals
+math namespaces sequences system threads windows.errors
+windows.handles windows.kernel32 ;
 IN: io.backend.windows.nt
 
 ! Global variable with assoc mapping overlapped to threads
 IN: io.backend.windows.nt
 
 ! Global variable with assoc mapping overlapped to threads
index 8864dff9ada6cf353d42829f2369429a2b4af2e8..e0dd8062122794b15442dfdf31fee84e2e61eac3 100755 (executable)
@@ -1,37 +1,10 @@
-! Copyright (C) 2004, 2008 Mackenzie Straight, Doug Coleman.
+! Copyright (C) 2004, 2010 Mackenzie Straight, Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.c-types arrays destructors io io.backend
-io.buffers io.files io.ports io.binary io.timeouts system
-strings kernel math namespaces sequences windows.errors
-windows.kernel32 windows.shell32 windows.types splitting
-continuations math.bitwise accessors init sets assocs
-classes.struct classes literals ;
+USING: accessors alien.c-types classes.struct destructors
+io.backend kernel literals windows.errors windows.handles
+windows.kernel32 ;
 IN: io.backend.windows
 
 IN: io.backend.windows
 
-TUPLE: win32-handle < disposable handle ;
-
-: set-inherit ( handle ? -- )
-    [ handle>> HANDLE_FLAG_INHERIT ] dip
-    >BOOLEAN SetHandleInformation win32-error=0/f ;
-
-: new-win32-handle ( handle class -- win32-handle )
-    new-disposable swap >>handle
-    dup f set-inherit ;
-
-: <win32-handle> ( handle -- win32-handle )
-    win32-handle new-win32-handle ;
-
-M: win32-handle dispose* ( handle -- )
-    handle>> CloseHandle win32-error=0/f ;
-
-TUPLE: win32-file < win32-handle ptr ;
-
-: <win32-file> ( handle -- win32-file )
-    win32-file new-win32-handle ;
-
-M: win32-file dispose
-    [ cancel-operation ] [ call-next-method ] bi ;
-
 HOOK: CreateFile-flags io-backend ( DWORD -- DWORD )
 HOOK: FileArgs-overlapped io-backend ( port -- overlapped/f )
 HOOK: add-completion io-backend ( port -- )
 HOOK: CreateFile-flags io-backend ( DWORD -- DWORD )
 HOOK: FileArgs-overlapped io-backend ( port -- overlapped/f )
 HOOK: add-completion io-backend ( port -- )
@@ -47,7 +20,7 @@ CONSTANT: share-mode
         FILE_SHARE_WRITE
         FILE_SHARE_DELETE
     }
         FILE_SHARE_WRITE
         FILE_SHARE_DELETE
     }
-
+    
 : default-security-attributes ( -- obj )
     SECURITY_ATTRIBUTES <struct>
     SECURITY_ATTRIBUTES heap-size >>nLength ;
 : default-security-attributes ( -- obj )
     SECURITY_ATTRIBUTES <struct>
     SECURITY_ATTRIBUTES heap-size >>nLength ;
index 959bf931199665bd1e0420de290e3554a9b64ce9..3651785242dce89c016a53a42d88118a6832bcb3 100644 (file)
@@ -1,11 +1,10 @@
 ! Copyright (C) 2007, 2008 Doug Coleman, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 ! Copyright (C) 2007, 2008 Doug Coleman, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.c-types arrays continuations destructors io
-io.backend.windows libc io.ports io.pipes windows.types math
-windows.kernel32 windows namespaces make io.launcher kernel
-sequences windows.errors assocs splitting system strings
-io.launcher.windows io.files.windows io.backend io.files
-io.files.private combinators shuffle accessors locals ;
+USING: accessors alien.c-types combinators destructors
+io.backend io.backend.windows io.files.windows io.launcher
+io.launcher.windows io.pipes io.ports kernel locals strings
+system windows.errors windows.handles windows.kernel32
+windows.types ;
 IN: io.launcher.windows.nt
 
 : duplicate-handle ( handle -- handle' )
 IN: io.launcher.windows.nt
 
 : duplicate-handle ( handle -- handle' )
index b1191082b36d78f22b5f69e25ae0f08ef91c9bf2..27382a511821a5244fd7ecf24e7382e3fbad9a18 100644 (file)
@@ -1,8 +1,7 @@
-USING: alien alien.c-types arrays destructors generic io.mmap
-io.ports io.backend.windows io.files.windows io.backend.windows.privileges
-io.mmap.private kernel libc math math.bitwise namespaces quotations sequences
-windows windows.advapi32 windows.kernel32 io.backend system
-accessors locals windows.errors literals ;
+USING: accessors destructors io.backend.windows.privileges
+io.files.windows io.mmap io.mmap.private kernel literals locals
+math math.bitwise system windows.errors windows.handles
+windows.kernel32 ;
 IN: io.mmap.windows
 
 : create-file-mapping ( hFile lpAttributes flProtect dwMaximumSizeHigh dwMaximumSizeLow lpName -- HANDLE )
 IN: io.mmap.windows
 
 : create-file-mapping ( hFile lpAttributes flProtect dwMaximumSizeHigh dwMaximumSizeLow lpName -- HANDLE )
index d14833e61e4dd1e3a2357a4707b9626b9a36973e..3d9b3a6e14c9e04ba98a108ded0f850edf11d3ae 100755 (executable)
@@ -1,8 +1,9 @@
 ! Copyright (C) 2007, 2009 Slava Pestov, Doug Coleman.\r
 ! See http://factorcode.org/license.txt for BSD license.\r
 ! Copyright (C) 2007, 2009 Slava Pestov, Doug Coleman.\r
 ! See http://factorcode.org/license.txt for BSD license.\r
-USING: kernel accessors io.sockets io.sockets.private\r
-io.backend.windows io.backend windows.winsock system destructors\r
-alien.c-types classes.struct combinators ;\r
+USING: accessors alien.c-types classes.struct combinators\r
+destructors io.backend io.backend.windows io.sockets\r
+io.sockets.private kernel system windows.handles\r
+windows.winsock ;\r
 FROM: namespaces => get ;\r
 IN: io.sockets.windows\r
 \r
 FROM: namespaces => get ;\r
 IN: io.sockets.windows\r
 \r
index 55d568f01d088cb455f8bd3bf209d2cc433b21a5..0bf08b78783eb1f7b0393f21f5c195c3002b3ccd 100755 (executable)
@@ -1,8 +1,7 @@
-USING: accessors alien.c-types alien.data byte-arrays
-combinators.short-circuit continuations destructors init kernel
-locals namespaces random windows.advapi32 windows.errors
-windows.kernel32 windows.types math.bitwise sequences fry
-literals io.backend.windows ;
+USING: accessors alien.data byte-arrays continuations
+destructors init kernel literals locals namespaces random
+sequences windows.advapi32 windows.errors windows.handles
+windows.types ;
 IN: random.windows
 
 TUPLE: windows-crypto-context < win32-handle provider type ;
 IN: random.windows
 
 TUPLE: windows-crypto-context < win32-handle provider type ;
diff --git a/basis/windows/handles/authors.txt b/basis/windows/handles/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/basis/windows/handles/handles.factor b/basis/windows/handles/handles.factor
new file mode 100644 (file)
index 0000000..70ffdf8
--- /dev/null
@@ -0,0 +1,29 @@
+! Copyright (C) 2010 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors destructors io.timeouts kernel windows.errors
+windows.kernel32 windows.types ;
+IN: windows.handles
+
+TUPLE: win32-handle < disposable handle ;
+
+: set-inherit ( handle ? -- )
+    [ handle>> HANDLE_FLAG_INHERIT ] dip
+    >BOOLEAN SetHandleInformation win32-error=0/f ;
+
+: new-win32-handle ( handle class -- win32-handle )
+    new-disposable swap >>handle
+    dup f set-inherit ;
+
+: <win32-handle> ( handle -- win32-handle )
+    win32-handle new-win32-handle ;
+
+M: win32-handle dispose* ( handle -- )
+    handle>> CloseHandle win32-error=0/f ;
+
+TUPLE: win32-file < win32-handle ptr ;
+
+: <win32-file> ( handle -- win32-file )
+    win32-file new-win32-handle ;
+
+M: win32-file dispose
+    [ cancel-operation ] [ call-next-method ] bi ;
index 904c85200e583509959a70edf683461f5815ed8f..913e613312ebd369adf405b4ffa911ca89d69e6a 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.c-types kernel math windows.errors
 windows.kernel32 windows.types namespaces calendar math.bitwise
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.c-types kernel math windows.errors
 windows.kernel32 windows.types namespaces calendar math.bitwise
-accessors classes.struct ;
+accessors classes.struct windows.handles ;
 IN: windows.time
 
 : >64bit ( lo hi -- n )
 IN: windows.time
 
 : >64bit ( lo hi -- n )