| 1 |
/***************************************************************************** |
| 2 |
|
| 3 |
Copyright (c) 1994, 2026, Oracle and/or its affiliates. |
| 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, version 2.0, as published by the |
| 7 |
Free Software Foundation. |
| 8 |
|
| 9 |
This program is designed to work with certain software (including |
| 10 |
but not limited to OpenSSL) that is licensed under separate terms, |
| 11 |
as designated in a particular file or component or in included license |
| 12 |
documentation. The authors of MySQL hereby grant you an additional |
| 13 |
permission to link the program and your derivative works with the |
| 14 |
separately licensed software that they have either included with |
| 15 |
the program or referenced in the documentation. |
| 16 |
|
| 17 |
This program is distributed in the hope that it will be useful, but WITHOUT |
| 18 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 19 |
FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, |
| 20 |
for more details. |
| 21 |
|
| 22 |
You should have received a copy of the GNU General Public License along with |
| 23 |
this program; if not, write to the Free Software Foundation, Inc., |
| 24 |
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 25 |
|
| 26 |
*****************************************************************************/ |
| 27 |
|
| 28 |
/** @file page/page.ic |
| 29 |
Index page routines |
| 30 |
|
| 31 |
Created 2/2/1994 Heikki Tuuri |
| 32 |
*******************************************************/ |
| 33 |
|
| 34 |
/** NOTE: The functions in this file should only use functions from |
| 35 |
other files in library. The code in this file is used to make a library for |
| 36 |
external tools. */ |
| 37 |
|
| 38 |
#ifndef page_page_h |
| 39 |
#define page_page_h |
| 40 |
|
| 41 |
#include "mach0data.h" |
| 42 |
|
| 43 |
static inline uint16_t page_header_get_field(const page_t *page, ulint field) { |
| 44 |
ut_ad(page); |
| 45 |
ut_ad(field <= PAGE_INDEX_ID); |
| 46 |
|
| 47 |
return (mach_read_from_2(page + PAGE_HEADER + field)); |
| 48 |
} |
| 49 |
static inline uint16_t page_dir_get_n_heap(const page_t *page) { |
| 50 |
return (page_header_get_field(page, PAGE_N_HEAP) & 0x7fff); |
| 51 |
} |
| 52 |
#endif |