/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: 2014-11-24 17:37:05 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20141124173705-iu97keoxp0qfxlxm
* Made code compile

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include "baseobject.h"
40
40
#include "Func.h"
41
41
#include "defs.h"
42
 
#include "utils"
 
42
#include "utils.h"
43
43
#include <stdbool.h>
44
44
 
 
45
BEGIN_DECLS
 
46
 
45
47
/** @brief
46
48
 * SMapItem holds the mapping of a key to a value.
47
49
 */
76
78
 * Data structure representing an SMap
77
79
 */
78
80
struct _SMap {
79
 
  SBaseObjectInstance parent; /**< The parent instance */
 
81
  SMapClass * klass;
80
82
  SMapPrivate * priv; /**< Private data pointer */
81
83
};
82
84
 
83
85
struct _SMapClass {
84
 
  SBaseObjectClass parentclass;
85
86
  CompFunc is_equal; /** method to check if items are equal. */
86
 
  MethodFunc free_key;
87
 
  MethodFunc free_value;
 
87
  FuncPointer free_key;
 
88
  FuncPointer free_value;
88
89
};
89
90
 
90
91
/* -------------------------------
109
110
 * @param free_key The function to be used to free the key.
110
111
 * @param free_value The function to be used to free the value.
111
112
 */
112
 
void s_map_item_free (SMapItem * self, MethodFunc free_key,
113
 
                                       MethodFunc free_value);
 
113
void s_map_item_free (SMapItem * self, FuncPointer free_key,
 
114
                                       FuncPointer free_value);
114
115
 
115
116
/* -------------------------------
116
117
 * The SMap functions.
130
131
 * Check if free_key and/or free_value is null and set them to something
131
132
 * appropriate.
132
133
 */
133
 
SMap * s_map_new ( CompFunc comp_func, MethodFunc free_key,
134
 
                                       MethodFunc free_value);
 
134
SMap * s_map_new ( CompFunc comp_func, FuncPointer free_key,
 
135
                                       FuncPointer free_value);
135
136
 
136
137
/** @breif
137
138
 * This function frees an instance of an SMap.
165
166
 */
166
167
void  s_map_remove (SMap * self, void * key);
167
168
 
 
169
/**
 
170
 *
 
171
 */
 
172
int s_map_ref (SMap * self);
 
173
 
 
174
/**
 
175
 *
 
176
 */
 
177
int s_map_unref (SMap * self);
 
178
 
 
179
END_DECLS
 
180
 
168
181
#endif