mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 09:24:36 +00:00
better opengl wrapper; oids and endians modules documented
This commit is contained in:
@@ -289,6 +289,15 @@ Miscellaneous
|
||||
This module implements an event system that is not dependant on external
|
||||
graphical toolkits.
|
||||
|
||||
* `oids <oids.html>`_
|
||||
An OID is a global ID that consists of a timestamp,
|
||||
a unique counter and a random value. This combination should suffice to
|
||||
produce a globally distributed unique ID. This implementation was extracted
|
||||
from the Mongodb interface and it thus binary compatible with a Mongo OID.
|
||||
|
||||
* `endians <endians.html>`_
|
||||
This module contains helpers that deal with different byte orders.
|
||||
|
||||
|
||||
Database support
|
||||
----------------
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
# distribution, for details about the copyright.
|
||||
#
|
||||
|
||||
## This module contains helpers that deal with `endian`:idx: changes.
|
||||
## This module contains helpers that deal with different byte orders
|
||||
## (`endian`:idx:).
|
||||
|
||||
proc swapEndian64*(outp, inp: pointer) =
|
||||
## copies `inp` to `outp` swapping bytes. Both buffers are supposed to
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
# distribution, for details about the copyright.
|
||||
#
|
||||
|
||||
## Nimrod OID support. An OID consists of a timestamp, a unique counter
|
||||
## and a random value. This combination should suffice to produce a globally
|
||||
## distributed unique ID. This implementation was extracted from the
|
||||
## Mongodb interface. This calls ``math.randomize()`` for the first call of
|
||||
## Nimrod OID support. An OID is a global ID that consists of a timestamp,
|
||||
## a unique counter and a random value. This combination should suffice to
|
||||
## produce a globally distributed unique ID. This implementation was extracted
|
||||
## from the Mongodb interface and it thus binary compatible with a Mongo OID.
|
||||
##
|
||||
## This implementation calls ``math.randomize()`` for the first call of
|
||||
## ``genOid``.
|
||||
|
||||
import times, endians
|
||||
@@ -79,3 +81,6 @@ proc generatedTime*(oid: TOid): TTime =
|
||||
bigEndian32(addr(tmp), addr(dummy))
|
||||
result = TTime(tmp)
|
||||
|
||||
when isMainModule:
|
||||
let xo = genOID()
|
||||
echo xo.generatedTime
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
3
todo.txt
3
todo.txt
@@ -3,6 +3,7 @@ version 0.9.0
|
||||
|
||||
- test and document AVR/embedded systems better
|
||||
- make GC realtime capable: GC_step(ms: int)
|
||||
- make templates hygienic by default
|
||||
- ``=`` should be overloadable; requires specialization for ``=``
|
||||
- fix remaining generics bugs
|
||||
- fix remaining closure bugs:
|
||||
@@ -101,7 +102,7 @@ version 0.9.XX
|
||||
Library
|
||||
-------
|
||||
|
||||
- wrappers for mongodb; poppler; libharu
|
||||
- wrappers for mongodb
|
||||
- suffix trees
|
||||
- locale support; i18n module
|
||||
- bignums
|
||||
|
||||
@@ -28,6 +28,8 @@ Library Additions
|
||||
- Added ``strutils.parseEnum``.
|
||||
- The stdlib can now be avoided to a point where C code generation for 16bit
|
||||
micro controllers is feasible.
|
||||
- Added module ``oids``.
|
||||
- Added module ``endians``.
|
||||
- Added a new OpenGL wrapper that supports OpenGL up to version 4.2.
|
||||
- Added a wrapper for ``libsvm``.
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ srcdoc: "pure/collections/tables;pure/collections/sets;pure/collections/lists"
|
||||
srcdoc: "pure/collections/intsets;pure/collections/queues;pure/encodings"
|
||||
srcdoc: "pure/events;pure/collections/sequtils;pure/irc;ecmas/dom"
|
||||
srcdoc: "pure/ftpclient;pure/memfiles;pure/subexes;pure/collections/critbits"
|
||||
srcdoc: "pure/asyncio;pure/actors;core/locks"
|
||||
srcdoc: "pure/asyncio;pure/actors;core/locks;pure/oids;pure/endians"
|
||||
|
||||
webdoc: "wrappers/libcurl;pure/md5;wrappers/mysql;wrappers/iup"
|
||||
webdoc: "wrappers/sqlite3;wrappers/postgres;wrappers/tinyc"
|
||||
|
||||
Reference in New Issue
Block a user