The style guide for Nim only applies to our team's projects.
proc createIoCompletionPort*(
FileHandle: Handle,
ExistingCompletionPort: Handle,
CompletionKey: ULONG_PTR,
NumberOfConcurrentThreads: DWORD
): Handle {.libKernel32, importc: "CreateIoCompletionPort"}C wrapper must be both standard and correct.
| ctypes | nim types |
|---|---|
| char | cchar |
| unsigned char | cuchar |
| signed char | cschar |
| short | cshort |
| unsigned short | cushort |
| int | cint |
| unsigned int | cuint |
| long | clong |
| unsigned long | culong |
| long long | clonglong |
| unsigned long long | culonglong |
| [const] char* | cstring |
| [const] void * | pointer |
For example,
type
POINTER_64_INT* = uint
INT8* = cchar
PINT8* = ptr INT8
INT16* = cshort
PINT16* = ptr INT16
INT32* = cint
PINT32* = ptr INT32
INT64* = int64
PINT64* = ptr INT64
UINT8* = cuchar
PUINT8* = ptr UINT8
UINT16* = cushort
PUINT16* = ptr UINT16proc foo(a: int, b: string): int
## Calculate something.
## Params:
## - ``a``: An int.
## - ``b``: An string.
## Returns:
## - Return results.If examples are runnable
proc foo(a: int, b: string): int
## Calculate something.
runnableExamples:
assert foo(12, "ok") == 3Otherwise
proc foo(a: int, b: string): int
## Calculate something.
## .. code-block:: Nim
## assert foo(12, "ok") == 3Use testament instead of unittest.