641.2.2
by Monty Taylor
InnoDB Plugin 1.0.3 |
1 |
/*****************************************************************************
|
2 |
||
3 |
Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
|
|
4 |
||
5 |
This program is free software; you can redistribute it and/or modify it under
|
|
6 |
the terms of the GNU General Public License as published by the Free Software
|
|
7 |
Foundation; version 2 of the License.
|
|
8 |
||
9 |
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
10 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11 |
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
12 |
||
13 |
You should have received a copy of the GNU General Public License along with
|
|
1802.10.2
by Monty Taylor
Update all of the copyright headers to include the correct address. |
14 |
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
|
15 |
St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
641.2.2
by Monty Taylor
InnoDB Plugin 1.0.3 |
16 |
|
17 |
*****************************************************************************/
|
|
18 |
||
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
19 |
/******************************************************************//**
|
20 |
@file include/mach0data.h
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
21 |
Utilities for converting data from the database file
|
22 |
to the machine format.
|
|
23 |
||
24 |
Created 11/28/1995 Heikki Tuuri
|
|
25 |
***********************************************************************/
|
|
26 |
||
27 |
#ifndef mach0data_h
|
|
28 |
#define mach0data_h
|
|
29 |
||
30 |
#include "univ.i" |
|
31 |
#include "ut0byte.h" |
|
32 |
||
33 |
/* The data and all fields are always stored in a database file
|
|
34 |
in the same format: ascii, big-endian, ... .
|
|
35 |
All data in the files MUST be accessed using the functions in this
|
|
36 |
module. */
|
|
37 |
||
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
38 |
/*******************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
39 |
The following function is used to store data in one byte. */
|
40 |
UNIV_INLINE
|
|
41 |
void
|
|
42 |
mach_write_to_1( |
|
43 |
/*============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
44 |
byte* b, /*!< in: pointer to byte where to store */ |
45 |
ulint n); /*!< in: ulint integer to be stored, >= 0, < 256 */ |
|
46 |
/********************************************************//**
|
|
47 |
The following function is used to fetch data from one byte.
|
|
48 |
@return ulint integer, >= 0, < 256 */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
49 |
UNIV_INLINE
|
50 |
ulint
|
|
51 |
mach_read_from_1( |
|
52 |
/*=============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
53 |
const byte* b) /*!< in: pointer to byte */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
54 |
__attribute__((nonnull, pure)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
55 |
/*******************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
56 |
The following function is used to store data in two consecutive
|
57 |
bytes. We store the most significant byte to the lower address. */
|
|
58 |
UNIV_INLINE
|
|
59 |
void
|
|
60 |
mach_write_to_2( |
|
61 |
/*============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
62 |
byte* b, /*!< in: pointer to two bytes where to store */ |
63 |
ulint n); /*!< in: ulint integer to be stored, >= 0, < 64k */ |
|
64 |
/********************************************************//**
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
65 |
The following function is used to fetch data from two consecutive
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
66 |
bytes. The most significant byte is at the lowest address.
|
67 |
@return ulint integer, >= 0, < 64k */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
68 |
UNIV_INLINE
|
69 |
ulint
|
|
70 |
mach_read_from_2( |
|
71 |
/*=============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
72 |
const byte* b) /*!< in: pointer to two bytes */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
73 |
__attribute__((nonnull, pure)); |
74 |
||
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
75 |
/********************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
76 |
The following function is used to convert a 16-bit data item
|
77 |
to the canonical format, for fast bytewise equality test
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
78 |
against memory.
|
79 |
@return 16-bit integer in canonical format */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
80 |
UNIV_INLINE
|
81 |
uint16
|
|
82 |
mach_encode_2( |
|
83 |
/*==========*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
84 |
ulint n) /*!< in: integer in machine-dependent format */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
85 |
__attribute__((const)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
86 |
/********************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
87 |
The following function is used to convert a 16-bit data item
|
88 |
from the canonical format, for fast bytewise equality test
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
89 |
against memory.
|
90 |
@return integer in machine-dependent format */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
91 |
UNIV_INLINE
|
92 |
ulint
|
|
93 |
mach_decode_2( |
|
94 |
/*==========*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
95 |
uint16 n) /*!< in: 16-bit integer in canonical format */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
96 |
__attribute__((const)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
97 |
/*******************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
98 |
The following function is used to store data in 3 consecutive
|
99 |
bytes. We store the most significant byte to the lowest address. */
|
|
100 |
UNIV_INLINE
|
|
101 |
void
|
|
102 |
mach_write_to_3( |
|
103 |
/*============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
104 |
byte* b, /*!< in: pointer to 3 bytes where to store */ |
105 |
ulint n); /*!< in: ulint integer to be stored */ |
|
106 |
/********************************************************//**
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
107 |
The following function is used to fetch data from 3 consecutive
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
108 |
bytes. The most significant byte is at the lowest address.
|
109 |
@return ulint integer */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
110 |
UNIV_INLINE
|
111 |
ulint
|
|
112 |
mach_read_from_3( |
|
113 |
/*=============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
114 |
const byte* b) /*!< in: pointer to 3 bytes */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
115 |
__attribute__((nonnull, pure)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
116 |
/*******************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
117 |
The following function is used to store data in four consecutive
|
118 |
bytes. We store the most significant byte to the lowest address. */
|
|
119 |
UNIV_INLINE
|
|
120 |
void
|
|
121 |
mach_write_to_4( |
|
122 |
/*============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
123 |
byte* b, /*!< in: pointer to four bytes where to store */ |
124 |
ulint n); /*!< in: ulint integer to be stored */ |
|
125 |
/********************************************************//**
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
126 |
The following function is used to fetch data from 4 consecutive
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
127 |
bytes. The most significant byte is at the lowest address.
|
128 |
@return ulint integer */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
129 |
UNIV_INLINE
|
130 |
ulint
|
|
131 |
mach_read_from_4( |
|
132 |
/*=============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
133 |
const byte* b) /*!< in: pointer to four bytes */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
134 |
__attribute__((nonnull, pure)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
135 |
/*********************************************************//**
|
136 |
Writes a ulint in a compressed form (1..5 bytes).
|
|
137 |
@return stored size in bytes */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
138 |
UNIV_INLINE
|
139 |
ulint
|
|
140 |
mach_write_compressed( |
|
141 |
/*==================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
142 |
byte* b, /*!< in: pointer to memory where to store */ |
143 |
ulint n); /*!< in: ulint integer to be stored */ |
|
144 |
/*********************************************************//**
|
|
145 |
Returns the size of an ulint when written in the compressed form.
|
|
146 |
@return compressed size in bytes */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
147 |
UNIV_INLINE
|
148 |
ulint
|
|
149 |
mach_get_compressed_size( |
|
150 |
/*=====================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
151 |
ulint n) /*!< in: ulint integer to be stored */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
152 |
__attribute__((const)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
153 |
/*********************************************************//**
|
154 |
Reads a ulint in a compressed form.
|
|
155 |
@return read integer */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
156 |
UNIV_INLINE
|
157 |
ulint
|
|
158 |
mach_read_compressed( |
|
159 |
/*=================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
160 |
const byte* b) /*!< in: pointer to memory from where to read */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
161 |
__attribute__((nonnull, pure)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
162 |
/*******************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
163 |
The following function is used to store data in 6 consecutive
|
164 |
bytes. We store the most significant byte to the lowest address. */
|
|
165 |
UNIV_INLINE
|
|
166 |
void
|
|
167 |
mach_write_to_6( |
|
168 |
/*============*/
|
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
169 |
byte* b, /*!< in: pointer to 6 bytes where to store */ |
170 |
ib_uint64_t id); /*!< in: 48-bit integer */ |
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
171 |
/********************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
172 |
The following function is used to fetch data from 6 consecutive
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
173 |
bytes. The most significant byte is at the lowest address.
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
174 |
@return 48-bit integer */
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
175 |
UNIV_INLINE
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
176 |
ib_uint64_t
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
177 |
mach_read_from_6( |
178 |
/*=============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
179 |
const byte* b) /*!< in: pointer to 6 bytes */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
180 |
__attribute__((nonnull, pure)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
181 |
/*******************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
182 |
The following function is used to store data in 7 consecutive
|
183 |
bytes. We store the most significant byte to the lowest address. */
|
|
184 |
UNIV_INLINE
|
|
185 |
void
|
|
186 |
mach_write_to_7( |
|
187 |
/*============*/
|
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
188 |
byte* b, /*!< in: pointer to 7 bytes where to store */ |
189 |
ib_uint64_t n); /*!< in: 56-bit integer */ |
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
190 |
/********************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
191 |
The following function is used to fetch data from 7 consecutive
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
192 |
bytes. The most significant byte is at the lowest address.
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
193 |
@return 56-bit integer */
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
194 |
UNIV_INLINE
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
195 |
ib_uint64_t
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
196 |
mach_read_from_7( |
197 |
/*=============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
198 |
const byte* b) /*!< in: pointer to 7 bytes */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
199 |
__attribute__((nonnull, pure)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
200 |
/*******************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
201 |
The following function is used to store data in 8 consecutive
|
202 |
bytes. We store the most significant byte to the lowest address. */
|
|
203 |
UNIV_INLINE
|
|
204 |
void
|
|
205 |
mach_write_to_8( |
|
206 |
/*============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
207 |
byte* b, /*!< in: pointer to 8 bytes where to store */ |
208 |
ib_uint64_t n); /*!< in: 64-bit integer to be stored */ |
|
209 |
/********************************************************//**
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
210 |
The following function is used to fetch data from 8 consecutive
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
211 |
bytes. The most significant byte is at the lowest address.
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
212 |
@return 64-bit integer */
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
213 |
UNIV_INLINE
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
214 |
ib_uint64_t
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
215 |
mach_read_from_8( |
216 |
/*=============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
217 |
const byte* b) /*!< in: pointer to 8 bytes */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
218 |
__attribute__((nonnull, pure)); |
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
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 */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
239 |
UNIV_INLINE
|
240 |
ib_uint64_t
|
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
241 |
mach_ull_read_compressed( |
242 |
/*=====================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
243 |
const byte* b) /*!< in: pointer to memory from where to read */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
244 |
__attribute__((nonnull, pure)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
245 |
/*********************************************************//**
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
246 |
Writes a 64-bit integer in a compressed form (1..11 bytes).
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
247 |
@return size in bytes */
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
248 |
UNIV_INLINE
|
249 |
ulint
|
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
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( |
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
260 |
/*==============================*/
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
261 |
ib_uint64_t n) /*!< in: 64-bit integer to be stored */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
262 |
__attribute__((const)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
263 |
/*********************************************************//**
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
264 |
Reads a 64-bit integer in a compressed form.
|
265 |
@return the value read */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
266 |
UNIV_INLINE
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
267 |
ib_uint64_t
|
268 |
mach_ull_read_much_compressed( |
|
269 |
/*==========================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
270 |
const byte* b) /*!< in: pointer to memory from where to read */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
271 |
__attribute__((nonnull, pure)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
272 |
/*********************************************************//**
|
273 |
Reads a ulint in a compressed form if the log record fully contains it.
|
|
274 |
@return pointer to end of the stored field, NULL if not complete */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
275 |
UNIV_INTERN
|
276 |
byte* |
|
277 |
mach_parse_compressed( |
|
278 |
/*==================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
279 |
byte* ptr, /*!< in: pointer to buffer from where to read */ |
280 |
byte* end_ptr,/*!< in: pointer to end of the buffer */ |
|
281 |
ulint* val); /*!< out: read value */ |
|
282 |
/*********************************************************//**
|
|
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
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 */
|
|
1819.9.33
by Marko Mäkelä
Merge Revision revid:marko.makela@oracle.com-20100624060842-bkagpd3u6qii6odd from MySQL InnoDB |
286 |
UNIV_INLINE
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
287 |
byte* |
1819.9.31
by Marko Mäkelä, Stewart Smith
Merge Revision revid:marko.makela@oracle.com-20100623110659-pk5bqnmo0j7hj6md from MySQL InnoDB |
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 */ |
|
1819.9.43
by Sunny Bains
Merge Revision revid:sunny.bains@oracle.com-20100715015515-7juwgsmtkzvj3bn5 from MySQL InnoDB |
292 |
ib_uint64_t* val); /*!< out: read value */ |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
293 |
#ifndef UNIV_HOTBACKUP
|
294 |
/*********************************************************//**
|
|
295 |
Reads a double. It is stored in a little-endian format.
|
|
296 |
@return double read */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
297 |
UNIV_INLINE
|
298 |
double
|
|
299 |
mach_double_read( |
|
300 |
/*=============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
301 |
const byte* b) /*!< in: pointer to memory from where to read */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
302 |
__attribute__((nonnull, pure)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
303 |
/*********************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
304 |
Writes a double. It is stored in a little-endian format. */
|
305 |
UNIV_INLINE
|
|
306 |
void
|
|
307 |
mach_double_write( |
|
308 |
/*==============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
309 |
byte* b, /*!< in: pointer to memory where to write */ |
310 |
double d); /*!< in: double */ |
|
311 |
/*********************************************************//**
|
|
312 |
Reads a float. It is stored in a little-endian format.
|
|
313 |
@return float read */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
314 |
UNIV_INLINE
|
315 |
float
|
|
316 |
mach_float_read( |
|
317 |
/*============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
318 |
const byte* b) /*!< in: pointer to memory from where to read */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
319 |
__attribute__((nonnull, pure)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
320 |
/*********************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
321 |
Writes a float. It is stored in a little-endian format. */
|
322 |
UNIV_INLINE
|
|
323 |
void
|
|
324 |
mach_float_write( |
|
325 |
/*=============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
326 |
byte* b, /*!< in: pointer to memory where to write */ |
327 |
float d); /*!< in: float */ |
|
328 |
/*********************************************************//**
|
|
329 |
Reads a ulint stored in the little-endian format.
|
|
330 |
@return unsigned long int */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
331 |
UNIV_INLINE
|
332 |
ulint
|
|
333 |
mach_read_from_n_little_endian( |
|
334 |
/*===========================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
335 |
const byte* buf, /*!< in: from where to read */ |
336 |
ulint buf_size) /*!< in: from how many bytes to read */ |
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
337 |
__attribute__((nonnull, pure)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
338 |
/*********************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
339 |
Writes a ulint in the little-endian format. */
|
340 |
UNIV_INLINE
|
|
341 |
void
|
|
342 |
mach_write_to_n_little_endian( |
|
343 |
/*==========================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
344 |
byte* dest, /*!< in: where to write */ |
345 |
ulint dest_size, /*!< in: into how many bytes to write */ |
|
346 |
ulint n); /*!< in: unsigned long int to write */ |
|
347 |
/*********************************************************//**
|
|
348 |
Reads a ulint stored in the little-endian format.
|
|
349 |
@return unsigned long int */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
350 |
UNIV_INLINE
|
351 |
ulint
|
|
352 |
mach_read_from_2_little_endian( |
|
353 |
/*===========================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
354 |
const byte* buf) /*!< in: from where to read */ |
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
355 |
__attribute__((nonnull, pure)); |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
356 |
/*********************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
357 |
Writes a ulint in the little-endian format. */
|
358 |
UNIV_INLINE
|
|
359 |
void
|
|
360 |
mach_write_to_2_little_endian( |
|
361 |
/*==========================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
362 |
byte* dest, /*!< in: where to write */ |
363 |
ulint n); /*!< in: unsigned long int to write */ |
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
364 |
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
365 |
/*********************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
366 |
Convert integral type from storage byte order (big endian) to
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
367 |
host byte order.
|
368 |
@return integer value */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
369 |
UNIV_INLINE
|
370 |
ullint
|
|
371 |
mach_read_int_type( |
|
372 |
/*===============*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
373 |
const byte* src, /*!< in: where to read from */ |
374 |
ulint len, /*!< in: length of src */ |
|
375 |
ibool unsigned_type); /*!< in: signed or unsigned flag */ |
|
376 |
#endif /* !UNIV_HOTBACKUP */ |
|
377 |
||
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
378 |
#ifndef UNIV_NONINL
|
379 |
#include "mach0data.ic" |
|
380 |
#endif
|
|
381 |
||
382 |
#endif
|