FreeBASIC  0.91.0
hash.bi
Go to the documentation of this file.
1 #ifndef __HASH_BI__
2 #define __HASH_BI__
3 
4 #include once "list.bi"
5 
6 type HASHITEM
7  name as const zstring ptr '' shared
8  data as any ptr '' user data
9  prev as HASHITEM ptr
10  next as HASHITEM ptr
11 end type
12 
13 type HASHLIST
14  head as HASHITEM ptr
15  tail as HASHITEM ptr
16 end type
17 
18 type THASH
19  list as HASHLIST ptr
20  nodes as integer
21  delstr as integer
22 end type
23 
24 declare sub hashInit _
25  ( _
26  byval hash as THASH ptr, _
27  byval nodes as integer, _
28  byval delstr as integer = FALSE _
29  )
30 
31 declare sub hashEnd(byval hash as THASH ptr)
32 
33 declare function hashHash _
34  ( _
35  byval symbol as const zstring ptr _
36  ) as uinteger
37 
38 declare function hashLookup _
39  ( _
40  byval hash as THASH ptr, _
41  byval symbol as zstring ptr _
42  ) as any ptr
43 
44 declare function hashLookupEx _
45  ( _
46  byval hash as THASH ptr, _
47  byval symbol as const zstring ptr, _
48  byval index as uinteger _
49  ) as any ptr
50 
51 declare function hashAdd _
52  ( _
53  byval hash as THASH ptr, _
54  byval symbol as const zstring ptr, _
55  byval userdata as any ptr, _
56  byval index as uinteger _
57  ) as HASHITEM ptr
58 
59 declare sub hashDel _
60  ( _
61  byval hash as THASH ptr, _
62  byval item as HASHITEM ptr, _
63  byval index as uinteger _
64  )
65 
66 type TSTRSETITEM
67  as string s
68  as integer userdata
69 end type
70 
71 type TSTRSET
72  as TLIST list
73  as THASH hash
74 end type
75 
76 declare sub strsetAdd _
77  ( _
78  byval set as TSTRSET ptr, _
79  byref s as const string, _
80  byval userdata as integer _
81  )
82 declare sub strsetCopy(byval target as TSTRSET ptr, byval source as TSTRSET ptr)
83 declare sub strsetInit(byval set as TSTRSET ptr, byval nodes as integer)
84 declare sub strsetEnd(byval set as TSTRSET ptr)
85 
86 #endif '' __HASH_BI__
87