~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Lee Bieber
  • Date: 2010-11-14 23:15:42 UTC
  • mfrom: (1929.1.42 warning-stack-frame)
  • Revision ID: kalebral@gmail.com-20101114231542-fnnu6ydd2p17n582
Merge Monty - fix bug 672372: some functions use > 32k stack

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
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.