aboutsummaryrefslogtreecommitdiff
path: root/cursor.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-01-08 08:06:17 -0700
committerBen Johnson <benbjohnson@yahoo.com>2014-01-08 08:06:17 -0700
commitebc9f0da9e0d2fe90a4f9a820114d462fdf13178 (patch)
tree287fb8791e03a70d5959c12dabab4bb25766d713 /cursor.go
parentNOTES (diff)
downloaddedo-ebc9f0da9e0d2fe90a4f9a820114d462fdf13178.tar.gz
dedo-ebc9f0da9e0d2fe90a4f9a820114d462fdf13178.tar.xz
Basic types.
Diffstat (limited to 'cursor.go')
-rw-r--r--cursor.go44
1 files changed, 44 insertions, 0 deletions
diff --git a/cursor.go b/cursor.go
new file mode 100644
index 0000000..8399b88
--- /dev/null
+++ b/cursor.go
@@ -0,0 +1,44 @@
+package bolt
+
+// TODO: #define CURSOR_STACK 32
+
+// TODO: #define C_INITIALIZED 0x01 /**< cursor has been initialized and is valid */
+// TODO: #define C_EOF 0x02 /**< No more data */
+// TODO: #define C_SUB 0x04 /**< Cursor is a sub-cursor */
+// TODO: #define C_DEL 0x08 /**< last op was a cursor_del */
+// TODO: #define C_SPLITTING 0x20 /**< Cursor is in page_split */
+// TODO: #define C_UNTRACK 0x40 /**< Un-track cursor when closing */
+
+type Cursor interface {
+ First() error
+ FirstDup() error
+ Get() ([]byte, []byte, error)
+ GetRange() ([]byte, []byte, error)
+ Current() ([]byte, []byte, error)
+ Last()
+ LastDup()
+ Next() ([]byte, []byte, error)
+ NextDup() ([]byte, []byte, error)
+ NextNoDup() ([]byte, []byte, error)
+ Prev() ([]byte, []byte, error)
+ PrevDup() ([]byte, []byte, error)
+ PrevNoDup() ([]byte, []byte, error)
+ Set() ([]byte, []byte, error)
+ SetRange() ([]byte, []byte, error)
+}
+
+type cursor struct {
+ flags int
+ next *cursor
+ backup *cursor
+ xcursor *xcursor
+ transaction *transaction
+ bucketId int
+ bucket *bucket
+ bucketx *bucketx
+ bucketFlag int
+ snum int
+ top int
+ page []*page
+ ki []int /**< stack of page indices */
+}