00001 /* Eliot */ 00002 /* Copyright (C) 2005 Antoine Fraboulet */ 00003 /* */ 00004 /* This file is part of Eliot. */ 00005 /* */ 00006 /* Eliot is free software; you can redistribute it and/or modify */ 00007 /* it under the terms of the GNU General Public License as published by */ 00008 /* the Free Software Foundation; either version 2 of the License, or */ 00009 /* (at your option) any later version. */ 00010 /* */ 00011 /* Eliot is distributed in the hope that it will be useful, */ 00012 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 00013 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 00014 /* GNU General Public License for more details. */ 00015 /* */ 00016 /* You should have received a copy of the GNU General Public License */ 00017 /* along with this program; if not, write to the Free Software */ 00018 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 00019 00020 /** 00021 * \file alist.h 00022 * \brief List type used by automaton 00023 * \author Antoine Fraboulet 00024 * \date 2005 00025 */ 00026 00027 #ifndef _ALIST_H_ 00028 #define _ALIST_H_ 00029 #if defined(__cplusplus) 00030 extern "C" 00031 { 00032 #endif 00033 00034 /** 00035 * untyped list type element 00036 */ 00037 typedef struct alist_elt_t* alist_elt; 00038 00039 /** 00040 * extract the value from an alist element 00041 * result is untyped si the user should know 00042 * what the value type is 00043 */ 00044 void* alist_elt_get_value(alist_elt); 00045 00046 /** 00047 * untyped list type 00048 */ 00049 typedef struct alist_t* alist; 00050 00051 /** 00052 * list creation 00053 * @returns list 00054 */ 00055 alist alist_create (); 00056 alist alist_clone (alist); 00057 00058 /** 00059 * funtion to use on data during list deletion. 00060 */ 00061 void alist_set_delete (alist,void (*f)(void*)); 00062 00063 /** 00064 * delete a complete list. 00065 */ 00066 void alist_delete (alist); 00067 00068 /** 00069 * add a element to the list 00070 */ 00071 void alist_add (alist, void*); 00072 void alist_insert (alist, alist); 00073 /** 00074 * get first element 00075 */ 00076 int alist_is_in (alist l, void* e); 00077 int alist_equal (alist , alist); 00078 00079 alist_elt alist_get_first (alist); 00080 00081 /** 00082 * get next element from current 00083 */ 00084 alist_elt alist_get_next (alist,alist_elt); 00085 00086 /** 00087 * @returns 0 or 1 00088 */ 00089 int alist_is_empty (alist); 00090 00091 int alist_get_size (alist); 00092 00093 void* alist_pop_first_value (alist); 00094 00095 #if defined(__cplusplus) 00096 } 00097 #endif 00098 #endif /* _ALIST_H_ */