00001 /* Copyright (C) 2003 MySQL AB 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00016 00017 #ifndef NDB_KERNEL_TYPES_H 00018 #define NDB_KERNEL_TYPES_H 00019 00020 #include <my_config.h> 00021 #include <ndb_types.h> 00022 #include "ndb_limits.h" 00023 00024 typedef Uint16 NodeId; 00025 typedef Uint16 BlockNumber; 00026 typedef Uint32 BlockReference; 00027 typedef Uint16 GlobalSignalNumber; 00028 00029 enum Operation_t { 00030 ZREAD = 0 00031 ,ZUPDATE = 1 00032 ,ZINSERT = 2 00033 ,ZDELETE = 3 00034 ,ZWRITE = 4 00035 ,ZREAD_EX = 5 00036 #if 0 00037 ,ZREAD_CONSISTENT = 6 00038 #endif 00039 }; 00040 00044 struct GlobalPage { 00045 union { 00046 Uint32 data[GLOBAL_PAGE_SIZE/sizeof(Uint32)]; 00047 Uint32 nextPool; 00048 }; 00049 }; 00050 00051 struct Local_key 00052 { 00053 Uint32 m_page_no; 00054 Uint16 m_page_idx; 00055 Uint16 m_file_no; 00056 00057 bool isNull() const { return m_page_no == RNIL; } 00058 void setNull() { m_page_no= RNIL; m_file_no= m_page_idx= ~0;} 00059 00060 Uint32 ref() const { return (m_page_no << MAX_TUPLES_BITS) | m_page_idx ;} 00061 00062 Local_key& assref (Uint32 ref) { 00063 m_page_no =ref >> MAX_TUPLES_BITS; 00064 m_page_idx = ref & MAX_TUPLES_PER_PAGE; 00065 return *this; 00066 } 00067 }; 00068 00069 class NdbOut& 00070 operator<<(class NdbOut&, const struct Local_key&); 00071 00072 inline 00073 Uint32 00074 table_version_major(Uint32 ver) 00075 { 00076 return ver & 0x00FFFFFF; 00077 } 00078 00079 #endif 00080 00081 00082 00083
1.4.7

