~jelmer/pkg-libinnodb/lintian-fixes

« back to all changes in this revision

Viewing changes to include/ut0list.h

  • Committer: Monty Taylor
  • Date: 2010-02-25 22:11:29 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: mordred@inaugust.com-20100225221129-7hp269rppif7b79c
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
*****************************************************************************/
18
18
 
19
 
/***********************************************************************
 
19
/*******************************************************************//**
 
20
@file include/ut0list.h
 
21
A double-linked list
 
22
 
 
23
Created 4/26/2006 Osku Salerma
 
24
************************************************************************/
 
25
 
 
26
/*******************************************************************//**
20
27
A double-linked list. This differs from the one in ut0lst.h in that in this
21
28
one, each list node contains a pointer to the data, whereas the one in
22
29
ut0lst.h uses a strategy where the list pointers are embedded in the data
45
52
typedef struct ib_list_node_struct ib_list_node_t;
46
53
typedef struct ib_list_helper_struct ib_list_helper_t;
47
54
 
48
 
/********************************************************************
 
55
/****************************************************************//**
49
56
Create a new list using mem_alloc. Lists created with this function must be
50
 
freed with ib_list_free. */
 
57
freed with ib_list_free.
 
58
@return list */
51
59
UNIV_INTERN
52
60
ib_list_t*
53
61
ib_list_create(void);
54
62
/*=================*/
55
 
                        /* out: list */
56
 
 
57
 
 
58
 
/********************************************************************
 
63
 
 
64
 
 
65
/****************************************************************//**
59
66
Free a list. */
60
67
UNIV_INTERN
61
68
void
62
69
ib_list_free(
63
70
/*=========*/
64
 
        ib_list_t*      list);  /* in: list */
 
71
        ib_list_t*      list);  /*!< in: list */
65
72
 
66
 
/********************************************************************
67
 
Add the data to the end of the list. */
 
73
/****************************************************************//**
 
74
Add the data to the end of the list.
 
75
@return new list node */
68
76
UNIV_INTERN
69
77
ib_list_node_t*
70
78
ib_list_add_last(
71
79
/*=============*/
72
 
                                /* out: new list node*/
73
 
        ib_list_t*      list,   /* in: list */
74
 
        void*           data,   /* in: data */
75
 
        mem_heap_t*     heap);  /* in: memory heap to use */
 
80
        ib_list_t*      list,   /*!< in: list */
 
81
        void*           data,   /*!< in: data */
 
82
        mem_heap_t*     heap);  /*!< in: memory heap to use */
76
83
 
77
 
/********************************************************************
78
 
Add the data after the indicated node. */
 
84
/****************************************************************//**
 
85
Add the data after the indicated node.
 
86
@return new list node */
79
87
UNIV_INTERN
80
88
ib_list_node_t*
81
89
ib_list_add_after(
82
90
/*==============*/
83
 
                                        /* out: new list node*/
84
 
        ib_list_t*      list,           /* in: list */
85
 
        ib_list_node_t* prev_node,      /* in: node preceding new node (can
 
91
        ib_list_t*      list,           /*!< in: list */
 
92
        ib_list_node_t* prev_node,      /*!< in: node preceding new node (can
86
93
                                        be NULL) */
87
 
        void*           data,           /* in: data */
88
 
        mem_heap_t*     heap);          /* in: memory heap to use */
 
94
        void*           data,           /*!< in: data */
 
95
        mem_heap_t*     heap);          /*!< in: memory heap to use */
89
96
 
90
 
/********************************************************************
 
97
/****************************************************************//**
91
98
Remove the node from the list. */
92
99
UNIV_INTERN
93
100
void
94
101
ib_list_remove(
95
102
/*===========*/
96
 
        ib_list_t*      list,   /* in: list */
97
 
        ib_list_node_t* node);  /* in: node to remove */
 
103
        ib_list_t*      list,   /*!< in: list */
 
104
        ib_list_node_t* node);  /*!< in: node to remove */
98
105
 
99
 
/********************************************************************
100
 
Get the first node in the list. */
 
106
/****************************************************************//**
 
107
Get the first node in the list.
 
108
@return first node, or NULL */
101
109
UNIV_INLINE
102
110
ib_list_node_t*
103
111
ib_list_get_first(
104
112
/*==============*/
105
 
                                /* out: first node, or NULL */
106
 
        ib_list_t*      list);  /* in: list */
 
113
        ib_list_t*      list);  /*!< in: list */
107
114
 
108
 
/********************************************************************
109
 
Get the last node in the list. */
 
115
/****************************************************************//**
 
116
Get the last node in the list.
 
117
@return last node, or NULL */
110
118
UNIV_INLINE
111
119
ib_list_node_t*
112
120
ib_list_get_last(
113
121
/*=============*/
114
 
                                /* out: last node, or NULL */
115
 
        ib_list_t*      list);  /* in: list */
 
122
        ib_list_t*      list);  /*!< in: list */
116
123
 
117
124
/* List. */
118
125
struct ib_list_struct {
119
 
        ib_list_node_t*         first;          /* first node */
120
 
        ib_list_node_t*         last;           /* last node */
121
 
        ibool                   is_heap_list;   /* TRUE if this list was
 
126
        ib_list_node_t*         first;          /*!< first node */
 
127
        ib_list_node_t*         last;           /*!< last node */
 
128
        ibool                   is_heap_list;   /*!< TRUE if this list was
122
129
                                                allocated through a heap */
123
130
};
124
131
 
125
132
/* A list node. */
126
133
struct ib_list_node_struct {
127
 
        ib_list_node_t*         prev;           /* previous node */
128
 
        ib_list_node_t*         next;           /* next node */
129
 
        void*                   data;           /* user data */
 
134
        ib_list_node_t*         prev;           /*!< previous node */
 
135
        ib_list_node_t*         next;           /*!< next node */
 
136
        void*                   data;           /*!< user data */
130
137
};
131
138
 
132
139
/* Quite often, the only additional piece of data you need is the per-item
133
140
memory heap, so we have this generic struct available to use in those
134
141
cases. */
135
142
struct ib_list_helper_struct {
136
 
        mem_heap_t*     heap;           /* memory heap */
137
 
        void*           data;           /* user data */
 
143
        mem_heap_t*     heap;           /*!< memory heap */
 
144
        void*           data;           /*!< user data */
138
145
};
139
146
 
140
147
#ifndef UNIV_NONINL