~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/mach0data.h

  • Committer: lbieber
  • Date: 2010-10-06 16:34:16 UTC
  • mfrom: (1816.1.3 build)
  • Revision ID: lbieber@orisndriz08-20101006163416-ea0sl59qgpglk21y
Merge Monty - Change the requirement from either libinnodb to libhaildb. Also, tied it to version 2.2
Merge Andrew - fix bug 650935: remove --compress from all clients
Merge Andrew - fix bug 653471: Add -A to drizzle client
Merge Travis - 621861 = To change C structs to C++ classes in Drizzle

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1995, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
166
166
void
167
167
mach_write_to_6(
168
168
/*============*/
169
 
        byte*           b,      /*!< in: pointer to 6 bytes where to store */
170
 
        ib_uint64_t     id);    /*!< in: 48-bit integer */
 
169
        byte*   b,      /*!< in: pointer to 6 bytes where to store */
 
170
        dulint  n);      /*!< in: dulint integer to be stored */
171
171
/********************************************************//**
172
172
The following function is used to fetch data from 6 consecutive
173
173
bytes. The most significant byte is at the lowest address.
174
 
@return 48-bit integer */
 
174
@return dulint integer */
175
175
UNIV_INLINE
176
 
ib_uint64_t
 
176
dulint
177
177
mach_read_from_6(
178
178
/*=============*/
179
179
        const byte*     b)      /*!< in: pointer to 6 bytes */
185
185
void
186
186
mach_write_to_7(
187
187
/*============*/
188
 
        byte*           b,      /*!< in: pointer to 7 bytes where to store */
189
 
        ib_uint64_t     n);     /*!< in: 56-bit integer */
 
188
        byte*   b,      /*!< in: pointer to 7 bytes where to store */
 
189
        dulint  n);      /*!< in: dulint integer to be stored */
190
190
/********************************************************//**
191
191
The following function is used to fetch data from 7 consecutive
192
192
bytes. The most significant byte is at the lowest address.
193
 
@return 56-bit integer */
 
193
@return dulint integer */
194
194
UNIV_INLINE
195
 
ib_uint64_t
 
195
dulint
196
196
mach_read_from_7(
197
197
/*=============*/
198
198
        const byte*     b)      /*!< in: pointer to 7 bytes */
204
204
void
205
205
mach_write_to_8(
206
206
/*============*/
 
207
        byte*   b,      /*!< in: pointer to 8 bytes where to store */
 
208
        dulint  n);     /*!< in: dulint integer to be stored */
 
209
/*******************************************************//**
 
210
The following function is used to store data in 8 consecutive
 
211
bytes. We store the most significant byte to the lowest address. */
 
212
UNIV_INLINE
 
213
void
 
214
mach_write_ull(
 
215
/*===========*/
207
216
        byte*           b,      /*!< in: pointer to 8 bytes where to store */
208
217
        ib_uint64_t     n);     /*!< in: 64-bit integer to be stored */
209
218
/********************************************************//**
210
219
The following function is used to fetch data from 8 consecutive
211
220
bytes. The most significant byte is at the lowest address.
 
221
@return dulint integer */
 
222
UNIV_INLINE
 
223
dulint
 
224
mach_read_from_8(
 
225
/*=============*/
 
226
        const byte*     b)      /*!< in: pointer to 8 bytes */
 
227
        __attribute__((nonnull, pure));
 
228
/********************************************************//**
 
229
The following function is used to fetch data from 8 consecutive
 
230
bytes. The most significant byte is at the lowest address.
212
231
@return 64-bit integer */
213
232
UNIV_INLINE
214
233
ib_uint64_t
215
 
mach_read_from_8(
216
 
/*=============*/
 
234
mach_read_ull(
 
235
/*==========*/
217
236
        const byte*     b)      /*!< in: pointer to 8 bytes */
218
237
        __attribute__((nonnull, pure));
219
238
/*********************************************************//**
220
 
Writes a 64-bit integer in a compressed form (5..9 bytes).
 
239
Writes a dulint in a compressed form (5..9 bytes).
221
240
@return size in bytes */
222
241
UNIV_INLINE
223
242
ulint
224
 
mach_ull_write_compressed(
225
 
/*======================*/
226
 
        byte*           b,      /*!< in: pointer to memory where to store */
227
 
        ib_uint64_t     n);     /*!< in: 64-bit integer to be stored */
228
 
/*********************************************************//**
229
 
Returns the size of a 64-bit integer when written in the compressed form.
230
 
@return compressed size in bytes */
231
 
UNIV_INLINE
232
 
ulint
233
 
mach_ull_get_compressed_size(
 
243
mach_dulint_write_compressed(
234
244
/*=========================*/
235
 
        ib_uint64_t     n);     /*!< in: 64-bit integer to be stored */
236
 
/*********************************************************//**
237
 
Reads a 64-bit integer in a compressed form.
238
 
@return the value read */
239
 
UNIV_INLINE
240
 
ib_uint64_t
241
 
mach_ull_read_compressed(
242
 
/*=====================*/
 
245
        byte*   b,      /*!< in: pointer to memory where to store */
 
246
        dulint  n);     /*!< in: dulint integer to be stored */
 
247
/*********************************************************//**
 
248
Returns the size of a dulint when written in the compressed form.
 
249
@return compressed size in bytes */
 
250
UNIV_INLINE
 
251
ulint
 
252
mach_dulint_get_compressed_size(
 
253
/*============================*/
 
254
        dulint   n);    /*!< in: dulint integer to be stored */
 
255
/*********************************************************//**
 
256
Reads a dulint in a compressed form.
 
257
@return read dulint */
 
258
UNIV_INLINE
 
259
dulint
 
260
mach_dulint_read_compressed(
 
261
/*========================*/
243
262
        const byte*     b)      /*!< in: pointer to memory from where to read */
244
263
        __attribute__((nonnull, pure));
245
264
/*********************************************************//**
246
 
Writes a 64-bit integer in a compressed form (1..11 bytes).
 
265
Writes a dulint in a compressed form (1..11 bytes).
247
266
@return size in bytes */
248
267
UNIV_INLINE
249
268
ulint
250
 
mach_ull_write_much_compressed(
251
 
/*===========================*/
252
 
        byte*           b,      /*!< in: pointer to memory where to store */
253
 
        ib_uint64_t     n);     /*!< in: 64-bit integer to be stored */
254
 
/*********************************************************//**
255
 
Returns the size of a 64-bit integer when written in the compressed form.
256
 
@return compressed size in bytes */
257
 
UNIV_INLINE
258
 
ulint
259
 
mach_ull_get_much_compressed_size(
 
269
mach_dulint_write_much_compressed(
260
270
/*==============================*/
261
 
        ib_uint64_t     n)      /*!< in: 64-bit integer to be stored */
 
271
        byte*   b,      /*!< in: pointer to memory where to store */
 
272
        dulint  n);     /*!< in: dulint integer to be stored */
 
273
/*********************************************************//**
 
274
Returns the size of a dulint when written in the compressed form.
 
275
@return compressed size in bytes */
 
276
UNIV_INLINE
 
277
ulint
 
278
mach_dulint_get_much_compressed_size(
 
279
/*=================================*/
 
280
        dulint   n)      /*!< in: dulint integer to be stored */
262
281
        __attribute__((const));
263
282
/*********************************************************//**
264
 
Reads a 64-bit integer in a compressed form.
265
 
@return the value read */
 
283
Reads a dulint in a compressed form.
 
284
@return read dulint */
266
285
UNIV_INLINE
267
 
ib_uint64_t
268
 
mach_ull_read_much_compressed(
269
 
/*==========================*/
 
286
dulint
 
287
mach_dulint_read_much_compressed(
 
288
/*=============================*/
270
289
        const byte*     b)      /*!< in: pointer to memory from where to read */
271
290
        __attribute__((nonnull, pure));
272
291
/*********************************************************//**
280
299
        byte*   end_ptr,/*!< in: pointer to end of the buffer */
281
300
        ulint*  val);   /*!< out: read value */
282
301
/*********************************************************//**
283
 
Reads a 64-bit integer in a compressed form
284
 
if the log record fully contains it.
285
 
@return pointer to end of the stored field, NULL if not complete */
286
 
UNIV_INLINE
 
302
Reads a dulint in a compressed form if the log record fully contains it.
 
303
@return pointer to end of the stored field, NULL if not complete */
 
304
UNIV_INTERN
287
305
byte*
288
 
mach_ull_parse_compressed(
289
 
/*======================*/
290
 
        byte*           ptr,    /*!< in: pointer to buffer from where to read */
291
 
        byte*           end_ptr,/*!< in: pointer to end of the buffer */
292
 
        ib_uint64_t*    val);   /*!< out: read value */
 
306
mach_dulint_parse_compressed(
 
307
/*=========================*/
 
308
        byte*   ptr,    /*!< in: pointer to buffer from where to read */
 
309
        byte*   end_ptr,/*!< in: pointer to end of the buffer */
 
310
        dulint* val);   /*!< out: read value */
293
311
#ifndef UNIV_HOTBACKUP
294
312
/*********************************************************//**
295
313
Reads a double. It is stored in a little-endian format.