about summary refs log blame commit diff stats
path: root/src/bindings/termcap.nim
blob: 02962a671f535b65b05a131e6546da5f2d4f7c2c (plain) (tree)



















                                                                                        
const termlib = (func(): string =
  let libs = ["terminfo", "mytinfo", "termlib", "termcap", "tinfo", "ncurses", "curses"]
  for lib in libs:
    let res = staticExec("pkg-config --libs --silence-errors " & lib)
    if res != "":
      return res
)()
when termlib != "":
  {.passl: termlib.}
  {.push importc, cdecl.}
  const termcap_found* = true
  proc tgetent*(bp: cstring, name: cstring): cint
  proc tgetnum*(id: cstring): cint
  proc tgetflag*(id: cstring): cint
  proc tgetstr*(id: cstring, area: ptr cstring): cstring
  proc tgoto*(cap: cstring, x, y: cint): cstring
  proc tputs*(str: cstring, len: cint, putc: proc(c: char): cint {.cdecl.}): cint
  {.pop.}
else:
  const termcap_found* = false