1/* Copyright (C) 2006 MySQL AB & Ramil Kalimullin & MySQL Finland AB
2 & TCX DataKonsult AB
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 02111-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(share, page, nod_flag) (page + share->keypage_header + nod_flag)
23#define rt_PAGE_NEXT_KEY(share, key, key_length, nod_flag) (key + key_length +\
24 (nod_flag ? nod_flag : share->base.rec_reflength))
25#define rt_PAGE_END(page) ((page)->buff + (page)->size)
26
27#define rt_PAGE_MIN_SIZE(block_length) ((uint)(block_length - KEYPAGE_CHECKSUM_SIZE) / 3)
28
29my_bool maria_rtree_insert(MARIA_HA *info, MARIA_KEY *key);
30my_bool maria_rtree_delete(MARIA_HA *info, MARIA_KEY *key);
31int maria_rtree_insert_level(MARIA_HA *info, MARIA_KEY *key,
32 int ins_level, my_off_t *root);
33my_bool maria_rtree_real_delete(MARIA_HA *info, MARIA_KEY *key,
34 my_off_t *root);
35int maria_rtree_find_first(MARIA_HA *info, MARIA_KEY *key, uint search_flag);
36int maria_rtree_find_next(MARIA_HA *info, uint keynr, uint32 search_flag);
37
38int maria_rtree_get_first(MARIA_HA *info, uint keynr, uint key_length);
39int maria_rtree_get_next(MARIA_HA *info, uint keynr, uint key_length);
40
41ha_rows maria_rtree_estimate(MARIA_HA *info, MARIA_KEY *key, uint32 flag);
42
43int maria_rtree_split_page(const MARIA_KEY *key, MARIA_PAGE *page,
44 my_off_t *new_page_offs);
45#endif /*HAVE_RTREE_KEYS*/
46#endif /* _rt_index_h */
47