/[ascend]/trunk/base/generic/general/hashpjw.h
ViewVC logotype

Contents of /trunk/base/generic/general/hashpjw.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 59 - (show annotations) (download) (as text)
Sun Oct 30 01:38:20 2005 UTC (18 years, 7 months ago) by jds
File MIME type: text/x-chdr
File size: 1597 byte(s)
- prototype unit test suite based on CUnit added.
- unit tests for base/generic/general and base/generic/utilites added.
- 2nd manual rework of doxygen documentation in general and utilities.
- bug fixes (mostly general & utilities) found during test development.
- added asc_assert prototype to redirect failures to Asc_Panic() and enable decoupling assertions from NDEBUG.
- some modifications of interface & implementation to facilitate testing.
- utilities/ascPrint & utilities/ascMalloc functions now always included in base libs to minimize recompilation when an interface chooses different options.
1 /*
2 * Hash function
3 * by Tom Epperly
4 * 10/24/89
5 * Version: $Revision: 1.1 $
6 * Version control file: $RCSfile: hashpjw.h,v $
7 * Date last modified: $Date: 1997/07/18 11:38:39 $
8 * Last modified by: $Author: mthomas $
9 */
10
11 /** @file
12 * Hash function.
13 * <pre>
14 * When #including hashpjw.h, make sure these files are #included first:
15 * #include "utilities/ascConfig.h"
16 * </pre>
17 */
18
19 #ifndef __hashpjw_h_seen__
20 #define __hashpjw_h_seen__
21
22 extern unsigned long hashpjw(CONST char *str, unsigned long size);
23 /**<
24 * Return a hash value base on str. The value will be >= 0 and < size.
25 * The specified string may not be NULL, and size must be greater than 0
26 * (checked by assertion).
27 *
28 * @param str String to use as base for hash (non-NULL).
29 * @param size Maximum value for hash (0 <= hash < size).
30 * @return Returns the hash value.
31 */
32
33 extern unsigned long hashpjw_int(int id, unsigned long size);
34 /**<
35 * Return a hash value base on id. The value will be >= 0 and < size.
36 * The requested size must be greater than 0 (checked by assertion).
37 * This function at the moment does a conversion of the integer to a string
38 * and so is relatively expensive. This needs to be cleaned up, with a
39 * dedicated integer hashing function.
40 *
41 * @param id Integer to use as base for hash.
42 * @param size Maximum value for hash (0 <= hash < size).
43 * @return Returns the hash value.
44 *
45 * @todo general/hashpjw.h - Provide integer hashing function (or
46 * possibly remove function as hashpjw_int is not used in ASCEND).
47 */
48
49 #endif /* __hashpjw_h_seen__ */
50

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22