~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

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
 
        dulint  n);      /*!< in: dulint integer to be stored */
 
169
        byte*           b,      /*!< in: pointer to 6 bytes where to store */
 
170
        ib_uint64_t     id);    /*!< in: 48-bit integer */
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 dulint integer */
 
174
@return 48-bit integer */
175
175
UNIV_INLINE
176
 
dulint
 
176
ib_uint64_t
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
 
        dulint  n);      /*!< in: dulint integer to be stored */
 
188
        byte*           b,      /*!< in: pointer to 7 bytes where to store */
 
189
        ib_uint64_t     n);     /*!< in: 56-bit integer */
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 dulint integer */
 
193
@return 56-bit integer */
194
194
UNIV_INLINE
195
 
dulint
 
195
ib_uint64_t
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
 
/*===========*/
216
207
        byte*           b,      /*!< in: pointer to 8 bytes where to store */
217
208
        ib_uint64_t     n);     /*!< in: 64-bit integer to be stored */
218
209
/********************************************************//**
219
210
The following function is used to fetch data from 8 consecutive
220
211
bytes. The most significant byte is at the lowest address.
221
 
@return dulint integer */
 
212
@return 64-bit integer */
222
213
UNIV_INLINE
223
 
dulint
 
214
ib_uint64_t
224
215
mach_read_from_8(
225
216
/*=============*/
226
217
        const byte*     b)      /*!< in: pointer to 8 bytes */
227
218
        __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.
231
 
@return 64-bit integer */
 
219
/*********************************************************//**
 
220
Writes a 64-bit integer in a compressed form (5..9 bytes).
 
221
@return size in bytes */
 
222
UNIV_INLINE
 
223
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(
 
234
/*=========================*/
 
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 */
232
239
UNIV_INLINE
233
240
ib_uint64_t
234
 
mach_read_ull(
235
 
/*==========*/
236
 
        const byte*     b)      /*!< in: pointer to 8 bytes */
237
 
        __attribute__((nonnull, pure));
238
 
/*********************************************************//**
239
 
Writes a dulint in a compressed form (5..9 bytes).
240
 
@return size in bytes */
241
 
UNIV_INLINE
242
 
ulint
243
 
mach_dulint_write_compressed(
244
 
/*=========================*/
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
 
/*========================*/
 
241
mach_ull_read_compressed(
 
242
/*=====================*/
262
243
        const byte*     b)      /*!< in: pointer to memory from where to read */
263
244
        __attribute__((nonnull, pure));
264
245
/*********************************************************//**
265
 
Writes a dulint in a compressed form (1..11 bytes).
 
246
Writes a 64-bit integer in a compressed form (1..11 bytes).
266
247
@return size in bytes */
267
248
UNIV_INLINE
268
249
ulint
269
 
mach_dulint_write_much_compressed(
 
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(
270
260
/*==============================*/
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 */
 
261
        ib_uint64_t     n)      /*!< in: 64-bit integer to be stored */
281
262
        __attribute__((const));
282
263
/*********************************************************//**
283
 
Reads a dulint in a compressed form.
284
 
@return read dulint */
 
264
Reads a 64-bit integer in a compressed form.
 
265
@return the value read */
285
266
UNIV_INLINE
286
 
dulint
287
 
mach_dulint_read_much_compressed(
288
 
/*=============================*/
 
267
ib_uint64_t
 
268
mach_ull_read_much_compressed(
 
269
/*==========================*/
289
270
        const byte*     b)      /*!< in: pointer to memory from where to read */
290
271
        __attribute__((nonnull, pure));
291
272
/*********************************************************//**
299
280
        byte*   end_ptr,/*!< in: pointer to end of the buffer */
300
281
        ulint*  val);   /*!< out: read value */
301
282
/*********************************************************//**
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
 
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
305
287
byte*
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 */
 
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 */
311
293
#ifndef UNIV_HOTBACKUP
312
294
/*********************************************************//**
313
295
Reads a double. It is stored in a little-endian format.