Drizzled Public API Documentation

data0data.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (C) 1994, 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 /********************************************************************/
26 #pragma once
27 #ifndef data0data_h
28 #define data0data_h
29 
30 #include "univ.i"
31 
32 #include "data0types.h"
33 #include "data0type.h"
34 #include "mem0mem.h"
35 #include "dict0types.h"
36 
39 typedef struct big_rec_struct big_rec_t;
40 
41 #ifdef UNIV_DEBUG
42 /*********************************************************************/
45 UNIV_INLINE
46 dtype_t*
47 dfield_get_type(
48 /*============*/
49  const dfield_t* field);
50 /*********************************************************************/
53 UNIV_INLINE
54 void*
55 dfield_get_data(
56 /*============*/
57  const dfield_t* field);
58 #else /* UNIV_DEBUG */
59 # define dfield_get_type(field) (&(field)->type)
60 # define dfield_get_data(field) ((field)->data)
61 #endif /* UNIV_DEBUG */
62 /*********************************************************************/
64 UNIV_INLINE
65 void
67 /*============*/
68  dfield_t* field,
69  dtype_t* type);
70 /*********************************************************************/
73 UNIV_INLINE
74 ulint
76 /*===========*/
77  const dfield_t* field);
78 /*********************************************************************/
80 UNIV_INLINE
81 void
83 /*===========*/
84  dfield_t* field,
85  ulint len);
86 /*********************************************************************/
89 UNIV_INLINE
90 ulint
92 /*===========*/
93  const dfield_t* field);
94 /*********************************************************************/
97 UNIV_INLINE
98 ulint
100 /*==========*/
101  const dfield_t* field);
102 /*********************************************************************/
104 UNIV_INLINE
105 void
107 /*===========*/
108  dfield_t* field);
109 /*********************************************************************/
111 UNIV_INLINE
112 void
114 /*============*/
115  dfield_t* field,
116  const void* data,
117  ulint len);
118 /*********************************************************************/
120 UNIV_INLINE
121 void
123 /*============*/
124  dfield_t* field);
125 /**********************************************************************/
127 UNIV_INLINE
128 void
130 /*================*/
131  byte* data,
132  ulint len);
133 /*********************************************************************/
135 UNIV_INLINE
136 void
138 /*=============*/
139  dfield_t* field1,
140  const dfield_t* field2);
141 /*********************************************************************/
143 UNIV_INLINE
144 void
146 /*========*/
147  dfield_t* field1,
148  const dfield_t* field2);
149 /*********************************************************************/
151 UNIV_INLINE
152 void
153 dfield_dup(
154 /*=======*/
155  dfield_t* field,
156  mem_heap_t* heap);
157 /*********************************************************************/
160 UNIV_INLINE
161 ibool
163 /*==========================*/
164  const dfield_t* field1,
165  const dfield_t* field2);
166 /*********************************************************************/
169 UNIV_INTERN
170 ibool
171 dfield_data_is_binary_equal(
172 /*========================*/
173  const dfield_t* field,
174  ulint len,
175  const byte* data);
176 /*********************************************************************/
179 UNIV_INLINE
180 ulint
182 /*================*/
183  const dtuple_t* tuple);
184 #ifdef UNIV_DEBUG
185 /*********************************************************************/
188 UNIV_INLINE
189 dfield_t*
190 dtuple_get_nth_field(
191 /*=================*/
192  const dtuple_t* tuple,
193  ulint n);
194 #else /* UNIV_DEBUG */
195 # define dtuple_get_nth_field(tuple, n) ((tuple)->fields + (n))
196 #endif /* UNIV_DEBUG */
197 /*********************************************************************/
200 UNIV_INLINE
201 ulint
203 /*=================*/
204  const dtuple_t* tuple);
205 /*********************************************************************/
207 UNIV_INLINE
208 void
210 /*=================*/
211  dtuple_t* tuple,
212  ulint info_bits);
213 /*********************************************************************/
216 UNIV_INLINE
217 ulint
219 /*====================*/
220  const dtuple_t* tuple);
221 /*********************************************************************/
223 UNIV_INLINE
224 void
226 /*====================*/
227  dtuple_t* tuple,
228  ulint n_fields_cmp);
230 /**********************************************************/
234 UNIV_INLINE
235 dtuple_t*
237 /*==========*/
238  mem_heap_t* heap,
240  ulint n_fields);
242 /**********************************************************/
246 UNIV_INLINE
247 const dtuple_t*
249 /*===============*/
250  dtuple_t* tuple,
251  const dfield_t* fields,
252  ulint n_fields);
254 /*********************************************************************/
257 UNIV_INTERN
258 void
259 dtuple_set_n_fields(
260 /*================*/
261  dtuple_t* tuple,
262  ulint n_fields);
263 /*********************************************************************/
267 UNIV_INLINE
268 dtuple_t*
270 /*========*/
271  const dtuple_t* tuple,
272  mem_heap_t* heap);
274 /**********************************************************/
278 UNIV_INLINE
279 ulint
281 /*=================*/
282  const dtuple_t* tuple,
283  ulint comp);
284 /*********************************************************************/
287 UNIV_INLINE
288 ulint
290 /*=============*/
291  const dtuple_t* tuple);
292 /************************************************************/
296 UNIV_INTERN
297 int
298 dtuple_coll_cmp(
299 /*============*/
300  const dtuple_t* tuple1,
301  const dtuple_t* tuple2);
302 /************************************************************/
305 UNIV_INLINE
306 ulint
308 /*========*/
309  const dtuple_t* tuple,
310  ulint n_fields,
311  ulint n_bytes,
313  index_id_t tree_id)
314  __attribute__((pure));
315 /*******************************************************************/
317 UNIV_INLINE
318 void
320 /*====================*/
321  dtuple_t* tuple,
322  ulint n);
323 /**********************************************************************/
326 UNIV_INLINE
327 ibool
329 /*=================*/
330  const dtuple_t* tuple);
331 /**********************************************************/
334 UNIV_INTERN
335 ibool
337 /*===============*/
338  const dfield_t* field);
339 /**********************************************************/
342 UNIV_INTERN
343 ibool
345 /*===============*/
346  const dtuple_t* tuple);
347 /**********************************************************/
350 UNIV_INTERN
351 ibool
352 dtuple_check_typed_no_assert(
353 /*=========================*/
354  const dtuple_t* tuple);
355 #ifdef UNIV_DEBUG
356 /**********************************************************/
360 UNIV_INTERN
361 ibool
362 dtuple_validate(
363 /*============*/
364  const dtuple_t* tuple);
365 #endif /* UNIV_DEBUG */
366 /*************************************************************/
368 UNIV_INTERN
369 void
370 dfield_print(
371 /*=========*/
372  const dfield_t* dfield);
373 /*************************************************************/
376 UNIV_INTERN
377 void
378 dfield_print_also_hex(
379 /*==================*/
380  const dfield_t* dfield);
381 /**********************************************************/
383 UNIV_INTERN
384 void
385 dtuple_print(
386 /*=========*/
387  FILE* f,
388  const dtuple_t* tuple);
389 /**************************************************************/
397 UNIV_INTERN
398 big_rec_t*
399 dtuple_convert_big_rec(
400 /*===================*/
401  dict_index_t* index,
402  dtuple_t* entry,
403  ulint* n_ext);
405 /**************************************************************/
409 UNIV_INTERN
410 void
411 dtuple_convert_back_big_rec(
412 /*========================*/
413  dict_index_t* index,
414  dtuple_t* entry,
415  big_rec_t* vector);
417 /**************************************************************/
419 UNIV_INLINE
420 void
422 /*================*/
423  big_rec_t* vector);
426 /*######################################################################*/
427 
430  void* data;
431  unsigned ext:1;
432  unsigned len:32;
434 };
435 
438  ulint info_bits;
442  ulint n_fields;
443  ulint n_fields_cmp;
451  UT_LIST_NODE_T(dtuple_t) tuple_list;
454 #ifdef UNIV_DEBUG
455  ulint magic_n;
458 # define DATA_TUPLE_MAGIC_N 65478679
459 #endif /* UNIV_DEBUG */
460 };
461 
466  ulint field_no;
467  ulint len;
468  const void* data;
469 };
470 
476  ulint n_fields;
478 };
479 
480 #ifndef UNIV_NONINL
481 #include "data0data.ic"
482 #endif
483 
484 #endif