19 #include "myisampack.h"
36 #define HA_MAX_POSSIBLE_KEY 255
42 #define HA_MAX_KEY_LENGTH 1000
43 #define HA_MAX_KEY_SEG 16
45 #define HA_MAX_POSSIBLE_KEY_BUFF (HA_MAX_KEY_LENGTH + 24+ 6+6)
46 #define HA_MAX_KEY_BUFF (HA_MAX_KEY_LENGTH+HA_MAX_KEY_SEG*6+8+8)
59 uint8 bit_start,bit_end;
63 #define get_key_length(length,key) \
64 { if (*(uchar*) (key) != 255) \
65 length= (uint) *(uchar*) ((key)++); \
67 { length= mi_uint2korr((key)+1); (key)+=3; } \
70 #define get_key_length_rdonly(length,key) \
71 { if (*(uchar*) (key) != 255) \
72 length= ((uint) *(uchar*) ((key))); \
74 { length= mi_uint2korr((key)+1); } \
77 #define get_key_pack_length(length,length_pack,key) \
78 { if (*(uchar*) (key) != 255) \
79 { length= (uint) *(uchar*) ((key)++); length_pack= 1; }\
81 { length=mi_uint2korr((key)+1); (key)+= 3; length_pack= 3; } \
84 #define store_key_length_inc(key,length) \
85 { if ((length) < 255) \
86 { *(key)++= (length); } \
88 { *(key)=255; mi_int2store((key)+1,(length)); (key)+=3; } \
91 #define size_to_store_key_length(length) ((length) < 255 ? 1 : 3)
93 #define get_rec_bits(bit_ptr, bit_ofs, bit_len) \
94 (((((uint16) (bit_ptr)[1] << 8) | (uint16) (bit_ptr)[0]) >> (bit_ofs)) & \
95 ((1 << (bit_len)) - 1))
97 #define set_rec_bits(bits, bit_ptr, bit_ofs, bit_len) \
99 (bit_ptr)[0]= ((bit_ptr)[0] & ~(((1 << (bit_len)) - 1) << (bit_ofs))) | \
100 ((bits) << (bit_ofs)); \
101 if ((bit_ofs) + (bit_len) > 8) \
102 (bit_ptr)[1]= ((bit_ptr)[1] & ~((1 << ((bit_len) - 8 + (bit_ofs))) - 1)) | \
103 ((bits) >> (8 - (bit_ofs))); \
106 #define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \
107 set_rec_bits(0, bit_ptr, bit_ofs, bit_len)
109 extern int ha_compare_text(
const CHARSET_INFO *, uchar *, uint, uchar *, uint ,
111 extern int ha_key_cmp(
register HA_KEYSEG *keyseg,
register uchar *a,
112 register uchar *b, uint key_length, uint nextflag,
120 #define portable_sizeof_char_ptr 8
136 typedef enum icp_result {