3 * This file is part of Maemo Mapper.
5 * Maemo Mapper is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * Maemo Mapper is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with Maemo Mapper. If not, see <http://www.gnu.org/licenses/>.
19 * Parts of this code have been ported from Xastir by Rob Williams (10 Aug 2008):
21 * * XASTIR, Amateur Station Tracking and Information Reporting
22 * Copyright (C) 1999,2000 Frank Giannandrea
23 * Copyright (C) 2000-2007 The Xastir Group
24 * Copyright (C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk>
34 #ifndef __HASHTABLE_PRIVATE_CWC22_H__
35 #define __HASHTABLE_PRIVATE_CWC22_H__
37 #include "hashtable.h"
40 /*****************************************************************************/
49 unsigned int tablelength;
51 unsigned int entrycount;
52 unsigned int loadlimit;
53 unsigned int primeindex;
54 unsigned int (*hashfn) (void *k);
55 int (*eqfn) (void *k1, void *k2);
58 /*****************************************************************************/
60 hash(struct hashtable *h, void *k);
62 /*****************************************************************************/
64 static inline unsigned int
65 indexFor(unsigned int tablelength, unsigned int hashvalue) {
66 return (hashvalue % tablelength);
69 /* Only works if tablelength == 2^N */
70 /*static inline unsigned int
71 indexFor(unsigned int tablelength, unsigned int hashvalue)
73 return (hashvalue & (tablelength - 1u));
77 /*****************************************************************************/
78 #define freekey(X) free(X)
79 /*define freekey(X) ; */
82 /*****************************************************************************/
84 #endif /* __HASHTABLE_PRIVATE_CWC22_H__*/
87 #endif // INCLUDE_APRS
90 * Copyright (C) 2002 Christopher Clark <firstname.lastname@cl.cam.ac.uk>
92 * Permission is hereby granted, free of charge, to any person obtaining a copy
93 * of this software and associated documentation files (the "Software"), to
94 * deal in the Software without restriction, including without limitation the
95 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
96 * sell copies of the Software, and to permit persons to whom the Software is
97 * furnished to do so, subject to the following conditions:
99 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
100 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
101 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
102 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
103 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
104 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.