175
/* defines for mf_iocache */
177
/* Test if buffer is inited */
178
#define my_b_clear(info) (info)->buffer=0
179
#define my_b_inited(info) (info)->buffer
180
#define my_b_EOF INT_MIN
182
#define my_b_read(info,Buffer,Count) \
183
((info)->read_pos + (Count) <= (info)->read_end ?\
184
(memcpy(Buffer,(info)->read_pos,(size_t) (Count)), \
185
((info)->read_pos+=(Count)),0) :\
186
(*(info)->read_function)((info),Buffer,Count))
188
#define my_b_write(info,Buffer,Count) \
189
((info)->write_pos + (Count) <=(info)->write_end ?\
190
(memcpy((info)->write_pos, (Buffer), (size_t)(Count)),\
191
((info)->write_pos+=(Count)),0) : \
192
(*(info)->write_function)((info),(Buffer),(Count)))
194
#define my_b_get(info) \
195
((info)->read_pos != (info)->read_end ?\
196
((info)->read_pos++, (int) (unsigned char) (info)->read_pos[-1]) :\
199
#define my_b_tell(info) ((info)->pos_in_file + \
200
(size_t) (*(info)->current_pos - (info)->request_pos))
202
#define my_b_bytes_in_cache(info) (size_t) (*(info)->current_end - \
203
*(info)->current_pos)
205
162
/* Prototypes for mysys and my_func functions */
207
164
extern int my_copy(const char *from,const char *to,myf MyFlags);
208
165
DRIZZLED_API int my_delete(const char *name,myf MyFlags);
209
166
DRIZZLED_API int my_open(const char *FileName,int Flags,myf MyFlags);
210
extern int my_register_filename(int fd, const char *FileName,
211
uint32_t error_message_number, myf MyFlags);
212
DRIZZLED_API int my_create(const char *FileName,int CreateFlags,
213
int AccessFlags, myf MyFlags);
167
extern int my_register_filename(int fd, const char *FileName, uint32_t error_message_number, myf MyFlags);
168
DRIZZLED_API int my_create(const char *FileName,int CreateFlags, int AccessFlags, myf MyFlags);
214
169
DRIZZLED_API int my_close(int Filedes,myf MyFlags);
215
170
extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
216
171
extern int my_realpath(char *to, const char *filename, myf MyFlags);
217
172
extern int my_create_with_symlink(const char *linkname, const char *filename,
218
int createflags, int access_flags,
173
int createflags, int access_flags, myf MyFlags);
220
174
DRIZZLED_API int my_delete_with_symlink(const char *name, myf MyFlags);
221
175
extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags);
222
176
DRIZZLED_API size_t my_read(int Filedes,unsigned char *Buffer,size_t Count,myf MyFlags);
223
177
DRIZZLED_API int my_rename(const char *from, const char *to,myf MyFlags);
224
DRIZZLED_API size_t my_write(int Filedes, const unsigned char *Buffer,
225
size_t Count, myf MyFlags);
178
DRIZZLED_API size_t my_write(int Filedes, const unsigned char *Buffer, size_t Count, myf MyFlags);
227
180
extern int check_if_legal_tablename(const char *path);
249
202
extern char * intern_filename(char * to,const char *from);
250
203
extern int pack_filename(char * to, const char *name, size_t max_length);
251
204
extern char * my_load_path(char * to, const char *path, const char *own_path_prefix);
253
extern void my_set_alarm_variable(int signo);
254
205
extern void my_string_ptr_sort(unsigned char *base,uint32_t items,size_t size);
255
extern void radixsort_for_str_ptr(unsigned char* base[], uint32_t number_of_elements,
256
size_t size_of_element,unsigned char *buffer[]);
257
extern void my_qsort(void *base_ptr, size_t total_elems, size_t size,
259
extern void my_qsort2(void *base_ptr, size_t total_elems, size_t size,
260
qsort2_cmp cmp, void *cmp_argument);
206
extern void radixsort_for_str_ptr(unsigned char* base[], uint32_t number_of_elements, size_t size_of_element,unsigned char *buffer[]);
207
extern void my_qsort(void *base_ptr, size_t total_elems, size_t size, qsort_cmp cmp);
208
extern void my_qsort2(void *base_ptr, size_t total_elems, size_t size, qsort2_cmp cmp, void *cmp_argument);
261
209
extern qsort2_cmp get_ptr_compare(size_t);
262
210
DRIZZLED_API void my_store_ptr(unsigned char *buff, size_t pack_length, my_off_t pos);
263
211
DRIZZLED_API my_off_t my_get_ptr(unsigned char *ptr, size_t pack_length);