X-Git-Url: http://dolda2000.com/gitweb/?p=didex.git;a=blobdiff_plain;f=didex%2Findex.py;fp=didex%2Findex.py;h=65b1b12c1cff197dced8c25a7e4b73267b5d089b;hp=4906b46a2e7ec260c2dc2a96c85c8f2b7a3f9a77;hb=61b65544e7aa2faa74269c1ae9627a8b23e5304d;hpb=874b91d5878b929b53a227a3a409d8c507eb093c diff --git a/didex/index.py b/didex/index.py index 4906b46..65b1b12 100644 --- a/didex/index.py +++ b/didex/index.py @@ -2,7 +2,7 @@ import struct, contextlib, math from . import db, lib from .db import bd, txnfun, dloopfun -__all__ = ["maybe", "t_int", "t_uint", "t_float", "t_str", "ordered"] +__all__ = ["maybe", "t_int", "t_uint", "t_dbid", "t_float", "t_str", "ordered"] deadlock = bd.DBLockDeadlockError notfound = bd.DBNotFoundError @@ -134,6 +134,7 @@ def floatcmp(a, b): t_int = simpletype.struct(">q") t_uint = simpletype.struct(">Q") +t_dbid = t_uint t_float = simpletype.struct(">d") t_float.compare = floatcmp t_str = simpletype((lambda ob: ob.encode("utf-8")), (lambda dat: dat.decode("utf-8")))