| 1 | /* |
| 2 | * Copyright (C) 2000 Ross Combs ([email protected]) |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; either version 2 |
| 7 | * of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 | */ |
| 18 | #ifndef INCLUDED_HASHTABLE_TYPES |
| 19 | #define INCLUDED_HASHTABLE_TYPEScxx . . $ `src/common/hashtable.h:19:9`! |
| 20 | |
| 21 | namespace pvpgncxx . . $ pvpgn/ |
| 22 | { |
| 23 | |
| 24 | #ifdef HASHTABLE_INTERNAL_ACCESScxx . . $ `src/common/hashtable.cpp:18:9`! |
| 25 | struct hashtablecxx . . $ pvpgn/hashtable#; /* forward reference for t_entry */ |
| 26 | #endif |
| 27 | |
| 28 | #ifdef HASHTABLE_INTERNAL_ACCESScxx . . $ `src/common/hashtable.cpp:18:9`! |
| 29 | typedef struct internentrycxx . . $ pvpgn/internentry# |
| 30 | { |
| 31 | void * datacxx . . $ pvpgn/internentry#data.; |
| 32 | struct internentrycxx . . $ pvpgn/internentry# * nextcxx . . $ pvpgn/internentry#next.; |
| 33 | } |
| 34 | t_internentrycxx . . $ pvpgn/t_internentry#; |
| 35 | #endif |
| 36 | |
| 37 | typedef struct entrycxx . . $ pvpgn/entry# |
| 38 | #ifdef HASHTABLE_INTERNAL_ACCESScxx . . $ `src/common/hashtable.cpp:18:9`! |
| 39 | { |
| 40 | unsigned int rowcxx . . $ pvpgn/entry#row.; |
| 41 | t_internentrycxx . . $ pvpgn/t_internentry# * realcxx . . $ pvpgn/entry#real.; |
| 42 | struct hashtablecxx . . $ pvpgn/hashtable# const * hashtablecxx . . $ pvpgn/entry#hashtable.; |
| 43 | } |
| 44 | #endif |
| 45 | t_entrycxx . . $ pvpgn/t_entry#; |
| 46 | |
| 47 | typedef struct hashtablecxx . . $ pvpgn/hashtable# |
| 48 | #ifdef HASHTABLE_INTERNAL_ACCESScxx . . $ `src/common/hashtable.cpp:18:9`! |
| 49 | { |
| 50 | unsigned int num_rowscxx . . $ pvpgn/hashtable#num_rows.; |
| 51 | unsigned int lencxx . . $ pvpgn/hashtable#len.; |
| 52 | unsigned int zombiescxx . . $ pvpgn/hashtable#zombies.; |
| 53 | t_internentrycxx . . $ pvpgn/t_internentry# * * rowscxx . . $ pvpgn/hashtable#rows.; |
| 54 | } |
| 55 | #endif |
| 56 | t_hashtablecxx . . $ pvpgn/t_hashtable#; |
| 57 | |
| 58 | } |
| 59 | |
| 60 | #endif |
| 61 | |
| 62 | |
| 63 | /*****/ |
| 64 | #ifndef JUST_NEED_TYPES |
| 65 | #ifndef INCLUDED_HASHTABLE_PROTOS |
| 66 | #define INCLUDED_HASHTABLE_PROTOScxx . . $ `src/common/hashtable.h:66:9`! |
| 67 | |
| 68 | namespace pvpgncxx . . $ pvpgn/ |
| 69 | { |
| 70 | |
| 71 | extern t_hashtablecxx . . $ pvpgn/t_hashtable# * hashtable_createcxx . . $ pvpgn/hashtable_create(7bfadb07e2d0490a).(unsigned int num_rows); |
| 72 | extern int hashtable_destroycxx . . $ pvpgn/hashtable_destroy(8afcf31a4e16cf42).(t_hashtablecxx . . $ pvpgn/t_hashtable# * hashtable); |
| 73 | extern int hashtable_purgecxx . . $ pvpgn/hashtable_purge(8afcf31a4e16cf42).(t_hashtablecxx . . $ pvpgn/t_hashtable# * hashtable); |
| 74 | extern int hashtable_checkcxx . . $ pvpgn/hashtable_check(76a73806bc01dce2).(t_hashtablecxx . . $ pvpgn/t_hashtable# const * hashtable); |
| 75 | extern unsigned int hashtable_get_lengthcxx . . $ pvpgn/hashtable_get_length(cf8ce18ab63d7d2c).(t_hashtablecxx . . $ pvpgn/t_hashtable# const * hashtable); |
| 76 | extern int hashtable_insert_datacxx . . $ pvpgn/hashtable_insert_data(e38f1de6fd62ec3a).(t_hashtablecxx . . $ pvpgn/t_hashtable# * hashtable, void * data, unsigned int hash); |
| 77 | extern t_entrycxx . . $ pvpgn/t_entry# * hashtable_get_entry_by_datacxx . . $ pvpgn/hashtable_get_entry_by_data(e55fbe464426d824).(t_hashtablecxx . . $ pvpgn/t_hashtable# const * hashtable, void const * data, unsigned int hash); |
| 78 | extern t_entrycxx . . $ pvpgn/t_entry# const * hashtable_get_entry_by_data_constcxx . . $ pvpgn/hashtable_get_entry_by_data_const(534dc66aa9b8719c).(t_hashtablecxx . . $ pvpgn/t_hashtable# const * hashtable, void const * data, unsigned int hash); |
| 79 | extern int hashtable_remove_datacxx . . $ pvpgn/hashtable_remove_data(c6644015312508b0).(t_hashtablecxx . . $ pvpgn/t_hashtable# * hashtable, void const * data, unsigned int hash); /* delete matching item */ |
| 80 | extern int hashtable_remove_entrycxx . . $ pvpgn/hashtable_remove_entry(1b043d8f0bcccff1).(t_hashtablecxx . . $ pvpgn/t_hashtable# * hashtable, t_entrycxx . . $ pvpgn/t_entry# * entry); |
| 81 | extern void * hashtable_get_data_by_poscxx . . $ pvpgn/hashtable_get_data_by_pos(10be6e303e675c1f).(t_hashtablecxx . . $ pvpgn/t_hashtable# const * hashtable, unsigned int pos); |
| 82 | extern void * entry_get_datacxx . . $ pvpgn/entry_get_data(ad401fc46215ce52).(t_entrycxx . . $ pvpgn/t_entry# const * entry); |
| 83 | #ifdef HASHTABLE_DEBUG |
| 84 | extern t_entry * hashtable_match_get_first_real(t_hashtable const * hashtable, unsigned int hash, char const * fn, unsigned int ln); |
| 85 | # define hashtable_match_get_first(L,H) hashtable_match_get_first_real(L,H,__FILE__,__LINE__) |
| 86 | #else |
| 87 | extern t_entrycxx . . $ pvpgn/t_entry# * hashtable_match_get_firstcxx . . $ pvpgn/hashtable_match_get_first(fdba7c131b4d72f1).(t_hashtablecxx . . $ pvpgn/t_hashtable# const * hashtable, unsigned int hash); |
| 88 | #endif |
| 89 | extern t_entrycxx . . $ pvpgn/t_entry# * entry_match_get_nextcxx . . $ pvpgn/entry_match_get_next(a1df3d4b99234c34).(t_entrycxx . . $ pvpgn/t_entry# const * entry, unsigned int hash); |
| 90 | #ifdef HASHTABLE_DEBUG |
| 91 | extern t_entry * hashtable_get_first_real(t_hashtable const * hashtable, char const * fn, unsigned int ln); |
| 92 | # define hashtable_get_first(L) hashtable_get_first_real(L,__FILE__,__LINE__) |
| 93 | #else |
| 94 | extern t_entrycxx . . $ pvpgn/t_entry# * hashtable_get_firstcxx . . $ pvpgn/hashtable_get_first(b903d86a7b8543ff).(t_hashtablecxx . . $ pvpgn/t_hashtable# const * hashtable); |
| 95 | #endif |
| 96 | extern t_entrycxx . . $ pvpgn/t_entry# * entry_get_nextcxx . . $ pvpgn/entry_get_next(e7e16cf9303dbb2b).(t_entrycxx . . $ pvpgn/t_entry# * entry); |
| 97 | #ifdef HASHTABLE_DEBUG |
| 98 | extern t_entry * hashtable_get_first_matching_real(t_hashtable const * hashtable, unsigned int hash, char const * fn, unsigned int ln); |
| 99 | # define hashtable_get_first_matching(L,H) hashtable_get_first_matching_real(L,H,__FILE__,__LINE__) |
| 100 | #else |
| 101 | extern t_entrycxx . . $ pvpgn/t_entry# * hashtable_get_first_matchingcxx . . $ pvpgn/hashtable_get_first_matching(fdba7c131b4d72f1).(t_hashtablecxx . . $ pvpgn/t_hashtable# const * hashtable, unsigned int hash); |
| 102 | #endif |
| 103 | extern t_entrycxx . . $ pvpgn/t_entry# * entry_get_next_matchingcxx . . $ pvpgn/entry_get_next_matching(e7e16cf9303dbb2b).(t_entrycxx . . $ pvpgn/t_entry# * entry); |
| 104 | extern int hashtable_entry_releasecxx . . $ pvpgn/hashtable_entry_release(ac222f288a486716).(t_entrycxx . . $ pvpgn/t_entry# * entry); |
| 105 | extern int hashtable_statscxx . . $ pvpgn/hashtable_stats(8afcf31a4e16cf42).(t_hashtablecxx . . $ pvpgn/t_hashtable# * hashtable); |
| 106 | |
| 107 | #define HASHTABLE_TRAVERSEcxx . . $ `src/common/hashtable.h:107:9`!(hashtable,curr) for (curr=hashtable_get_first(hashtable); curr; curr=entry_get_next(curr)) |
| 108 | #define HASHTABLE_TRAVERSE_MATCHINGcxx . . $ `src/common/hashtable.h:108:9`!(hashtable,curr,hash) for (curr=hashtable_get_first_matching(hashtable,hash); curr; curr=entry_get_next_matching(curr)) |
| 109 | |
| 110 | } |
| 111 | |
| 112 | #endif |
| 113 | #endif |