2 Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
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.
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.
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 St, Fifth Floor, Boston, MA 02110-1301 USA
18 /* Written by Sergei A. Golubchik, who has a shared copyright to this code */
20 /* some definitions for full-text indices */
22 #include "myisamdef.h"
23 #include "ft_global.h"
25 #define HA_FT_WTYPE HA_KEYTYPE_FLOAT
30 Accessor methods for the weight and the number of subkeys in a buffer.
32 The weight is of float type and subkeys number is of integer type. Both
33 are stored in the same position of the buffer and the stored object is
34 identified by the sign (bit): the weight value is positive whilst the
35 number of subkeys is negative.
37 In light of C's strict-aliasing rules, which roughly state that an object
38 must not be accessed through incompatible types, these methods are used to
39 avoid any problems arising from the type duality inside the buffer. The
40 values are retrieved using a character type which can access any object.
42 #define ft_sintXkorr(A) mi_sint4korr(A)
43 #define ft_intXstore(T,A) mi_int4store(T,A)
44 #define ft_floatXget(V,M) mi_float4get(V,M)
47 extern const HA_KEYSEG ft_keysegs
[FT_SEGS
];
49 int _mi_ft_cmp(MI_INFO
*, uint
, const uchar
*, const uchar
*);
50 int _mi_ft_add(MI_INFO
*, uint
, uchar
*, const uchar
*, my_off_t
);
51 int _mi_ft_del(MI_INFO
*, uint
, uchar
*, const uchar
*, my_off_t
);
53 uint
_mi_ft_convert_to_ft2(MI_INFO
*, uint
, uchar
*);