| http://www.sim.no/ http://www.coin3d.org/

hash.h
1 #ifndef CC_HASH_H
2 #define CC_HASH_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 /* This interface is OBSOLETE -- please do not use it in your
28 application code, as it will be removed from Coin 3 and onwards. */
29
30 #include <stdlib.h>
31 #include <Inventor/C/basic.h>
32
33 #if defined(COIN_INTERNAL) && !defined(COIN_ALLOW_CC_HASH)
34 #error prefer cc_dict over cc_hash for internal code
35 #endif /* COIN_INTERNAL */
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40
41 typedef uintptr_t cc_hash_key;
42 typedef struct cc_hash cc_hash;
43 typedef cc_hash_key cc_hash_func(const cc_hash_key key);
44 typedef void cc_hash_apply_func(cc_hash_key key, void * val, void * closure);
45
46 COIN_DLL_API cc_hash * cc_hash_construct(unsigned int size, float loadfactor);
47 COIN_DLL_API void cc_hash_destruct(cc_hash * ht);
48 COIN_DLL_API void cc_hash_clear(cc_hash * ht);
49
50 COIN_DLL_API SbBool cc_hash_put(cc_hash * ht, cc_hash_key key, void * val);
51 COIN_DLL_API SbBool cc_hash_get(cc_hash * ht, cc_hash_key key, void ** val);
52 COIN_DLL_API SbBool cc_hash_remove(cc_hash * ht, cc_hash_key key);
53 COIN_DLL_API void cc_hash_apply(cc_hash * ht, cc_hash_apply_func * func, void * closure);
54
55 COIN_DLL_API unsigned int cc_hash_get_num_elements(cc_hash * ht);
56
57 COIN_DLL_API void cc_hash_set_hash_func(cc_hash * ht, cc_hash_func * func);
58 COIN_DLL_API void cc_hash_print_stat(cc_hash * ht);
59
60 /* ********************************************************************** */
61
62 #ifdef __cplusplus
63 } /* extern "C" */
64 #endif /* __cplusplus */
65
66 #endif /* ! CC_HASH_H */

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.