fix
This commit is contained in:
parent
54ee368358
commit
55fdac46e3
3 changed files with 8 additions and 12 deletions
|
|
@ -120,7 +120,6 @@ proc dbQuote*(s: string): string =
|
||||||
result = "'"
|
result = "'"
|
||||||
for c in items(s):
|
for c in items(s):
|
||||||
if c == '\'': add(result, "''")
|
if c == '\'': add(result, "''")
|
||||||
if c == '\\': add(result, "\\\\")
|
|
||||||
else: add(result, c)
|
else: add(result, c)
|
||||||
add(result, '\'')
|
add(result, '\'')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -962,13 +962,10 @@ proc utimes*(path: cstring, times: ptr array[2, Timeval]): int {.
|
||||||
proc handle_signal(sig: cint, handler: proc (a: cint) {.noconv.}) {.importc: "signal", header: "<signal.h>".}
|
proc handle_signal(sig: cint, handler: proc (a: cint) {.noconv.}) {.importc: "signal", header: "<signal.h>".}
|
||||||
|
|
||||||
template onSignal*(signals: varargs[cint], body: untyped) =
|
template onSignal*(signals: varargs[cint], body: untyped) =
|
||||||
## Setup code to be executed when Unix signals are received.
|
## Setup code to be executed when Unix signals are received. Example:
|
||||||
## Example:
|
## from posix import SIGINT, SIGTERM
|
||||||
##
|
## onSignal(SIGINT, SIGTERM):
|
||||||
## .. code-block:: nim
|
## echo "bye"
|
||||||
## from posix import SIGINT, SIGTERM
|
|
||||||
## onSignal(SIGINT, SIGTERM):
|
|
||||||
## echo "bye"
|
|
||||||
|
|
||||||
for s in signals:
|
for s in signals:
|
||||||
handle_signal(s,
|
handle_signal(s,
|
||||||
|
|
|
||||||
|
|
@ -650,10 +650,10 @@ template setCursorPos*(x, y: int) = setCursorPos(stdout, x, y)
|
||||||
template setCursorXPos*(x: int) = setCursorXPos(stdout, x)
|
template setCursorXPos*(x: int) = setCursorXPos(stdout, x)
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
template setCursorYPos(x: int) = setCursorYPos(stdout, x)
|
template setCursorYPos(x: int) = setCursorYPos(stdout, x)
|
||||||
template cursorUp*(count=1) = cursorUp(stdout, count)
|
template cursorUp*(count=1) = cursorUp(stdout, f)
|
||||||
template cursorDown*(count=1) = cursorDown(stdout, count)
|
template cursorDown*(count=1) = cursorDown(stdout, f)
|
||||||
template cursorForward*(count=1) = cursorForward(stdout, count)
|
template cursorForward*(count=1) = cursorForward(stdout, f)
|
||||||
template cursorBackward*(count=1) = cursorBackward(stdout, count)
|
template cursorBackward*(count=1) = cursorBackward(stdout, f)
|
||||||
template eraseLine*() = eraseLine(stdout)
|
template eraseLine*() = eraseLine(stdout)
|
||||||
template eraseScreen*() = eraseScreen(stdout)
|
template eraseScreen*() = eraseScreen(stdout)
|
||||||
template setStyle*(style: set[Style]) =
|
template setStyle*(style: set[Style]) =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue