summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorrumpf_a@web.de <>2010-01-10 17:53:33 +0100
committerrumpf_a@web.de <>2010-01-10 17:53:33 +0100
commit55e900bba2be06cf91789e749d9fc31f017a0dd0 (patch)
tree6e223c8a7c3f70767b036d698de7ed00a2f80ea3 /lib
parenta4ba67dd2eb335cb9c41a6a267b774a4830ea529 (diff)
downloadNim-55e900bba2be06cf91789e749d9fc31f017a0dd0.tar.gz
devel of web frontend
Diffstat (limited to 'lib')
-rwxr-xr-xlib/devel/httpserver.nim6
-rwxr-xr-xlib/pure/osproc.nim4
-rwxr-xr-xlib/windows/shellapi.nim1
-rwxr-xr-xlib/windows/winlean.nim6
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".}