diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.am | 3 | ||||
-rw-r--r-- | include/base64.h | 3 | ||||
-rw-r--r-- | include/config-win.h | 12 | ||||
-rw-r--r-- | include/my_base.h | 7 | ||||
-rw-r--r-- | include/my_global.h | 32 | ||||
-rw-r--r-- | include/my_vle.h | 42 |
6 files changed, 94 insertions, 5 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index d2605628a7d..44efe0b7211 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -30,7 +30,8 @@ noinst_HEADERS = config-win.h config-os2.h config-netware.h \ my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \ thr_lock.h t_ctype.h violite.h md5.h base64.h \ - mysql_version.h.in my_handler.h my_time.h decimal.h + mysql_version.h.in my_handler.h my_time.h decimal.h \ + my_vle.h # mysql_version.h are generated CLEANFILES = mysql_version.h my_config.h readline diff --git a/include/base64.h b/include/base64.h index fcc2f8b40dc..a2b0fc0352b 100644 --- a/include/base64.h +++ b/include/base64.h @@ -21,8 +21,7 @@ extern "C" { #endif - -#include <mysys_priv.h> +#include <my_global.h> /* Calculate how much memory needed for dst of base64_encode() diff --git a/include/config-win.h b/include/config-win.h index b825d34f1ee..6c0937391fb 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -269,6 +269,12 @@ inline double ulonglong2double(ulonglong value) (((uint32) ((uchar) (A)[2])) << 16) +\ (((uint32) ((uchar) (A)[3])) << 24)) +\ (((ulonglong) ((uchar) (A)[4])) << 32)) +#define uint6korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) + \ + (((uint32) ((uchar) (A)[1])) << 8) + \ + (((uint32) ((uchar) (A)[2])) << 16) + \ + (((uint32) ((uchar) (A)[3])) << 24)) + \ + (((ulonglong) ((uchar) (A)[4])) << 32) + \ + (((ulonglong) ((uchar) (A)[5])) << 40)) #define uint8korr(A) (*((ulonglong *) (A))) #define sint8korr(A) (*((longlong *) (A))) #define int2store(T,A) *((uint16*) (T))= (uint16) (A) @@ -281,6 +287,12 @@ inline double ulonglong2double(ulonglong value) *((T)+2)=(uchar) (((A) >> 16));\ *((T)+3)=(uchar) (((A) >> 24)); \ *((T)+4)=(uchar) (((A) >> 32)); } +#define int6store(T,A) { *(T) =(uchar)((A)); \ + *((T)+1)=(uchar) (((A) >> 8)); \ + *((T)+2)=(uchar) (((A) >> 16)); \ + *((T)+3)=(uchar) (((A) >> 24)); \ + *((T)+4)=(uchar) (((A) >> 32)); \ + *((T)+5)=(uchar) (((A) >> 40)); } #define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A) #define doubleget(V,M) do { *((long *) &V) = *((long*) M); \ diff --git a/include/my_base.h b/include/my_base.h index 5ea3795f715..4e1a573217b 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -343,9 +343,12 @@ enum ha_base_keytype { #define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */ #define HA_ERR_NULL_IN_SPATIAL 158 /* NULLs are not supported in spatial index */ #define HA_ERR_TABLE_DEF_CHANGED 159 /* The table changed in storage engine */ -#define HA_ERR_NO_PARTITION_FOUND 160 /* There's no partition in table for given value */ +#define HA_ERR_NO_PARTITION_FOUND 160 /* There's no partition in table for + given value */ +#define HA_ERR_RBR_LOGGING_FAILED 161 /* Row-based binlogging of row failed */ + +#define HA_ERR_LAST 161 /* Copy last error no */ -#define HA_ERR_LAST 160 /*Copy last error nr.*/ /* Add error numbers before HA_ERR_LAST and change it accordingly. */ #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) diff --git a/include/my_global.h b/include/my_global.h index 6be59e41512..8d7ad9e0ad5 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -844,6 +844,14 @@ typedef long my_ptrdiff_t; typedef long long my_ptrdiff_t; #endif +#if HAVE_SIZE_T +typedef size_t my_size_t; +#elif SIZEOF_CHARP <= SIZEOF_LONG +typedef unsigned long my_size_t; +#else +typedef unsigned long long my_size_t; +#endif + #define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1)) #define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double)) /* Size to make adressable obj. */ @@ -1122,6 +1130,12 @@ typedef char bool; /* Ordinary boolean values 0 1 */ (((uint32) ((uchar) (A)[2])) << 16) +\ (((uint32) ((uchar) (A)[3])) << 24)) +\ (((ulonglong) ((uchar) (A)[4])) << 32)) +#define uint6korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) + \ + (((uint32) ((uchar) (A)[1])) << 8) + \ + (((uint32) ((uchar) (A)[2])) << 16) + \ + (((uint32) ((uchar) (A)[3])) << 24)) + \ + (((ulonglong) ((uchar) (A)[4])) << 32) + \ + (((ulonglong) ((uchar) (A)[5])) << 40)) #define uint8korr(A) (*((ulonglong *) (A))) #define sint8korr(A) (*((longlong *) (A))) #define int2store(T,A) *((uint16*) (T))= (uint16) (A) @@ -1134,6 +1148,12 @@ typedef char bool; /* Ordinary boolean values 0 1 */ *((T)+2)=(uchar) (((A) >> 16));\ *((T)+3)=(uchar) (((A) >> 24)); \ *((T)+4)=(uchar) (((A) >> 32)); } while(0) +#define int6store(T,A) do { *(T)= (uchar)((A)); \ + *((T)+1)=(uchar) (((A) >> 8)); \ + *((T)+2)=(uchar) (((A) >> 16)); \ + *((T)+3)=(uchar) (((A) >> 24)); \ + *((T)+4)=(uchar) (((A) >> 32)); \ + *((T)+5)=(uchar) (((A) >> 40)); } while(0) #define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A) typedef union { @@ -1190,6 +1210,12 @@ do { doubleget_union _tmp; \ (((uint32) ((uchar) (A)[2])) << 16) +\ (((uint32) ((uchar) (A)[3])) << 24)) +\ (((ulonglong) ((uchar) (A)[4])) << 32)) +#define uint6korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) + \ + (((uint32) ((uchar) (A)[1])) << 8) + \ + (((uint32) ((uchar) (A)[2])) << 16) + \ + (((uint32) ((uchar) (A)[3])) << 24)) + \ + (((ulonglong) ((uchar) (A)[4])) << 32) + \ + (((ulonglong) ((uchar) (A)[5])) << 40)) #define uint8korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ (((uint32) ((uchar) (A)[1])) << 8) +\ (((uint32) ((uchar) (A)[2])) << 16) +\ @@ -1217,6 +1243,12 @@ do { doubleget_union _tmp; \ *(((char *)(T))+2)=(((A) >> 16));\ *(((char *)(T))+3)=(((A) >> 24)); \ *(((char *)(T))+4)=(((A) >> 32)); } while(0) +#define int6store(T,A) do { *((char *)(T))=((A));\ + *(((char *)(T))+1)=(((A) >> 8)); \ + *(((char *)(T))+2)=(((A) >> 16)); \ + *(((char *)(T))+3)=(((A) >> 24)); \ + *(((char *)(T))+4)=(((A) >> 32)); \ + *(((char *)(T))+5)=(((A) >> 40)); } while(0) #define int8store(T,A) do { uint def_temp= (uint) (A), def_temp2= (uint) ((A) >> 32); \ int4store((T),def_temp); \ int4store((T+4),def_temp2); } while(0) diff --git a/include/my_vle.h b/include/my_vle.h new file mode 100644 index 00000000000..94d293487f4 --- /dev/null +++ b/include/my_vle.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2005 MySQL AB + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA +*/ + +#ifndef VLE_H +#define VLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "my_global.h" + +/* + The size (in bytes) required to store the object ITEM, which can be + either an expression or a type (since sizeof() is used on the item). +*/ +#define my_vle_sizeof(ITEM) (((sizeof(ITEM) * CHAR_BIT) + 6) / 7) + +byte *my_vle_encode(byte *vle, my_size_t max, ulong value); +byte const *my_vle_decode(ulong *value_ptr, byte const *vle); + +#ifdef __cplusplus +} +#endif + +#endif |