~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/fut0lst.ic

  • Committer: Monty Taylor
  • Date: 2008-12-18 07:24:54 UTC
  • mto: This revision was merged to the branch mainline in revision 714.
  • Revision ID: monty@bitters-20081218072454-8pnep622damjgqli
Fixed one more my_time thing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*****************************************************************************
2
 
 
3
 
Copyright (C) 1995, 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
 
/******************************************************************//**
20
 
@file include/fut0lst.ic
 
1
/**********************************************************************
21
2
File-based list utilities
22
3
 
 
4
(c) 1995 Innobase Oy
 
5
 
23
6
Created 11/28/1995 Heikki Tuuri
24
7
***********************************************************************/
25
8
 
43
26
                                last element of the list; undefined
44
27
                                if empty list */
45
28
 
46
 
/********************************************************************//**
 
29
/************************************************************************
47
30
Writes a file address. */
48
31
UNIV_INLINE
49
32
void
50
33
flst_write_addr(
51
34
/*============*/
52
 
        fil_faddr_t*    faddr,  /*!< in: pointer to file faddress */
53
 
        fil_addr_t      addr,   /*!< in: file address */
54
 
        mtr_t*          mtr)    /*!< in: mini-transaction handle */
 
35
        fil_faddr_t*    faddr,  /* in: pointer to file faddress */
 
36
        fil_addr_t      addr,   /* in: file address */
 
37
        mtr_t*          mtr)    /* in: mini-transaction handle */
55
38
{
56
39
        ut_ad(faddr && mtr);
57
40
        ut_ad(mtr_memo_contains_page(mtr, faddr, MTR_MEMO_PAGE_X_FIX));
63
46
                         MLOG_2BYTES, mtr);
64
47
}
65
48
 
66
 
/********************************************************************//**
67
 
Reads a file address.
68
 
@return file address */
 
49
/************************************************************************
 
50
Reads a file address. */
69
51
UNIV_INLINE
70
52
fil_addr_t
71
53
flst_read_addr(
72
54
/*===========*/
73
 
        const fil_faddr_t*      faddr,  /*!< in: pointer to file faddress */
74
 
        mtr_t*                  mtr)    /*!< in: mini-transaction handle */
 
55
                                        /* out: file address */
 
56
        const fil_faddr_t*      faddr,  /* in: pointer to file faddress */
 
57
        mtr_t*                  mtr)    /* in: mini-transaction handle */
75
58
{
76
59
        fil_addr_t      addr;
77
60
 
85
68
        return(addr);
86
69
}
87
70
 
88
 
/********************************************************************//**
 
71
/************************************************************************
89
72
Initializes a list base node. */
90
73
UNIV_INLINE
91
74
void
92
75
flst_init(
93
76
/*======*/
94
 
        flst_base_node_t*       base,   /*!< in: pointer to base node */
95
 
        mtr_t*                  mtr)    /*!< in: mini-transaction handle */
 
77
        flst_base_node_t*       base,   /* in: pointer to base node */
 
78
        mtr_t*                  mtr)    /* in: mini-transaction handle */
96
79
{
97
80
        ut_ad(mtr_memo_contains_page(mtr, base, MTR_MEMO_PAGE_X_FIX));
98
81
 
101
84
        flst_write_addr(base + FLST_LAST, fil_addr_null, mtr);
102
85
}
103
86
 
104
 
/********************************************************************//**
105
 
Gets list length.
106
 
@return length */
 
87
/************************************************************************
 
88
Gets list length. */
107
89
UNIV_INLINE
108
90
ulint
109
91
flst_get_len(
110
92
/*=========*/
111
 
        const flst_base_node_t* base,   /*!< in: pointer to base node */
112
 
        mtr_t*                  mtr)    /*!< in: mini-transaction handle */
 
93
                                        /* out: length */
 
94
        const flst_base_node_t* base,   /* in: pointer to base node */
 
95
        mtr_t*                  mtr)    /* in: mini-transaction handle */
113
96
{
114
97
        return(mtr_read_ulint(base + FLST_LEN, MLOG_4BYTES, mtr));
115
98
}
116
99
 
117
 
/********************************************************************//**
118
 
Gets list first node address.
119
 
@return file address */
 
100
/************************************************************************
 
101
Gets list first node address. */
120
102
UNIV_INLINE
121
103
fil_addr_t
122
104
flst_get_first(
123
105
/*===========*/
124
 
        const flst_base_node_t* base,   /*!< in: pointer to base node */
125
 
        mtr_t*                  mtr)    /*!< in: mini-transaction handle */
 
106
                                        /* out: file address */
 
107
        const flst_base_node_t* base,   /* in: pointer to base node */
 
108
        mtr_t*                  mtr)    /* in: mini-transaction handle */
126
109
{
127
110
        return(flst_read_addr(base + FLST_FIRST, mtr));
128
111
}
129
112
 
130
 
/********************************************************************//**
131
 
Gets list last node address.
132
 
@return file address */
 
113
/************************************************************************
 
114
Gets list last node address. */
133
115
UNIV_INLINE
134
116
fil_addr_t
135
117
flst_get_last(
136
118
/*==========*/
137
 
        const flst_base_node_t* base,   /*!< in: pointer to base node */
138
 
        mtr_t*                  mtr)    /*!< in: mini-transaction handle */
 
119
                                        /* out: file address */
 
120
        const flst_base_node_t* base,   /* in: pointer to base node */
 
121
        mtr_t*                  mtr)    /* in: mini-transaction handle */
139
122
{
140
123
        return(flst_read_addr(base + FLST_LAST, mtr));
141
124
}
142
125
 
143
 
/********************************************************************//**
144
 
Gets list next node address.
145
 
@return file address */
 
126
/************************************************************************
 
127
Gets list next node address. */
146
128
UNIV_INLINE
147
129
fil_addr_t
148
130
flst_get_next_addr(
149
131
/*===============*/
150
 
        const flst_node_t*      node,   /*!< in: pointer to node */
151
 
        mtr_t*                  mtr)    /*!< in: mini-transaction handle */
 
132
                                        /* out: file address */
 
133
        const flst_node_t*      node,   /* in: pointer to node */
 
134
        mtr_t*                  mtr)    /* in: mini-transaction handle */
152
135
{
153
136
        return(flst_read_addr(node + FLST_NEXT, mtr));
154
137
}
155
138
 
156
 
/********************************************************************//**
157
 
Gets list prev node address.
158
 
@return file address */
 
139
/************************************************************************
 
140
Gets list prev node address. */
159
141
UNIV_INLINE
160
142
fil_addr_t
161
143
flst_get_prev_addr(
162
144
/*===============*/
163
 
        const flst_node_t*      node,   /*!< in: pointer to node */
164
 
        mtr_t*                  mtr)    /*!< in: mini-transaction handle */
 
145
                                        /* out: file address */
 
146
        const flst_node_t*      node,   /* in: pointer to node */
 
147
        mtr_t*                  mtr)    /* in: mini-transaction handle */
165
148
{
166
149
        return(flst_read_addr(node + FLST_PREV, mtr));
167
150
}