Drizzled Public API Documentation

ha0storage.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002 
00003 Copyright (C) 2007, 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 /**************************************************/
00028 #pragma once
00029 #ifndef ha0storage_h
00030 #define ha0storage_h
00031 
00032 #include "univ.i"
00033 
00036 #define HA_STORAGE_DEFAULT_HEAP_BYTES 1024
00037 
00040 #define HA_STORAGE_DEFAULT_HASH_CELLS 4096
00041 
00043 typedef struct ha_storage_struct  ha_storage_t;
00044 
00045 /*******************************************************************/
00049 UNIV_INLINE
00050 ha_storage_t*
00051 ha_storage_create(
00052 /*==============*/
00053   ulint initial_heap_bytes, 
00054   ulint initial_hash_cells);  
00057 /*******************************************************************/
00067 UNIV_INTERN
00068 const void*
00069 ha_storage_put_memlim(
00070 /*==================*/
00071   ha_storage_t* storage,  
00072   const void* data,   
00073   ulint   data_len, 
00074   ulint   memlim);  
00076 /*******************************************************************/
00082 #define ha_storage_put(storage, data, data_len) \
00083   ha_storage_put_memlim((storage), (data), (data_len), 0)
00084 
00085 /*******************************************************************/
00092 #define ha_storage_put_str(storage, str)  \
00093   ((const char*) ha_storage_put((storage), (str), strlen(str) + 1))
00094 
00095 /*******************************************************************/
00104 #define ha_storage_put_str_memlim(storage, str, memlim) \
00105   ((const char*) ha_storage_put_memlim((storage), (str),  \
00106                strlen(str) + 1, (memlim)))
00107 
00108 /*******************************************************************/
00112 UNIV_INLINE
00113 void
00114 ha_storage_empty(
00115 /*=============*/
00116   ha_storage_t**  storage); 
00118 /*******************************************************************/
00122 UNIV_INLINE
00123 void
00124 ha_storage_free(
00125 /*============*/
00126   ha_storage_t* storage); 
00128 /*******************************************************************/
00131 UNIV_INLINE
00132 ulint
00133 ha_storage_get_size(
00134 /*================*/
00135   const ha_storage_t* storage); 
00137 #ifndef UNIV_NONINL
00138 #include "ha0storage.ic"
00139 #endif
00140 
00141 #endif /* ha0storage_h */