Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Update for proplib(3) API changes.
details: https://anonhg.NetBSD.org/src/rev/989c1a0f9a5e
branches: trunk
changeset: 934096:989c1a0f9a5e
user: thorpej <thorpej%NetBSD.org@localhost>
date: Sat Jun 06 22:33:23 2020 +0000
description:
Update for proplib(3) API changes.
diffstat:
sbin/veriexecctl/veriexecctl.h | 10 +++++-----
usr.sbin/ofctl/ofctl.c | 18 ++++++++++--------
2 files changed, 15 insertions(+), 13 deletions(-)
diffs (96 lines):
diff -r 9e3a274fef80 -r 989c1a0f9a5e sbin/veriexecctl/veriexecctl.h
--- a/sbin/veriexecctl/veriexecctl.h Sat Jun 06 22:31:40 2020 +0000
+++ b/sbin/veriexecctl/veriexecctl.h Sat Jun 06 22:33:23 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: veriexecctl.h,v 1.11 2008/08/31 23:37:45 dholland Exp $ */
+/* $NetBSD: veriexecctl.h,v 1.12 2020/06/06 22:36:39 thorpej Exp $ */
/*-
* Copyright 2005 Elad Efrat <elad%NetBSD.org@localhost>
@@ -34,15 +34,15 @@
#define _VERIEXECCTL_H_
#define dict_sets(d, k, v) \
- prop_dictionary_set(d, k, prop_string_create_cstring(v))
+ prop_dictionary_set_string(d, k, v)
#define dict_gets(d, k) \
- prop_string_cstring_nocopy(prop_dictionary_get(d, k))
+ prop_string_value(prop_dictionary_get(d, k))
#define dict_setd(d, k, v, n) \
- prop_dictionary_set(d, k, prop_data_create_data(v, n))
+ prop_dictionary_set_data(d, k, v, n)
#define dict_getd(d, k) \
- prop_data_data_nocopy(prop_dictionary_get(d, k))
+ prop_data_value(prop_dictionary_get(d, k))
#endif /* _VERIEXECCTL_H_ */
diff -r 9e3a274fef80 -r 989c1a0f9a5e usr.sbin/ofctl/ofctl.c
--- a/usr.sbin/ofctl/ofctl.c Sat Jun 06 22:31:40 2020 +0000
+++ b/usr.sbin/ofctl/ofctl.c Sat Jun 06 22:33:23 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofctl.c,v 1.14 2018/05/28 12:42:45 wiz Exp $ */
+/* $NetBSD: ofctl.c,v 1.15 2020/06/06 22:33:23 thorpej Exp $ */
/*-
* Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 2006, 2007\
The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: ofctl.c,v 1.14 2018/05/28 12:42:45 wiz Exp $");
+__RCSID("$NetBSD: ofctl.c,v 1.15 2020/06/06 22:33:23 thorpej Exp $");
#endif /* not lint */
#include <stdio.h>
@@ -108,7 +108,7 @@
prop_data_t obj;
const char *name;
- name = prop_dictionary_keysym_cstring_nocopy(key);
+ name = prop_dictionary_keysym_value(key);
obj = prop_dictionary_get_keysym(propdict, key);
prop = malloc(sizeof(*prop) + strlen(name) + 1);
@@ -131,8 +131,10 @@
of_prop_count++;
prop->prop_length = prop_data_size(obj);
- if (prop->prop_length)
- prop->prop_data = prop_data_data(obj);
+ if (prop->prop_length) {
+ prop->prop_data = malloc(prop->prop_length);
+ prop_data_copy_value(obj, prop->prop_data, prop->prop_length);
+ }
}
static struct of_node *
@@ -163,7 +165,7 @@
prop_array_t children;
unsigned int i, count;
- node->of_nodeid = prop_number_unsigned_integer_value(
+ node->of_nodeid = prop_number_unsigned_value(
prop_dictionary_get(dict, "node"));
propdict = prop_dictionary_get(dict, "properties");
@@ -224,7 +226,7 @@
free(ofio.of_buf);
return NULL;
}
- obj = prop_data_create_data(ofio.of_buf, ofio.of_buflen);
+ obj = prop_data_create_copy(ofio.of_buf, ofio.of_buflen);
free(ofio.of_buf);
return obj;
}
@@ -249,7 +251,7 @@
dict = prop_dictionary_create();
prop_dictionary_set(dict, "node",
- prop_number_create_unsigned_integer(nodeid));
+ prop_number_create_unsigned(nodeid));
propdict = prop_dictionary_create();
for (;;) {
Home |
Main Index |
Thread Index |
Old Index