1 /********************************************************************/
2 /*                                                                  */
3 /*  hsh_rtl.h     Primitive actions for the hash map type.          */
4 /*  Copyright (C) 1989 - 2009  Thomas Mertes                        */
5 /*                                                                  */
6 /*  This file is part of the Seed7 Runtime Library.                 */
7 /*                                                                  */
8 /*  The Seed7 Runtime Library is free software; you can             */
9 /*  redistribute it and/or modify it under the terms of the GNU     */
10 /*  Lesser General Public License as published by the Free Software */
11 /*  Foundation; either version 2.1 of the License, or (at your      */
12 /*  option) any later version.                                      */
13 /*                                                                  */
14 /*  The Seed7 Runtime Library is distributed in the hope that it    */
15 /*  will be useful, but WITHOUT ANY WARRANTY; without even the      */
16 /*  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */
17 /*  PURPOSE.  See the GNU Lesser General Public License for more    */
18 /*  details.                                                        */
19 /*                                                                  */
20 /*  You should have received a copy of the GNU Lesser General       */
21 /*  Public License along with this program; if not, write to the    */
22 /*  Free Software Foundation, Inc., 51 Franklin Street,             */
23 /*  Fifth Floor, Boston, MA  02110-1301, USA.                       */
24 /*                                                                  */
25 /*  Module: Seed7 Runtime Library                                   */
26 /*  File: seed7/src/hsh_rtl.h                                       */
27 /*  Changes: 2007  Thomas Mertes                                    */
28 /*  Content: Primitive actions for the hash map type.               */
29 /*                                                                  */
30 /********************************************************************/
31 
32 boolType hshContains (const const_rtlHashType hash1,
33                       const genericType key, intType hashcode,
34                       compareType cmp_func);
35 void hshCpy (rtlHashType *const dest, const const_rtlHashType source,
36              const createFuncType key_create_func, const destrFuncType key_destr_func,
37              const createFuncType data_create_func, const destrFuncType data_destr_func);
38 rtlHashType hshCreate (const const_rtlHashType source,
39                        const createFuncType key_create_func,
40                        const destrFuncType key_destr_func,
41                        const createFuncType data_create_func,
42                        const destrFuncType data_destr_func);
43 void hshDestr (const const_rtlHashType old_hash,
44                const destrFuncType key_destr_func, const destrFuncType data_destr_func);
45 rtlHashType hshEmpty (void);
46 void hshExcl (const rtlHashType hash1, const genericType key,
47               intType hashcode, compareType cmp_func,
48               const destrFuncType key_destr_func, const destrFuncType data_destr_func);
49 genericType hshIdx (const const_rtlHashType hash1,
50                        const genericType key, intType hashcode,
51                        compareType cmp_func);
52 rtlObjectType *hshIdxAddr (const const_rtlHashType hash1,
53                            const genericType key,
54                            intType hashcode, compareType cmp_func);
55 rtlObjectType *hshIdxAddr2 (const const_rtlHashType aHashMap,
56                             const genericType aKey,
57                             intType hashcode, compareType cmp_func);
58 genericType hshIdxEnterDefault (const rtlHashType hash1,
59                                 const genericType key,
60                                 const genericType data,
61                                 intType hashcode);
62 genericType hshIdxWithDefault (const const_rtlHashType hash1,
63                                const genericType key,
64                                const genericType defaultData,
65                                intType hashcode, compareType cmp_func);
66 genericType hshIdxDefault0 (const const_rtlHashType aHashMap,
67                             const genericType aKey,
68                             intType hashcode, compareType cmp_func);
69 void hshIncl (const rtlHashType hash1, const genericType key,
70               const genericType data, intType hashcode,
71               compareType cmp_func, const createFuncType key_create_func,
72               const createFuncType data_create_func,
73               const copyFuncType data_copy_func);
74 rtlArrayType hshKeys (const const_rtlHashType hash1,
75                       const createFuncType key_create_func,
76                       const destrFuncType key_destr_func);
77 const_rtlHashElemType hshRand (const const_rtlHashType aHashMap);
78 genericType hshUpdate (const rtlHashType aHashMap, const genericType aKey,
79                        const genericType data, intType hashcode,
80                        compareType cmp_func, const createFuncType key_create_func,
81                        const createFuncType data_create_func);
82 rtlArrayType hshValues (const const_rtlHashType hash1,
83                         const createFuncType value_create_func,
84                         const destrFuncType value_destr_func);
85