mirror of
https://code.semirocket.science/wrapsix
synced 2024-09-19 23:11:04 +03:00
41 lines
1.3 KiB
C
41 lines
1.3 KiB
C
|
/*
|
||
|
* WrapSix
|
||
|
* Copyright (C) 2008-2012 Michal Zima <xhire@mujmalysvet.cz>
|
||
|
*
|
||
|
* This program is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation, either version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program 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 General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*/
|
||
|
|
||
|
#ifndef LINKEDLIST_H
|
||
|
#define LINKEDLIST_H
|
||
|
|
||
|
/* Linked list node structure */
|
||
|
typedef struct s_linkedlist_node {
|
||
|
struct s_linkedlist_node *prev;
|
||
|
struct s_linkedlist_node *next;
|
||
|
void *data;
|
||
|
} linkedlist_node_t;
|
||
|
|
||
|
/* Linked list root structure */
|
||
|
typedef struct s_linkedlist {
|
||
|
linkedlist_node_t first;
|
||
|
linkedlist_node_t last;
|
||
|
} linkedlist_t;
|
||
|
|
||
|
linkedlist_t *linkedlist_create(void);
|
||
|
void linkedlist_destroy(linkedlist_t *root);
|
||
|
int linkedlist_append(linkedlist_t *root, void *data);
|
||
|
void linkedlist_delete(linkedlist_t *root, linkedlist_node_t *node);
|
||
|
|
||
|
#endif /* LINKEDLIST_H */
|