/***********************************************************************
gutenfetch - query and fetch electronic texts from project gutenberg
Copyright (C) 2001, 2002, 2003 Russell Francis
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 2 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, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Last updated on $Date: 2004/03/21 05:14:43 $ by $Author: johntabularasa $.
***********************************************************************/
#ifndef LIST_H
#define LIST_H
#include "stddefs.h"
typedef struct list_t* list_ptr_t;
typedef struct {
void *data;
list_ptr_t prev;
list_ptr_t next;
} list_t;
typedef void (*list_data_destroy_func)(void*);
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
list_t* list_prepend(list_t*, void*);
list_t* list_append(list_t*, void*);
list_t* list_previous(list_t*);
list_t* list_next(list_t*);
list_t* list_first(list_t*);
list_t* list_last(list_t*);
list_t* list_remove_node(list_t*, list_data_destroy_func);
void list_remove_all(list_t*, list_data_destroy_func);
#ifdef __cplusplus
};
#endif /* __cplusplus */
#endif /* LIST_H */
syntax highlighted by Code2HTML, v. 0.9.1