# # # Nim's Runtime Library # (c) Copyright 2015 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. # ## libuv is still fast moving target ## This file was last updated against a development HEAD revision of https://github.com/joyent/libuv/ ## Use the following link to see changes (in uv.h) since then and don't forget to update the information here. ## https://github.com/joyent/libuv/compare/9f6024a6fa9d254527b4b59af724257df870288b...master when defined(Windows): import winlean else: import posix type Port* = distinct int16 ## port type cssize = int coff = int csize = int AllocProc* = proc (handle: PHandle, suggested_size: csize): Buf {.cdecl.} ReadProc* = proc (stream: PStream, nread: cssize, buf: Buf) {.cdecl.} ReadProc2* = proc (stream: PPipe, nread: cssize, buf: Buf, pending: HandleType) {.cdecl.} WriteProc* = proc (req: PWrite, status: cint) {.cdecl.} ConnectProc* = proc (req: PConnect, status: cint) {.cdecl.} ShutdownProc* = proc (req: PShutdown, status: cint) {.cdecl.} ConnectionProc* = proc (server: PStream, status: cint) {.cdecl.} CloseProc* = proc (handle: PHandle) {.cdecl.} TimerProc* = proc (handle: PTimer, status: cint) {.cdecl.} AsyncProc* = proc (handle: PAsync, status: cint) {.cdecl.} PrepareProc* = proc (handle: PPrepare, status: cint) {.cdecl.} CheckProc* = proc (handle: PCheck, status: cint) {.cdecl.} IdleProc* = proc (handle: PIdle, status: cint) {.cdecl.} PSockAddr* = ptr SockAddr GetAddrInfoProc* = proc (handle: PGetAddrInfo, status: cint, res: ptr AddrInfo) ExitProc* = proc (a2: PProcess, exit_status: cint, term_signal: cint) FsProc* = proc (req: PFS) WorkProc* = proc (req: PWork) AfterWorkProc* = proc (req: PWork) FsEventProc* = proc (handle: PFsEvent, filename: cstring, events: cint, status: cint) ErrorCode* {.size: sizeof(cint).} = enum UNKNOWN = - 1, OK = 0, EOF, EACCESS, EAGAIN, EADDRINUSE, EADDRNOTAVAIL, EAFNOSUPPORT, EALREADY, EBADF, EBUSY, ECONNABORTED, ECONNREFUSED, ECONNRESET, EDESTADDRREQ, EFAULT, EHOSTUNREACH, EINTR, EINVAL, EISCONN, EMFILE, EMSGSIZE, ENETDOWN, ENETUNREACH, ENFILE, ENOBUFS, ENOMEM, ENONET, ENOPROTOOPT, ENOTCONN, ENOTSOCK, ENOTSUP, ENOENT, EPIPE, EPROTO, EPROTONOSUPPORT, EPROTOTYPE, ETIMEDOUT, ECHARSET, EAIFAMNOSUPPORT, EAINONAME, EAISERVICE, EAISOCKTYPE, ESHUTDOWN, EEXIST HandleType* {.size: sizeof(cint).} = enum UNKNOWN_HANDLE = 0, TCP, UDP, NAMED_PIPE, TTY, FILE, TIMER, PREPARE, CHECK, IDLE, ASYNC, ARES_TASK, ARES_EVENT, PROCESS, FS_EVENT ReqType* {.size: sizeof(cint).} = enum rUNKNOWN_REQ = 0, rCONNECT, rACCEPT, rREAD, rWRITE, rSHUTDOWN, rWAKEUP, rUDP_SEND, rFS, rWORK, rGETADDRINFO, rREQ_TYPE_PRIVATE Err* {.pure, final, importc: "uv_err_t", header: "uv.h".} = object code* {.importc: "code".}: ErrorCode sys_errno* {.importc: "sys_errno_".}: cint FsEventType* = enum evRENAME = 1, evCHANGE = 2 TFsEvent* {.pure, final, importc: "uv_fs_event_t", header: "uv.h".} = object loop* {.importc: "loop".}: PLoop typ* {.importc: "type".}: HandleType close_cb* {.importc: "close_cb".}: CloseProc data* {.importc: "data".}: pointer filename {.importc: "filename".}: cstring PFsEvent* = ptr TFsEvent FsEvents* {.pure, final, importc: "uv_f
discard """
output: '''
3
'''
"""
echo int(22 / 7)