00001 /***************************************************************************** 00002 00003 Copyright (C) 1994, 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 /******************************************************************/ 00026 #pragma once 00027 #ifndef ut0rnd_h 00028 #define ut0rnd_h 00029 00030 #include "univ.i" 00031 00032 #include "ut0byte.h" 00033 00036 #define UT_END_OF_FIELD 257 00037 00038 /********************************************************/ 00040 UNIV_INLINE 00041 void 00042 ut_rnd_set_seed( 00043 /*============*/ 00044 ulint seed); 00045 /********************************************************/ 00048 UNIV_INLINE 00049 ulint 00050 ut_rnd_gen_next_ulint( 00051 /*==================*/ 00052 ulint rnd); 00053 /*********************************************************/ 00059 UNIV_INLINE 00060 ulint 00061 ut_rnd_gen_ulint(void); 00062 /*==================*/ 00063 /********************************************************/ 00066 UNIV_INLINE 00067 ulint 00068 ut_rnd_interval( 00069 /*============*/ 00070 ulint low, 00071 ulint high); 00072 /*********************************************************/ 00075 UNIV_INLINE 00076 ibool 00077 ut_rnd_gen_ibool(void); 00078 /*=================*/ 00079 /*******************************************************/ 00084 UNIV_INLINE 00085 ulint 00086 ut_hash_ulint( 00087 /*==========*/ 00088 ulint key, 00089 ulint table_size); 00090 /*************************************************************/ 00093 UNIV_INLINE 00094 ulint 00095 ut_fold_ulint_pair( 00096 /*===============*/ 00097 ulint n1, 00098 ulint n2) 00099 __attribute__((const)); 00100 /*************************************************************/ 00103 UNIV_INLINE 00104 ulint 00105 ut_fold_ull( 00106 /*========*/ 00107 ib_uint64_t d) 00108 __attribute__((const)); 00109 /*************************************************************/ 00112 UNIV_INLINE 00113 ulint 00114 ut_fold_string( 00115 /*===========*/ 00116 const char* str) 00117 __attribute__((pure)); 00118 /*************************************************************/ 00121 UNIV_INLINE 00122 ulint 00123 ut_fold_binary( 00124 /*===========*/ 00125 const byte* str, 00126 ulint len) 00127 __attribute__((pure)); 00128 /***********************************************************/ 00132 UNIV_INTERN 00133 ulint 00134 ut_find_prime( 00135 /*==========*/ 00136 ulint n) 00137 __attribute__((const)); 00138 00139 00140 #ifndef UNIV_NONINL 00141 #include "ut0rnd.ic" 00142 #endif 00143 00144 #endif