~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/ut0lst.h

  • Committer: patrick crews
  • Date: 2010-09-29 15:15:19 UTC
  • mfrom: (1099.4.188 drizzle)
  • Revision ID: gleebix@gmail.com-20100929151519-6mrmzd1ciw2p9nws
Tags: 2010.09.1802
Update translations

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1995, 2010, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
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
 
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
39
39
to both ends of the list and a count of nodes in the list (excluding
40
40
the base node from the count).
41
41
@param TYPE     the name of the list node data type */
42
 
#ifdef __cplusplus
43
 
template<class T>
44
 
class ut_list_base_node
45
 
{
46
 
public:
47
 
  size_t count; /*!< count of nodes in list */\
48
 
  T *   start;  /*!< pointer to list start, NULL if empty */\
49
 
  T *   end;    /*!< pointer to list end, NULL if empty */\
50
 
};
51
 
#define UT_LIST_BASE_NODE_T(TYPE) ut_list_base_node<TYPE>
52
 
#else
53
 
#define UT_LIST_BASE_NODE_T(TYPE) int
54
 
#endif
 
42
#define UT_LIST_BASE_NODE_T(TYPE)\
 
43
struct {\
 
44
        ulint   count;  /*!< count of nodes in list */\
 
45
        TYPE *  start;  /*!< pointer to list start, NULL if empty */\
 
46
        TYPE *  end;    /*!< pointer to list end, NULL if empty */\
 
47
}\
55
48
 
56
49
/*******************************************************************//**
57
50
This macro expands to the unnamed type definition of a struct which
117
110
*/
118
111
#define UT_LIST_ADD_LAST(NAME, BASE, N)\
119
112
{\
120
 
        ut_ad(N != NULL);\
 
113
        ut_ad(N);\
121
114
        ((BASE).count)++;\
122
115
        ((N)->NAME).prev = (BASE).end;\
123
116
        ((N)->NAME).next = NULL;\
227
220
Gets the last node in a two-way list.
228
221
@param BASE     the base node (not a pointer to it)
229
222
@return         last node, or NULL if the list is empty */
230
 
#ifdef __cplusplus
231
223
#define UT_LIST_GET_LAST(BASE)\
232
224
        (BASE).end
233
 
#else
234
 
#define UT_LIST_GET_LAST(BASE) (BASE= NULL)
235
 
#endif
236
225
 
237
226
/********************************************************************//**
238
227
Checks the consistency of a two-way list.