Merge branch 'master' of github.com:Araq/Nimrod
This commit is contained in:
commit
f1f458137b
6 changed files with 22 additions and 3 deletions
|
|
@ -15,7 +15,7 @@
|
||||||
## to release its locks should it be part of a deadlock. This thread then
|
## to release its locks should it be part of a deadlock. This thread then
|
||||||
## re-acquires its locks and proceeds.
|
## re-acquires its locks and proceeds.
|
||||||
|
|
||||||
include "lib/system/syslocks"
|
include "system/syslocks"
|
||||||
|
|
||||||
type
|
type
|
||||||
TLock* = TSysLock ## Nimrod lock; whether this is re-entrant
|
TLock* = TSysLock ## Nimrod lock; whether this is re-entrant
|
||||||
|
|
|
||||||
|
|
@ -467,6 +467,16 @@ proc ParseHexInt*(s: string): int {.noSideEffect, procvar,
|
||||||
inc(i)
|
inc(i)
|
||||||
of '\0': break
|
of '\0': break
|
||||||
else: raise newException(EInvalidValue, "invalid integer: " & s)
|
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,
|
proc repeatChar*(count: int, c: Char = ' '): string {.noSideEffect,
|
||||||
rtl, extern: "nsuRepeatChar".} =
|
rtl, extern: "nsuRepeatChar".} =
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ proc ShellAbout*(HWND: hWnd, szApp: LPCSTR, szOtherStuff: LPCSTR, HICON: hIcon):
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ShellAboutA".}
|
stdcall, dynlib: "shell32.dll", importc: "ShellAboutA".}
|
||||||
proc ShellAbout*(HWND: hWnd, szApp: LPCWSTR, szOtherStuff: LPCWSTR, HICON: hIcon): int32{.
|
proc ShellAbout*(HWND: hWnd, szApp: LPCWSTR, szOtherStuff: LPCWSTR, HICON: hIcon): int32{.
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ShellAboutW".}
|
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".}
|
dynlib: "shell32.dll", importc: "DuplicateIcon".}
|
||||||
proc ExtractAssociatedIconA*(hInst: HINST, lpIconPath: LPSTR, lpiIcon: LPWORD): HICON{.
|
proc ExtractAssociatedIconA*(hInst: HINST, lpIconPath: LPSTR, lpiIcon: LPWORD): HICON{.
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconA".}
|
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 {.
|
proc g_timeout_add*(interval: guint, function, data: gpointer): guint {.
|
||||||
cdecl, dynlib: gliblib, importc: "g_timeout_add".}
|
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]
|
cmdLine{.importc: "cmdLine".}: array[0..255, cstring]
|
||||||
cmdCount{.importc: "cmdCount".}: cint
|
cmdCount{.importc: "cmdCount".}: cint
|
||||||
init(addr(cmdLine), addr(cmdCount))
|
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
|
const
|
||||||
myRes = slurp"readme.txt"
|
myRes = slurp"../../readme.txt"
|
||||||
|
|
||||||
echo myRes
|
echo myRes
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue