Drizzled Public API Documentation

page0zip.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (C) 2005, 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
14 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15 St, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 *****************************************************************************/
18 
19 /**************************************************/
26 #pragma once
27 #ifndef page0zip_h
28 #define page0zip_h
29 
30 #ifdef UNIV_MATERIALIZE
31 # undef UNIV_INLINE
32 # define UNIV_INLINE
33 #endif
34 
35 #include "mtr0types.h"
36 #include "page0types.h"
37 #include "buf0types.h"
38 #include "dict0types.h"
39 #include "trx0types.h"
40 #include "mem0mem.h"
41 
42 /**********************************************************************/
45 UNIV_INLINE
46 ulint
48 /*==============*/
49  const page_zip_des_t* page_zip)
50  __attribute__((nonnull, pure));
51 /**********************************************************************/
53 UNIV_INLINE
54 void
56 /*==============*/
57  page_zip_des_t* page_zip,
58  ulint size);
60 #ifndef UNIV_HOTBACKUP
61 /**********************************************************************/
64 UNIV_INLINE
65 ibool
67 /*===================*/
68  ulint rec_size,
69  ulint comp,
70  ulint n_fields,
72  ulint zip_size)
73  __attribute__((const));
74 
75 /**********************************************************************/
78 UNIV_INTERN
79 ulint
81 /*================*/
82  ulint n_fields,
83  ulint zip_size)
84  __attribute__((const));
85 #endif /* !UNIV_HOTBACKUP */
86 
87 /**********************************************************************/
89 UNIV_INLINE
90 void
92 /*==============*/
93  page_zip_des_t* page_zip);
96 /**********************************************************************/
98 UNIV_INTERN
99 void
101 /*===============*/
102  void* stream,
103  mem_heap_t* heap);
105 /**********************************************************************/
109 UNIV_INTERN
110 ibool
112 /*==============*/
113  page_zip_des_t* page_zip,
115  const page_t* page,
116  dict_index_t* index,
117  mtr_t* mtr)
118  __attribute__((nonnull(1,2,3)));
119 
120 /**********************************************************************/
125 UNIV_INTERN
126 ibool
128 /*================*/
129  page_zip_des_t* page_zip,
131  page_t* page,
132  ibool all)
136  __attribute__((nonnull(1,2)));
137 
138 #ifdef UNIV_DEBUG
139 /**********************************************************************/
142 UNIV_INLINE
143 ibool
144 page_zip_simple_validate(
145 /*=====================*/
146  const page_zip_des_t* page_zip);
148 #endif /* UNIV_DEBUG */
149 
150 #ifdef UNIV_ZIP_DEBUG
151 /**********************************************************************/
154 UNIV_INTERN
155 ibool
156 page_zip_validate_low(
157 /*==================*/
158  const page_zip_des_t* page_zip,
159  const page_t* page,
160  ibool sloppy)
162  __attribute__((nonnull));
163 /**********************************************************************/
165 UNIV_INTERN
166 ibool
167 page_zip_validate(
168 /*==============*/
169  const page_zip_des_t* page_zip,
170  const page_t* page)
171  __attribute__((nonnull));
172 #endif /* UNIV_ZIP_DEBUG */
173 
174 /**********************************************************************/
178 UNIV_INLINE
179 lint
181 /*==================*/
182  const page_zip_des_t* page_zip,
183  ibool is_clust)
184  __attribute__((nonnull, pure));
185 
186 /**********************************************************************/
189 UNIV_INLINE
190 ibool
192 /*===============*/
193  const page_zip_des_t* page_zip,
194  ibool is_clust,
195  ulint length,
196  ulint create)
198  __attribute__((nonnull, pure));
199 
200 /**********************************************************************/
203 UNIV_INLINE
204 void
206 /*==================*/
207  page_zip_des_t* page_zip,
208  const byte* str,
209  ulint length,
210  mtr_t* mtr)
211  __attribute__((nonnull(1,2)));
212 
213 /**********************************************************************/
216 UNIV_INTERN
217 void
219 /*===============*/
220  page_zip_des_t* page_zip,
221  const byte* rec,
222  dict_index_t* index,
223  const ulint* offsets,
224  ulint create)
225  __attribute__((nonnull));
226 
227 /***********************************************************/
230 UNIV_INTERN
231 byte*
233 /*==========================*/
234  byte* ptr,
235  byte* end_ptr,
236  page_t* page,
237  page_zip_des_t* page_zip);
239 /**********************************************************************/
242 UNIV_INTERN
243 void
245 /*====================*/
246  page_zip_des_t* page_zip,
247  const byte* rec,
249  dict_index_t* index,
250  const ulint* offsets,
251  ulint n,
252  mtr_t* mtr)
254  __attribute__((nonnull(1,2,3,4)));
255 
256 /***********************************************************/
259 UNIV_INTERN
260 byte*
262 /*==========================*/
263  byte* ptr,
264  byte* end_ptr,
265  page_t* page,
266  page_zip_des_t* page_zip);
268 /**********************************************************************/
270 UNIV_INTERN
271 void
273 /*====================*/
274  page_zip_des_t* page_zip,
275  byte* rec,
276  ulint size,
277  ulint ptr,
278  mtr_t* mtr)
279  __attribute__((nonnull(1,2)));
280 
281 /**********************************************************************/
283 UNIV_INTERN
284 void
286 /*===============================*/
287  page_zip_des_t* page_zip,
288  byte* rec,
289  const ulint* offsets,
290  ulint trx_id_col,
291  trx_id_t trx_id,
292  roll_ptr_t roll_ptr)
293  __attribute__((nonnull));
294 
295 
296 /**********************************************************************/
298 UNIV_INTERN
299 void
301 /*================*/
302  page_zip_des_t* page_zip,
303  const byte* prev_rec,
304  const byte* free_rec,
306  byte* rec);
308 UNIV_INTERN
309 byte*
311 /*========================*/
312  byte* ptr,
313  byte* end_ptr,
314  page_t* page,
315  page_zip_des_t* page_zip);
318 /**********************************************************************/
329 UNIV_INTERN
330 ibool
332 /*================*/
333  buf_block_t* block,
337  dict_index_t* index,
338  mtr_t* mtr)
339  __attribute__((nonnull));
340 #ifndef UNIV_HOTBACKUP
341 /**********************************************************************/
346 UNIV_INTERN
347 void
349 /*===============*/
350  page_zip_des_t* page_zip,
353  page_t* page,
354  const page_zip_des_t* src_zip,
355  const page_t* src,
356  dict_index_t* index,
357  mtr_t* mtr)
358  __attribute__((nonnull));
359 #endif /* !UNIV_HOTBACKUP */
360 
361 /**********************************************************************/
364 UNIV_INTERN
365 byte*
367 /*====================*/
368  byte* ptr,
369  byte* end_ptr,
370  page_t* page,
371  page_zip_des_t* page_zip)
372  __attribute__((nonnull(1,2)));
373 
374 /**********************************************************************/
377 UNIV_INTERN
378 ulint
380 /*===================*/
381  const void* data,
382  ulint size)
383  __attribute__((nonnull));
384 
385 #ifndef UNIV_HOTBACKUP
386 
390 # define PAGE_ZIP_MATCH(ptr, page_zip) \
391  (buf_frame_get_page_zip(ptr) == (page_zip))
392 #else /* !UNIV_HOTBACKUP */
393 
397 # define PAGE_ZIP_MATCH(ptr, page_zip) \
398  (page_align(ptr) + UNIV_PAGE_SIZE == (page_zip)->data)
399 #endif /* !UNIV_HOTBACKUP */
400 
401 #ifdef UNIV_MATERIALIZE
402 # undef UNIV_INLINE
403 # define UNIV_INLINE UNIV_INLINE_ORIGINAL
404 #endif
405 
406 #ifndef UNIV_NONINL
407 # include "page0zip.ic"
408 #endif
409 
410 #endif /* page0zip_h */