drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
mach0data.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (C) 1995, 2009, Innobase Oy. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/******************************************************************/
26
27#pragma once
28#ifndef mach0data_h
29#define mach0data_h
30
31#include "univ.i"
32#include "ut0byte.h"
33
34/* The data and all fields are always stored in a database file
35in the same format: ascii, big-endian, ... .
36All data in the files MUST be accessed using the functions in this
37module. */
38
39/*******************************************************/
41UNIV_INLINE
42void
44/*============*/
45 byte* b,
46 ulint n);
47/********************************************************/
50UNIV_INLINE
51ulint
53/*=============*/
54 const byte* b)
55 __attribute__((nonnull, pure));
56/*******************************************************/
59UNIV_INLINE
60void
62/*============*/
63 byte* b,
64 ulint n);
65/********************************************************/
69UNIV_INLINE
70ulint
72/*=============*/
73 const byte* b)
74 __attribute__((nonnull, pure));
75
76/********************************************************/
81UNIV_INLINE
82uint16
84/*==========*/
85 ulint n)
86 __attribute__((const));
87/********************************************************/
92UNIV_INLINE
93ulint
95/*==========*/
96 uint16 n)
97 __attribute__((const));
98/*******************************************************/
101UNIV_INLINE
102void
104/*============*/
105 byte* b,
106 ulint n);
107/********************************************************/
111UNIV_INLINE
112ulint
114/*=============*/
115 const byte* b)
116 __attribute__((nonnull, pure));
117/*******************************************************/
120UNIV_INLINE
121void
123/*============*/
124 byte* b,
125 ulint n);
126/********************************************************/
130UNIV_INLINE
131ulint
133/*=============*/
134 const byte* b)
135 __attribute__((nonnull, pure));
136/*********************************************************/
139UNIV_INLINE
140ulint
142/*==================*/
143 byte* b,
144 ulint n);
145/*********************************************************/
148UNIV_INLINE
149ulint
151/*=====================*/
152 ulint n)
153 __attribute__((const));
154/*********************************************************/
157UNIV_INLINE
158ulint
160/*=================*/
161 const byte* b)
162 __attribute__((nonnull, pure));
163/*******************************************************/
166UNIV_INLINE
167void
169/*============*/
170 byte* b,
171 ib_uint64_t id);
172/********************************************************/
176UNIV_INLINE
177ib_uint64_t
179/*=============*/
180 const byte* b)
181 __attribute__((nonnull, pure));
182/*******************************************************/
185UNIV_INLINE
186void
188/*============*/
189 byte* b,
190 ib_uint64_t n);
191/********************************************************/
195UNIV_INLINE
196ib_uint64_t
198/*=============*/
199 const byte* b)
200 __attribute__((nonnull, pure));
201/*******************************************************/
204UNIV_INLINE
205void
207/*============*/
208 byte* b,
209 ib_uint64_t n);
210/********************************************************/
214UNIV_INLINE
215ib_uint64_t
217/*=============*/
218 const byte* b)
219 __attribute__((nonnull, pure));
220/*********************************************************/
223UNIV_INLINE
224ulint
226/*======================*/
227 byte* b,
228 ib_uint64_t n);
229/*********************************************************/
232UNIV_INLINE
233ulint
235/*=========================*/
236 ib_uint64_t n);
237/*********************************************************/
240UNIV_INLINE
241ib_uint64_t
243/*=====================*/
244 const byte* b)
245 __attribute__((nonnull, pure));
246/*********************************************************/
249UNIV_INLINE
250ulint
252/*===========================*/
253 byte* b,
254 ib_uint64_t n);
255/*********************************************************/
258UNIV_INLINE
259ulint
261/*==============================*/
262 ib_uint64_t n)
263 __attribute__((const));
264/*********************************************************/
267UNIV_INLINE
268ib_uint64_t
270/*==========================*/
271 const byte* b)
272 __attribute__((nonnull, pure));
273/*********************************************************/
276UNIV_INTERN
277byte*
279/*==================*/
280 byte* ptr,
281 byte* end_ptr,
282 ulint* val);
283/*********************************************************/
287UNIV_INLINE
288byte*
290/*======================*/
291 byte* ptr,
292 byte* end_ptr,
293 ib_uint64_t* val);
294#ifndef UNIV_HOTBACKUP
295/*********************************************************/
298UNIV_INLINE
299double
301/*=============*/
302 const byte* b)
303 __attribute__((nonnull, pure));
304/*********************************************************/
306UNIV_INLINE
307void
309/*==============*/
310 byte* b,
311 double d);
312/*********************************************************/
315UNIV_INLINE
316float
318/*============*/
319 const byte* b)
320 __attribute__((nonnull, pure));
321/*********************************************************/
323UNIV_INLINE
324void
326/*=============*/
327 byte* b,
328 float d);
329/*********************************************************/
332UNIV_INLINE
333ulint
335/*===========================*/
336 const byte* buf,
337 ulint buf_size)
338 __attribute__((nonnull, pure));
339/*********************************************************/
341UNIV_INLINE
342void
344/*==========================*/
345 byte* dest,
346 ulint dest_size,
347 ulint n);
348/*********************************************************/
351UNIV_INLINE
352ulint
354/*===========================*/
355 const byte* buf)
356 __attribute__((nonnull, pure));
357/*********************************************************/
359UNIV_INLINE
360void
362/*==========================*/
363 byte* dest,
364 ulint n);
365
366/*********************************************************/
370UNIV_INLINE
371ullint
373/*===============*/
374 const byte* src,
375 ulint len,
376 ibool unsigned_type);
377#endif /* !UNIV_HOTBACKUP */
378
379#ifndef UNIV_NONINL
380#include "mach0data.ic"
381#endif
382
383#endif
UNIV_INLINE void mach_write_to_6(byte *b, ib_uint64_t id)
UNIV_INLINE ib_uint64_t mach_read_from_6(const byte *b) __attribute__((nonnull
UNIV_INLINE void mach_write_to_2(byte *b, ulint n)
UNIV_INLINE void mach_write_to_3(byte *b, ulint n)
UNIV_INLINE ulint mach_get_compressed_size(ulint n) __attribute__((const))
UNIV_INLINE ullint mach_read_int_type(const byte *src, ulint len, ibool unsigned_type)
UNIV_INLINE float mach_float_read(const byte *b) __attribute__((nonnull
UNIV_INLINE ulint mach_read_from_n_little_endian(const byte *buf, ulint buf_size) __attribute__((nonnull
UNIV_INLINE ib_uint64_t mach_read_from_8(const byte *b) __attribute__((nonnull
UNIV_INLINE double mach_double_read(const byte *b) __attribute__((nonnull
UNIV_INLINE uint16 mach_encode_2(ulint n) __attribute__((const))
UNIV_INLINE ulint mach_read_from_3(const byte *b) __attribute__((nonnull
UNIV_INLINE void mach_write_to_8(byte *b, ib_uint64_t n)
UNIV_INLINE ulint mach_read_from_2_little_endian(const byte *buf) __attribute__((nonnull
UNIV_INLINE ulint mach_ull_write_much_compressed(byte *b, ib_uint64_t n)
UNIV_INLINE ulint mach_ull_write_compressed(byte *b, ib_uint64_t n)
UNIV_INLINE ulint mach_read_from_2(const byte *b) __attribute__((nonnull
UNIV_INLINE void mach_write_to_n_little_endian(byte *dest, ulint dest_size, ulint n)
UNIV_INTERN byte * mach_parse_compressed(byte *ptr, byte *end_ptr, ulint *val)
Definition mach0data.cc:38
UNIV_INLINE ib_uint64_t mach_ull_read_compressed(const byte *b) __attribute__((nonnull
UNIV_INLINE ulint mach_ull_get_much_compressed_size(ib_uint64_t n) __attribute__((const))
UNIV_INLINE ulint mach_read_from_1(const byte *b) __attribute__((nonnull
UNIV_INLINE ulint mach_ull_get_compressed_size(ib_uint64_t n)
UNIV_INLINE void mach_write_to_7(byte *b, ib_uint64_t n)
UNIV_INLINE void mach_write_to_2_little_endian(byte *dest, ulint n)
UNIV_INLINE void mach_float_write(byte *b, float d)
UNIV_INLINE ib_uint64_t mach_read_from_7(const byte *b) __attribute__((nonnull
UNIV_INLINE void mach_write_to_4(byte *b, ulint n)
UNIV_INLINE void mach_double_write(byte *b, double d)
UNIV_INLINE ulint mach_decode_2(uint16 n) __attribute__((const))
UNIV_INLINE void mach_write_to_1(byte *b, ulint n)
UNIV_INLINE ib_uint64_t mach_ull_read_much_compressed(const byte *b) __attribute__((nonnull
UNIV_INLINE ulint mach_read_compressed(const byte *b) __attribute__((nonnull
UNIV_INLINE ulint mach_write_compressed(byte *b, ulint n)
UNIV_INLINE ulint mach_read_from_4(const byte *b) __attribute__((nonnull
UNIV_INLINE byte * mach_ull_parse_compressed(byte *ptr, byte *end_ptr, ib_uint64_t *val)