mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 09:24:36 +00:00
Merge branch 'master' of github.com:Araq/Nimrod
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
## to release its locks should it be part of a deadlock. This thread then
|
||||
## re-acquires its locks and proceeds.
|
||||
|
||||
include "lib/system/syslocks"
|
||||
include "system/syslocks"
|
||||
|
||||
type
|
||||
TLock* = TSysLock ## Nimrod lock; whether this is re-entrant
|
||||
|
||||
@@ -467,6 +467,16 @@ proc ParseHexInt*(s: string): int {.noSideEffect, procvar,
|
||||
inc(i)
|
||||
of '\0': break
|
||||
else: raise newException(EInvalidValue, "invalid integer: " & s)
|
||||
|
||||
proc parseBool*(s: string): bool =
|
||||
## Parses a value into a `bool`. If ``s`` is one of the following values:
|
||||
## ``y, yes, true, 1, on``, then returns `true`. If ``s`` is one of the
|
||||
## following values: ``n, no, false, 0, off``, then returns `false`.
|
||||
## If ``s`` is something else a ``EInvalidValue`` exception is raised.
|
||||
case normalize(s)
|
||||
of "y", "yes", "true", "1", "on": result = true
|
||||
of "n", "no", "false", "0", "off": result = false
|
||||
else: raise newException(EInvalidValue, "cannot interpret as a bool: " & s)
|
||||
|
||||
proc repeatChar*(count: int, c: Char = ' '): string {.noSideEffect,
|
||||
rtl, extern: "nsuRepeatChar".} =
|
||||
|
||||
@@ -105,7 +105,7 @@ proc ShellAbout*(HWND: hWnd, szApp: LPCSTR, szOtherStuff: LPCSTR, HICON: hIcon):
|
||||
stdcall, dynlib: "shell32.dll", importc: "ShellAboutA".}
|
||||
proc ShellAbout*(HWND: hWnd, szApp: LPCWSTR, szOtherStuff: LPCWSTR, HICON: hIcon): int32{.
|
||||
stdcall, dynlib: "shell32.dll", importc: "ShellAboutW".}
|
||||
proc DuplicateIcon*(hinst: HINST, HICON: hIcon): HIcon{.stdcall,
|
||||
proc DuplicateIcon*(inst: HINST, icon: HICON): HIcon{.stdcall,
|
||||
dynlib: "shell32.dll", importc: "DuplicateIcon".}
|
||||
proc ExtractAssociatedIconA*(hInst: HINST, lpIconPath: LPSTR, lpiIcon: LPWORD): HICON{.
|
||||
stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconA".}
|
||||
|
||||
@@ -4507,3 +4507,9 @@ proc g_thread_init*(vtable: pointer) {.
|
||||
|
||||
proc g_timeout_add*(interval: guint, function, data: gpointer): guint {.
|
||||
cdecl, dynlib: gliblib, importc: "g_timeout_add".}
|
||||
|
||||
proc g_idle_add*(function, data: gpointer): guint {.
|
||||
cdecl, dynlib: gliblib, importc: "g_idle_add".}
|
||||
|
||||
proc g_source_remove*(tag: guint): gboolean {.
|
||||
cdecl, dynlib: gliblib, importc: "g_source_remove".}
|
||||
|
||||
@@ -16880,3 +16880,6 @@ proc nimrod_init*() =
|
||||
cmdLine{.importc: "cmdLine".}: array[0..255, cstring]
|
||||
cmdCount{.importc: "cmdCount".}: cint
|
||||
init(addr(cmdLine), addr(cmdCount))
|
||||
|
||||
proc set_tooltip_text*(w: PWidget, t: cstring){.cdecl,
|
||||
dynlib: lib, importc: "gtk_widget_set_tooltip_text".}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
const
|
||||
myRes = slurp"readme.txt"
|
||||
myRes = slurp"../../readme.txt"
|
||||
|
||||
echo myRes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user