~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_handler.h

Cleanup around SAFEMALLOC

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
16
16
   MA 02111-1307, USA */
17
17
 
18
 
#ifndef PLUGIN_MYISAM_MY_HANDLER_H
19
 
#define PLUGIN_MYISAM_MY_HANDLER_H
 
18
#ifndef _my_handler_h
 
19
#define _my_handler_h
20
20
 
21
 
#include "drizzled/charset_info.h"
22
 
#include <plugin/myisam/myisampack.h>
 
21
#include <storage/myisam/myisampack.h>
 
22
#ifdef  __cplusplus
 
23
extern "C" {
 
24
#endif
23
25
 
24
26
/*
25
27
  There is a hard limit for the maximum number of keys as there are only
45
47
 
46
48
typedef struct st_HA_KEYSEG             /* Key-portion */
47
49
{
48
 
  const drizzled::CHARSET_INFO *charset;
 
50
  const CHARSET_INFO *charset;
49
51
  uint32_t start;                               /* Start of key in record */
50
52
  uint32_t null_pos;                    /* position to NULL indicator */
51
53
  uint16_t bit_pos;                       /* Position to bit part */
59
61
} HA_KEYSEG;
60
62
 
61
63
#define get_key_length(length,key) \
62
 
{ if (*(unsigned char*) (key) != 255) \
63
 
    length= (uint) *(unsigned char*) ((key)++); \
 
64
{ if (*(uchar*) (key) != 255) \
 
65
    length= (uint) *(uchar*) ((key)++); \
64
66
  else \
65
67
  { length= mi_uint2korr((key)+1); (key)+=3; } \
66
68
}
67
69
 
68
70
#define get_key_length_rdonly(length,key) \
69
 
{ if (*(unsigned char*) (key) != 255) \
70
 
    length= ((uint) *(unsigned char*) ((key))); \
 
71
{ if (*(uchar*) (key) != 255) \
 
72
    length= ((uint) *(uchar*) ((key))); \
71
73
  else \
72
74
  { length= mi_uint2korr((key)+1); } \
73
75
}
74
76
 
75
77
#define get_key_pack_length(length,length_pack,key) \
76
 
{ if (*(unsigned char*) (key) != 255) \
77
 
  { length= (uint) *(unsigned char*) ((key)++); length_pack= 1; }\
 
78
{ if (*(uchar*) (key) != 255) \
 
79
  { length= (uint) *(uchar*) ((key)++); length_pack= 1; }\
78
80
  else \
79
81
  { length=mi_uint2korr((key)+1); (key)+= 3; length_pack= 3; } \
80
82
}
104
106
#define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \
105
107
  set_rec_bits(0, bit_ptr, bit_ofs, bit_len)
106
108
 
107
 
extern int ha_compare_text(const drizzled::CHARSET_INFO * const, unsigned char *, uint, unsigned char *, uint, bool, bool);
 
109
extern int ha_compare_text(const CHARSET_INFO * const, uchar *, uint, uchar *, uint, bool, bool);
108
110
 
109
 
extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, unsigned char *a);
110
 
void my_handler_error_register(void);
111
 
extern int ha_key_cmp(HA_KEYSEG *keyseg, unsigned char *a,unsigned char *b,
112
 
                      uint32_t key_length,uint32_t nextflag,uint32_t *diff_length);
 
111
extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a);
 
112
extern void my_handler_error_register(void);
 
113
extern void my_handler_error_unregister(void);
 
114
extern int ha_key_cmp(HA_KEYSEG *keyseg, uchar *a,uchar *b,
 
115
                      uint key_length,uint nextflag,uint *diff_length);
113
116
 
114
117
/*
115
118
  Inside an in-memory data record, memory pointers to pieces of the
117
120
  this amount of bytes.
118
121
*/
119
122
#define portable_sizeof_char_ptr 8
 
123
#ifdef  __cplusplus
 
124
}
 
125
#endif
120
126
 
121
 
#endif /* PLUGIN_MYISAM_MY_HANDLER_H */
 
127
#endif /* _my_handler_h */