Aegis  4.25.D505
/home/archives/aegis/branch.4/branch.25/delta28933.505/common/itab.h
Go to the documentation of this file.
00001 //
00002 // aegis - project change supervisor
00003 // Copyright (C) 1998, 2003-2008, 2012 Peter Miller
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or (at
00008 // your option) any later version.
00009 //
00010 // This program 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 GNU
00013 // General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program. If not, see <http://www.gnu.org/licenses/>.
00017 //
00018 
00019 #ifndef COMMON_ITAB_H
00020 #define COMMON_ITAB_H
00021 
00027 typedef long itab_key_ty;
00028 
00029 struct itab_row_ty
00030 {
00031     itab_key_ty     key;
00032     void            *data;
00033     itab_row_ty     *overflow;
00034 };
00035 
00036 struct itab_ty
00037 {
00038     void            (*reap)(void *);
00039     itab_row_ty     **hash_table;
00040     itab_key_ty     hash_modulus;
00041     itab_key_ty     hash_mask;
00042     itab_key_ty     load;
00043 };
00044 
00045 itab_ty *itab_alloc(void);
00046 void itab_free(itab_ty *);
00047 void *itab_query(itab_ty *, itab_key_ty);
00048 void itab_assign(itab_ty *, itab_key_ty, void *);
00049 void itab_delete(itab_ty *, itab_key_ty);
00050 void itab_walk(itab_ty *, void (*)(itab_ty *, itab_key_ty, void *, void *),
00051         void *);
00052 
00054 #endif // COMMON_ITAB_H
00055 // vim: set ts=8 sw=4 et :