1
/* Copyright (C) 2000-2001, 2003, 2005 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17
#ifdef USE_PRAGMA_IMPLEMENTATION
18
#pragma implementation // gcc: Class implementation
21
#include "mysql_priv.h"
23
list_node end_of_list;
25
void free_list(I_List <i_string_pair> *list)
28
while ((tmp= list->get()))
33
void free_list(I_List <i_string> *list)
36
while ((tmp= list->get()))
41
base_list::base_list(const base_list &rhs, MEM_ROOT *mem_root)
46
It's okay to allocate an array of nodes at once: we never
47
call a destructor for list_node objects anyway.
49
first= (list_node*) alloc_root(mem_root,
50
sizeof(list_node) * rhs.elements);
53
elements= rhs.elements;
54
list_node *dst= first;
55
list_node *src= rhs.first;
56
for (; dst < first + elements - 1; dst++, src= src->next)
61
/* Copy the last node */
63
dst->next= &end_of_list;
64
/* Setup 'last' member */