libdacav 0.9.0
/home/dacav/Projects/libdacav/libdacav/dacav/dacaviter.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2009 2010 Giovanni Simoni
00003  *
00004  * This file is part of LibDacav.
00005  *
00006  * LibDacav 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 3 of the License, or
00009  * (at your option) any later version.  *
00010  * LibDacav is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with LibDacav.  If not, see <http://www.gnu.org/licenses/>.
00017  *
00018  */
00019 
00025 #ifndef __defined_dacav_dacaviter_h
00026 #define __defined_dacav_dacaviter_h
00027 
00028 #include <dacav/dacav.h>
00029 
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033 
00036 
00046 typedef struct diter diter_t;
00047 
00060 int diter_hasnext (diter_t *i);
00061 
00073 void * diter_next(diter_t *i);
00074 
00096 void diter_remove (diter_t *i);
00097 
00114 void diter_replace (diter_t *i, void *n);
00115 
00120 
00134 typedef int (*dhasnext_t) (void *iterable);
00135 
00150 typedef void * (*dnext_t) (void *iterable);
00151 
00165 typedef void (*dremove_t) (void *iterable);
00166 
00183 typedef void (*dreplace_t) (void *iterable, void *new_val);
00184 
00204 diter_t *diter_new (dnext_t nx, dhasnext_t hnx, dremove_t rm,
00205                     dreplace_t rep, unsigned iterable_size);
00206 
00221 void *diter_get_iterable (diter_t *i);
00222 
00236 void diter_free (diter_t *it);
00237 
00241 #ifdef __cplusplus
00242 }
00243 #endif
00244 
00245 #endif // __defined_dacav_dacaviter_h
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator