1/***************************************************************************** 2 3Copyright (c) 2006, 2009, Oracle and/or its affiliates. All Rights Reserved. 4 5This program is free software; you can redistribute it and/or modify 6it under the terms of the GNU General Public License, version 2.0, 7as published by the Free Software Foundation. 8 9This program is also distributed with certain software (including 10but not limited to OpenSSL) that is licensed under separate terms, 11as designated in a particular file or component or in included license 12documentation. The authors of MySQL hereby grant you an additional 13permission to link the program and your derivative works with the 14separately licensed software that they have included with MySQL. 15 16This program is distributed in the hope that it will be useful, 17but WITHOUT ANY WARRANTY; without even the implied warranty of 18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19GNU General Public License, version 2.0, for more details. 20 21You should have received a copy of the GNU General Public License along with 22this program; if not, write to the Free Software Foundation, Inc., 2351 Franklin Street, Suite 500, Boston, MA 02110-1335 USA 24 25*****************************************************************************/ 26 27/*******************************************************************//** 28@file include/ut0list.ic 29A double-linked list 30 31Created 4/26/2006 Osku Salerma 32************************************************************************/ 33 34/****************************************************************//** 35Get the first node in the list. 36@return first node, or NULL */ 37UNIV_INLINE 38ib_list_node_t* 39ib_list_get_first( 40/*==============*/ 41 ib_list_t* list) /*!< in: list */ 42{ 43 return(list->first); 44} 45 46/****************************************************************//** 47Get the last node in the list. 48@return last node, or NULL */ 49UNIV_INLINE 50ib_list_node_t* 51ib_list_get_last( 52/*=============*/ 53 ib_list_t* list) /*!< in: list */ 54{ 55 return(list->last); 56} 57 58/******************************************************************** 59Check if list is empty. */ 60UNIV_INLINE 61ibool 62ib_list_is_empty( 63/*=============*/ 64 /* out: TRUE if empty else FALSE */ 65 const ib_list_t* list) /* in: list */ 66{ 67 return(!(list->first || list->last)); 68} 69