diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/devel/httpserver.nim | 6 | ||||
-rwxr-xr-x | lib/pure/osproc.nim | 4 | ||||
-rwxr-xr-x | lib/windows/shellapi.nim | 1 | ||||
-rwxr-xr-x | lib/windows/winlean.nim | 6 |
4 files changed, 12 insertions, 5 deletions
diff --git a/lib/devel/httpserver.nim b/lib/devel/httpserver.nim index 285dadf0a..be317c952 100755 --- a/lib/devel/httpserver.nim +++ b/lib/devel/httpserver.nim @@ -12,7 +12,7 @@ import strutils, os, osproc, strtabs, streams, sockets const - wwwNL = "\r\L" + wwwNL* = "\r\L" ServerSig = "Server: httpserver.nim/1.0.0" & wwwNL # --------------- output messages -------------------------------------------- @@ -222,12 +222,12 @@ proc run*(handleRequest: proc (client: TSocket, path, query: string): bool, ## encapsulates the server object and main loop var s: TServer open(s, port) - echo("httpserver running on port ", s.port) + #echo("httpserver running on port ", s.port) while true: next(s) if handleRequest(s.client, s.path, s.query): break close(s.client) - close(s.socket) + close(s) when false: proc main = diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index d76825531..bbdea1eee 100755 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -1,7 +1,7 @@ # # # Nimrod's Runtime Library -# (c) Copyright 2009 Andreas Rumpf +# (c) Copyright 2010 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -33,7 +33,7 @@ type TProcessOption* = enum ## options that can be passed `startProcess` poEchoCmd, ## echo the command before execution poUseShell, ## use the shell to execute the command; NOTE: This - ## often creates a security whole! + ## often creates a security hole! poStdErrToStdOut, ## merge stdout and stderr to the stdout stream poParentStreams ## use the parent's streams diff --git a/lib/windows/shellapi.nim b/lib/windows/shellapi.nim index af6972c96..a4a976c60 100755 --- a/lib/windows/shellapi.nim +++ b/lib/windows/shellapi.nim @@ -6,6 +6,7 @@ # See the file "copying.txt", included in this # distribution, for details about the copyright. # + # leave out unused functions so the unit can be used on win2000 as well #+------------------------------------------------------------------------- diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim index d6ef9ffbb..f384a04e8 100755 --- a/lib/windows/winlean.nim +++ b/lib/windows/winlean.nim @@ -60,6 +60,8 @@ const STD_ERROR_HANDLE* = -12'i32 DETACHED_PROCESS* = 8'i32 + + SW_SHOWNORMAL* = 1'i32 proc CloseHandle*(hObject: THANDLE): WINBOOL {.stdcall, dynlib: "kernel32", importc: "CloseHandle".} @@ -190,4 +192,8 @@ proc rdFileTime*(f: FILETIME): int64 = proc Sleep*(dwMilliseconds: int32){.stdcall, dynlib: "kernel32", importc: "Sleep".} +proc ShellExecute*(HWND: THandle, lpOperation, lpFile, + lpParameters, lpDirectory: cstring, + nShowCmd: int32): THandle{. + stdcall, dynlib: "shell32.dll", importc: "ShellExecuteA".} |