diff options
author | serg@serg.mylan <> | 2004-11-07 22:39:27 +0100 |
---|---|---|
committer | serg@serg.mylan <> | 2004-11-07 22:39:27 +0100 |
commit | f58484fac2796502bbb2b874d436cb73f3dd89b7 (patch) | |
tree | 21cfbec56aed1543b9eb0098b188565895034f18 /mysys/ptr_cmp.c | |
parent | bb9cc04026719d95ecd5d44d45634e7ecc110dc8 (diff) | |
download | mariadb-git-f58484fac2796502bbb2b874d436cb73f3dd89b7.tar.gz |
s/ha_store_ptr/my_store_ptr/
s/ha_get_ptr/my_get_ptr/
Diffstat (limited to 'mysys/ptr_cmp.c')
-rw-r--r-- | mysys/ptr_cmp.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/mysys/ptr_cmp.c b/mysys/ptr_cmp.c index 5fc7ccab4fa..57778574bb6 100644 --- a/mysys/ptr_cmp.c +++ b/mysys/ptr_cmp.c @@ -21,6 +21,7 @@ */ #include "mysys_priv.h" +#include <myisampack.h> static int ptr_compare(uint *compare_length, uchar **a, uchar **b); static int ptr_compare_0(uint *compare_length, uchar **a, uchar **b); @@ -152,3 +153,41 @@ static int ptr_compare_3(uint *compare_length,uchar **a, uchar **b) } return (0); } + +void my_store_ptr(byte *buff, uint pack_length, my_off_t pos) +{ + switch (pack_length) { +#if SIZEOF_OFF_T > 4 + case 8: mi_int8store(buff,pos); break; + case 7: mi_int7store(buff,pos); break; + case 6: mi_int6store(buff,pos); break; + case 5: mi_int5store(buff,pos); break; +#endif + case 4: mi_int4store(buff,pos); break; + case 3: mi_int3store(buff,pos); break; + case 2: mi_int2store(buff,pos); break; + case 1: buff[0]= (uchar) pos; break; + default: DBUG_ASSERT(0); + } + return; +} + +my_off_t my_get_ptr(byte *ptr, uint pack_length) +{ + my_off_t pos; + switch (pack_length) { +#if SIZEOF_OFF_T > 4 + case 8: pos= (my_off_t) mi_uint8korr(ptr); break; + case 7: pos= (my_off_t) mi_uint7korr(ptr); break; + case 6: pos= (my_off_t) mi_uint6korr(ptr); break; + case 5: pos= (my_off_t) mi_uint5korr(ptr); break; +#endif + case 4: pos= (my_off_t) mi_uint4korr(ptr); break; + case 3: pos= (my_off_t) mi_uint3korr(ptr); break; + case 2: pos= (my_off_t) mi_uint2korr(ptr); break; + case 1: pos= (my_off_t) mi_uint2korr(ptr); break; + default: DBUG_ASSERT(0); + } + return pos; +} + |