Update for proplib(3) API changes.

This commit is contained in:
thorpej 2020-06-07 05:54:00 +00:00
parent d147ce2226
commit abcb66ec85
12 changed files with 81 additions and 85 deletions

@ -207,7 +207,7 @@ libdm_task_create(const char *command)
return NULL;
}
if ((prop_dictionary_set_cstring(task->ldm_task, DM_IOCTL_COMMAND,
if ((prop_dictionary_set_string(task->ldm_task, DM_IOCTL_COMMAND,
command)) == false) {
prop_object_release(task->ldm_task);
free(task);
@ -253,7 +253,7 @@ int
libdm_task_set_name(const char *name, libdm_task_t libdm_task)
{
if ((prop_dictionary_set_cstring(libdm_task->ldm_task,
if ((prop_dictionary_set_string(libdm_task->ldm_task,
DM_IOCTL_NAME, name)) == false)
return ENOENT;
@ -278,7 +278,7 @@ int
libdm_task_set_uuid(const char *uuid, libdm_task_t libdm_task)
{
if ((prop_dictionary_set_cstring(libdm_task->ldm_task,
if ((prop_dictionary_set_string(libdm_task->ldm_task,
DM_IOCTL_UUID, uuid)) == false)
return ENOENT;
@ -657,7 +657,7 @@ libdm_cmd_get_deps(libdm_iter_t libdm_iter)
uint64_t deps;
obj = prop_object_iterator_next(libdm_iter->ldm_obji);
deps = prop_number_unsigned_integer_value(obj);
deps = prop_number_unsigned_value(obj);
if (obj != NULL)
prop_object_release(obj);
@ -747,7 +747,7 @@ libdm_table_set_target(const char *name, libdm_table_t libdm_table)
if (libdm_table == NULL)
return ENOENT;
return prop_dictionary_set_cstring(libdm_table->ldm_tbl, DM_TABLE_TYPE, name);
return prop_dictionary_set_string(libdm_table->ldm_tbl, DM_TABLE_TYPE, name);
}
char *
@ -769,7 +769,7 @@ libdm_table_set_params(const char *params, libdm_table_t libdm_table)
if (libdm_table == NULL)
return ENOENT;
return prop_dictionary_set_cstring(libdm_table->ldm_tbl,
return prop_dictionary_set_string(libdm_table->ldm_tbl,
DM_TABLE_PARAMS, params);
}
@ -885,5 +885,5 @@ libdm_dev_set_newname(const char *newname, libdm_cmd_t libdm_cmd)
if (newname == NULL)
return ENOENT;
return prop_array_set_cstring(libdm_cmd->ldm_cmd, 0, newname);
return prop_array_set_string(libdm_cmd->ldm_cmd, 0, newname);
}

@ -1,4 +1,4 @@
/* $NetBSD: af_atalk.c,v 1.20 2019/08/16 10:33:17 msaitoh Exp $ */
/* $NetBSD: af_atalk.c,v 1.21 2020/06/07 06:02:58 thorpej Exp $ */
/*
* Copyright (c) 1983, 1993
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: af_atalk.c,v 1.20 2019/08/16 10:33:17 msaitoh Exp $");
__RCSID("$NetBSD: af_atalk.c,v 1.21 2020/06/07 06:02:58 thorpej Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -138,7 +138,13 @@ at_commit_address(prop_dictionary_t env, prop_dictionary_t oenv)
if ((d0 = (prop_data_t)prop_dictionary_get(env, "address")) == NULL)
return;
addr = prop_data_data(d0);
addr = malloc(prop_data_size(d0));
if (addr == NULL)
return;
if (!prop_data_copy_value(d0, addr, prop_data_size(d0))) {
free(addr);
return;
}
sat = (struct sockaddr_at *)&addr->pfx_addr;
@ -154,11 +160,13 @@ at_commit_address(prop_dictionary_t env, prop_dictionary_t oenv)
/* Copy the new address to a temporary input environment */
d = prop_data_create_data_nocopy(addr, paddr_prefix_size(addr));
d = prop_data_create_copy(addr, paddr_prefix_size(addr));
free(addr);
ienv = prop_dictionary_copy_mutable(env);
if (d == NULL)
err(EXIT_FAILURE, "%s: prop_data_create_data", __func__);
err(EXIT_FAILURE, "%s: prop_data_create_copy", __func__);
if (ienv == NULL)
err(EXIT_FAILURE, "%s: prop_dictionary_copy_mutable", __func__);

@ -1,4 +1,4 @@
/* $NetBSD: af_inetany.c,v 1.18 2019/08/16 10:33:17 msaitoh Exp $ */
/* $NetBSD: af_inetany.c,v 1.19 2020/06/07 06:02:58 thorpej Exp $ */
/*-
* Copyright (c) 2008 David Young. All rights reserved.
@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: af_inetany.c,v 1.18 2019/08/16 10:33:17 msaitoh Exp $");
__RCSID("$NetBSD: af_inetany.c,v 1.19 2020/06/07 06:02:58 thorpej Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -87,7 +87,7 @@ commit_address(prop_dictionary_t env, prop_dictionary_t oenv,
strlcpy(param->name[1].buf, ifname, param->name[1].buflen);
if ((d = (prop_data_t)prop_dictionary_get(env, "address")) != NULL)
addr = prop_data_data_nocopy(d);
addr = prop_data_value(d);
else if (!prop_dictionary_get_bool(env, "alias", &alias) || alias ||
param->gifaddr.cmd == 0)
return;
@ -99,17 +99,17 @@ commit_address(prop_dictionary_t env, prop_dictionary_t oenv,
return;
if ((d = (prop_data_t)prop_dictionary_get(env, "dst")) != NULL)
dst = prop_data_data_nocopy(d);
dst = prop_data_value(d);
else
dst = NULL;
if ((d = (prop_data_t)prop_dictionary_get(env, "netmask")) != NULL)
mask = prop_data_data_nocopy(d);
mask = prop_data_value(d);
else
mask = NULL;
if ((d = (prop_data_t)prop_dictionary_get(env, "broadcast")) != NULL)
brd = prop_data_data_nocopy(d);
brd = prop_data_value(d);
else
brd = NULL;

@ -1,4 +1,4 @@
/* $NetBSD: carp.c,v 1.13 2009/09/11 23:22:28 dyoung Exp $ */
/* $NetBSD: carp.c,v 1.14 2020/06/07 06:02:58 thorpej Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: carp.c,v 1.13 2009/09/11 23:22:28 dyoung Exp $");
__RCSID("$NetBSD: carp.c,v 1.14 2020/06/07 06:02:58 thorpej Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -167,7 +167,7 @@ setcarp_passwd(prop_dictionary_t env, prop_dictionary_t oenv)
memset(carpr.carpr_key, 0, sizeof(carpr.carpr_key));
/* XXX Should hash the password into the key here, perhaps? */
strlcpy((char *)carpr.carpr_key, prop_data_data_nocopy(data),
strlcpy((char *)carpr.carpr_key, prop_data_value(data),
MIN(CARP_KEY_LEN, prop_data_size(data)));
carp_set(env, &carpr);
@ -267,7 +267,7 @@ setcarpdev(prop_dictionary_t env, prop_dictionary_t oenv)
carp_get(env, &carpr);
strlcpy(carpr.carpr_carpdev, prop_string_cstring_nocopy(s),
strlcpy(carpr.carpr_carpdev, prop_string_value(s),
sizeof(carpr.carpr_carpdev));
carp_set(env, &carpr);

@ -1,4 +1,4 @@
/* $NetBSD: env.c,v 1.12 2019/08/16 10:33:17 msaitoh Exp $ */
/* $NetBSD: env.c,v 1.13 2020/06/07 06:02:58 thorpej Exp $ */
/*-
* Copyright (c) 2008 David Young. All rights reserved.
@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: env.c,v 1.12 2019/08/16 10:33:17 msaitoh Exp $");
__RCSID("$NetBSD: env.c,v 1.13 2020/06/07 06:02:58 thorpej Exp $");
#endif /* not lint */
#include <errno.h>
@ -60,7 +60,7 @@ prop_dictionary_augment(prop_dictionary_t bottom, prop_dictionary_t top)
while (i != NULL && (ko = prop_object_iterator_next(i)) != NULL) {
k = (prop_dictionary_keysym_t)ko;
key = prop_dictionary_keysym_cstring_nocopy(k);
key = prop_dictionary_keysym_value(k);
o = prop_dictionary_get_keysym(top, k);
if (o == NULL || !prop_dictionary_set(d, key, o)) {
prop_object_release((prop_object_t)d);
@ -141,7 +141,7 @@ getargdata(prop_dictionary_t env, const char *key, uint8_t *buf, size_t buflen)
errno = ENAMETOOLONG;
return -1;
}
memcpy(buf, prop_data_data_nocopy(data), datalen);
memcpy(buf, prop_data_value(data), datalen);
memset(buf + datalen, 0, buflen - datalen);
return datalen;
}
@ -162,7 +162,7 @@ getargstr(prop_dictionary_t env, const char *key, char *buf, size_t buflen)
errno = ENAMETOOLONG;
return -1;
}
memcpy(buf, prop_data_data_nocopy(data), datalen);
memcpy(buf, prop_data_value(data), datalen);
memset(buf + datalen, 0, buflen - datalen);
return datalen;
}

@ -1,4 +1,4 @@
/* $NetBSD: ether.c,v 1.8 2020/01/02 23:02:19 ryo Exp $ */
/* $NetBSD: ether.c,v 1.9 2020/06/07 06:02:58 thorpej Exp $ */
/*
* Copyright (c) 1983, 1993
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: ether.c,v 1.8 2020/01/02 23:02:19 ryo Exp $");
__RCSID("$NetBSD: ether.c,v 1.9 2020/06/07 06:02:58 thorpej Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -85,7 +85,7 @@ do_setethercaps(prop_dictionary_t env)
assert(sizeof(eccr) == prop_data_size(d));
memcpy(&eccr, prop_data_data_nocopy(d), sizeof(eccr));
memcpy(&eccr, prop_data_value(d), sizeof(eccr));
if (direct_ioctl(env, SIOCSETHERCAP, &eccr) == -1)
err(EXIT_FAILURE, "SIOCSETHERCAP");
}
@ -102,7 +102,7 @@ getethercaps(prop_dictionary_t env, prop_dictionary_t oenv,
capdata = (prop_data_t)prop_dictionary_get(env, "ethercaps");
if (capdata != NULL) {
tmpeccr = prop_data_data_nocopy(capdata);
tmpeccr = prop_data_value(capdata);
*oeccr = *tmpeccr;
return 0;
}
@ -110,7 +110,7 @@ getethercaps(prop_dictionary_t env, prop_dictionary_t oenv,
(void)direct_ioctl(env, SIOCGETHERCAP, &eccr);
*oeccr = eccr;
capdata = prop_data_create_data(&eccr, sizeof(eccr));
capdata = prop_data_create_copy(&eccr, sizeof(eccr));
rc = prop_dictionary_set(oenv, "ethercaps", capdata);
@ -139,7 +139,7 @@ setethercaps(prop_dictionary_t env, prop_dictionary_t oenv)
} else
eccr.eccr_capenable |= ethercap;
if ((capdata = prop_data_create_data(&eccr, sizeof(eccr))) == NULL)
if ((capdata = prop_data_create_copy(&eccr, sizeof(eccr))) == NULL)
return -1;
rc = prop_dictionary_set(oenv, "ethercaps", capdata);

@ -1,4 +1,4 @@
/* $NetBSD: ifconfig.c,v 1.241 2020/01/02 23:02:19 ryo Exp $ */
/* $NetBSD: ifconfig.c,v 1.242 2020/06/07 06:02:58 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@ -63,7 +63,7 @@
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1983, 1993\
The Regents of the University of California. All rights reserved.");
__RCSID("$NetBSD: ifconfig.c,v 1.241 2020/01/02 23:02:19 ryo Exp $");
__RCSID("$NetBSD: ifconfig.c,v 1.242 2020/06/07 06:02:58 thorpej Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -614,7 +614,7 @@ do_setifcaps(prop_dictionary_t env)
assert(sizeof(ifcr) == prop_data_size(d));
memcpy(&ifcr, prop_data_data_nocopy(d), sizeof(ifcr));
memcpy(&ifcr, prop_data_value(d), sizeof(ifcr));
if (direct_ioctl(env, SIOCSIFCAP, &ifcr) == -1)
err(EXIT_FAILURE, "SIOCSIFCAP");
}
@ -884,7 +884,7 @@ printall(const char *ifname, prop_dictionary_t env0)
sdl = ifa->ifa_addr;
if (p && strcmp(p, ifa->ifa_name) == 0)
continue;
if (!prop_dictionary_set_cstring(env, "if", ifa->ifa_name))
if (!prop_dictionary_set_string(env, "if", ifa->ifa_name))
continue;
p = ifa->ifa_name;
@ -990,7 +990,7 @@ setifaddr(prop_dictionary_t env, prop_dictionary_t oenv)
d = (prop_data_t)prop_dictionary_get(env, "address");
assert(d != NULL);
pfx0 = prop_data_data_nocopy(d);
pfx0 = prop_data_value(d);
if (pfx0->pfx_len >= 0) {
pfx = prefixlen_to_mask(af, pfx0->pfx_len);
@ -1107,7 +1107,7 @@ getifcaps(prop_dictionary_t env, prop_dictionary_t oenv, struct ifcapreq *oifcr)
capdata = (prop_data_t)prop_dictionary_get(env, "ifcaps");
if (capdata != NULL) {
tmpifcr = prop_data_data_nocopy(capdata);
tmpifcr = prop_data_value(capdata);
*oifcr = *tmpifcr;
return 0;
}
@ -1115,7 +1115,7 @@ getifcaps(prop_dictionary_t env, prop_dictionary_t oenv, struct ifcapreq *oifcr)
(void)direct_ioctl(env, SIOCGIFCAP, &ifcr);
*oifcr = ifcr;
capdata = prop_data_create_data(&ifcr, sizeof(ifcr));
capdata = prop_data_create_copy(&ifcr, sizeof(ifcr));
rc = prop_dictionary_set(oenv, "ifcaps", capdata);
@ -1144,7 +1144,7 @@ setifcaps(prop_dictionary_t env, prop_dictionary_t oenv)
} else
ifcr.ifcr_capenable |= ifcap;
if ((capdata = prop_data_create_data(&ifcr, sizeof(ifcr))) == NULL)
if ((capdata = prop_data_create_copy(&ifcr, sizeof(ifcr))) == NULL)
return -1;
rc = prop_dictionary_set(oenv, "ifcaps", capdata);
@ -1185,7 +1185,7 @@ do_setifpreference(prop_dictionary_t env)
d = (prop_data_t)prop_dictionary_get(env, "address");
assert(d != NULL);
pfx = prop_data_data_nocopy(d);
pfx = prop_data_value(d);
memcpy(&ifap.ifap_addr, &pfx->pfx_addr,
MIN(sizeof(ifap.ifap_addr), pfx->pfx_addr.sa_len));
@ -1422,9 +1422,9 @@ setifprefixlen(prop_dictionary_t env, prop_dictionary_t oenv)
if (pfx == NULL)
err(EXIT_FAILURE, "prefixlen_to_mask");
d = prop_data_create_data(pfx, paddr_prefix_size(pfx));
d = prop_data_create_copy(pfx, paddr_prefix_size(pfx));
if (d == NULL)
err(EXIT_FAILURE, "%s: prop_data_create_data", __func__);
err(EXIT_FAILURE, "%s: prop_data_create_copy", __func__);
if (!prop_dictionary_set(oenv, "netmask", (prop_object_t)d))
err(EXIT_FAILURE, "%s: prop_dictionary_set", __func__);

@ -1,6 +1,6 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: media.c,v 1.8 2019/04/22 10:44:55 msaitoh Exp $");
__RCSID("$NetBSD: media.c,v 1.9 2020/06/07 06:02:58 thorpej Exp $");
#endif /* not lint */
#include <assert.h>
@ -188,7 +188,7 @@ setmedia(prop_dictionary_t env, prop_dictionary_t oenv)
type = IFM_TYPE(media_current);
inst = IFM_INST(media_current);
val = strndup(prop_data_data_nocopy(data), prop_data_size(data));
val = strndup(prop_data_value(data), prop_data_size(data));
if (val == NULL)
return -1;
@ -219,7 +219,7 @@ setmediaopt(prop_dictionary_t env, prop_dictionary_t oenv)
/* Can only issue `mediaopt' once. */
/* Can't issue `mediaopt' if `instance' has already been issued. */
val = strndup(prop_data_data_nocopy(data), prop_data_size(data));
val = strndup(prop_data_value(data), prop_data_size(data));
if (val == NULL)
return -1;
@ -246,7 +246,7 @@ unsetmediaopt(prop_dictionary_t env, prop_dictionary_t oenv)
return -1;
}
val = strndup(prop_data_data_nocopy(data), prop_data_size(data));
val = strndup(prop_data_value(data), prop_data_size(data));
if (val == NULL)
return -1;
@ -306,7 +306,7 @@ setmediamode(prop_dictionary_t env, prop_dictionary_t oenv)
options = IFM_OPTIONS(media_current);
inst = IFM_INST(media_current);
val = strndup(prop_data_data_nocopy(data), prop_data_size(data));
val = strndup(prop_data_value(data), prop_data_size(data));
if (val == NULL)
return -1;

@ -1,4 +1,4 @@
/* $NetBSD: parse.c,v 1.19 2019/08/16 10:33:17 msaitoh Exp $ */
/* $NetBSD: parse.c,v 1.20 2020/06/07 06:02:58 thorpej Exp $ */
/*-
* Copyright (c) 2008 David Young. All rights reserved.
@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: parse.c,v 1.19 2019/08/16 10:33:17 msaitoh Exp $");
__RCSID("$NetBSD: parse.c,v 1.20 2020/06/07 06:02:58 thorpej Exp $");
#endif /* not lint */
#include <err.h>
@ -163,7 +163,7 @@ pstr_match(const struct parser *p, const struct match *im, struct match *om,
return -1;
}
o = (prop_object_t)prop_data_create_data(buf, len);
o = (prop_object_t)prop_data_create_copy(buf, len);
if (o == NULL) {
errno = ENOMEM;
@ -208,7 +208,7 @@ pinteger_match(const struct parser *p, const struct match *im, struct match *om,
return -1;
}
o = (prop_object_t)prop_number_create_integer(val);
o = (prop_object_t)prop_number_create_signed(val);
if (o == NULL) {
errno = ENOMEM;
@ -446,7 +446,7 @@ paddr_match(const struct parser *p, const struct match *im, struct match *om,
if (result != NULL)
freeaddrinfo(result);
o = (prop_object_t)prop_data_create_data(pfx, len);
o = (prop_object_t)prop_data_create_copy(pfx, len);
free(pfx);
@ -467,11 +467,11 @@ paddr_match(const struct parser *p, const struct match *im, struct match *om,
masklen = paddr_prefix_size(mask);
d = prop_data_create_data(mask, masklen);
d = prop_data_create_copy(mask, masklen);
free(mask);
if (d == NULL) {
err(EXIT_FAILURE, "%s: prop_data_create_data",
err(EXIT_FAILURE, "%s: prop_data_create_copy",
__func__);
return -1;
}
@ -527,7 +527,7 @@ piface_match(const struct parser *p, const struct match *im,
return -1;
}
if ((o = (prop_object_t)prop_string_create_cstring(arg)) == NULL) {
if ((o = (prop_object_t)prop_string_create_copy(arg)) == NULL) {
errno = ENOMEM;
return -1;
}
@ -666,13 +666,12 @@ pkw_match(const struct parser *p, const struct match *im,
goto err;
break;
case KW_T_INT:
o = (prop_object_t)prop_number_create_integer(u->u_sint);
o = (prop_object_t)prop_number_create_signed(u->u_sint);
if (o == NULL)
goto err;
break;
case KW_T_UINT:
o = (prop_object_t)prop_number_create_unsigned_integer(
u->u_uint);
o = (prop_object_t)prop_number_create_unsigned(u->u_uint);
if (o == NULL)
goto err;
break;
@ -680,7 +679,7 @@ pkw_match(const struct parser *p, const struct match *im,
o = u->u_obj;
break;
case KW_T_STR:
o = (prop_object_t)prop_string_create_cstring_nocopy(u->u_str);
o = (prop_object_t)prop_string_create_nocopy(u->u_str);
if (o == NULL)
goto err;
break;

@ -1,4 +1,4 @@
/* $NetBSD: pfsync.c,v 1.2 2019/08/16 10:33:17 msaitoh Exp $ */
/* $NetBSD: pfsync.c,v 1.3 2020/06/07 06:02:58 thorpej Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
* All rights reserved.
@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: pfsync.c,v 1.2 2019/08/16 10:33:17 msaitoh Exp $");
__RCSID("$NetBSD: pfsync.c,v 1.3 2020/06/07 06:02:58 thorpej Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -185,7 +185,7 @@ setpfsync_peer(prop_dictionary_t env, prop_dictionary_t oenv)
pfsync_get(env, &pfsyncr);
peerpfx = prop_data_data_nocopy(data);
peerpfx = prop_data_value(data);
if (peerpfx != NULL) {
// Only AF_INET is supported for now

@ -1,4 +1,4 @@
/* $NetBSD: tunnel.c,v 1.21 2019/08/16 10:33:17 msaitoh Exp $ */
/* $NetBSD: tunnel.c,v 1.22 2020/06/07 06:02:58 thorpej Exp $ */
/*
* Copyright (c) 1983, 1993
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: tunnel.c,v 1.21 2019/08/16 10:33:17 msaitoh Exp $");
__RCSID("$NetBSD: tunnel.c,v 1.22 2020/06/07 06:02:58 thorpej Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -98,8 +98,8 @@ settunnel(prop_dictionary_t env, prop_dictionary_t oenv)
return -1;
}
srcpfx = prop_data_data_nocopy(srcdata);
dstpfx = prop_data_data_nocopy(dstdata);
srcpfx = prop_data_value(srcdata);
dstpfx = prop_data_value(dstdata);
if (srcpfx->pfx_addr.sa_family != dstpfx->pfx_addr.sa_family)
errx(EXIT_FAILURE,

@ -1,4 +1,4 @@
/* $NetBSD: powerd.c,v 1.18 2013/02/09 01:16:39 christos Exp $ */
/* $NetBSD: powerd.c,v 1.19 2020/06/07 05:54:00 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -314,7 +314,6 @@ static void
dispatch_power_event_state_change(int fd, power_event_t *pev)
{
prop_dictionary_t dict;
prop_object_t obj;
const char *argv[6];
char *buf = NULL;
int error;
@ -333,21 +332,11 @@ dispatch_power_event_state_change(int fd, power_event_t *pev)
free(buf);
}
obj = prop_dictionary_get(dict, "powerd-script-name");
argv[0] = prop_string_cstring_nocopy(obj);
obj = prop_dictionary_get(dict, "driver-name");
argv[1] = prop_string_cstring_nocopy(obj);
obj = prop_dictionary_get(dict, "powerd-event-name");
argv[2] = prop_string_cstring_nocopy(obj);
obj = prop_dictionary_get(dict, "sensor-name");
argv[3] = prop_string_cstring_nocopy(obj);
obj = prop_dictionary_get(dict, "state-description");
argv[4] = prop_string_cstring_nocopy(obj);
prop_dictionary_get_string(dict, "powerd-script-name", &argv[0]);
prop_dictionary_get_string(dict, "driver-name", &argv[1]);
prop_dictionary_get_string(dict, "powerd-event-name", &argv[2]);
prop_dictionary_get_string(dict, "sensor-name", &argv[3]);
prop_dictionary_get_string(dict, "state-description", &argv[4]);
argv[5] = NULL;
run_script(argv);