Drizzled Public API Documentation

mach0data.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 
00003 Copyright (C) 1995, 2009, Innobase Oy. All Rights Reserved.
00004 
00005 This program is free software; you can redistribute it and/or modify it under
00006 the terms of the GNU General Public License as published by the Free Software
00007 Foundation; version 2 of the License.
00008 
00009 This program is distributed in the hope that it will be useful, but WITHOUT
00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00011 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
00012 
00013 You should have received a copy of the GNU General Public License along with
00014 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
00015 St, Fifth Floor, Boston, MA 02110-1301 USA
00016 
00017 *****************************************************************************/
00018 
00019 /******************************************************************/
00027 #pragma once
00028 #ifndef mach0data_h
00029 #define mach0data_h
00030 
00031 #include "univ.i"
00032 #include "ut0byte.h"
00033 
00034 /* The data and all fields are always stored in a database file
00035 in the same format: ascii, big-endian, ... .
00036 All data in the files MUST be accessed using the functions in this
00037 module. */
00038 
00039 /*******************************************************/
00041 UNIV_INLINE
00042 void
00043 mach_write_to_1(
00044 /*============*/
00045   byte* b,  
00046   ulint n);  
00047 /********************************************************/
00050 UNIV_INLINE
00051 ulint
00052 mach_read_from_1(
00053 /*=============*/
00054   const byte* b)  
00055   __attribute__((nonnull, pure));
00056 /*******************************************************/
00059 UNIV_INLINE
00060 void
00061 mach_write_to_2(
00062 /*============*/
00063   byte* b,  
00064   ulint n);  
00065 /********************************************************/
00069 UNIV_INLINE
00070 ulint
00071 mach_read_from_2(
00072 /*=============*/
00073   const byte* b)  
00074   __attribute__((nonnull, pure));
00075 
00076 /********************************************************/
00081 UNIV_INLINE
00082 uint16
00083 mach_encode_2(
00084 /*==========*/
00085   ulint n)  
00086   __attribute__((const));
00087 /********************************************************/
00092 UNIV_INLINE
00093 ulint
00094 mach_decode_2(
00095 /*==========*/
00096   uint16  n)  
00097   __attribute__((const));
00098 /*******************************************************/
00101 UNIV_INLINE
00102 void
00103 mach_write_to_3(
00104 /*============*/
00105   byte* b,  
00106   ulint n);  
00107 /********************************************************/
00111 UNIV_INLINE
00112 ulint
00113 mach_read_from_3(
00114 /*=============*/
00115   const byte* b)  
00116   __attribute__((nonnull, pure));
00117 /*******************************************************/
00120 UNIV_INLINE
00121 void
00122 mach_write_to_4(
00123 /*============*/
00124   byte* b,  
00125   ulint n);  
00126 /********************************************************/
00130 UNIV_INLINE
00131 ulint
00132 mach_read_from_4(
00133 /*=============*/
00134   const byte* b)  
00135   __attribute__((nonnull, pure));
00136 /*********************************************************/
00139 UNIV_INLINE
00140 ulint
00141 mach_write_compressed(
00142 /*==================*/
00143   byte* b,  
00144   ulint n); 
00145 /*********************************************************/
00148 UNIV_INLINE
00149 ulint
00150 mach_get_compressed_size(
00151 /*=====================*/
00152   ulint n)  
00153   __attribute__((const));
00154 /*********************************************************/
00157 UNIV_INLINE
00158 ulint
00159 mach_read_compressed(
00160 /*=================*/
00161   const byte* b)  
00162   __attribute__((nonnull, pure));
00163 /*******************************************************/
00166 UNIV_INLINE
00167 void
00168 mach_write_to_6(
00169 /*============*/
00170   byte*   b,  
00171   ib_uint64_t id);  
00172 /********************************************************/
00176 UNIV_INLINE
00177 ib_uint64_t
00178 mach_read_from_6(
00179 /*=============*/
00180   const byte* b)  
00181   __attribute__((nonnull, pure));
00182 /*******************************************************/
00185 UNIV_INLINE
00186 void
00187 mach_write_to_7(
00188 /*============*/
00189   byte*   b,  
00190   ib_uint64_t n); 
00191 /********************************************************/
00195 UNIV_INLINE
00196 ib_uint64_t
00197 mach_read_from_7(
00198 /*=============*/
00199   const byte* b)  
00200   __attribute__((nonnull, pure));
00201 /*******************************************************/
00204 UNIV_INLINE
00205 void
00206 mach_write_to_8(
00207 /*============*/
00208   byte*   b,  
00209   ib_uint64_t n); 
00210 /********************************************************/
00214 UNIV_INLINE
00215 ib_uint64_t
00216 mach_read_from_8(
00217 /*=============*/
00218   const byte* b)  
00219   __attribute__((nonnull, pure));
00220 /*********************************************************/
00223 UNIV_INLINE
00224 ulint
00225 mach_ull_write_compressed(
00226 /*======================*/
00227   byte*   b,  
00228   ib_uint64_t n); 
00229 /*********************************************************/
00232 UNIV_INLINE
00233 ulint
00234 mach_ull_get_compressed_size(
00235 /*=========================*/
00236   ib_uint64_t n); 
00237 /*********************************************************/
00240 UNIV_INLINE
00241 ib_uint64_t
00242 mach_ull_read_compressed(
00243 /*=====================*/
00244   const byte* b)  
00245   __attribute__((nonnull, pure));
00246 /*********************************************************/
00249 UNIV_INLINE
00250 ulint
00251 mach_ull_write_much_compressed(
00252 /*===========================*/
00253   byte*   b,  
00254   ib_uint64_t n); 
00255 /*********************************************************/
00258 UNIV_INLINE
00259 ulint
00260 mach_ull_get_much_compressed_size(
00261 /*==============================*/
00262   ib_uint64_t n)  
00263   __attribute__((const));
00264 /*********************************************************/
00267 UNIV_INLINE
00268 ib_uint64_t
00269 mach_ull_read_much_compressed(
00270 /*==========================*/
00271   const byte* b)  
00272   __attribute__((nonnull, pure));
00273 /*********************************************************/
00276 UNIV_INTERN
00277 byte*
00278 mach_parse_compressed(
00279 /*==================*/
00280   byte* ptr,  
00281   byte* end_ptr,
00282   ulint*  val); 
00283 /*********************************************************/
00287 UNIV_INLINE
00288 byte*
00289 mach_ull_parse_compressed(
00290 /*======================*/
00291   byte*   ptr,  
00292   byte*   end_ptr,
00293   ib_uint64_t*  val); 
00294 #ifndef UNIV_HOTBACKUP
00295 /*********************************************************/
00298 UNIV_INLINE
00299 double
00300 mach_double_read(
00301 /*=============*/
00302   const byte* b)  
00303   __attribute__((nonnull, pure));
00304 /*********************************************************/
00306 UNIV_INLINE
00307 void
00308 mach_double_write(
00309 /*==============*/
00310   byte* b,  
00311   double  d); 
00312 /*********************************************************/
00315 UNIV_INLINE
00316 float
00317 mach_float_read(
00318 /*============*/
00319   const byte* b)  
00320   __attribute__((nonnull, pure));
00321 /*********************************************************/
00323 UNIV_INLINE
00324 void
00325 mach_float_write(
00326 /*=============*/
00327   byte* b,  
00328   float d); 
00329 /*********************************************************/
00332 UNIV_INLINE
00333 ulint
00334 mach_read_from_n_little_endian(
00335 /*===========================*/
00336   const byte* buf,    
00337   ulint   buf_size) 
00338   __attribute__((nonnull, pure));
00339 /*********************************************************/
00341 UNIV_INLINE
00342 void
00343 mach_write_to_n_little_endian(
00344 /*==========================*/
00345   byte* dest,   
00346   ulint dest_size,  
00347   ulint n);   
00348 /*********************************************************/
00351 UNIV_INLINE
00352 ulint
00353 mach_read_from_2_little_endian(
00354 /*===========================*/
00355   const byte* buf)    
00356   __attribute__((nonnull, pure));
00357 /*********************************************************/
00359 UNIV_INLINE
00360 void
00361 mach_write_to_2_little_endian(
00362 /*==========================*/
00363   byte* dest,   
00364   ulint n);   
00366 /*********************************************************/
00370 UNIV_INLINE
00371 ullint
00372 mach_read_int_type(
00373 /*===============*/
00374   const byte* src,    
00375   ulint   len,    
00376   ibool   unsigned_type); 
00377 #endif /* !UNIV_HOTBACKUP */
00378 
00379 #ifndef UNIV_NONINL
00380 #include "mach0data.ic"
00381 #endif
00382 
00383 #endif