list.h

Go to the documentation of this file.
00001 /*
00002  * list.h: this file is part of the FM project.
00003  *
00004  * FM, a fast and optimized C implementation of Fourier-Motzkin
00005  * projection algorithm.
00006  *
00007  * Copyright (C) 2006,2007,2008 Louis-Noel Pouchet
00008  *
00009  * This program is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public License
00011  * as published by the Free Software Foundation; either version 3
00012  * of the License, or (at your option) any later version.
00013  *
00014  * The complete GNU Lesser General Public Licence Notice can be found
00015  *  as the `COPYING.LESSER' file in the root directory.
00016  *
00017  * Author:
00018  * Louis-Noel Pouchet <Louis-Noel.Pouchet@inria.fr>
00019  *
00020  */
00021 #ifndef FM_LIST_H
00022 # define FM_LIST_H
00023 
00024 # include <assert.h>
00025 # include <fm/common.h>
00026 
00027 BEGIN_C_DECLS
00028 
00029 struct s_fm_list
00030 {
00031   void*                 data;
00032   struct s_fm_list*     next;
00033 };
00034 
00035 typedef struct s_fm_list s_fm_list_t;
00036 typedef void (*free_fun_t) (void*);
00037 typedef int (*cmp_fun_t) (void*, void*);
00038 
00039 extern s_fm_list_t*     fm_list_new(void *data);
00040 extern void             fm_list_dummy_free (void*);
00041 extern void             fm_list_free (s_fm_list_t* l, free_fun_t f);
00042 extern s_fm_list_t*     fm_list_add_head (s_fm_list_t** head, void* data);
00043 extern s_fm_list_t*     fm_list_add_head_unique (s_fm_list_t** head,
00044                                                  void* data,
00045                                                  cmp_fun_t f);
00046 extern s_fm_list_t*     fm_list_cons(s_fm_list_t *head, s_fm_list_t *tail);
00047 extern s_fm_list_t*     s_fm_list_tail(s_fm_list_t *head);
00048 extern size_t           fm_list_length(s_fm_list_t *head);
00049 
00050 extern int              fm_list_remove (s_fm_list_t** head, void* data);
00051 
00052 END_C_DECLS
00053 
00054 
00055 #endif // FM_LIST_H

Generated on Thu Oct 30 13:38:21 2008 for FM by  doxygen 1.5.3