Drizzled Public API Documentation

ha0storage.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (C) 2007, 2009, Innobase Oy. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
8 
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15 St, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 *****************************************************************************/
18 
19 /**************************************************/
28 #pragma once
29 #ifndef ha0storage_h
30 #define ha0storage_h
31 
32 #include "univ.i"
33 
36 #define HA_STORAGE_DEFAULT_HEAP_BYTES 1024
37 
40 #define HA_STORAGE_DEFAULT_HASH_CELLS 4096
41 
43 typedef struct ha_storage_struct ha_storage_t;
44 
45 /*******************************************************************/
49 UNIV_INLINE
52 /*==============*/
53  ulint initial_heap_bytes,
54  ulint initial_hash_cells);
57 /*******************************************************************/
67 UNIV_INTERN
68 const void*
70 /*==================*/
71  ha_storage_t* storage,
72  const void* data,
73  ulint data_len,
74  ulint memlim);
76 /*******************************************************************/
82 #define ha_storage_put(storage, data, data_len) \
83  ha_storage_put_memlim((storage), (data), (data_len), 0)
84 
85 /*******************************************************************/
92 #define ha_storage_put_str(storage, str) \
93  ((const char*) ha_storage_put((storage), (str), strlen(str) + 1))
94 
95 /*******************************************************************/
104 #define ha_storage_put_str_memlim(storage, str, memlim) \
105  ((const char*) ha_storage_put_memlim((storage), (str), \
106  strlen(str) + 1, (memlim)))
107 
108 /*******************************************************************/
112 UNIV_INLINE
113 void
115 /*=============*/
116  ha_storage_t** storage);
118 /*******************************************************************/
122 UNIV_INLINE
123 void
125 /*============*/
126  ha_storage_t* storage);
128 /*******************************************************************/
131 UNIV_INLINE
132 ulint
134 /*================*/
135  const ha_storage_t* storage);
137 #ifndef UNIV_NONINL
138 #include "ha0storage.ic"
139 #endif
140 
141 #endif /* ha0storage_h */
UNIV_INLINE void ha_storage_empty(ha_storage_t **storage)
UNIV_INTERN const void * ha_storage_put_memlim(ha_storage_t *storage, const void *data, ulint data_len, ulint memlim)
Definition: ha0storage.cc:90
struct ha_storage_struct ha_storage_t
Definition: ha0storage.h:43
UNIV_INLINE ha_storage_t * ha_storage_create(ulint initial_heap_bytes, ulint initial_hash_cells)
UNIV_INLINE void ha_storage_free(ha_storage_t *storage)
UNIV_INLINE ulint ha_storage_get_size(const ha_storage_t *storage)