Commit bcf56672 authored by Yoni Fogel's avatar Yoni Fogel

Addresses #284

Add accessor function for allow_overlaps in range trees.

git-svn-id: file:///svn/tokudb@1824 c7de825b-a66e-492c-adef-691d508d4ae1
parent 0229a8e0
...@@ -245,6 +245,8 @@ int toku_rt_successor (toku_range_tree* tree, void* point, toku_range* succ, ...@@ -245,6 +245,8 @@ int toku_rt_successor (toku_range_tree* tree, void* point, toku_range* succ,
return 0; return 0;
} }
/* int toku_rt_get_allow_overlaps(toku_range_tree* tree, BOOL* allowed) {
\marginpar{add more \\marginpar\'s} if (!tree || !allowed) return EINVAL;
*/ *allowed = tree->allow_overlaps;
return 0;
}
...@@ -69,6 +69,17 @@ struct __toku_range_tree_internal { ...@@ -69,6 +69,17 @@ struct __toku_range_tree_internal {
/* These lines will remain. */ /* These lines will remain. */
typedef struct __toku_range_tree_internal toku_range_tree; typedef struct __toku_range_tree_internal toku_range_tree;
/**
Gets whether the range tree allows overlapping ranges.
\param tree The range tree.
\param allowed Returns whether overlaps are allowed.
\return
- 0: Success.
- EINVAL: If any pointer argument is NULL. */
int toku_rt_get_allow_overlaps(toku_range_tree* tree, BOOL* allowed);
/** /**
Creates a range tree. Creates a range tree.
...@@ -86,7 +97,7 @@ typedef struct __toku_range_tree_internal toku_range_tree; ...@@ -86,7 +97,7 @@ typedef struct __toku_range_tree_internal toku_range_tree;
\return \return
- 0: Success. - 0: Success.
- EINVAL: If any pointer argument is NULL. - EINVAL: If any pointer argument is NULL.
- Other exit codes may be forwarded from underlying system calls. */ - Other exit codes may be forwarded from underlying system calls. */
int toku_rt_create(toku_range_tree** ptree, int (*end_cmp)(void*,void*), int toku_rt_create(toku_range_tree** ptree, int (*end_cmp)(void*,void*),
int (*data_cmp)(void*,void*), BOOL allow_overlaps, int (*data_cmp)(void*,void*), BOOL allow_overlaps,
void* (*user_malloc) (size_t), void* (*user_malloc) (size_t),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment