Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

iterator.h

00001  /*
00002   * plint/data/iterator.h : memory values iterators
00003   * 
00004   * Time-stamp: <2002-12-21 14:34:03 gseba>
00005   * 
00006   * Copyright (C) Sebastian Glita, email: gseba@users.sourceforge.net
00007   * 
00008   * This file is part of plint.
00009   * 
00010   * plint is free software; you can  redistribute it and/or modify it under the
00011   * terms of the  GNU General Public License as published  by the Free Software
00012   * Foundation; either version 2, or (at your option) any later version.
00013   *
00014   * plint  is distributed  in the  hope  that it  will be  useful, but  WITHOUT
00015   * ANY  WARRANTY; without  even  the implied  warranty  of MERCHANTABILITY  or
00016   * FITNESS FOR A  PARTICULAR PURPOSE.  See the GNU  General Public License for
00017   * more details.
00018   * 
00019   * You should  have received a  copy of the  GNU General Public  License along
00020   * with  plint; see  the file  COPYING.  If  not, write  to the  Free Software
00021   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA USA.
00022   *
00023   */
00024 
00025 #ifndef PLINT_DATA_TYPE_H
00026 #error Dont include me directly, but through data/type.h
00027 #endif
00028 
00038 struct _plint_ite
00039 {
00040   plint_typ_t typ;      
00042   union
00043   {
00044     size_t tab;
00045     hashindex_t hsh;
00046   } crt;                
00048   union
00049   {
00050     plint_tab_t tab;
00051     plint_hsh_t hsh;
00052   } mem;                
00054 };
00055 
00056 __BEGIN_DECLS
00057 
00058 void plint_ite_free(plint_ite_t * PITERATOR);
00059 void plint_ite_start(plint_ite_t * PITERATOR);
00060 plint_ref_t plint_ite_data(plint_ite_t * PITERATOR);
00061 int  plint_ite_next(plint_ite_t * PITERATOR);
00062 void plint_ite_break(plint_ite_t * PITERATOR);
00063 void plint_ite_sync(plint_ite_t * PITERATOR);
00064 int  plint_ite_done(plint_ite_t * PITERATOR);
00065 void plint_ite_stop(plint_ite_t * PITERATOR);
00066 
00067 __END_DECLS
00068 
00069 #define _PLINT_ITE_INIT(__typ__, __mem__...) { typ: PLINT_##__typ__, mem: { __typ__: __mem__ } }
00070 #define PLINT_ITE_tab_INIT(__tab__...) _PLINT_ITE_INIT(tab, ##__tab__)
00071 #define PLINT_ITE_hsh_INIT(__hsh__...) _PLINT_ITE_INIT(hsh, ##__hsh__)
00072 
00073 #define plint_ite_typ(__i__...) ((__i__).typ)
00074 
00075 #define _plint_ite_crt(__t__, __i__...) ((__i__).crt.__t__)
00076 #define plint_ite_i(__i__...) _plint_ite_crt(tab, ##__i__)
00077 #define plint_ite_hi(__i__...) _plint_ite_crt(hsh, ##__i__)
00078 
00079 #define _plint_ite_mem(__t__, __i__...) ((__i__).mem.__t__)
00080 #define plint_ite_tab(__i__...) _plint_ite_mem(tab, ##__i__)
00081 #define plint_ite_hsh(__i__...) _plint_ite_mem(hsh, ##__i__)
00082 

Generated on Thu Jan 9 19:02:38 2003 for plint by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002