Move win32-handle to windows.handles and update using lists to avoid pulling in the io backend where not necessary

release
Doug Coleman 2010-09-16 15:40:36 -05:00
parent 77db248759
commit 5c8316be07
9 changed files with 60 additions and 60 deletions

View File

@ -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

View File

@ -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.
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
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 -- )
@ -47,7 +20,7 @@ CONSTANT: share-mode
FILE_SHARE_WRITE
FILE_SHARE_DELETE
}
: default-security-attributes ( -- obj )
SECURITY_ATTRIBUTES <struct>
SECURITY_ATTRIBUTES heap-size >>nLength ;

View File

@ -1,11 +1,10 @@
! 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' )

View 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 )

View File

@ -1,8 +1,9 @@
! Copyright (C) 2007, 2009 Slava Pestov, Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel accessors io.sockets io.sockets.private
io.backend.windows io.backend windows.winsock system destructors
alien.c-types classes.struct combinators ;
USING: accessors alien.c-types classes.struct combinators
destructors io.backend io.backend.windows io.sockets
io.sockets.private kernel system windows.handles
windows.winsock ;
FROM: namespaces => get ;
IN: io.sockets.windows

View File

@ -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 ;

View File

@ -0,0 +1 @@
Doug Coleman

View File

@ -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 ;

View 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
accessors classes.struct ;
accessors classes.struct windows.handles ;
IN: windows.time
: >64bit ( lo hi -- n )