From d632a1dfc7f6ae40566a13ae98de709805c906e8 Mon Sep 17 00:00:00 2001 From: Mackenzie Straight Date: Wed, 29 Dec 2004 07:16:03 +0000 Subject: [PATCH] Minor cleanups; fix copyright notices --- factor.vcproj | 10 ++++++++-- library/bootstrap/win32-io.factor | 2 +- library/io/buffer.factor | 2 +- library/io/win32-console.factor | 2 +- library/io/win32-io-internals.factor | 7 +++++-- library/io/win32-server.factor | 27 +++++++++++---------------- library/io/win32-stream.factor | 2 +- library/win32/win32-errors.factor | 2 +- library/win32/win32-io.factor | 2 +- library/win32/winsock.factor | 2 +- 10 files changed, 31 insertions(+), 27 deletions(-) diff --git a/factor.vcproj b/factor.vcproj index 0f86356cea..6726f24b2c 100644 --- a/factor.vcproj +++ b/factor.vcproj @@ -19,7 +19,7 @@ + + @@ -391,6 +394,9 @@ + + diff --git a/library/bootstrap/win32-io.factor b/library/bootstrap/win32-io.factor index 561adcd24f..2cfe934d43 100644 --- a/library/bootstrap/win32-io.factor +++ b/library/bootstrap/win32-io.factor @@ -2,7 +2,7 @@ ! $Id$ ! -! Copyright (C) 2003, 2004 Slava Pestov. +! Copyright (C) 2003, 2004 Mackenzie Straight. ! ! Redistribution and use in source and binary forms, with or without ! modification, are permitted provided that the following conditions are met: diff --git a/library/io/buffer.factor b/library/io/buffer.factor index 0a44ef0716..bfbec80db5 100644 --- a/library/io/buffer.factor +++ b/library/io/buffer.factor @@ -2,7 +2,7 @@ ! $Id$ ! -! Copyright (C) 2004 Slava Pestov. +! Copyright (C) 2004 Mackenzie Straight. ! ! Redistribution and use in source and binary forms, with or without ! modification, are permitted provided that the following conditions are met: diff --git a/library/io/win32-console.factor b/library/io/win32-console.factor index d9cdd34605..5f5cbb82f3 100644 --- a/library/io/win32-console.factor +++ b/library/io/win32-console.factor @@ -2,7 +2,7 @@ ! $Id$ ! -! Copyright (C) 2004 Slava Pestov. +! Copyright (C) 2004 Mackenzie Straight. ! ! Redistribution and use in source and binary forms, with or without ! modification, are permitted provided that the following conditions are met: diff --git a/library/io/win32-io-internals.factor b/library/io/win32-io-internals.factor index 5ba9da2ddb..2796a6506f 100644 --- a/library/io/win32-io-internals.factor +++ b/library/io/win32-io-internals.factor @@ -2,7 +2,7 @@ ! $Id$ ! -! Copyright (C) 2004 Slava Pestov. +! Copyright (C) 2004 Mackenzie Straight. ! ! Redistribution and use in source and binary forms, with or without ! modification, are permitted provided that the following conditions are met: @@ -59,6 +59,9 @@ SYMBOL: callbacks f free-list set ] extend io-queue set ; +: add-completion ( handle -- ) + completion-port get NULL 1 CreateIoCompletionPort drop ; + : get-access ( -- file-mode ) "file-mode" get uncons GENERIC_WRITE 0 ? >r @@ -79,7 +82,7 @@ SYMBOL: callbacks cons "file-mode" set get-access get-sharemode NULL get-create FILE_FLAG_OVERLAPPED NULL CreateFile dup INVALID_HANDLE_VALUE = [ win32-throw-error ] when - dup completion-port get NULL 1 CreateIoCompletionPort drop + dup add-completion ] with-scope ; BEGIN-STRUCT: indirect-pointer diff --git a/library/io/win32-server.factor b/library/io/win32-server.factor index 24004b5913..ee1dc3d80a 100644 --- a/library/io/win32-server.factor +++ b/library/io/win32-server.factor @@ -2,7 +2,7 @@ ! $Id$ ! -! Copyright (C) 2004 Slava Pestov. +! Copyright (C) 2004 Mackenzie Straight. ! ! Redistribution and use in source and binary forms, with or without ! modification, are permitted provided that the following conditions are met: @@ -79,8 +79,8 @@ SYMBOL: socket : ( buf stream -- stream ) [ buffer-ptr 0 32 32 - dup >r dup >r over - GetAcceptExSockaddrs r> r> drop + dup >r dup >r + GetAcceptExSockaddrs r> r> drop dup sockaddr-in-port ntohs swap sockaddr-in-addr inet-ntoa [ , ":" , unparse , ] make-string "client" set ] extend ; @@ -88,7 +88,7 @@ SYMBOL: socket C: win32-server ( port -- server ) [ maybe-init-winsock new-socket swap over bind-socket dup listen-socket - dup completion-port get NULL 1 CreateIoCompletionPort drop + dup add-completion socket set ] extend ; @@ -97,18 +97,13 @@ M: win32-server fclose ( server -- ) M: win32-server accept ( server -- client ) [ + new-socket 1024 [ - new-socket "ns" set 1024 "buf" set - [ - alloc-io-task init-overlapped >r - socket get "ns" get "buf" get buffer-ptr 0 - "sockaddr-in" size 16 + dup NULL r> AcceptEx - [ handle-socket-error ] unless (yield) - ] callcc0 - "buf" get "ns" get - dup completion-port get NULL 1 CreateIoCompletionPort drop - - "buf" get buffer-free - ] with-scope + alloc-io-task init-overlapped >r >r >r socket get r> r> + buffer-ptr 0 "sockaddr-in" size 16 + dup NULL r> AcceptEx + [ handle-socket-error ] unless (yield) + ] callcc0 + swap dup add-completion dupd + swap buffer-free ] bind ; diff --git a/library/io/win32-stream.factor b/library/io/win32-stream.factor index 34ffd52fa3..9b12faf098 100644 --- a/library/io/win32-stream.factor +++ b/library/io/win32-stream.factor @@ -2,7 +2,7 @@ ! $Id$ ! -! Copyright (C) 2004 Slava Pestov. +! Copyright (C) 2004 Mackenzie Straight. ! ! Redistribution and use in source and binary forms, with or without ! modification, are permitted provided that the following conditions are met: diff --git a/library/win32/win32-errors.factor b/library/win32/win32-errors.factor index 541b6876ab..5cb481271d 100644 --- a/library/win32/win32-errors.factor +++ b/library/win32/win32-errors.factor @@ -2,7 +2,7 @@ ! $Id$ ! -! Copyright (C) 2004 Slava Pestov. +! Copyright (C) 2004 Mackenzie Straight. ! ! Redistribution and use in source and binary forms, with or without ! modification, are permitted provided that the following conditions are met: diff --git a/library/win32/win32-io.factor b/library/win32/win32-io.factor index e4b906d538..ecebf9d054 100644 --- a/library/win32/win32-io.factor +++ b/library/win32/win32-io.factor @@ -2,7 +2,7 @@ ! $Id$ ! -! Copyright (C) 2004 Slava Pestov. +! Copyright (C) 2004 Mackenzie Straight. ! ! Redistribution and use in source and binary forms, with or without ! modification, are permitted provided that the following conditions are met: diff --git a/library/win32/winsock.factor b/library/win32/winsock.factor index 27f1d83faf..407c37457a 100644 --- a/library/win32/winsock.factor +++ b/library/win32/winsock.factor @@ -2,7 +2,7 @@ ! $Id$ ! -! Copyright (C) 2004 Slava Pestov. +! Copyright (C) 2004 Mackenzie Straight. ! ! Redistribution and use in source and binary forms, with or without ! modification, are permitted provided that the following conditions are met: