2009-07-15 06:13:52 -07:00
|
|
|
/* EINA - EFL data type library
|
|
|
|
* Copyright (C) 2008 Cedric Bail
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library;
|
|
|
|
* if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef EINA_INLINE_TRASH_X__
|
|
|
|
#define EINA_INLINE_TRASH_X__
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
eina_trash_init(Eina_Trash **trash)
|
|
|
|
{
|
|
|
|
*trash = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
eina_trash_push(Eina_Trash **trash, void *data)
|
|
|
|
{
|
|
|
|
Eina_Trash *tmp;
|
|
|
|
|
2009-07-15 20:04:56 -07:00
|
|
|
tmp = (Eina_Trash *)data;
|
2009-07-15 06:13:52 -07:00
|
|
|
tmp->next = *trash;
|
|
|
|
*trash = tmp;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void*
|
|
|
|
eina_trash_pop(Eina_Trash **trash)
|
|
|
|
{
|
|
|
|
void *tmp;
|
|
|
|
|
|
|
|
tmp = *trash;
|
|
|
|
|
2010-08-25 18:34:13 -07:00
|
|
|
if (*trash)
|
2009-07-15 06:13:52 -07:00
|
|
|
*trash = (*trash)->next;
|
|
|
|
|
|
|
|
return tmp;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|