drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
ut0list.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (C) 2006, 2009, Innobase Oy. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/*******************************************************************/
25
26/*******************************************************************/
45
46#pragma once
47#ifndef IB_LIST_H
48#define IB_LIST_H
49
50#include "mem0mem.h"
51
52typedef struct ib_list_struct ib_list_t;
53typedef struct ib_list_node_struct ib_list_node_t;
54typedef struct ib_list_helper_struct ib_list_helper_t;
55
56/****************************************************************/
60UNIV_INTERN
61ib_list_t*
62ib_list_create(void);
63/*=================*/
64
65
66/****************************************************************/
70UNIV_INTERN
71ib_list_t*
73/*================*/
74 mem_heap_t* heap);
75
76/****************************************************************/
78UNIV_INTERN
79void
81/*=========*/
82 ib_list_t* list);
83
84/****************************************************************/
87UNIV_INTERN
88ib_list_node_t*
90/*==============*/
91 ib_list_t* list,
92 void* data,
93 mem_heap_t* heap);
94
95/****************************************************************/
98UNIV_INTERN
99ib_list_node_t*
101/*=============*/
102 ib_list_t* list,
103 void* data,
104 mem_heap_t* heap);
105
106/****************************************************************/
109UNIV_INTERN
110ib_list_node_t*
112/*==============*/
113 ib_list_t* list,
114 ib_list_node_t* prev_node,
116 void* data,
117 mem_heap_t* heap);
118
119/****************************************************************/
121UNIV_INTERN
122void
124/*===========*/
125 ib_list_t* list,
126 ib_list_node_t* node);
127
128/****************************************************************/
131UNIV_INLINE
132ib_list_node_t*
134/*==============*/
135 ib_list_t* list);
136
137/****************************************************************/
140UNIV_INLINE
141ib_list_node_t*
143/*=============*/
144 ib_list_t* list);
145
146/* List. */
148 ib_list_node_t* first;
149 ib_list_node_t* last;
152};
153
154/* A list node. */
156 ib_list_node_t* prev;
157 ib_list_node_t* next;
158 void* data;
159};
160
161/* Quite often, the only additional piece of data you need is the per-item
162memory heap, so we have this generic struct available to use in those
163cases. */
165 mem_heap_t* heap;
166 void* data;
167};
168
169#ifndef UNIV_NONINL
170#include "ut0list.ic"
171#endif
172
173#endif
mem_heap_t * heap
Definition ut0list.h:165
ib_list_node_t * next
Definition ut0list.h:157
ib_list_node_t * prev
Definition ut0list.h:156
ib_list_node_t * last
Definition ut0list.h:149
ib_list_node_t * first
Definition ut0list.h:148
ibool is_heap_list
Definition ut0list.h:150
UNIV_INTERN ib_list_t * ib_list_create_heap(mem_heap_t *heap)
Definition ut0list.cc:54
UNIV_INLINE ib_list_node_t * ib_list_get_first(ib_list_t *list)
UNIV_INTERN void ib_list_remove(ib_list_t *list, ib_list_node_t *node)
Definition ut0list.cc:170
UNIV_INTERN void ib_list_free(ib_list_t *list)
Definition ut0list.cc:71
UNIV_INTERN ib_list_node_t * ib_list_add_first(ib_list_t *list, void *data, mem_heap_t *heap)
Definition ut0list.cc:89
UNIV_INTERN ib_list_t * ib_list_create(void)
Definition ut0list.cc:36
UNIV_INTERN ib_list_node_t * ib_list_add_last(ib_list_t *list, void *data, mem_heap_t *heap)
Definition ut0list.cc:103
UNIV_INLINE ib_list_node_t * ib_list_get_last(ib_list_t *list)
UNIV_INTERN ib_list_node_t * ib_list_add_after(ib_list_t *list, ib_list_node_t *prev_node, void *data, mem_heap_t *heap)
Definition ut0list.cc:117