lib: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
This commit is contained in:
parent
d681812465
commit
43bddf62dd
67 changed files with 2435 additions and 2435 deletions
|
|
@ -29,34 +29,34 @@ const
|
|||
|
||||
# Valid opcodes ( "op" parameter ) to issue to epoll_ctl().
|
||||
|
||||
const
|
||||
EPOLL_CTL_ADD* = 1 # Add a file descriptor to the interface.
|
||||
EPOLL_CTL_DEL* = 2 # Remove a file descriptor from the interface.
|
||||
EPOLL_CTL_MOD* = 3 # Change file descriptor epoll_event structure.
|
||||
const
|
||||
EPOLL_CTL_ADD* = 1 # Add a file descriptor to the interface.
|
||||
EPOLL_CTL_DEL* = 2 # Remove a file descriptor from the interface.
|
||||
EPOLL_CTL_MOD* = 3 # Change file descriptor epoll_event structure.
|
||||
|
||||
type
|
||||
epoll_data* {.importc: "union epoll_data",
|
||||
type
|
||||
epoll_data* {.importc: "union epoll_data",
|
||||
header: "<sys/epoll.h>", pure, final.} = object # TODO: This is actually a union.
|
||||
#thePtr* {.importc: "ptr".}: pointer
|
||||
fd* {.importc: "fd".}: cint # \
|
||||
#u32*: uint32
|
||||
#u64*: uint64
|
||||
|
||||
epoll_event* {.importc: "struct epoll_event", header: "<sys/epoll.h>", pure, final.} = object
|
||||
events*: uint32 # Epoll events
|
||||
data*: epoll_data # User data variable
|
||||
epoll_event* {.importc: "struct epoll_event", header: "<sys/epoll.h>", pure, final.} = object
|
||||
events*: uint32 # Epoll events
|
||||
data*: epoll_data # User data variable
|
||||
|
||||
proc epoll_create*(size: cint): cint {.importc: "epoll_create",
|
||||
proc epoll_create*(size: cint): cint {.importc: "epoll_create",
|
||||
header: "<sys/epoll.h>".}
|
||||
## Creates an epoll instance. Returns an fd for the new instance.
|
||||
## The "size" parameter is a hint specifying the number of file
|
||||
## descriptors to be associated with the new instance. The fd
|
||||
## returned by epoll_create() should be closed with close().
|
||||
## returned by epoll_create() should be closed with close().
|
||||
|
||||
proc epoll_create1*(flags: cint): cint {.importc: "epoll_create1",
|
||||
proc epoll_create1*(flags: cint): cint {.importc: "epoll_create1",
|
||||
header: "<sys/epoll.h>".}
|
||||
## Same as epoll_create but with an FLAGS parameter. The unused SIZE
|
||||
## parameter has been dropped.
|
||||
## parameter has been dropped.
|
||||
|
||||
proc epoll_ctl*(epfd: cint; op: cint; fd: cint | SocketHandle; event: ptr epoll_event): cint {.
|
||||
importc: "epoll_ctl", header: "<sys/epoll.h>".}
|
||||
|
|
@ -65,10 +65,10 @@ proc epoll_ctl*(epfd: cint; op: cint; fd: cint | SocketHandle; event: ptr epoll_
|
|||
## specific error code ) The "op" parameter is one of the EPOLL_CTL_*
|
||||
## constants defined above. The "fd" parameter is the target of the
|
||||
## operation. The "event" parameter describes which events the caller
|
||||
## is interested in and any associated user data.
|
||||
## is interested in and any associated user data.
|
||||
|
||||
proc epoll_wait*(epfd: cint; events: ptr epoll_event; maxevents: cint;
|
||||
timeout: cint): cint {.importc: "epoll_wait",
|
||||
proc epoll_wait*(epfd: cint; events: ptr epoll_event; maxevents: cint;
|
||||
timeout: cint): cint {.importc: "epoll_wait",
|
||||
header: "<sys/epoll.h>".}
|
||||
## Wait for events on an epoll instance "epfd". Returns the number of
|
||||
## triggered events returned in "events" buffer. Or -1 in case of
|
||||
|
|
@ -82,11 +82,11 @@ proc epoll_wait*(epfd: cint; events: ptr epoll_event; maxevents: cint;
|
|||
## __THROW.
|
||||
|
||||
|
||||
#proc epoll_pwait*(epfd: cint; events: ptr epoll_event; maxevents: cint;
|
||||
#proc epoll_pwait*(epfd: cint; events: ptr epoll_event; maxevents: cint;
|
||||
# timeout: cint; ss: ptr sigset_t): cint {.
|
||||
# importc: "epoll_pwait", header: "<sys/epoll.h>".}
|
||||
# Same as epoll_wait, but the thread's signal mask is temporarily
|
||||
# and atomically replaced with the one provided as parameter.
|
||||
#
|
||||
# This function is a cancellation point and therefore not marked with
|
||||
# __THROW.
|
||||
# __THROW.
|
||||
|
|
|
|||
|
|
@ -9,65 +9,65 @@
|
|||
|
||||
{.deadCodeElim:on.}
|
||||
|
||||
# Get the platform-dependent flags.
|
||||
# Structure describing an inotify event.
|
||||
type
|
||||
InotifyEvent*{.pure, final, importc: "struct inotify_event",
|
||||
header: "<sys/inotify.h>".} = object
|
||||
wd*{.importc: "wd".}: cint # Watch descriptor.
|
||||
mask*{.importc: "mask".}: uint32 # Watch mask.
|
||||
cookie*{.importc: "cookie".}: uint32 # Cookie to synchronize two events.
|
||||
len*{.importc: "len".}: uint32 # Length (including NULs) of name.
|
||||
name*{.importc: "name".}: char # Name.
|
||||
# Get the platform-dependent flags.
|
||||
# Structure describing an inotify event.
|
||||
type
|
||||
InotifyEvent*{.pure, final, importc: "struct inotify_event",
|
||||
header: "<sys/inotify.h>".} = object
|
||||
wd*{.importc: "wd".}: cint # Watch descriptor.
|
||||
mask*{.importc: "mask".}: uint32 # Watch mask.
|
||||
cookie*{.importc: "cookie".}: uint32 # Cookie to synchronize two events.
|
||||
len*{.importc: "len".}: uint32 # Length (including NULs) of name.
|
||||
name*{.importc: "name".}: char # Name.
|
||||
{.deprecated: [Tinotify_event: InotifyEvent].}
|
||||
|
||||
# Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH.
|
||||
const
|
||||
IN_ACCESS* = 0x00000001 # File was accessed.
|
||||
IN_MODIFY* = 0x00000002 # File was modified.
|
||||
IN_ATTRIB* = 0x00000004 # Metadata changed.
|
||||
IN_CLOSE_WRITE* = 0x00000008 # Writtable file was closed.
|
||||
IN_CLOSE_NOWRITE* = 0x00000010 # Unwrittable file closed.
|
||||
IN_CLOSE* = (IN_CLOSE_WRITE or IN_CLOSE_NOWRITE) # Close.
|
||||
IN_OPEN* = 0x00000020 # File was opened.
|
||||
IN_MOVED_FROM* = 0x00000040 # File was moved from X.
|
||||
IN_MOVED_TO* = 0x00000080 # File was moved to Y.
|
||||
IN_MOVE* = (IN_MOVED_FROM or IN_MOVED_TO) # Moves.
|
||||
IN_CREATE* = 0x00000100 # Subfile was created.
|
||||
IN_DELETE* = 0x00000200 # Subfile was deleted.
|
||||
IN_DELETE_SELF* = 0x00000400 # Self was deleted.
|
||||
IN_MOVE_SELF* = 0x00000800 # Self was moved.
|
||||
# Events sent by the kernel.
|
||||
const
|
||||
IN_UNMOUNT* = 0x00002000 # Backing fs was unmounted.
|
||||
IN_Q_OVERFLOW* = 0x00004000 # Event queued overflowed.
|
||||
IN_IGNORED* = 0x00008000 # File was ignored.
|
||||
# Special flags.
|
||||
const
|
||||
# Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH.
|
||||
const
|
||||
IN_ACCESS* = 0x00000001 # File was accessed.
|
||||
IN_MODIFY* = 0x00000002 # File was modified.
|
||||
IN_ATTRIB* = 0x00000004 # Metadata changed.
|
||||
IN_CLOSE_WRITE* = 0x00000008 # Writtable file was closed.
|
||||
IN_CLOSE_NOWRITE* = 0x00000010 # Unwrittable file closed.
|
||||
IN_CLOSE* = (IN_CLOSE_WRITE or IN_CLOSE_NOWRITE) # Close.
|
||||
IN_OPEN* = 0x00000020 # File was opened.
|
||||
IN_MOVED_FROM* = 0x00000040 # File was moved from X.
|
||||
IN_MOVED_TO* = 0x00000080 # File was moved to Y.
|
||||
IN_MOVE* = (IN_MOVED_FROM or IN_MOVED_TO) # Moves.
|
||||
IN_CREATE* = 0x00000100 # Subfile was created.
|
||||
IN_DELETE* = 0x00000200 # Subfile was deleted.
|
||||
IN_DELETE_SELF* = 0x00000400 # Self was deleted.
|
||||
IN_MOVE_SELF* = 0x00000800 # Self was moved.
|
||||
# Events sent by the kernel.
|
||||
const
|
||||
IN_UNMOUNT* = 0x00002000 # Backing fs was unmounted.
|
||||
IN_Q_OVERFLOW* = 0x00004000 # Event queued overflowed.
|
||||
IN_IGNORED* = 0x00008000 # File was ignored.
|
||||
# Special flags.
|
||||
const
|
||||
IN_ONLYDIR* = 0x01000000 # Only watch the path if it is a
|
||||
# directory.
|
||||
IN_DONT_FOLLOW* = 0x02000000 # Do not follow a sym link.
|
||||
# directory.
|
||||
IN_DONT_FOLLOW* = 0x02000000 # Do not follow a sym link.
|
||||
IN_EXCL_UNLINK* = 0x04000000 # Exclude events on unlinked
|
||||
# objects.
|
||||
# objects.
|
||||
IN_MASK_ADD* = 0x20000000 # Add to the mask of an already
|
||||
# existing watch.
|
||||
IN_ISDIR* = 0x40000000 # Event occurred against dir.
|
||||
IN_ONESHOT* = 0x80000000 # Only send event once.
|
||||
# All events which a program can wait on.
|
||||
const
|
||||
# existing watch.
|
||||
IN_ISDIR* = 0x40000000 # Event occurred against dir.
|
||||
IN_ONESHOT* = 0x80000000 # Only send event once.
|
||||
# All events which a program can wait on.
|
||||
const
|
||||
IN_ALL_EVENTS* = (IN_ACCESS or IN_MODIFY or IN_ATTRIB or IN_CLOSE_WRITE or
|
||||
IN_CLOSE_NOWRITE or IN_OPEN or IN_MOVED_FROM or IN_MOVED_TO or
|
||||
IN_CREATE or IN_DELETE or IN_DELETE_SELF or IN_MOVE_SELF)
|
||||
# Create and initialize inotify instance.
|
||||
proc inotify_init*(): cint{.cdecl, importc: "inotify_init",
|
||||
proc inotify_init*(): cint{.cdecl, importc: "inotify_init",
|
||||
header: "<sys/inotify.h>".}
|
||||
# Create and initialize inotify instance.
|
||||
proc inotify_init1*(flags: cint): cint{.cdecl, importc: "inotify_init1",
|
||||
# Create and initialize inotify instance.
|
||||
proc inotify_init1*(flags: cint): cint{.cdecl, importc: "inotify_init1",
|
||||
header: "<sys/inotify.h>".}
|
||||
# Add watch of object NAME to inotify instance FD. Notify about
|
||||
# events specified by MASK.
|
||||
# events specified by MASK.
|
||||
proc inotify_add_watch*(fd: cint; name: cstring; mask: uint32): cint{.
|
||||
cdecl, importc: "inotify_add_watch", header: "<sys/inotify.h>".}
|
||||
# Remove the watch specified by WD from the inotify instance FD.
|
||||
proc inotify_rm_watch*(fd: cint; wd: cint): cint{.cdecl,
|
||||
# Remove the watch specified by WD from the inotify instance FD.
|
||||
proc inotify_rm_watch*(fd: cint; wd: cint): cint{.cdecl,
|
||||
importc: "inotify_rm_watch", header: "<sys/inotify.h>".}
|
||||
|
|
|
|||
|
|
@ -24,5 +24,5 @@ const
|
|||
|
||||
# fn should be of type proc (a2: pointer): void {.cdecl.}
|
||||
proc clone*(fn: pointer; child_stack: pointer; flags: cint;
|
||||
arg: pointer; ptid: ptr Pid; tls: pointer;
|
||||
arg: pointer; ptid: ptr Pid; tls: pointer;
|
||||
ctid: ptr Pid): cint {.importc, header: "<sched.h>".}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue