1
- /* $NetBSD: prop_dictionary.c,v 1.39 2013/10/18 18:26:20 martin Exp $ */
1
+ /* $NetBSD: prop_dictionary.c,v 1.41 2016/06/28 05:21:15 pgoyette Exp $ */
2
2
3
3
/*-
4
4
* Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
33
33
#include <prop/prop_array.h>
34
34
#include <prop/prop_dictionary.h>
35
35
#include <prop/prop_string.h>
36
- #include "prop_rb_impl.h"
36
+
37
+ #include <sys/rbtree.h>
37
38
38
39
#if !defined(_KERNEL ) && !defined(_STANDALONE )
39
40
#include <errno.h>
@@ -210,7 +211,7 @@ _prop_dict_init(void)
210
211
{
211
212
212
213
_PROP_MUTEX_INIT (_prop_dict_keysym_tree_mutex );
213
- _prop_rb_tree_init (& _prop_dict_keysym_tree ,
214
+ rb_tree_init (& _prop_dict_keysym_tree ,
214
215
& _prop_dict_keysym_rb_tree_ops );
215
216
return 0 ;
216
217
}
@@ -235,7 +236,7 @@ _prop_dict_keysym_free(prop_stack_t stack, prop_object_t *obj)
235
236
{
236
237
prop_dictionary_keysym_t pdk = * obj ;
237
238
238
- _prop_rb_tree_remove_node (& _prop_dict_keysym_tree , pdk );
239
+ rb_tree_remove_node (& _prop_dict_keysym_tree , pdk );
239
240
_prop_dict_keysym_put (pdk );
240
241
241
242
return _PROP_OBJECT_FREE_DONE ;
@@ -292,7 +293,7 @@ _prop_dict_keysym_alloc(const char *key)
292
293
* we just retain it and return it.
293
294
*/
294
295
_PROP_MUTEX_LOCK (_prop_dict_keysym_tree_mutex );
295
- opdk = _prop_rb_tree_find (& _prop_dict_keysym_tree , key );
296
+ opdk = rb_tree_find_node (& _prop_dict_keysym_tree , key );
296
297
if (opdk != NULL ) {
297
298
prop_object_retain (opdk );
298
299
_PROP_MUTEX_UNLOCK (_prop_dict_keysym_tree_mutex );
@@ -328,14 +329,14 @@ _prop_dict_keysym_alloc(const char *key)
328
329
* we have to check again if it is in the tree.
329
330
*/
330
331
_PROP_MUTEX_LOCK (_prop_dict_keysym_tree_mutex );
331
- opdk = _prop_rb_tree_find (& _prop_dict_keysym_tree , key );
332
+ opdk = rb_tree_find_node (& _prop_dict_keysym_tree , key );
332
333
if (opdk != NULL ) {
333
334
prop_object_retain (opdk );
334
335
_PROP_MUTEX_UNLOCK (_prop_dict_keysym_tree_mutex );
335
336
_prop_dict_keysym_put (pdk );
336
337
return (opdk );
337
338
}
338
- rpdk = _prop_rb_tree_insert_node (& _prop_dict_keysym_tree , pdk );
339
+ rpdk = rb_tree_insert_node (& _prop_dict_keysym_tree , pdk );
339
340
_PROP_ASSERT (rpdk == pdk );
340
341
_PROP_MUTEX_UNLOCK (_prop_dict_keysym_tree_mutex );
341
342
return (rpdk );
0 commit comments