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