/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to src/Map.h

  • Committer: Gustav Hartvigsson
  • Date: 2015-06-18 19:01:54 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20150618190154-nd5ucxkx4b1ww5xh
* Finnished up s_map_add () ???

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include "Func.h"
27
27
#include "defs.h"
28
28
#include "utils.h"
 
29
#include "hash.h"
 
30
#include "DynamicArray.h"
29
31
 
30
32
BEGIN_DECLS
31
33
 
84
86
 * Data structure representing an SMap
85
87
 */
86
88
struct SMap {
 
89
  SMapClass * klass;
87
90
  SMapPrivate * priv; /**< Private data pointer */
88
91
};
89
92
 
90
93
struct SMapClass {
91
94
  CompFunc is_equal; /** method to check if items are equal. */
 
95
  HashFunc key_hash_func;
92
96
  FuncPointer free_key;
93
97
  FuncPointer free_value;
94
98
};
134
138
 * Check if free_key and/or free_value is null and set them to something
135
139
 * appropriate.
136
140
 */
137
 
SMap * s_map_new ( CompFunc comp_func, FuncPointer free_key,
138
 
                                       FuncPointer free_value);
 
141
SMap * s_map_new (CompFunc comp_func,
 
142
                  HashFunc key_hash_func,
 
143
                  FuncPointer free_key,
 
144
                  FuncPointer free_value);
139
145
 
140
146
/** @breif
141
147
 * This function frees an instance of an SMap.
153
159
 * @todo
154
160
 *  make it return false on failure, or some other nastiness.
155
161
 */
156
 
void s_map_add (SMap * self ,void * key, void * value);
 
162
void s_map_add (SMap * self, spointer key, spointer value);
157
163
 
158
164
/** @breif
159
165
 * Get a value using using a key.