1/* Copyright (c) 2002, 2004-2006 MySQL AB
2 Use is subject to license terms
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; version 2 of the License.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
16
17#ifndef _rt_index_h
18#define _rt_index_h
19
20#ifdef HAVE_RTREE_KEYS
21
22#define rt_PAGE_FIRST_KEY(page, nod_flag) (page + 2 + nod_flag)
23#define rt_PAGE_NEXT_KEY(key, key_length, nod_flag) (key + key_length + \
24 (nod_flag ? nod_flag : info->s->base.rec_reflength))
25#define rt_PAGE_END(page) (page + mi_getint(page))
26
27#define rt_PAGE_MIN_SIZE(block_length) ((uint)(block_length) / 3)
28
29int rtree_insert(MI_INFO *info, uint keynr, uchar *key, uint key_length);
30int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length);
31
32int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length,
33 uint search_flag);
34int rtree_find_next(MI_INFO *info, uint keynr, uint search_flag);
35
36int rtree_get_first(MI_INFO *info, uint keynr, uint key_length);
37int rtree_get_next(MI_INFO *info, uint keynr, uint key_length);
38
39ha_rows rtree_estimate(MI_INFO *info, uint keynr, uchar *key,
40 uint key_length, uint flag);
41
42int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key,
43 uint key_length, my_off_t *new_page_offs);
44
45#endif /*HAVE_RTREE_KEYS*/
46#endif /* _rt_index_h */
47