~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2008-08-04 19:37:18 UTC
  • mto: (261.2.2 codestyle)
  • mto: This revision was merged to the branch mainline in revision 262.
  • Revision ID: monty@inaugust.com-20080804193718-f0rz13uli4429ozb
Changed gettext_noop() to N_()

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
ulint
33
33
mach_read_from_1(
34
34
/*=============*/
35
 
                                /* out: ulint integer, >= 0, < 256 */
36
 
        const byte*     b)      /* in: pointer to byte */
37
 
        __attribute__((nonnull, pure));
 
35
                        /* out: ulint integer, >= 0, < 256 */
 
36
        byte*   b);      /* in: pointer to byte */
38
37
/***********************************************************
39
38
The following function is used to store data in two consecutive
40
39
bytes. We store the most significant byte to the lower address. */
51
50
ulint
52
51
mach_read_from_2(
53
52
/*=============*/
54
 
                                /* out: ulint integer, >= 0, < 64k */
55
 
        const byte*     b)      /* in: pointer to two bytes */
56
 
        __attribute__((nonnull, pure));
 
53
                        /* out: ulint integer, >= 0, < 64k */
 
54
        byte*   b);      /* in: pointer to two bytes */
57
55
 
58
56
/************************************************************
59
57
The following function is used to convert a 16-bit data item
60
58
to the canonical format, for fast bytewise equality test
61
59
against memory. */
62
60
UNIV_INLINE
63
 
uint16
 
61
uint16_t
64
62
mach_encode_2(
65
63
/*==========*/
66
64
                        /* out: 16-bit integer in canonical format */
67
 
        ulint   n)      /* in: integer in machine-dependent format */
68
 
        __attribute__((__const__));
 
65
        ulint   n);     /* in: integer in machine-dependent format */
69
66
/************************************************************
70
67
The following function is used to convert a 16-bit data item
71
68
from the canonical format, for fast bytewise equality test
75
72
mach_decode_2(
76
73
/*==========*/
77
74
                        /* out: integer in machine-dependent format */
78
 
        uint16  n)      /* in: 16-bit integer in canonical format */
79
 
        __attribute__((__const__));
 
75
        uint16_t        n);     /* in: 16-bit integer in canonical format */
80
76
/***********************************************************
81
77
The following function is used to store data in 3 consecutive
82
78
bytes. We store the most significant byte to the lowest address. */
93
89
ulint
94
90
mach_read_from_3(
95
91
/*=============*/
96
 
                                /* out: ulint integer */
97
 
        const byte*     b)      /* in: pointer to 3 bytes */
98
 
        __attribute__((nonnull, pure));
 
92
                        /* out: ulint integer */
 
93
        byte*   b);      /* in: pointer to 3 bytes */
99
94
/***********************************************************
100
95
The following function is used to store data in four consecutive
101
96
bytes. We store the most significant byte to the lowest address. */
112
107
ulint
113
108
mach_read_from_4(
114
109
/*=============*/
115
 
                                /* out: ulint integer */
116
 
        const byte*     b)      /* in: pointer to four bytes */
117
 
        __attribute__((nonnull, pure));
 
110
                        /* out: ulint integer */
 
111
        byte*   b);      /* in: pointer to four bytes */
118
112
/*************************************************************
119
113
Writes a ulint in a compressed form (1..5 bytes). */
120
114
UNIV_INLINE
131
125
mach_get_compressed_size(
132
126
/*=====================*/
133
127
                        /* out: compressed size in bytes */
134
 
        ulint   n)      /* in: ulint integer to be stored */
135
 
        __attribute__((__const__));
 
128
        ulint   n);     /* in: ulint integer to be stored */
136
129
/*************************************************************
137
130
Reads a ulint in a compressed form. */
138
131
UNIV_INLINE
139
132
ulint
140
133
mach_read_compressed(
141
134
/*=================*/
142
 
                                /* out: read integer */
143
 
        const byte*     b)      /* in: pointer to memory from where to read */
144
 
        __attribute__((nonnull, pure));
 
135
                        /* out: read integer */
 
136
        byte*   b);     /* in: pointer to memory from where to read */
145
137
/***********************************************************
146
138
The following function is used to store data in 6 consecutive
147
139
bytes. We store the most significant byte to the lowest address. */
158
150
dulint
159
151
mach_read_from_6(
160
152
/*=============*/
161
 
                                /* out: dulint integer */
162
 
        const byte*     b)      /* in: pointer to 6 bytes */
163
 
        __attribute__((nonnull, pure));
 
153
                        /* out: dulint integer */
 
154
        byte*   b);      /* in: pointer to 6 bytes */
164
155
/***********************************************************
165
156
The following function is used to store data in 7 consecutive
166
157
bytes. We store the most significant byte to the lowest address. */
177
168
dulint
178
169
mach_read_from_7(
179
170
/*=============*/
180
 
                                /* out: dulint integer */
181
 
        const byte*     b)      /* in: pointer to 7 bytes */
182
 
        __attribute__((nonnull, pure));
 
171
                        /* out: dulint integer */
 
172
        byte*   b);      /* in: pointer to 7 bytes */
183
173
/***********************************************************
184
174
The following function is used to store data in 8 consecutive
185
175
bytes. We store the most significant byte to the lowest address. */
189
179
/*============*/
190
180
        byte*   b,      /* in: pointer to 8 bytes where to store */
191
181
        dulint  n);     /* in: dulint integer to be stored */
192
 
/***********************************************************
193
 
The following function is used to store data in 8 consecutive
194
 
bytes. We store the most significant byte to the lowest address. */
195
 
UNIV_INLINE
196
 
void
197
 
mach_write_ull(
198
 
/*===========*/
199
 
        byte*           b,      /* in: pointer to 8 bytes where to store */
200
 
        ib_uint64_t     n);     /* in: 64-bit integer to be stored */
201
182
/************************************************************
202
183
The following function is used to fetch data from 8 consecutive
203
184
bytes. The most significant byte is at the lowest address. */
205
186
dulint
206
187
mach_read_from_8(
207
188
/*=============*/
208
 
                                /* out: dulint integer */
209
 
        const byte*     b)      /* in: pointer to 8 bytes */
210
 
        __attribute__((nonnull, pure));
211
 
/************************************************************
212
 
The following function is used to fetch data from 8 consecutive
213
 
bytes. The most significant byte is at the lowest address. */
214
 
UNIV_INLINE
215
 
ib_uint64_t
216
 
mach_read_ull(
217
 
/*==========*/
218
 
                                /* out: 64-bit integer */
219
 
        const byte*     b)      /* in: pointer to 8 bytes */
220
 
        __attribute__((nonnull, pure));
 
189
                        /* out: dulint integer */
 
190
        byte*   b);      /* in: pointer to 8 bytes */
221
191
/*************************************************************
222
192
Writes a dulint in a compressed form (5..9 bytes). */
223
193
UNIV_INLINE
241
211
dulint
242
212
mach_dulint_read_compressed(
243
213
/*========================*/
244
 
                                /* out: read dulint */
245
 
        const byte*     b)      /* in: pointer to memory from where to read */
246
 
        __attribute__((nonnull, pure));
 
214
                        /* out: read dulint */
 
215
        byte*   b);     /* in: pointer to memory from where to read */
247
216
/*************************************************************
248
217
Writes a dulint in a compressed form (1..11 bytes). */
249
218
UNIV_INLINE
260
229
mach_dulint_get_much_compressed_size(
261
230
/*=================================*/
262
231
                        /* out: compressed size in bytes */
263
 
        dulint   n)      /* in: dulint integer to be stored */
264
 
        __attribute__((__const__));
 
232
        dulint   n);     /* in: dulint integer to be stored */
265
233
/*************************************************************
266
234
Reads a dulint in a compressed form. */
267
235
UNIV_INLINE
268
236
dulint
269
237
mach_dulint_read_much_compressed(
270
238
/*=============================*/
271
 
                                /* out: read dulint */
272
 
        const byte*     b)      /* in: pointer to memory from where to read */
273
 
        __attribute__((nonnull, pure));
 
239
                        /* out: read dulint */
 
240
        byte*   b);      /* in: pointer to memory from where to read */
274
241
/*************************************************************
275
242
Reads a ulint in a compressed form if the log record fully contains it. */
276
 
UNIV_INTERN
 
243
 
277
244
byte*
278
245
mach_parse_compressed(
279
246
/*==================*/
284
251
        ulint*  val);   /* out: read value */
285
252
/*************************************************************
286
253
Reads a dulint in a compressed form if the log record fully contains it. */
287
 
UNIV_INTERN
 
254
 
288
255
byte*
289
256
mach_dulint_parse_compressed(
290
257
/*=========================*/
299
266
double
300
267
mach_double_read(
301
268
/*=============*/
302
 
                                /* out: double read */
303
 
        const byte*     b)      /* in: pointer to memory from where to read */
304
 
        __attribute__((nonnull, pure));
 
269
                        /* out: double read */
 
270
        byte*   b);      /* in: pointer to memory from where to read */
305
271
/*************************************************************
306
272
Writes a double. It is stored in a little-endian format. */
307
273
UNIV_INLINE
316
282
float
317
283
mach_float_read(
318
284
/*============*/
319
 
                                /* out: float read */
320
 
        const byte*     b)      /* in: pointer to memory from where to read */
321
 
        __attribute__((nonnull, pure));
 
285
                        /* out: float read */
 
286
        byte*   b);      /* in: pointer to memory from where to read */
322
287
/*************************************************************
323
288
Writes a float. It is stored in a little-endian format. */
324
289
UNIV_INLINE
333
298
ulint
334
299
mach_read_from_n_little_endian(
335
300
/*===========================*/
336
 
                                        /* out: unsigned long int */
337
 
        const byte*     buf,            /* in: from where to read */
338
 
        ulint           buf_size)       /* in: from how many bytes to read */
339
 
        __attribute__((nonnull, pure));
 
301
                                /* out: unsigned long int */
 
302
        byte*   buf,            /* in: from where to read */
 
303
        ulint   buf_size);      /* in: from how many bytes to read */
340
304
/*************************************************************
341
305
Writes a ulint in the little-endian format. */
342
306
UNIV_INLINE
352
316
ulint
353
317
mach_read_from_2_little_endian(
354
318
/*===========================*/
355
 
                                        /* out: unsigned long int */
356
 
        const byte*     buf)            /* in: from where to read */
357
 
        __attribute__((nonnull, pure));
 
319
                                /* out: unsigned long int */
 
320
        byte*   buf);           /* in: from where to read */
358
321
/*************************************************************
359
322
Writes a ulint in the little-endian format. */
360
323
UNIV_INLINE
368
331
Convert integral type from storage byte order (big endian) to
369
332
host byte order. */
370
333
UNIV_INLINE
371
 
ullint
 
334
void
372
335
mach_read_int_type(
373
336
/*===============*/
374
 
                                        /* out: integer value */
 
337
        byte*           dest,           /* out: where to write */
375
338
        const byte*     src,            /* in: where to read from */
376
339
        ulint           len,            /* in: length of src */
377
340
        ibool           unsigned_type); /* in: signed or unsigned flag */