/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: 2013-09-09 16:55:42 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20130909165542-24h1f5kylq4qh5r2
* Think I am 70% done with SMap now...
  still needs a lot of testing...

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
struct _SMapClass {
77
77
  SBaseObjectClass parentclass;
78
78
  CompFunc is_equal; /** method to check if items are equal. */
 
79
  MethodFunc free_key;
 
80
  MethodFunc free_value;
79
81
};
80
82
 
81
83
/* -------------------------------
88
90
 *
89
91
 * @param key The key to be added to the item.
90
92
 * @param value The value to be added to the item.
 
93
 * @param free_key The function to be used to free the key.
 
94
 * @param free_value The function to be used to free the value.
91
95
 */
92
96
SMapItem * s_map_item_new (void * key, void * value);
93
97
 
109
113
 * @param comp_func tells the SMap object if the key already exists when
110
114
 * adding key/value pares or when searching after a key when retrieving a value.
111
115
 *
112
 
 * A the @c CompFunc returns true if the first and second parameters are equal,
 
116
 * The @c CompFunc returns true if the first and second parameters are equal,
113
117
 * otherwise false.
 
118
 *
 
119
 * @TODO:
 
120
 * Check if free_key and/or free_value is null and set them to something
 
121
 * appropriate.
114
122
 */
115
 
SMap * s_map_new ( CompFunc comp_func );
 
123
SMap * s_map_new ( CompFunc comp_func, MethodFunc free_key,
 
124
                                       MethodFunc free_value);
116
125
 
117
126
/** @breif
118
127
 * This function frees an instance of an SMap.