Files
qse/qse/lib/cmn/gdl.c

45 lines
1.3 KiB
C
Raw Normal View History

2010-09-04 06:50:08 +00:00
/*
* $Id$
*
2013-12-31 10:24:12 +00:00
Copyright 2006-2014 Chung, Hyung-Hwan.
2010-09-04 06:50:08 +00:00
This file is part of QSE.
QSE 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 3 of
the License, or (at your option) any later version.
QSE 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 QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#include <qse/cmn/gdl.h>
2013-11-26 13:47:58 +00:00
void qse_gdl_chain (qse_gdl_t* gdl, qse_gdl_link_t* prev, qse_gdl_link_t* x, qse_gdl_link_t* next)
2010-09-04 06:50:08 +00:00
{
2013-11-26 13:47:58 +00:00
x->prev = prev;
x->next = next;
next->prev = x;
prev->next = x;
2010-09-04 06:50:08 +00:00
}
2013-11-26 13:47:58 +00:00
void qse_gdl_unchain (qse_gdl_t* gdl, qse_gdl_link_t* x)
2010-09-04 06:50:08 +00:00
{
2013-11-26 13:47:58 +00:00
qse_gdl_link_t* p = x->prev;
qse_gdl_link_t* n = x->next;
2010-09-04 06:50:08 +00:00
n->prev = p; p->next = n;
}
2013-11-26 13:47:58 +00:00
void qse_gdl_replace (qse_gdl_t* gdl, qse_gdl_link_t* old_link, qse_gdl_link_t* new_link)
{
new_link->next = old_link->next;
new_link->next->prev = new_link;
new_link->prev = old_link->prev;
new_link->prev->next = new_link;
}