Quentin Garnier | 5 Mar 2008 08:30

prop_dictionary_make_immutable

Any reason why that one isn't implemented?  It is in the man page and in
the include, but not in the actual code.

It should be simple enough though:

Index: common/lib/libprop/prop_dictionary.c
===================================================================
RCS file: /cvs/repository/src/common/lib/libprop/prop_dictionary.c,v
retrieving revision 1.20
diff -u -r1.20 prop_dictionary.c
--- common/lib/libprop/prop_dictionary.c	30 Aug 2007 12:23:54 -0000	1.20
+++ common/lib/libprop/prop_dictionary.c	1 Mar 2008 23:49:32 -0000
 <at>  <at>  -696,6 +696,20  <at>  <at> 
 }

 /*
+ * prop_dictionary_make_immutable --
+ *	Set the immutable flag on that dictionary.
+ */
+void
+prop_dictionary_make_immutable(prop_dictionary_t pd)
+{
+
+	_PROP_RWLOCK_WRLOCK(pd->pd_rwlock);
+	if (prop_dictionary_is_immutable(pd) == false)
+		pd->pd_flags |= PD_F_IMMUTABLE;
+	_PROP_RWLOCK_UNLOCK(pd->pd_rwlock);
+}
+
+/*
  * prop_dictionary_count --
  *	Return the number of objects stored in the dictionary.
  */

--

-- 
Quentin Garnier - cube <at> cubidou.net - cube <at> NetBSD.org
"See the look on my face from staying too long in one place
[...] every time the morning breaks I know I'm closer to falling"
KT Tunstall, Saving My Face, Drastic Fantastic, 2007.

Gmane