Change type name to be more NEP-1-ish as per Araq request.

This commit is contained in:
Charles Blake
2016-09-01 08:33:39 -04:00
parent 5db1de87b1
commit 8df2078f08
2 changed files with 3 additions and 3 deletions

View File

@@ -263,9 +263,9 @@ proc tcGetSid*(fd: cint): Pid {.importc: "tcgetsid", header: "<termios.h>".}
# Window size ioctl. Should work on on any Unix that xterm has been ported to.
var TIOCGWINSZ*{.importc, header: "<sys/ioctl.h>".}: culong
type ioctl_winsize* {.importc: "struct winsize", header: "<termios.h>",
type IOctl_WinSize* {.importc: "struct winsize", header: "<termios.h>",
final, pure.} = object
ws_row*, ws_col*, ws_xpixel*, ws_ypixel*: cushort
proc ioctl*(fd: cint, request: culong, reply: ptr ioctl_winsize): int {.
proc ioctl*(fd: cint, request: culong, reply: ptr IOctl_WinSize): int {.
importc: "ioctl", header: "<stdio.h>", varargs.}

View File

@@ -156,7 +156,7 @@ else:
proc terminalWidthIoctl*(fds: openArray[int]): int =
## Returns terminal width from first fd that supports the ioctl.
var win: ioctl_winsize
var win: IOctl_WinSize
for fd in fds:
if ioctl(cint(fd), TIOCGWINSZ, addr win) != -1:
return int(win.ws_col)