7179786 libadr rename impacts various modules in the userland consolidation
authorGary Pennington <gary.pennington@oracle.com>
Sat, 30 Jun 2012 06:30:16 -0700
changeset 901 19b502ccabc8
parent 900 63d3bf696d85
child 902 908943bbfdb9
7179786 libadr rename impacts various modules in the userland consolidation
components/visual-panels/core/src/cmd/rad/mod/files/mod_files.c
components/visual-panels/core/src/cmd/rad/mod/network/mod_network.c
components/visual-panels/core/src/cmd/rad/mod/panels/mod_panels.c
components/visual-panels/core/src/cmd/rad/mod/smf_old/mod_smf.c
components/visual-panels/examples/src/cmd/rad/mod/example-time2/example-time2.c
components/visual-panels/smf/src/cmd/rad/mod/smf/common.c
components/visual-panels/smf/src/cmd/rad/mod/smf/datatype.c
components/visual-panels/smf/src/cmd/rad/mod/smf/datatype.h
components/visual-panels/smf/src/cmd/rad/mod/smf/instance.c
components/visual-panels/smf/src/cmd/rad/mod/smf/mod_smf.c
components/visual-panels/smf/src/cmd/rad/mod/smf/service.c
components/visual-panels/smf/src/cmd/rad/mod/smf/smfutil.c
components/visual-panels/smf/src/cmd/rad/mod/smf/smfutil.h
components/visual-panels/time/src/cmd/rad/mod/time/mod_time.c
--- a/components/visual-panels/core/src/cmd/rad/mod/files/mod_files.c	Fri Jun 29 12:23:11 2012 -0700
+++ b/components/visual-panels/core/src/cmd/rad/mod/files/mod_files.c	Sat Jun 30 06:30:16 2012 -0700
@@ -50,28 +50,30 @@
 
 #include "api_file.h"
 
-static data_t *
-empty_file(data_t *data, const char *apath, const char *cpath)
+static adr_data_t *
+empty_file(adr_data_t *data, const char *apath, const char *cpath)
 {
-	struct_set(data, "absolutePath", data_new_string(apath, lt_copy));
-	struct_set(data, "canonicalPath", data_new_string(cpath, lt_copy));
-	struct_set(data, "canonical", data_new_boolean(B_TRUE));
-	struct_set(data, "baseName", data_new_string("", lt_copy));
-	struct_set(data, "exists", data_new_boolean(B_FALSE));
-	struct_set(data, "readable", data_new_boolean(B_FALSE));
-	struct_set(data, "writable", data_new_boolean(B_FALSE));
-	struct_set(data, "hidden", data_new_boolean(B_FALSE));
-	struct_set(data, "directory", data_new_boolean(B_FALSE));
-	struct_set(data, "file", data_new_boolean(B_FALSE));
-	struct_set(data, "lastModified", data_new_time(0, 0));
-	struct_set(data, "length", data_new_long(0));
-	struct_set(data, "freeSpace", data_new_long(0));
-	struct_set(data, "totalSpace", data_new_long(0));
-	struct_set(data, "usableSpace", data_new_long(0));
-	return (data_purify(data));
+	adr_struct_set(data, "absolutePath",
+	    adr_data_new_string(apath, LT_COPY));
+	adr_struct_set(data, "canonicalPath",
+	    adr_data_new_string(cpath, LT_COPY));
+	adr_struct_set(data, "canonical", adr_data_new_boolean(B_TRUE));
+	adr_struct_set(data, "baseName", adr_data_new_string("", LT_COPY));
+	adr_struct_set(data, "exists", adr_data_new_boolean(B_FALSE));
+	adr_struct_set(data, "readable", adr_data_new_boolean(B_FALSE));
+	adr_struct_set(data, "writable", adr_data_new_boolean(B_FALSE));
+	adr_struct_set(data, "hidden", adr_data_new_boolean(B_FALSE));
+	adr_struct_set(data, "directory", adr_data_new_boolean(B_FALSE));
+	adr_struct_set(data, "file", adr_data_new_boolean(B_FALSE));
+	adr_struct_set(data, "lastModified", adr_data_new_time(0, 0));
+	adr_struct_set(data, "length", adr_data_new_long(0));
+	adr_struct_set(data, "freeSpace", adr_data_new_long(0));
+	adr_struct_set(data, "totalSpace", adr_data_new_long(0));
+	adr_struct_set(data, "usableSpace", adr_data_new_long(0));
+	return (adr_data_purify(data));
 }
 
-static data_t *
+static adr_data_t *
 read_file(const char *path, const char *file)
 {
 	struct stat64 st;
@@ -79,13 +81,13 @@
 	char cpath[PATH_MAX] = "";
 	const char *name = file != NULL ? file : path;
 
-	data_t *data = data_new_struct(&t__FileSnapshot);
-	struct_set(data, "path", data_new_string(name, lt_copy));
-	struct_set(data, "absolute", data_new_boolean(name[0] == '/'));
+	adr_data_t *data = adr_data_new_struct(&t__FileSnapshot);
+	adr_struct_set(data, "path", adr_data_new_string(name, LT_COPY));
+	adr_struct_set(data, "absolute", adr_data_new_boolean(name[0] == '/'));
 
 	if (path[0] != '/') {
 		if (getcwd(apath, PATH_MAX) == NULL) {
-			data_free(data);
+			adr_data_free(data);
 			return (NULL);
 		}
 		if (apath[1] != '\0')
@@ -99,60 +101,66 @@
 	    stat64(path, &st) == -1)
 		return (empty_file(data, apath, apath));
 
-	struct_set(data, "absolutePath", data_new_string(apath, lt_copy));
-	struct_set(data, "canonicalPath", data_new_string(cpath, lt_copy));
-	struct_set(data, "canonical",
-	    data_new_boolean(strcmp(apath, cpath) == 0));
-	struct_set(data, "baseName", data_new_string(basename(apath), lt_copy));
-	struct_set(data, "exists", data_new_boolean(B_TRUE));
-	struct_set(data, "readable", data_new_boolean(access(path, R_OK) == 0));
-	struct_set(data, "writable", data_new_boolean(access(path, W_OK) == 0));
-	struct_set(data, "hidden", data_new_boolean(B_FALSE));
-	struct_set(data, "directory", data_new_boolean(S_ISDIR(st.st_mode)));
-	struct_set(data, "file", data_new_boolean(S_ISREG(st.st_mode)));
-	struct_set(data, "lastModified", data_new_time_ts(&st.st_mtim));
+	adr_struct_set(data, "absolutePath",
+	    adr_data_new_string(apath, LT_COPY));
+	adr_struct_set(data, "canonicalPath",
+	    adr_data_new_string(cpath, LT_COPY));
+	adr_struct_set(data, "canonical",
+	    adr_data_new_boolean(strcmp(apath, cpath) == 0));
+	adr_struct_set(data, "baseName",
+	    adr_data_new_string(basename(apath), LT_COPY));
+	adr_struct_set(data, "exists", adr_data_new_boolean(B_TRUE));
+	adr_struct_set(data, "readable",
+	    adr_data_new_boolean(access(path, R_OK) == 0));
+	adr_struct_set(data, "writable",
+	    adr_data_new_boolean(access(path, W_OK) == 0));
+	adr_struct_set(data, "hidden", adr_data_new_boolean(B_FALSE));
+	adr_struct_set(data, "directory",
+	    adr_data_new_boolean(S_ISDIR(st.st_mode)));
+	adr_struct_set(data, "file", adr_data_new_boolean(S_ISREG(st.st_mode)));
+	adr_struct_set(data, "lastModified", adr_data_new_time_ts(&st.st_mtim));
 	/* XXX: 64-bitify */
-	struct_set(data, "length", data_new_long(st.st_size));
-	struct_set(data, "freeSpace", data_new_long(0));
-	struct_set(data, "totalSpace", data_new_long(0));
-	struct_set(data, "usableSpace", data_new_long(0));
-	return (data_purify(data));
+	adr_struct_set(data, "length", adr_data_new_long(st.st_size));
+	adr_struct_set(data, "freeSpace", adr_data_new_long(0));
+	adr_struct_set(data, "totalSpace", adr_data_new_long(0));
+	adr_struct_set(data, "usableSpace", adr_data_new_long(0));
+	return (adr_data_purify(data));
 }
 
 /* ARGSUSED */
 conerr_t
 interface_FileBrowser_read_roots(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
-	data_t *result = data_new_array(&t_array__FileSnapshot, 1);
-	(void) array_add(result, read_file("/", NULL));
-	*data = data_purify(result);
+	adr_data_t *result = adr_data_new_array(&t_array__FileSnapshot, 1);
+	(void) adr_array_add(result, read_file("/", NULL));
+	*data = adr_data_purify(result);
 	return (ce_ok);
 }
 
 /* ARGSUSED */
 conerr_t
 interface_FileBrowser_invoke_getFile(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
-	*ret = read_file(data_to_string(args[0]), NULL);
+	*ret = read_file(adr_data_to_string(args[0]), NULL);
 	return (ce_ok);
 }
 
 /* ARGSUSED */
 conerr_t
 interface_FileBrowser_invoke_getFiles(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
-	const char *path = data_to_string(args[0]);
+	const char *path = adr_data_to_string(args[0]);
 	DIR *d = opendir(path);
 	struct dirent *ent;
-	data_t *result;
+	adr_data_t *result;
 
 	if (d == NULL)
 		return (ce_object);
 
-	result = data_new_array(&t_array__FileSnapshot, 1);
+	result = adr_data_new_array(&t_array__FileSnapshot, 1);
 	while ((ent = readdir(d)) != NULL) {
 		char buf[PATH_MAX];
 		if (strcmp(ent->d_name, ".") == 0 ||
@@ -163,12 +171,12 @@
 			len--;
 		(void) snprintf(buf, PATH_MAX, "%.*s/%s", len, path,
 		    ent->d_name);
-		data_t *file = read_file(buf, NULL);
+		adr_data_t *file = read_file(buf, NULL);
 		if (file != NULL)
-			(void) array_add(result, file);
+			(void) adr_array_add(result, file);
 	}
 	(void) closedir(d);
-	*ret = data_purify(result);
+	*ret = adr_data_purify(result);
 
 	return (ce_ok);
 }
--- a/components/visual-panels/core/src/cmd/rad/mod/network/mod_network.c	Fri Jun 29 12:23:11 2012 -0700
+++ b/components/visual-panels/core/src/cmd/rad/mod/network/mod_network.c	Sat Jun 30 06:30:16 2012 -0700
@@ -65,14 +65,14 @@
 /* ARGSUSED */
 conerr_t
 interface_Network_read_networkInterfaces(rad_instance_t *inst,
-    adr_attribute_t *attr, data_t **data, data_t **error)
+    adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
 {
 	int fd;
 	int count, rcount;
 	int reqsize;
 	struct lifreq *reqs = NULL;
 	struct lifconf ifconf;
-	data_t *result;
+	adr_data_t *result;
 
 	if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
 		return (ce_object);
@@ -86,7 +86,7 @@
 
 		if (count == 0) {
 			(void) close(fd);
-			*data = data_new_array(&t_array_string, 0);
+			*data = adr_data_new_array(&adr_t_array_string, 0);
 			return (ce_ok);
 		}
 
@@ -109,7 +109,7 @@
 		rcount = ifconf.lifc_len / sizeof (struct lifreq);
 	} while (rcount >= count);
 
-	result = data_new_array(&t_array_string, rcount);
+	result = adr_data_new_array(&adr_t_array_string, rcount);
 	for (int i = 0; i < rcount; i++) {
 		struct lifreq *r = &ifconf.lifc_req[i];
 		if (strchr(r->lifr_name, ':') != NULL)
@@ -118,37 +118,38 @@
 			continue;
 		if ((r->lifr_flags & (IFF_LOOPBACK | IFF_VIRTUAL)) != 0)
 			continue;
-		(void) array_add(result, data_new_string(r->lifr_name,
-		    lt_copy));
+		(void) adr_array_add(result, adr_data_new_string(r->lifr_name,
+		    LT_COPY));
 	}
 	(void) close(fd);
 	free(reqs);
 
-	*data = data_purify_deep(result);
+	*data = adr_data_purify_deep(result);
 	return (ce_ok);
 }
 
 /* ARGSUSED */
 conerr_t
 interface_Network_invoke_getHostNameForIP(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	int errnum;
 	struct hostent *he;
 	ipaddr_t addr;
 
-	if (inet_pton(AF_INET, data_to_string(args[0]), &addr) != 1)
+	if (inet_pton(AF_INET, adr_data_to_string(args[0]), &addr) != 1)
 		return (ce_object);
 
 	if ((he = getipnodebyaddr(&addr, sizeof (addr), AF_INET, &errnum))
 	    == NULL) {
 		/* Not found?  Bounce it back. */
-		(void) data_ref(args[0]);
+		(void) adr_data_ref(args[0]);
 		*ret = args[0];
 		return (ce_ok);
 	}
 
-	data_t *result = data_new_string(he->h_name, lt_copy);
+	adr_data_t *result = adr_data_new_string(he->h_name, LT_COPY);
 	freehostent(he);
 	*ret = result;
 
@@ -158,13 +159,13 @@
 /* ARGSUSED */
 conerr_t
 interface_Network_invoke_hostGetIPs(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	int errnum;
 	struct hostent *he;
 
-	if ((he = getipnodebyname(data_to_string(args[0]), AF_INET, AI_DEFAULT,
-	    &errnum)) == NULL) {
+	if ((he = getipnodebyname(adr_data_to_string(args[0]), AF_INET,
+	    AI_DEFAULT, &errnum)) == NULL) {
 		*ret = NULL;
 		return (ce_object);
 	}
@@ -172,16 +173,16 @@
 	int n = 0;
 	for (char **aptr = he->h_addr_list; *aptr != NULL; aptr++)
 		n++;
-	data_t *result = data_new_array(&t_array_string, n);
+	adr_data_t *result = adr_data_new_array(&adr_t_array_string, n);
 	for (int i = 0; i < n; i++) {
 		char abuf[INET_ADDRSTRLEN];
 		if (inet_ntop(AF_INET, he->h_addr_list[i], abuf,
 		    sizeof (abuf)) != NULL)
-			(void) array_add(result, data_new_string(abuf,
-			    lt_copy));
+			(void) adr_array_add(result, adr_data_new_string(abuf,
+			    LT_COPY));
 	}
 
-	*ret = data_purify_deep(result);
+	*ret = adr_data_purify_deep(result);
 	freehostent(he);
 
 	return (ce_ok);
@@ -190,7 +191,8 @@
 /* ARGSUSED */
 conerr_t
 interface_Network_invoke_isLocalAddress(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	struct ifaddrs *ifaddr;
 	struct ifaddrs *ifa;
@@ -201,7 +203,7 @@
 	(void) memset(buf, 0, sizeof (buf));
 
 	/* Set default return value */
-	*ret = data_new_boolean(B_FALSE);
+	*ret = adr_data_new_boolean(B_FALSE);
 
 	// Get IP addresses of each network interface.
 	//
@@ -224,9 +226,10 @@
 			sin = (struct sockaddr_in *)ifa->ifa_addr;
 
 			/* Match given IP address */
-			if (strcmp(data_to_string(args[0]), inet_ntop(AF_INET,
+			if (strcmp(adr_data_to_string(args[0]),
+			    inet_ntop(AF_INET,
 			    &sin->sin_addr.s_addr, buf, 1024)) == 0) {
-				*ret = data_new_boolean(B_TRUE);
+				*ret = adr_data_new_boolean(B_TRUE);
 				break;
 			}
 		} else {
@@ -234,9 +237,10 @@
 			sin6 = (struct sockaddr_in6 *)ifa->ifa_addr;
 
 			/* Match given IP address */
-			if (strcmp(data_to_string(args[0]), inet_ntop(AF_INET6,
+			if (strcmp(adr_data_to_string(args[0]),
+			    inet_ntop(AF_INET6,
 			    &sin6->sin6_addr.s6_addr, buf, 1024)) == 0) {
-				*ret = data_new_boolean(B_TRUE);
+				*ret = adr_data_new_boolean(B_TRUE);
 				break;
 			}
 		}
--- a/components/visual-panels/core/src/cmd/rad/mod/panels/mod_panels.c	Fri Jun 29 12:23:11 2012 -0700
+++ b/components/visual-panels/core/src/cmd/rad/mod/panels/mod_panels.c	Sat Jun 30 06:30:16 2012 -0700
@@ -45,18 +45,18 @@
  */
 
 static int md5_file(const char *fname, unsigned char *hash);
-static data_t *get_text(xmlDoc *doc, xmlNode *node);
+static adr_data_t *get_text(xmlDoc *doc, xmlNode *node);
 static char *get_text_str(xmlDoc *doc, xmlNode *node);
-static data_t *get_prop(xmlNode *node, const char *name);
-static data_t *file_to_token(rad_locale_t *rlocale, const char *pname,
+static adr_data_t *get_prop(xmlNode *node, const char *name);
+static adr_data_t *file_to_token(rad_locale_t *rlocale, const char *pname,
     char *file);
-static conerr_t token_to_file(data_t *t, char **f);
-static data_t *create_resource(rad_locale_t *rlocale, const char *pname,
+static conerr_t token_to_file(adr_data_t *t, char **f);
+static adr_data_t *create_resource(rad_locale_t *rlocale, const char *pname,
     char *file);
 static void add_localized(rad_locale_t *rlocale, const char *pname,
-    data_t *farray, char *file);
-static data_t *read_panel_path(rad_locale_t *rlocale, const char *path);
-static data_t *read_panel(const char *locale, const char *pname);
+    adr_data_t *farray, char *file);
+static adr_data_t *read_panel_path(rad_locale_t *rlocale, const char *path);
+static adr_data_t *read_panel(const char *locale, const char *pname);
 
 /*
  * Static data
@@ -105,15 +105,15 @@
  * Seems like overkill, but it's better than mixing xml-allocated
  * and other strings.
  */
-static data_t *
+static adr_data_t *
 get_text(xmlDoc *doc, xmlNode *node)
 {
-	data_t *result;
+	adr_data_t *result;
 	xmlChar *d = xmlNodeListGetString(doc, node, 1);
 	if (d == NULL)
 		return (NULL);
 
-	result = data_new_string((char *)d, lt_copy);
+	result = adr_data_new_string((char *)d, LT_COPY);
 	xmlFree(d);
 	return (result);
 }
@@ -131,20 +131,20 @@
 	return (result);
 }
 
-static data_t *
+static adr_data_t *
 get_prop(xmlNode *node, const char *name)
 {
-	data_t *result;
+	adr_data_t *result;
 	xmlChar *d = xmlGetProp(node, (xmlChar *)name);
 	if (d == NULL)
 		return (NULL);
 
-	result = data_new_string((char *)d, lt_copy);
+	result = adr_data_new_string((char *)d, LT_COPY);
 	xmlFree(d);
 	return (result);
 }
 
-static data_t *
+static adr_data_t *
 file_to_token(rad_locale_t *rlocale, const char *pname, char *file)
 {
 	int llen = strlen(rlocale->locale);
@@ -164,14 +164,14 @@
 	p += plen + 1;
 	(void) strcpy(p, file);
 
-	return (data_new_opaque(token, tokenlen, lt_free));
+	return (adr_data_new_opaque(token, tokenlen, LT_FREE));
 }
 
 static conerr_t
-token_to_file(data_t *t, char **f)
+token_to_file(adr_data_t *t, char **f)
 {
-	char *token = data_to_opaque(t);
-	char tokenlen = opaque_size(t);
+	char *token = adr_data_to_opaque(t);
+	char tokenlen = adr_opaque_size(t);
 
 	/* Cursory validation */
 	int nullcnt = 0;
@@ -189,16 +189,16 @@
 	char *pname = locale + strlen(locale) + 1;
 	char *file = pname + strlen(pname) + 1;
 
-	data_t *panel = read_panel(locale, pname);
+	adr_data_t *panel = read_panel(locale, pname);
 	if (panel == NULL) {
 		/* Bad panel */
 		return (ce_object);
 	}
 
-	data_t *resources = struct_get(panel, "resourceDescriptors");
+	adr_data_t *resources = adr_struct_get(panel, "resourceDescriptors");
 	static const char * const path[] = { "file", NULL };
-	int index = array_search(resources, file, path);
-	data_free(panel);
+	int index = adr_array_search(resources, file, path);
+	adr_data_free(panel);
 	if (index == -1) {
 		/* Bad file */
 		return (ce_object);
@@ -212,7 +212,7 @@
 	return (ce_ok);
 }
 
-static data_t *
+static adr_data_t *
 create_resource(rad_locale_t *rlocale, const char *pname, char *file)
 {
 	unsigned char hbuf[MD5_DIGEST_LENGTH];
@@ -220,18 +220,19 @@
 		return (NULL);
 	}
 
-	data_t *result = data_new_struct(&t__ResourceDescriptor);
-	struct_set(result, "token", file_to_token(rlocale, pname, file));
-	struct_set(result, "file", data_new_string(file, lt_copy));
-	struct_set(result, "hashAlgorithm", data_new_string("MD5", lt_const));
-	struct_set(result, "hash", data_new_opaque(hbuf, MD5_DIGEST_LENGTH,
-	    lt_copy));
+	adr_data_t *result = adr_data_new_struct(&t__ResourceDescriptor);
+	adr_struct_set(result, "token", file_to_token(rlocale, pname, file));
+	adr_struct_set(result, "file", adr_data_new_string(file, LT_COPY));
+	adr_struct_set(result, "hashAlgorithm",
+	    adr_data_new_string("MD5", LT_CONST));
+	adr_struct_set(result, "hash",
+	    adr_data_new_opaque(hbuf, MD5_DIGEST_LENGTH, LT_COPY));
 
 	return (result);
 }
 
 static void
-add_localized(rad_locale_t *rlocale, const char *pname, data_t *farray,
+add_localized(rad_locale_t *rlocale, const char *pname, adr_data_t *farray,
     char *file)
 {
 	if (rlocale != NULL && rlocale->language != NULL &&
@@ -275,23 +276,23 @@
 				    rlocale->territory, rlocale->modifier,
 				    base);
 				if (access(l10njar, F_OK) == 0) {
-					(void) array_add(farray,
+					(void) adr_array_add(farray,
 					    create_resource(rlocale, pname,
 					    l10njar));
 				}
 			}
 		}
 	}
-	(void) array_add(farray, create_resource(rlocale, pname, file));
+	(void) adr_array_add(farray, create_resource(rlocale, pname, file));
 }
 
-static data_t *
+static adr_data_t *
 read_panel_path(rad_locale_t *rlocale, const char *path)
 {
 	xmlParserCtxt *ctx;
 	xmlValidCtxt *vctx;
 	xmlDoc *doc;
-	data_t *panel = NULL;
+	adr_data_t *panel = NULL;
 
 	ctx = xmlNewParserCtxt();
 	vctx = xmlNewValidCtxt();
@@ -320,22 +321,24 @@
 		goto out;
 	}
 
-	panel = data_new_struct(&t__CustomPanel);
-	struct_set(panel, "locale", data_new_string(rlocale->locale, lt_copy));
+	panel = adr_data_new_struct(&t__CustomPanel);
+	adr_struct_set(panel, "locale",
+	    adr_data_new_string(rlocale->locale, LT_COPY));
 
-	data_t *pname = get_prop(root, "name");
-	struct_set(panel, "name", pname);
+	adr_data_t *pname = get_prop(root, "name");
+	adr_struct_set(panel, "name", pname);
 
-	data_t *farray = data_new_array(&t_array__ResourceDescriptor, 1);
-	struct_set(panel, "resourceDescriptors", farray);
+	adr_data_t *farray =
+	    adr_data_new_array(&t_array__ResourceDescriptor, 1);
+	adr_struct_set(panel, "resourceDescriptors", farray);
 
 	char *aroot = NULL;
 	for (xmlNode *np = root->children; np != NULL; np = np->next) {
 		if (np->type != XML_ELEMENT_NODE)
 			continue;
 		if (strcmp((const char *)np->name, "mainclass") == 0) {
-			data_t *mc = get_text(doc, np->children);
-			struct_set(panel, "panelDescriptorClassName", mc);
+			adr_data_t *mc = get_text(doc, np->children);
+			adr_struct_set(panel, "panelDescriptorClassName", mc);
 		} else if (strcmp((const char *)np->name, "approot") == 0) {
 			if (aroot != NULL)
 				continue;	/* schema violation */
@@ -359,8 +362,8 @@
 			    file);
 			free(file);
 
-			add_localized(rlocale, data_to_string(pname), farray,
-			    full);
+			add_localized(rlocale, adr_data_to_string(pname),
+			    farray, full);
 		}
 	}
 	if (aroot != NULL)
@@ -370,10 +373,10 @@
 	xmlFreeDoc(doc);
 	xmlFreeParserCtxt(ctx);
 
-	return (data_purify_deep(panel));
+	return (adr_data_purify_deep(panel));
 }
 
-static data_t *
+static adr_data_t *
 read_panel(const char *locale, const char *pname)
 {
 	rad_locale_t *rlocale;
@@ -384,13 +387,13 @@
 	char path[PATH_MAX];
 	(void) snprintf(path, RAD_COUNT(path), "%s/%s.xml", PANELDESCDIR,
 	    pname);
-	data_t *panel = read_panel_path(rlocale, path);
+	adr_data_t *panel = read_panel_path(rlocale, path);
 
 	if (panel != NULL) {
 		/* Sanity check - ensure panel @name matches file name */
-		data_t *nameattr = struct_get(panel, "name");
-		if (strcmp(data_to_string(nameattr), pname) != 0) {
-			data_free(panel);
+		adr_data_t *nameattr = adr_struct_get(panel, "name");
+		if (strcmp(adr_data_to_string(nameattr), pname) != 0) {
+			adr_data_free(panel);
 			panel = NULL;
 		}
 	}
@@ -423,12 +426,13 @@
 /* ARGSUSED */
 conerr_t
 interface_Panel_invoke_getPanel(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
-	const char *pname = data_to_string(args[0]);
-	const char *locale = args[1] == NULL ? NULL : data_to_string(args[1]);
+	const char *pname = adr_data_to_string(args[0]);
+	const char *locale = args[1] == NULL ? NULL :
+	    adr_data_to_string(args[1]);
 
-	data_t *panel = read_panel(locale, pname);
+	adr_data_t *panel = read_panel(locale, pname);
 	if (panel == NULL) {
 		/*
 		 * Could be a memory or system error, but more likely an invalid
@@ -444,9 +448,9 @@
 /* ARGSUSED */
 conerr_t
 interface_Panel_read_panelNames(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
-	data_t *array = data_new_array(&t_array_string, 0);
+	adr_data_t *array = adr_data_new_array(&adr_t_array_string, 0);
 	if (array == NULL) {
 		return (ce_nomem);
 	}
@@ -466,11 +470,12 @@
 		if (len < 1 || strcmp(ent->d_name + len, ext) != 0) {
 			continue;
 		}
-		(void) array_add(array, data_new_nstring(ent->d_name, len));
+		(void) adr_array_add(array,
+		    adr_data_new_nstring(ent->d_name, len));
 	}
 
 	(void) closedir(d);
-	*data = data_purify(array);
+	*data = adr_data_purify(array);
 
 	return (*data == NULL ? ce_nomem : ce_ok);
 }
@@ -478,7 +483,7 @@
 /* ARGSUSED */
 conerr_t
 interface_Panel_invoke_getResource(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	char *file;
 	conerr_t result = token_to_file(args[0], &file);
@@ -513,6 +518,6 @@
 
 	(void) close(fd);
 
-	*ret = data_new_opaque(buffer, st.st_size, lt_free);
+	*ret = adr_data_new_opaque(buffer, st.st_size, LT_FREE);
 	return (*ret == NULL ? ce_nomem : ce_ok);
 }
--- a/components/visual-panels/core/src/cmd/rad/mod/smf_old/mod_smf.c	Fri Jun 29 12:23:11 2012 -0700
+++ b/components/visual-panels/core/src/cmd/rad/mod/smf_old/mod_smf.c	Sat Jun 30 06:30:16 2012 -0700
@@ -74,20 +74,21 @@
 };
 
 static conerr_t
-error_scf(data_t **error, int code)
+error_scf(adr_data_t **error, int code)
 {
 	if (error != NULL) {
-		data_t *e = data_new_struct(&t__SmfError);
-		struct_set(e, "error", data_new_enum(&t__SmfErrorCode, code));
-		struct_set(e, "message",
-		    data_new_string(scf_strerror(code), lt_const));
-		*error = data_purify(e);
+		adr_data_t *e = adr_data_new_struct(&t__SmfError);
+		adr_struct_set(e, "error",
+		    adr_data_new_enum(&t__SmfErrorCode, code));
+		adr_struct_set(e, "message",
+		    adr_data_new_string(scf_strerror(code), LT_CONST));
+		*error = adr_data_purify(e);
 	}
 	return (ce_object);
 }
 
 static conerr_t
-simple_scf(data_t **error, int result)
+simple_scf(adr_data_t **error, int result)
 {
 	if (result == 0)
 		return (ce_ok);
@@ -123,9 +124,9 @@
 	return (h);
 }
 
-static int getpgs(servinst_t *si, data_t **data, boolean_t namesonly,
+static int getpgs(servinst_t *si, adr_data_t **data, boolean_t namesonly,
     boolean_t(*fp)(const char **, const char *), const char **set,
-    data_t **error)
+    adr_data_t **error)
 {
 	conerr_t err = ce_ok;
 	scf_handle_t *scfhandle = handle_create();
@@ -159,8 +160,9 @@
 		}
 	}
 
-	data_t *result = namesonly ? data_new_array(&t_array_string, 5) :
-	    data_new_array(&t_array__PropertyGroup, 5);
+	adr_data_t *result = namesonly ?
+	    adr_data_new_array(&adr_t_array_string, 5) :
+	    adr_data_new_array(&t_array__PropertyGroup, 5);
 	while (scf_iter_next_pg(iter, pg) > 0) {
 		char nbuf[1000];
 		char tbuf[1000];
@@ -169,16 +171,16 @@
 
 		if (fp(set, tbuf)) {
 			if (namesonly) {
-				(void) array_add(result,
-				    data_new_string(nbuf, lt_copy));
+				(void) adr_array_add(result,
+				    adr_data_new_string(nbuf, LT_COPY));
 			} else {
-				data_t *pgdata =
-				    data_new_struct(&t__PropertyGroup);
-				struct_set(pgdata, "name",
-				    data_new_string(nbuf, lt_copy));
-				struct_set(pgdata, "type",
-				    data_new_string(tbuf, lt_copy));
-				(void) array_add(result, pgdata);
+				adr_data_t *pgdata =
+				    adr_data_new_struct(&t__PropertyGroup);
+				adr_struct_set(pgdata, "name",
+				    adr_data_new_string(nbuf, LT_COPY));
+				adr_struct_set(pgdata, "type",
+				    adr_data_new_string(tbuf, LT_COPY));
+				(void) adr_array_add(result, pgdata);
 			}
 		}
 	}
@@ -199,17 +201,17 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_fmri(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
-	*data = data_new_string(si->fmri, lt_copy);
+	*data = adr_data_new_string(si->fmri, LT_COPY);
 	return (ce_ok);
 }
 
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_methodNames(rad_instance_t *inst,
-    adr_attribute_t *attr, data_t **data, data_t **error)
+    adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
 {
 	const char *pgtypes[] = { SCF_GROUP_METHOD, NULL };
 	return (getpgs(instance_getdata(inst), data, B_TRUE, strinset, pgtypes,
@@ -219,7 +221,7 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_dependencyNames(rad_instance_t *inst,
-    adr_attribute_t *attr, data_t **data, data_t **error)
+    adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
 {
 	const char *pgtypes[] = { SCF_GROUP_DEPENDENCY, NULL };
 	return (getpgs(instance_getdata(inst), data, B_TRUE, strinset, pgtypes,
@@ -229,7 +231,7 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_propertyGroups(rad_instance_t *inst,
-    adr_attribute_t *attr, data_t **data, data_t **error)
+    adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
 {
 	return (getpgs(instance_getdata(inst), data, B_FALSE, strnotinset,
 	    framework_pgtypes, error));
@@ -238,7 +240,7 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_manpages(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	char *title, *section, *path;
@@ -256,13 +258,13 @@
 		NULL
 	};
 
-	data_t *pgs;
+	adr_data_t *pgs;
 	conerr_t err = getpgs(si, &pgs, B_TRUE, strinset, pgtypes, error);
 	if (err != ce_ok)
 		return (err);
-	data_t *result = data_new_array(&t_array__Manpage, 5);
-	for (int i = 0; i < array_size(pgs); i++) {
-		const char *str = data_to_string(array_get(pgs, i));
+	adr_data_t *result = adr_data_new_array(&t_array__Manpage, 5);
+	for (int i = 0; i < adr_array_size(pgs); i++) {
+		const char *str = adr_data_to_string(adr_array_get(pgs, i));
 		if (strncmp(str, SCF_PG_TM_MAN_PREFIX,
 		    strlen(SCF_PG_TM_MAN_PREFIX)) != 0) {
 			continue;
@@ -272,14 +274,16 @@
 		    &badprop) != 0)
 			continue;
 
-		data_t *mp = data_new_struct(&t__Manpage);
-		struct_set(mp, "title", data_new_string(title, lt_copy));
-		struct_set(mp, "section", data_new_string(section, lt_copy));
-		struct_set(mp, "path", data_new_string(path, lt_copy));
-		(void) array_add(result, mp);
+		adr_data_t *mp = adr_data_new_struct(&t__Manpage);
+		adr_struct_set(mp, "title",
+		    adr_data_new_string(title, LT_COPY));
+		adr_struct_set(mp, "section",
+		    adr_data_new_string(section, LT_COPY));
+		adr_struct_set(mp, "path", adr_data_new_string(path, LT_COPY));
+		(void) adr_array_add(result, mp);
 		rad_clean_propvec(evec);
 	}
-	data_free(pgs);
+	adr_data_free(pgs);
 	*data = result;
 
 	return (ce_ok);
@@ -288,7 +292,7 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_doclinks(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	char *uri;
@@ -303,13 +307,13 @@
 		NULL
 	};
 
-	data_t *pgs;
+	adr_data_t *pgs;
 	conerr_t err = getpgs(si, &pgs, B_TRUE, strinset, pgtypes, error);
 	if (err != ce_ok)
 		return (err);
-	data_t *result = data_new_array(&t_array_string, 5);
-	for (int i = 0; i < array_size(pgs); i++) {
-		const char *str = data_to_string(array_get(pgs, i));
+	adr_data_t *result = adr_data_new_array(&adr_t_array_string, 5);
+	for (int i = 0; i < adr_array_size(pgs); i++) {
+		const char *str = adr_data_to_string(adr_array_get(pgs, i));
 		if (strncmp(str, SCF_PG_TM_DOC_PREFIX,
 		    strlen(SCF_PG_TM_DOC_PREFIX)) != 0) {
 			continue;
@@ -317,11 +321,12 @@
 
 		if (rad_read_propvec(si->fmri, str, B_FALSE, evec,
 		    &badprop) == 0) {
-			(void) array_add(result, data_new_string(uri, lt_copy));
+			(void) adr_array_add(result,
+			    adr_data_new_string(uri, LT_COPY));
 			rad_clean_propvec(evec);
 		}
 	}
-	data_free(pgs);
+	adr_data_free(pgs);
 	*data = result;
 
 	return (ce_ok);
@@ -330,7 +335,7 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_persistentlyEnabled(rad_instance_t *inst,
-    adr_attribute_t *attr, data_t **data, data_t **error)
+    adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
@@ -349,14 +354,14 @@
 		return (error_scf(error, scferr));
 	rad_clean_propvec(evec);
 
-	*data = data_new_boolean(enabled);
+	*data = adr_data_new_boolean(enabled);
 	return (ce_ok);
 }
 
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_temporarilyEnabled(rad_instance_t *inst,
-    adr_attribute_t *attr, data_t **data, data_t **error)
+    adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
@@ -375,14 +380,14 @@
 		    inst, attr, data, error));
 	rad_clean_propvec(evec);
 
-	*data = data_new_boolean(enabled);
+	*data = adr_data_new_boolean(enabled);
 	return (ce_ok);
 }
 
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_enabled(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	/*
 	 * XXX: The java version always had the same implementation for both.
@@ -394,17 +399,17 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_instance(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
-	*data = data_new_boolean(si->instance);
+	*data = adr_data_new_boolean(si->instance);
 	return (ce_ok);
 }
 
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_restarter(rad_instance_t *inst,
-    adr_attribute_t *attr, data_t **data, data_t **error)
+    adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
@@ -419,17 +424,17 @@
 	rad_propvec_t *badprop;
 	if (rad_read_propvec(si->fmri, SCF_PG_GENERAL, B_FALSE, evec,
 	    &badprop) == 0) {
-		*data = data_new_string(fmri, lt_copy);
+		*data = adr_data_new_string(fmri, LT_COPY);
 		rad_clean_propvec(evec);
 	} else {
-		*data = data_new_fstring("svc:/%s:%s",
+		*data = adr_data_new_fstring("svc:/%s:%s",
 		    "system/svc/restarter", "default");
 	}
 
 	return (*data != NULL ? ce_ok : ce_system);
 }
 
-static data_t *
+static adr_data_t *
 state2enum(const char *state)
 {
 	if (strcmp(state, SCF_STATE_STRING_UNINIT) == 0) {
@@ -439,14 +444,14 @@
 	} else if (strcmp(state, SCF_STATE_STRING_LEGACY) == 0) {
 		return (&e__SmfState_LEGACY);
 	} else {
-		return (data_new_enum_byname(&t__SmfState, state));
+		return (adr_data_new_enum_byname(&t__SmfState, state));
 	}
 }
 
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_state(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
@@ -464,7 +469,7 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_nextState(rad_instance_t *inst,
-    adr_attribute_t *attr, data_t **data, data_t **error)
+    adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
@@ -490,7 +495,7 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_auxiliaryState(rad_instance_t *inst,
-    adr_attribute_t *attr, data_t **data, data_t **error)
+    adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
@@ -513,7 +518,7 @@
 		return (error_scf(error, scferr));
 	}
 
-	*data = data_new_string(aux, lt_copy);
+	*data = adr_data_new_string(aux, LT_COPY);
 	rad_clean_propvec(evec);
 
 	return (*data != NULL ? ce_ok : ce_system);
@@ -522,7 +527,7 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_stime(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
@@ -542,7 +547,7 @@
 
 	rad_clean_propvec(evec);
 
-	*data = data_new_time(time.t_seconds, time.t_ns);
+	*data = adr_data_new_time(time.t_seconds, time.t_ns);
 
 	return (*data != NULL ? ce_ok : ce_system);
 }
@@ -550,7 +555,7 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_contractID(rad_instance_t *inst,
-    adr_attribute_t *attr, data_t **data, data_t **error)
+    adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
@@ -569,7 +574,7 @@
 		return (error_scf(error, scferr));
 	rad_clean_propvec(evec);
 
-	*data = data_new_long(count);
+	*data = adr_data_new_long(count);
 
 	return (*data != NULL ? ce_ok : ce_system);
 }
@@ -577,7 +582,7 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_read_reason(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
@@ -589,10 +594,10 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_write_persistentlyEnabled(rad_instance_t *inst,
-    adr_attribute_t *attr, data_t *data, data_t **error)
+    adr_attribute_t *attr, adr_data_t *data, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
-	boolean_t enable = data_to_boolean(data);
+	boolean_t enable = adr_data_to_boolean(data);
 	if (!si->instance)
 		return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
 
@@ -602,7 +607,7 @@
 
 static conerr_t
 get_pg(scf_handle_t *scfhandle, scf_propertygroup_t *pg, servinst_t *si,
-    const char *snapname, const char *pgname, data_t **error)
+    const char *snapname, const char *pgname, adr_data_t **error)
 {
 	conerr_t err = ce_ok;
 	scf_service_t *service = scf_service_create(scfhandle);
@@ -653,10 +658,11 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_getDependency(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	conerr_t err = ce_ok;
-	const char *pgname = data_to_string(args[0]);
+	const char *pgname = adr_data_to_string(args[0]);
 	servinst_t *si = instance_getdata(inst);
 	char type[1000];
 	char grouping[1000];
@@ -698,22 +704,24 @@
 		goto out;
 	}
 
-	data_t *result = data_new_struct(&t__Dependency);
-	data_t *array = data_new_array(&t_array_string, 5);
-	struct_set(result, "name", data_ref(args[0]));
-	struct_set(result, "grouping", data_new_string(grouping, lt_copy));
-	struct_set(result, "restartOn", data_new_string(restarton, lt_copy));
-	struct_set(result, "target", array);
+	adr_data_t *result = adr_data_new_struct(&t__Dependency);
+	adr_data_t *array = adr_data_new_array(&adr_t_array_string, 5);
+	adr_struct_set(result, "name", adr_data_ref(args[0]));
+	adr_struct_set(result, "grouping",
+	    adr_data_new_string(grouping, LT_COPY));
+	adr_struct_set(result, "restartOn",
+	    adr_data_new_string(restarton, LT_COPY));
+	adr_struct_set(result, "target", array);
 	while (scf_iter_next_value(iter, val) > 0) {
 		if (scf_value_get_as_string(val, type, sizeof (type)) == -1) {
 			err = error_scf(error, scf_error());
-			data_free(result);
+			adr_data_free(result);
 			goto out;
 		}
-		(void) array_add(array, data_new_string(type, lt_copy));
+		(void) adr_array_add(array, adr_data_new_string(type, LT_COPY));
 	}
-	if (!data_verify(result, NULL, B_TRUE)) {
-		data_free(result);
+	if (!adr_data_verify(result, NULL, B_TRUE)) {
+		adr_data_free(result);
 		err = error_scf(error, SCF_ERROR_NO_MEMORY);
 		goto out;
 	}
@@ -731,10 +739,11 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_getPropertyNames(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	conerr_t err = ce_ok;
-	const char *pgname = data_to_string(args[0]);
+	const char *pgname = adr_data_to_string(args[0]);
 	servinst_t *si = instance_getdata(inst);
 
 	scf_handle_t *scfhandle = handle_create();
@@ -751,12 +760,13 @@
 	    != ce_ok)
 		goto out;
 
-	data_t *result = data_new_array(&t_array_string, 5);
+	adr_data_t *result = adr_data_new_array(&adr_t_array_string, 5);
 	(void) scf_iter_pg_properties(iter, pg);
 	while (scf_iter_next_property(iter, prop) > 0) {
 		char pbuf[1000];
 		(void) scf_property_get_name(prop, pbuf, 1000);
-		(void) array_add(result, data_new_string(pbuf, lt_copy));
+		(void) adr_array_add(result,
+		    adr_data_new_string(pbuf, LT_COPY));
 	}
 	*ret = result;
 
@@ -772,10 +782,11 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_getPropertyType(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
-	const char *pgname = data_to_string(args[0]);
-	const char *propname = data_to_string(args[1]);
+	const char *pgname = adr_data_to_string(args[0]);
+	const char *propname = adr_data_to_string(args[1]);
 	conerr_t err = ce_ok;
 	servinst_t *si = instance_getdata(inst);
 
@@ -798,7 +809,7 @@
 		goto out;
 	}
 
-	data_t *result = data_new_enum(&t__PropertyType, type);
+	adr_data_t *result = adr_data_new_enum(&t__PropertyType, type);
 	if (result != NULL)
 		*ret = result;
 	else
@@ -814,11 +825,12 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_getPropertyValues(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	conerr_t err = ce_ok;
-	const char *pgname = data_to_string(args[0]);
-	const char *propname = data_to_string(args[1]);
+	const char *pgname = adr_data_to_string(args[0]);
+	const char *propname = adr_data_to_string(args[1]);
 
 	servinst_t *si = instance_getdata(inst);
 
@@ -853,11 +865,12 @@
 		goto out;
 	}
 
-	data_t *result = data_new_array(&t_array_string, 5);
+	adr_data_t *result = adr_data_new_array(&adr_t_array_string, 5);
 	while (scf_iter_next_value(iter, val) > 0) {
 		char pbuf[1000];
 		(void) scf_value_get_as_string(val, pbuf, 1000);
-		(void) array_add(result, data_new_string(pbuf, lt_copy));
+		(void) adr_array_add(result,
+		    adr_data_new_string(pbuf, LT_COPY));
 	}
 	*ret = result;
 out:
@@ -876,12 +889,13 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_getSnapshotPropertyValues(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	conerr_t err = ce_ok;
-	const char *snapname = data_to_string(args[0]);
-	const char *pgname = data_to_string(args[1]);
-	const char *propname = data_to_string(args[2]);
+	const char *snapname = adr_data_to_string(args[0]);
+	const char *pgname = adr_data_to_string(args[1]);
+	const char *propname = adr_data_to_string(args[2]);
 
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
@@ -909,12 +923,13 @@
 		goto out;
 	}
 
-	data_t *result = data_new_array(&t_array_string, 5);
+	adr_data_t *result = adr_data_new_array(&adr_t_array_string, 5);
 	(void) scf_iter_property_values(iter, prop);
 	while (scf_iter_next_value(iter, val) > 0) {
 		char pbuf[1000];
 		(void) scf_value_get_as_string(val, pbuf, 1000);
-		(void) array_add(result, data_new_string(pbuf, lt_copy));
+		(void) adr_array_add(result,
+		    adr_data_new_string(pbuf, LT_COPY));
 	}
 	*ret = result;
 out:
@@ -930,12 +945,13 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_setPropertyValues(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	conerr_t err = ce_ok;
-	const char *pgname = data_to_string(args[0]);
-	const char *propname = data_to_string(args[1]);
-	data_t *values = args[2];
+	const char *pgname = adr_data_to_string(args[0]);
+	const char *propname = adr_data_to_string(args[1]);
+	adr_data_t *values = args[2];
 
 	servinst_t *si = instance_getdata(inst);
 
@@ -947,7 +963,7 @@
 	scf_transaction_t *tx = scf_transaction_create(scfhandle);
 	scf_transaction_entry_t *ent = scf_entry_create(scfhandle);
 	scf_value_t **val =
-	    rad_zalloc(array_size(values) * sizeof (scf_value_t *));
+	    rad_zalloc(adr_array_size(values) * sizeof (scf_value_t *));
 	scf_type_t type;
 
 	if (scfhandle == NULL || service == NULL || instance == NULL ||
@@ -957,7 +973,7 @@
 		goto out;
 	}
 
-	for (int i = 0; i < array_size(values); i++) {
+	for (int i = 0; i < adr_array_size(values); i++) {
 		if ((val[i] = scf_value_create(scfhandle)) == NULL) {
 			err = error_scf(error, SCF_ERROR_NO_MEMORY);
 			goto out;
@@ -1002,9 +1018,9 @@
 		goto out;
 	}
 
-	for (int i = 0; i < array_size(values); i++) {
+	for (int i = 0; i < adr_array_size(values); i++) {
 		if (scf_value_set_from_string(val[i], type,
-		    data_to_string(array_get(values, i))) != 0 ||
+		    adr_data_to_string(adr_array_get(values, i))) != 0 ||
 		    scf_entry_add_value(ent, val[i]) != 0) {
 			err = error_scf(error, scf_error());
 			goto out;
@@ -1022,7 +1038,7 @@
 
 out:
 	if (val != NULL) {
-		for (int i = 0; i < array_size(values); i++) {
+		for (int i = 0; i < adr_array_size(values); i++) {
 			if (val[i] == NULL)
 				break;
 			scf_value_destroy(val[i]);
@@ -1044,11 +1060,12 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_createPropertyGroup(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	conerr_t err = ce_ok;
-	const char *pgname = data_to_string(args[0]);
-	const char *pgtype = data_to_string(args[1]);
+	const char *pgname = adr_data_to_string(args[0]);
+	const char *pgtype = adr_data_to_string(args[1]);
 
 	servinst_t *si = instance_getdata(inst);
 
@@ -1095,10 +1112,11 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_deletePropertyGroup(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	conerr_t err = ce_ok;
-	const char *pgname = data_to_string(args[0]);
+	const char *pgname = adr_data_to_string(args[0]);
 
 	servinst_t *si = instance_getdata(inst);
 
@@ -1151,12 +1169,13 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_createProperty(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	conerr_t err = ce_ok;
-	const char *pgname = data_to_string(args[0]);
-	const char *propname = data_to_string(args[1]);
-	scf_type_t type = enum_tovalue(args[2]);
+	const char *pgname = adr_data_to_string(args[0]);
+	const char *propname = adr_data_to_string(args[1]);
+	scf_type_t type = adr_enum_tovalue(args[2]);
 	int sret;
 
 	servinst_t *si = instance_getdata(inst);
@@ -1232,11 +1251,12 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_deleteProperty(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	conerr_t err = ce_ok;
-	const char *pgname = data_to_string(args[0]);
-	const char *propname = data_to_string(args[1]);
+	const char *pgname = adr_data_to_string(args[0]);
+	const char *propname = adr_data_to_string(args[1]);
 	int sret;
 
 	servinst_t *si = instance_getdata(inst);
@@ -1309,12 +1329,13 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_getPropertyTemplate(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	conerr_t err = ce_ok;
-	const char *pgname = data_to_string(args[0]);
-	const char *propname = data_to_string(args[1]);
-	const char *locale = data_to_string(args[2]);
+	const char *pgname = adr_data_to_string(args[0]);
+	const char *propname = adr_data_to_string(args[1]);
+	const char *locale = adr_data_to_string(args[2]);
 
 	servinst_t *si = instance_getdata(inst);
 	scf_handle_t *scfhandle = handle_create();
@@ -1333,25 +1354,27 @@
 		goto out;
 	}
 
-	data_t *result = data_new_struct(&t__Template);
+	adr_data_t *result = adr_data_new_struct(&t__Template);
 
 	char *name;
 	if (scf_tmpl_prop_common_name(proptmpl, locale, &name) >= 0)
-		struct_set(result, "name", data_new_string(name, lt_free));
+		adr_struct_set(result, "name",
+		    adr_data_new_string(name, LT_FREE));
 
 	if (scf_tmpl_prop_description(proptmpl, locale, &name) >= 0)
-		struct_set(result, "description",
-		    data_new_string(name, lt_free));
+		adr_struct_set(result, "description",
+		    adr_data_new_string(name, LT_FREE));
 
 	if (scf_tmpl_prop_units(proptmpl, locale, &name) >= 0)
-		struct_set(result, "units", data_new_string(name, lt_free));
+		adr_struct_set(result, "units",
+		    adr_data_new_string(name, LT_FREE));
 
 	uint8_t vis;
 	if (scf_tmpl_prop_visibility(proptmpl, &vis) == -1) {
-		data_free(result);
+		adr_data_free(result);
 		goto out;
 	}
-	data_t *visvalue = NULL;
+	adr_data_t *visvalue = NULL;
 	switch (vis) {
 	case SCF_TMPL_VISIBILITY_HIDDEN:
 		visvalue = &e__PropertyVisibility_HIDDEN;
@@ -1363,30 +1386,30 @@
 		visvalue = &e__PropertyVisibility_READWRITE;
 		break;
 	}
-	struct_set(result, "visibility", visvalue);
+	adr_struct_set(result, "visibility", visvalue);
 
 	scf_values_t values;
 	if (scf_tmpl_prop_internal_seps(proptmpl, &values) == 0) {
-		data_t *array =
-		    data_new_array(&t_array_string, values.value_count);
+		adr_data_t *array =
+		    adr_data_new_array(&adr_t_array_string, values.value_count);
 		for (int i = 0; i < values.value_count; i++)
-			(void) array_add(array, data_new_string(
-			    values.values_as_strings[i], lt_copy));
-		struct_set(result, "separators", array);
+			(void) adr_array_add(array, adr_data_new_string(
+			    values.values_as_strings[i], LT_COPY));
+		adr_struct_set(result, "separators", array);
 		scf_values_destroy(&values);
 	}
 
 	if (scf_tmpl_value_name_choices(proptmpl, &values) == 0) {
-		data_t *array =
-		    data_new_array(&t_array_string, values.value_count);
+		adr_data_t *array =
+		    adr_data_new_array(&adr_t_array_string, values.value_count);
 		for (int i = 0; i < values.value_count; i++)
-			(void) array_add(array, data_new_string(
-			    values.values_as_strings[i], lt_copy));
-		struct_set(result, "allowed", array);
+			(void) adr_array_add(array, adr_data_new_string(
+			    values.values_as_strings[i], LT_COPY));
+		adr_struct_set(result, "allowed", array);
 		scf_values_destroy(&values);
 	}
 
-	if ((*ret = data_purify_deep(result)) == NULL)
+	if ((*ret = adr_data_purify_deep(result)) == NULL)
 		err = error_scf(error, SCF_ERROR_NO_MEMORY);
 out:
 	scf_tmpl_prop_destroy(proptmpl);
@@ -1398,7 +1421,7 @@
 
 static int
 get_localedprop(servinst_t *si, const char *locale, const char *name,
-    data_t **ret, data_t **error)
+    adr_data_t **ret, adr_data_t **error)
 {
 	char *str;
 	rad_propvec_t *badprop;
@@ -1417,7 +1440,7 @@
 		return (error_scf(error, scferr));
 	}
 
-	*ret = data_new_string(str, lt_copy);
+	*ret = adr_data_new_string(str, LT_COPY);
 	rad_clean_propvec(evec);
 	return (ce_ok);
 }
@@ -1425,9 +1448,10 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_getCommonName(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
-	const char *locale = data_to_string(args[0]);
+	const char *locale = adr_data_to_string(args[0]);
 	servinst_t *si = instance_getdata(inst);
 
 	if (get_localedprop(si, locale, SCF_PG_TM_COMMON_NAME, ret, NULL)
@@ -1439,9 +1463,10 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_getDescription(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
-	const char *locale = data_to_string(args[0]);
+	const char *locale = adr_data_to_string(args[0]);
 	servinst_t *si = instance_getdata(inst);
 
 	if (get_localedprop(si, locale, SCF_PG_TM_DESCRIPTION, ret, NULL)
@@ -1453,7 +1478,8 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_getLogInfo(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
@@ -1477,7 +1503,7 @@
 		return (ce_object);
 	}
 
-	int max_size = data_to_integer(args[0]);
+	int max_size = adr_data_to_integer(args[0]);
 
 	int bsize = max_size >= 0 && max_size < st.st_size ?
 	    max_size : st.st_size;
@@ -1503,13 +1529,14 @@
 
 	(void) close(fd);
 
-	data_t *result = data_new_struct(&t__LogInfo);
-	struct_set(result, "name", data_new_string(logname, lt_free));
-	struct_set(result, "size", data_new_integer(st.st_size));
-	struct_set(result, "MTime", data_new_time_ts(&st.st_mtim));
-	struct_set(result, "contents", data_new_opaque(buffer, bsize, lt_free));
+	adr_data_t *result = adr_data_new_struct(&t__LogInfo);
+	adr_struct_set(result, "name", adr_data_new_string(logname, LT_FREE));
+	adr_struct_set(result, "size", adr_data_new_integer(st.st_size));
+	adr_struct_set(result, "MTime", adr_data_new_time_ts(&st.st_mtim));
+	adr_struct_set(result, "contents",
+	    adr_data_new_opaque(buffer, bsize, LT_FREE));
 
-	if ((*ret = data_purify(result)) == NULL)
+	if ((*ret = adr_data_purify(result)) == NULL)
 		return (ce_object);
 
 	return (ce_ok);
@@ -1518,7 +1545,7 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_delete(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	conerr_t err = ce_ok;
 	servinst_t *si = instance_getdata(inst);
@@ -1554,7 +1581,7 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_clear(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
@@ -1566,33 +1593,33 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_degrade(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
 		return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
 
 	return (simple_scf(error, smf_degrade_instance(si->fmri,
-	    data_to_boolean(args[0]) ? SMF_IMMEDIATE : 0)));
+	    adr_data_to_boolean(args[0]) ? SMF_IMMEDIATE : 0)));
 }
 
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_maintain(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
 		return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
 
 	return (simple_scf(error, smf_maintain_instance(si->fmri,
-	    data_to_boolean(args[0]) ? SMF_IMMEDIATE : 0)));
+	    adr_data_to_boolean(args[0]) ? SMF_IMMEDIATE : 0)));
 }
 
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_restart(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
@@ -1604,7 +1631,7 @@
 /* ARGSUSED */
 conerr_t
 interface_ServiceInfo_invoke_refresh(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	servinst_t *si = instance_getdata(inst);
 	if (!si->instance)
@@ -1616,30 +1643,35 @@
 /* ARGSUSED */
 conerr_t
 interface_Aggregator_read_services(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	rad_mutex_enter(&service_lock);
-	data_t *result = data_new_array(&t_array__Service, service_count);
+	adr_data_t *result =
+	    adr_data_new_array(&t_array__Service, service_count);
 
 	for (servinst_t *si = list_head(&service_list); si != NULL;
 	    si = list_next(&service_list, si)) {
-		data_t *insts = data_new_array(&t_array_string, si->ninstances);
+		adr_data_t *insts = adr_data_new_array(&adr_t_array_string,
+		    si->ninstances);
 		for (servinst_t *i = list_head(&si->instances); i != NULL;
 		    i = list_next(&si->instances, i))
-			(void) array_add(insts, data_new_string(i->iname,
-			    lt_copy));
+			(void) adr_array_add(insts,
+			    adr_data_new_string(i->iname,
+			    LT_COPY));
 
-		data_t *service = data_new_struct(&t__Service);
-		struct_set(service, "fmri", data_new_string(si->fmri, lt_copy));
-		struct_set(service, "objectName", instance_getname(si->inst));
-		struct_set(service, "instances", insts);
-		(void) array_add(result, service);
+		adr_data_t *service = adr_data_new_struct(&t__Service);
+		adr_struct_set(service, "fmri",
+		    adr_data_new_string(si->fmri, LT_COPY));
+		adr_struct_set(service, "objectName",
+		    instance_getname(si->inst));
+		adr_struct_set(service, "instances", insts);
+		(void) adr_array_add(result, service);
 	}
 
-	if (data_verify(result, NULL, B_TRUE))
+	if (adr_data_verify(result, NULL, B_TRUE))
 		*data = result;
 	else
-		data_free(result);
+		adr_data_free(result);
 
 	rad_mutex_exit(&service_lock);
 	return (*data != NULL ? ce_ok : ce_object);
@@ -1648,7 +1680,7 @@
 /* ARGSUSED */
 conerr_t
 interface_Aggregator_read_instances(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	conerr_t err = ce_ok;
 
@@ -1667,7 +1699,8 @@
 	}
 
 	rad_mutex_enter(&service_lock);
-	data_t *result = data_new_array(&t_array__Instance, instance_count);
+	adr_data_t *result = adr_data_new_array(&t_array__Instance,
+	    instance_count);
 
 	/*
 	 * It would be easy to iterate over all instances -- not just the
@@ -1700,18 +1733,19 @@
 		    scf_value_get_time(val, &seconds, &ns) != 0)
 			continue;
 
-		data_t *inst = data_new_struct(&t__Instance);
-		struct_set(inst, "fmri", data_new_string(si->fmri, lt_copy));
-		struct_set(inst, "objectName", instance_getname(si->inst));
-		struct_set(inst, "STime", data_new_time(seconds, ns));
-		struct_set(inst, "state", state2enum(statestr));
-		if (!data_verify(inst, NULL, B_TRUE))
-			data_free(inst);
+		adr_data_t *inst = adr_data_new_struct(&t__Instance);
+		adr_struct_set(inst, "fmri",
+		    adr_data_new_string(si->fmri, LT_COPY));
+		adr_struct_set(inst, "objectName", instance_getname(si->inst));
+		adr_struct_set(inst, "STime", adr_data_new_time(seconds, ns));
+		adr_struct_set(inst, "state", state2enum(statestr));
+		if (!adr_data_verify(inst, NULL, B_TRUE))
+			adr_data_free(inst);
 		else
-			(void) array_add(result, inst);
+			(void) adr_array_add(result, inst);
 	}
 
-	if ((*data = data_purify(result)) == NULL)
+	if ((*data = adr_data_purify(result)) == NULL)
 		err = ce_object;
 	rad_mutex_exit(&service_lock);
 out:
@@ -1770,8 +1804,8 @@
 
 		rad_log(RL_DEBUG, "identified SMF event: %s/%s", sname, iname);
 
-		data_t *stime = NULL, *state = NULL, *nstate = NULL;
-		data_t *astate = NULL, *reason = NULL;
+		adr_data_t *stime = NULL, *state = NULL, *nstate = NULL;
+		adr_data_t *astate = NULL, *reason = NULL;
 
 		/* Inefficient, but expedient */
 		(void) interface_ServiceInfo_read_stime(si->inst, NULL, &stime,
@@ -1785,23 +1819,23 @@
 		(void) interface_ServiceInfo_read_reason(si->inst, NULL,
 		    &reason, NULL);
 
-		data_t *event = data_new_struct(&t__StateChange);
-		struct_set(event, "source", instance_getname(si->inst));
-		struct_set(event, "state", state);
-		struct_set(event, "nextState", nstate);
-		struct_set(event, "stateTime", stime);
-		struct_set(event, "auxState", astate);
-		struct_set(event, "reason", reason);
-		struct_set(event, "anomaly", data_new_boolean(B_FALSE));
-		if (data_verify(event, NULL, B_FALSE)) {
+		adr_data_t *event = adr_data_new_struct(&t__StateChange);
+		adr_struct_set(event, "source", instance_getname(si->inst));
+		adr_struct_set(event, "state", state);
+		adr_struct_set(event, "nextState", nstate);
+		adr_struct_set(event, "stateTime", stime);
+		adr_struct_set(event, "auxState", astate);
+		adr_struct_set(event, "reason", reason);
+		adr_struct_set(event, "anomaly", adr_data_new_boolean(B_FALSE));
+		if (adr_data_verify(event, NULL, B_FALSE)) {
 			rad_log(RL_DEBUG, "sending SMF event");
 			if (agg_inst != NULL)
 				instance_notify(agg_inst, "statechange",
-				    0, data_ref(event));
+				    0, adr_data_ref(event));
 			instance_notify(si->inst, "statechange", 0, event);
 		} else {
 			rad_log(RL_DEBUG, "failed to send SMF event");
-			data_free(event);
+			adr_data_free(event);
 		}
 
 		rad_mutex_exit(&service_lock);
--- a/components/visual-panels/examples/src/cmd/rad/mod/example-time2/example-time2.c	Fri Jun 29 12:23:11 2012 -0700
+++ b/components/visual-panels/examples/src/cmd/rad/mod/example-time2/example-time2.c	Sat Jun 30 06:30:16 2012 -0700
@@ -40,18 +40,18 @@
 /*ARGSUSED*/
 conerr_t
 interface_Time_read_time(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
-	*data = data_new_long((long long)time(NULL) * 1000);
+	*data = adr_data_new_long((long long)time(NULL) * 1000);
 	return (ce_ok);
 }
 
 /*ARGSUSED*/
 conerr_t
 interface_Time_write_time(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t *data, data_t **error)
+    adr_data_t *data, adr_data_t **error)
 {
-	long long rawtime = data_to_longint(data) / 1000;
+	long long rawtime = adr_data_to_longint(data) / 1000;
 	time_t newtime = (time_t)rawtime;
 
 	if (rawtime > LONG_MAX)
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/common.c	Fri Jun 29 12:23:11 2012 -0700
+++ b/components/visual-panels/smf/src/cmd/rad/mod/smf/common.c	Sat Jun 30 06:30:16 2012 -0700
@@ -36,29 +36,29 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_read_fmri(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	smfobj_t *smfo = instance_getdata(inst);
-	*data = data_new_string(smfo->fmri, lt_copy);
+	*data = adr_data_new_string(smfo->fmri, LT_COPY);
 	return (*data == NULL ? ce_nomem : ce_ok);
 }
 
 /*ARGSUSED*/
 conerr_t
 interface_Entity_read_scope(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
-	*data = data_new_string("localhost", lt_const);
+	*data = adr_data_new_string("localhost", LT_CONST);
 	return (*data == NULL ? ce_nomem : ce_ok);
 }
 
 /*ARGSUSED*/
 conerr_t
 interface_Entity_read_service(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	smfobj_t *smfo = instance_getdata(inst);
-	*data = data_new_string(smfo->sname, lt_copy);
+	*data = adr_data_new_string(smfo->sname, LT_COPY);
 	return (*data == NULL ? ce_nomem : ce_ok);
 }
 
@@ -75,20 +75,20 @@
 
 struct pgargs {
 	smfobj_t *smfo;
-	type_t *type;
+	adr_type_t *type;
 	const char *pgtype;
-	svcerr_t (*cb)(scf_handle_t *, scf_propertygroup_t *, data_t **);
+	svcerr_t (*cb)(scf_handle_t *, scf_propertygroup_t *, adr_data_t **);
 };
 
 /*ARGSUSED*/
 static svcerr_t
-rt_collect_pgs(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_collect_pgs(scf_handle_t *h, void *arg, adr_data_t **ret, adr_data_t **error)
 {
 	struct pgargs *pga = arg;
 	smfobj_t *smfo = pga->smfo;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
 	svcerr_t se = SE_OK;
-	data_t *result = data_new_array(pga->type, 5);
+	adr_data_t *result = adr_data_new_array(pga->type, 5);
 	scf_propertygroup_t *pg = scf_pg_create(h);
 	scf_iter_t *iter = scf_iter_create(h);
 
@@ -105,10 +105,10 @@
 
 	int err;
 	while ((err = scf_iter_next_pg(iter, pg)) > 0) {
-		data_t *item = NULL;
+		adr_data_t *item = NULL;
 		se = pga->cb(h, pg, &item);
 		if (se == SE_OK)
-			(void) array_add(result, item);
+			(void) adr_array_add(result, item);
 		else if (se != SE_NOTFOUND)
 			goto done;
 	}
@@ -126,7 +126,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_read_dependencies(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	struct pgargs pga = {
 		.smfo = instance_getdata(inst),
@@ -140,7 +140,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_read_manpages(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	struct pgargs pga = {
 		.smfo = instance_getdata(inst),
@@ -154,7 +154,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_read_doclinks(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	struct pgargs pga = {
 		.smfo = instance_getdata(inst),
@@ -167,7 +167,7 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_read_pgs(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_read_pgs(scf_handle_t *h, void *arg, adr_data_t **ret, adr_data_t **error)
 {
 	smfobj_t *smfo = arg;
 	svcerr_t se = SE_OK;
@@ -175,7 +175,7 @@
 
 	scf_propertygroup_t *pg = scf_pg_create(h);
 	scf_iter_t *iter = scf_iter_create(h);
-	data_t *result = data_new_array(&t_array__PropertyGroup, 5);
+	adr_data_t *result = adr_data_new_array(&t_array__PropertyGroup, 5);
 
 	if (pg == NULL || iter == NULL) {
 		se = SE_FATAL;
@@ -190,10 +190,10 @@
 
 	int e;
 	while ((e = scf_iter_next_pg(iter, pg)) > 0) {
-		data_t *pgdata;
+		adr_data_t *pgdata;
 		if ((se = create_PropertyGroup(pg, &pgdata)) != SE_OK)
 			goto done;
-		(void) array_add(result, pgdata);
+		(void) adr_array_add(result, pgdata);
 	}
 	if (e != 0)
 		se = smfu_maperr(scf_error());
@@ -210,7 +210,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_read_pgs(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	return (smfu_rtrun(rt_read_pgs, instance_getdata(inst), data, error));
 }
@@ -218,7 +218,8 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_invoke_delete(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_invoke_delete(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	smfobj_t *smfo = arg;
 	svcerr_t se = SE_OK;
@@ -257,7 +258,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_delete(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	return (smfu_rtrun(rt_invoke_delete, instance_getdata(inst), NULL,
 	    error));
@@ -266,7 +267,8 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_invoke_deleteCust(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_invoke_deleteCust(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	smfobj_t *smfo = arg;
 	svcerr_t se = SE_OK;
@@ -306,7 +308,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_deleteCust(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	return (smfu_rtrun(rt_invoke_deleteCust, instance_getdata(inst), NULL,
 	    error));
@@ -314,13 +316,14 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_invoke_createPG(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_invoke_createPG(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	radarg_t *ra = arg;
 	smfobj_t *smfo = instance_getdata(ra->inst);
-	const char *pgname = data_to_string(ra->args[0]);
-	const char *pgtype = data_to_string(ra->args[1]);
-	unsigned int pgflags = data_to_uinteger(ra->args[2]);
+	const char *pgname = adr_data_to_string(ra->args[0]);
+	const char *pgtype = adr_data_to_string(ra->args[1]);
+	unsigned int pgflags = adr_data_to_uinteger(ra->args[2]);
 	svcerr_t se = SE_OK;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
 
@@ -363,7 +366,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_createPG(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	radarg_t ra = { .inst = inst, .args = args };
 	return (smfu_rtrun(rt_invoke_createPG, &ra, NULL, error));
@@ -372,11 +375,12 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_invoke_deletePG(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_invoke_deletePG(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	radarg_t *ra = arg;
 	smfobj_t *smfo = instance_getdata(ra->inst);
-	const char *pgname = data_to_string(ra->args[0]);
+	const char *pgname = adr_data_to_string(ra->args[0]);
 	svcerr_t se = SE_OK;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
 	scf_propertygroup_t *pg = scf_pg_create(h);
@@ -416,7 +420,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_deletePG(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	radarg_t ra = { .inst = inst, .args = args };
 	return (smfu_rtrun(rt_invoke_deletePG, &ra, NULL, error));
@@ -425,11 +429,12 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_invoke_deletePGCust(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_invoke_deletePGCust(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	radarg_t *ra = arg;
 	smfobj_t *smfo = instance_getdata(ra->inst);
-	const char *pgname = data_to_string(ra->args[0]);
+	const char *pgname = adr_data_to_string(ra->args[0]);
 	svcerr_t se = SE_OK;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
 	scf_propertygroup_t *pg = scf_pg_create(h);
@@ -473,19 +478,19 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_deletePGCust(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	radarg_t ra = { .inst = inst, .args = args };
 	return (smfu_rtrun(rt_invoke_deletePGCust, &ra, NULL, error));
 }
 
 static svcerr_t
-rt_invoke_readProperties(scf_handle_t *h, void *arg, data_t **ret,
-    data_t **error)
+rt_invoke_readProperties(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	radarg_t *ra = arg;
 	smfobj_t *smfo = instance_getdata(ra->inst);
-	const char *pgname = data_to_string(ra->args[0]);
+	const char *pgname = adr_data_to_string(ra->args[0]);
 	svcerr_t se = SE_OK;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
 	scf_propertygroup_t *pg = scf_pg_create(h);
@@ -511,7 +516,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_readProperties(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	radarg_t ra = { .inst = inst, .args = args };
 	return (smfu_rtrun(rt_invoke_readProperties, &ra, ret, error));
@@ -520,7 +525,7 @@
 /*ARGSUSED*/
 static svcerr_t
 tx_write_prop(scf_handle_t *h, scf_transaction_t *tx,
-    const char *name, scf_type_t type, data_t *values, data_t **error)
+    const char *name, scf_type_t type, adr_data_t *values, adr_data_t **error)
 {
 	scf_transaction_entry_t *entry = scf_entry_create(h);
 
@@ -549,9 +554,9 @@
 		}
 	}
 
-	int nvalues = array_size(values);
+	int nvalues = adr_array_size(values);
 	for (int i = 0; i < nvalues; i++) {
-		const char *vstr = data_to_string(array_get(values, i));
+		const char *vstr = adr_data_to_string(adr_array_get(values, i));
 		scf_value_t *v = scf_value_create(h);
 		if (v == NULL)
 			return (SE_FATAL);
@@ -571,13 +576,13 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_invoke_writeProperties(scf_handle_t *h, void *arg, data_t **ret,
-    data_t **error)
+rt_invoke_writeProperties(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	radarg_t *ra = arg;
 	smfobj_t *smfo = instance_getdata(ra->inst);
-	const char *pgname = data_to_string(ra->args[0]);
-	data_t *data = ra->args[1];
+	const char *pgname = adr_data_to_string(ra->args[0]);
+	adr_data_t *data = ra->args[1];
 	svcerr_t se = SE_OK;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
 	scf_propertygroup_t *pg = scf_pg_create(h);
@@ -598,14 +603,14 @@
 	if (scf_transaction_start(tx, pg) == -1)
 		goto txerror;
 
-	int nprops = array_size(data);
+	int nprops = adr_array_size(data);
 	for (int i = 0; i < nprops; i++) {
-		data_t *propdata = array_get(data, i);
+		adr_data_t *propdata = adr_array_get(data, i);
 		const char *propname =
-		    data_to_string(struct_get(propdata, "name"));
+		    adr_data_to_string(adr_struct_get(propdata, "name"));
 		scf_type_t proptype =
-		    from_PropertyType(struct_get(propdata, "type"));
-		data_t *values = struct_get(propdata, "values");
+		    from_PropertyType(adr_struct_get(propdata, "type"));
+		adr_data_t *values = adr_struct_get(propdata, "values");
 
 		se = tx_write_prop(h, tx, propname, proptype, values, error);
 		if (se != SE_OK)
@@ -647,19 +652,21 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_writeProperties(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	radarg_t ra = { .inst = inst, .args = args };
 	return (smfu_rtrun(rt_invoke_writeProperties, &ra, NULL, error));
 }
 
 static svcerr_t
-rt_invoke_readProperty(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_invoke_readProperty(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	radarg_t *ra = arg;
 	smfobj_t *smfo = instance_getdata(ra->inst);
-	const char *pgname = data_to_string(ra->args[0]);
-	const char *propname = data_to_string(ra->args[1]);
+	const char *pgname = adr_data_to_string(ra->args[0]);
+	const char *propname = adr_data_to_string(ra->args[1]);
 	svcerr_t se = SE_OK;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
 	scf_propertygroup_t *pg = scf_pg_create(h);
@@ -697,7 +704,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_readProperty(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	radarg_t ra = { .inst = inst, .args = args };
 	return (smfu_rtrun(rt_invoke_readProperty, &ra, ret, error));
@@ -706,15 +713,15 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_invoke_writeProperty(scf_handle_t *h, void *arg, data_t **ret,
-    data_t **error)
+rt_invoke_writeProperty(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	radarg_t *ra = arg;
 	smfobj_t *smfo = instance_getdata(ra->inst);
-	const char *pgname = data_to_string(ra->args[0]);
-	const char *propname = data_to_string(ra->args[1]);
+	const char *pgname = adr_data_to_string(ra->args[0]);
+	const char *propname = adr_data_to_string(ra->args[1]);
 	scf_type_t proptype = from_PropertyType(ra->args[2]);
-	data_t *data = ra->args[3];
+	adr_data_t *data = ra->args[3];
 	svcerr_t se = SE_OK;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
 	scf_propertygroup_t *pg = scf_pg_create(h);
@@ -774,7 +781,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_writeProperty(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	radarg_t ra = { .inst = inst, .args = args };
 	return (smfu_rtrun(rt_invoke_writeProperty, &ra, NULL, error));
@@ -782,7 +789,7 @@
 
 static svcerr_t
 tx_delete_prop(scf_handle_t *h, scf_transaction_t *tx,
-    const char *name, data_t **error)
+    const char *name, adr_data_t **error)
 {
 	scf_transaction_entry_t *entry = scf_entry_create(h);
 
@@ -810,13 +817,13 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_invoke_deleteProperty(scf_handle_t *h, void *arg, data_t **ret,
-    data_t **error)
+rt_invoke_deleteProperty(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	radarg_t *ra = arg;
 	smfobj_t *smfo = instance_getdata(ra->inst);
-	const char *pgname = data_to_string(ra->args[0]);
-	const char *propname = data_to_string(ra->args[1]);
+	const char *pgname = adr_data_to_string(ra->args[0]);
+	const char *propname = adr_data_to_string(ra->args[1]);
 	svcerr_t se = SE_OK;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
 	scf_propertygroup_t *pg = scf_pg_create(h);
@@ -875,7 +882,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_deleteProperty(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	radarg_t ra = { .inst = inst, .args = args };
 	return (smfu_rtrun(rt_invoke_deleteProperty, &ra, NULL, error));
@@ -883,7 +890,7 @@
 
 static svcerr_t
 tx_delete_propcust(scf_handle_t *h, scf_transaction_t *tx,
-    const char *name, data_t **error)
+    const char *name, adr_data_t **error)
 {
 	svcerr_t se = SE_OK;
 	scf_transaction_entry_t *entry = scf_entry_create(h);
@@ -916,13 +923,13 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_invoke_deletePropertyCust(scf_handle_t *h, void *arg, data_t **ret,
-    data_t **error)
+rt_invoke_deletePropertyCust(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	radarg_t *ra = arg;
 	smfobj_t *smfo = instance_getdata(ra->inst);
-	const char *pgname = data_to_string(ra->args[0]);
-	const char *propname = data_to_string(ra->args[1]);
+	const char *pgname = adr_data_to_string(ra->args[0]);
+	const char *propname = adr_data_to_string(ra->args[1]);
 	svcerr_t se = SE_OK;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
 	scf_propertygroup_t *pg = scf_pg_create(h);
@@ -981,7 +988,8 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_deletePropertyCust(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	radarg_t ra = { .inst = inst, .args = args };
 	return (smfu_rtrun(rt_invoke_deletePropertyCust, &ra, NULL, error));
@@ -1001,7 +1009,8 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_get_template(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_get_template(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	struct tmplarg *ta = arg;
 	svcerr_t se = SE_OK;
@@ -1020,7 +1029,7 @@
 
 	if ((se = smfu_get_pg_r(h, &entity, ta->pgname, pg)) == SE_OK &&
 	    (se = smfu_get_l10n_str(h, pg, ta->locale, &str)) == SE_OK) {
-		if ((*ret = data_new_string(str, lt_free)) == NULL)
+		if ((*ret = adr_data_new_string(str, LT_FREE)) == NULL)
 			se = SE_FATAL;
 	} else if (se == SE_NOTFOUND) {
 		se = SE_OK;
@@ -1036,12 +1045,12 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_getCommonName(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	struct tmplarg ta = {
 	    .smfo = instance_getdata(inst),
 	    .pgname = SCF_PG_TM_COMMON_NAME,
-	    .locale = data_to_string(args[0])
+	    .locale = adr_data_to_string(args[0])
 	};
 	return (smfu_rtrun_opt(rt_get_template, &ta, ret, error));
 }
@@ -1049,12 +1058,12 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_getDescription(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	struct tmplarg ta = {
 	    .smfo = instance_getdata(inst),
 	    .pgname = SCF_PG_TM_DESCRIPTION,
-	    .locale = data_to_string(args[0])
+	    .locale = adr_data_to_string(args[0])
 	};
 	return (smfu_rtrun_opt(rt_get_template, &ta, ret, error));
 }
@@ -1062,14 +1071,14 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_invoke_getPGTemplates(scf_handle_t *h, void *arg, data_t **ret,
-    data_t **error)
+rt_invoke_getPGTemplates(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	radarg_t *ra = arg;
 	smfobj_t *smfo = instance_getdata(ra->inst);
-	const char *locale = data_to_string(ra->args[0]);
+	const char *locale = adr_data_to_string(ra->args[0]);
 	svcerr_t se = SE_OK;
-	data_t *result = data_new_array(&t_array__PGTemplate, 5);
+	adr_data_t *result = adr_data_new_array(&t_array__PGTemplate, 5);
 
 	scf_pg_tmpl_t *pgtmpl = scf_tmpl_pg_create(h);
 	if (pgtmpl == NULL) {
@@ -1080,10 +1089,10 @@
 	int e;
 	while ((e = scf_tmpl_iter_pgs(pgtmpl, smfo->fmri, NULL, NULL,
 	    SCF_PG_TMPL_FLAG_CURRENT)) == 1) {
-		data_t *t = NULL;
+		adr_data_t *t = NULL;
 		if ((se = create_PGTemplate(pgtmpl, locale, &t)) != SE_OK)
 			goto done;
-		(void) array_add(result, t);
+		(void) adr_array_add(result, t);
 	}
 	if (e == -1)
 		se = smfu_maperr(scf_error());
@@ -1097,7 +1106,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_getPGTemplates(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	radarg_t ra = { .inst = inst, .args = args };
 	return (smfu_rtrun(rt_invoke_getPGTemplates, &ra, ret, error));
@@ -1106,16 +1115,16 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_invoke_getPropTemplates(scf_handle_t *h, void *arg, data_t **ret,
-    data_t **error)
+rt_invoke_getPropTemplates(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	radarg_t *ra = arg;
 	smfobj_t *smfo = instance_getdata(ra->inst);
-	const char *pgname = data_to_string(ra->args[0]);
-	const char *pgtype = data_to_string(ra->args[1]);
-	const char *locale = data_to_string(ra->args[2]);
+	const char *pgname = adr_data_to_string(ra->args[0]);
+	const char *pgtype = adr_data_to_string(ra->args[1]);
+	const char *locale = adr_data_to_string(ra->args[2]);
 	svcerr_t se = SE_OK;
-	data_t *result = data_new_array(&t_array__PropTemplate, 5);
+	adr_data_t *result = adr_data_new_array(&t_array__PropTemplate, 5);
 
 	scf_pg_tmpl_t *pgtmpl = scf_tmpl_pg_create(h);
 	scf_prop_tmpl_t *proptmpl = scf_tmpl_prop_create(h);
@@ -1133,10 +1142,10 @@
 
 	int e;
 	while ((e = scf_tmpl_iter_props(pgtmpl, proptmpl, 0)) == 0) {
-		data_t *t = NULL;
+		adr_data_t *t = NULL;
 		if ((se = create_PropTemplate(proptmpl, locale, &t)) != SE_OK)
 			goto done;
-		(void) array_add(result, t);
+		(void) adr_array_add(result, t);
 	}
 	if (e == -1)
 		se = smfu_maperr(scf_error());
@@ -1151,7 +1160,8 @@
 /*ARGSUSED*/
 conerr_t
 interface_Entity_invoke_getPropTemplates(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	radarg_t ra = { .inst = inst, .args = args };
 	return (smfu_rtrun(rt_invoke_getPropTemplates, &ra, ret, error));
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/datatype.c	Fri Jun 29 12:23:11 2012 -0700
+++ b/components/visual-panels/smf/src/cmd/rad/mod/smf/datatype.c	Sat Jun 30 06:30:16 2012 -0700
@@ -51,7 +51,7 @@
  * Consumed by the API entry points.
  */
 
-data_t *
+adr_data_t *
 create_SMFState(const char *state)
 {
 	if (strcmp(state, SCF_STATE_STRING_UNINIT) == 0) {
@@ -61,11 +61,11 @@
 	} else if (strcmp(state, SCF_STATE_STRING_LEGACY) == 0) {
 		return (&e__SMFState_LEGACY);
 	} else {
-		return (data_new_enum_byname(&t__SMFState, state));
+		return (adr_data_new_enum_byname(&t__SMFState, state));
 	}
 }
 
-static data_t *
+static adr_data_t *
 create_DepGrouping(const char *grouping)
 {
 	if (strcmp(grouping, SCF_DEP_REQUIRE_ALL) == 0)
@@ -79,7 +79,7 @@
 	return (NULL);
 }
 
-static data_t *
+static adr_data_t *
 create_DepRestart(const char *restarton)
 {
 	if (strcmp(restarton, SCF_DEP_RESET_ON_ERROR) == 0)
@@ -93,21 +93,21 @@
 	return (NULL);
 }
 
-static data_t *
+static adr_data_t *
 create_PropertyType(scf_type_t type)
 {
-	data_t *result = data_new_enum(&t__PropertyType, type);
+	adr_data_t *result = adr_data_new_enum(&t__PropertyType, type);
 	assert(result != NULL);
 	return (result);
 }
 
 scf_type_t
-from_PropertyType(data_t *type)
+from_PropertyType(adr_data_t *type)
 {
-	return (enum_tovalue(type));
+	return (adr_enum_tovalue(type));
 }
 
-static data_t *
+static adr_data_t *
 create_PropertyVisibility(uint8_t visibility)
 {
 	switch (visibility) {
@@ -129,7 +129,7 @@
  */
 svcerr_t
 create_Dependency(scf_handle_t *scfhandle, scf_propertygroup_t *pg,
-    data_t **ret)
+    adr_data_t **ret)
 {
 	svcerr_t se = SE_OK;
 	char type[max_pgtype + 1];
@@ -159,31 +159,31 @@
 		goto out;
 	}
 
-	data_t *group = create_DepGrouping(grouping);
-	data_t *restart = create_DepRestart(restarton);
+	adr_data_t *group = create_DepGrouping(grouping);
+	adr_data_t *restart = create_DepRestart(restarton);
 	if (group == NULL || restart == NULL) {
 		se = SE_NOTFOUND;
 		goto out;
 	}
 
-	data_t *result = data_new_struct(&t__Dependency);
-	struct_set(result, "name", data_new_string(pgname, lt_copy));
-	struct_set(result, "grouping", group);
-	struct_set(result, "restartOn", restart);
-	data_t *array = data_new_array(&t_array_string, 5);
-	struct_set(result, "target", array);
+	adr_data_t *result = adr_data_new_struct(&t__Dependency);
+	adr_struct_set(result, "name", adr_data_new_string(pgname, LT_COPY));
+	adr_struct_set(result, "grouping", group);
+	adr_struct_set(result, "restartOn", restart);
+	adr_data_t *array = adr_data_new_array(&adr_t_array_string, 5);
+	adr_struct_set(result, "target", array);
 
 	while (scf_iter_next_value(iter, val) > 0) {
 		if (scf_value_get_as_string(val, type, sizeof (type)) == -1) {
 			se = smfu_maperr(scf_error());
-			data_free(result);
+			adr_data_free(result);
 			goto out;
 		}
-		(void) array_add(array, data_new_string(type, lt_copy));
+		(void) adr_array_add(array, adr_data_new_string(type, LT_COPY));
 	}
-	if (!data_verify(result, NULL, B_TRUE)) {
+	if (!adr_data_verify(result, NULL, B_TRUE)) {
 		se = SE_FATAL;
-		data_free(result);
+		adr_data_free(result);
 		goto out;
 	}
 
@@ -202,7 +202,8 @@
  * a man page and should be skipped.
  */
 svcerr_t
-create_Manpage(scf_handle_t *scfhandle, scf_propertygroup_t *pg, data_t **ret)
+create_Manpage(scf_handle_t *scfhandle, scf_propertygroup_t *pg,
+    adr_data_t **ret)
 {
 	char manpath[max_value + 1];
 	char section[max_value + 1];
@@ -239,22 +240,24 @@
 		goto out;
 	}
 
-	data_t *result = data_new_struct(&t__Manpage);
-	struct_set(result, "title", data_new_string(title, lt_copy));
-	struct_set(result, "section", data_new_string(section, lt_copy));
+	adr_data_t *result = adr_data_new_struct(&t__Manpage);
+	adr_struct_set(result, "title", adr_data_new_string(title, LT_COPY));
+	adr_struct_set(result, "section",
+	    adr_data_new_string(section, LT_COPY));
 	if (strcmp(manpath, ":default") != 0) {
-		data_t *mp = data_new_string(manpath, lt_copy);
+		adr_data_t *mp = adr_data_new_string(manpath, LT_COPY);
 		if (mp == NULL) {
 			se = SE_FATAL;
-			data_free(result);
+			adr_data_free(result);
 			goto out;
 		}
-		struct_set(result, "path", data_new_string(manpath, lt_copy));
+		adr_struct_set(result, "path",
+		    adr_data_new_string(manpath, LT_COPY));
 	}
 
-	if (!data_verify(result, NULL, B_TRUE)) {
+	if (!adr_data_verify(result, NULL, B_TRUE)) {
 		se = SE_FATAL;
-		data_free(result);
+		adr_data_free(result);
 		goto out;
 	}
 
@@ -272,7 +275,8 @@
  * a doclink and should be skipped.
  */
 svcerr_t
-create_Doclink(scf_handle_t *scfhandle, scf_propertygroup_t *pg, data_t **ret)
+create_Doclink(scf_handle_t *scfhandle, scf_propertygroup_t *pg,
+    adr_data_t **ret)
 {
 	char name[max_value + 1];
 	char uri[max_value + 1];
@@ -304,13 +308,13 @@
 		goto out;
 	}
 
-	data_t *result = data_new_struct(&t__Doclink);
-	struct_set(result, "name", data_new_string(name, lt_copy));
-	struct_set(result, "uri", data_new_string(uri, lt_copy));
+	adr_data_t *result = adr_data_new_struct(&t__Doclink);
+	adr_struct_set(result, "name", adr_data_new_string(name, LT_COPY));
+	adr_struct_set(result, "uri", adr_data_new_string(uri, LT_COPY));
 
-	if (!data_verify(result, NULL, B_TRUE)) {
+	if (!adr_data_verify(result, NULL, B_TRUE)) {
 		se = SE_FATAL;
-		data_free(result);
+		adr_data_free(result);
 		goto out;
 	}
 
@@ -322,7 +326,7 @@
 }
 
 svcerr_t
-create_PropertyGroup(scf_propertygroup_t *pg, data_t **ret)
+create_PropertyGroup(scf_propertygroup_t *pg, adr_data_t **ret)
 {
 	char name[max_value + 1];
 	char type[max_pgtype + 1];
@@ -336,14 +340,14 @@
 		goto out;
 	}
 
-	data_t *result = data_new_struct(&t__PropertyGroup);
-	struct_set(result, "name", data_new_string(name, lt_copy));
-	struct_set(result, "type", data_new_string(type, lt_copy));
-	struct_set(result, "flags", data_new_uinteger(flags));
+	adr_data_t *result = adr_data_new_struct(&t__PropertyGroup);
+	adr_struct_set(result, "name", adr_data_new_string(name, LT_COPY));
+	adr_struct_set(result, "type", adr_data_new_string(type, LT_COPY));
+	adr_struct_set(result, "flags", adr_data_new_uinteger(flags));
 
-	if (!data_verify(result, NULL, B_TRUE)) {
+	if (!adr_data_verify(result, NULL, B_TRUE)) {
 		se = SE_FATAL;
-		data_free(result);
+		adr_data_free(result);
 		goto out;
 	}
 
@@ -354,7 +358,7 @@
 
 svcerr_t
 create_Property(scf_property_t *prop, scf_iter_t *iter, scf_value_t *value,
-    data_t **ret, data_t **error)
+    adr_data_t **ret, adr_data_t **error)
 {
 	char name[max_name + 1];
 	scf_type_t type;
@@ -364,15 +368,16 @@
 	    scf_iter_property_values(iter, prop))
 		return (smfu_maperr(scf_error()));
 
-	data_t *values = data_new_array(&t_array_string, 5);
+	adr_data_t *values = adr_data_new_array(&adr_t_array_string, 5);
 	int err;
 	while ((err = scf_iter_next_value(iter, value)) > 0) {
 		char *valstr;
 		if (smfu_value_get_string(value, &valstr) != 0) {
-			data_free(values);
+			adr_data_free(values);
 			return (SE_FATAL);
 		}
-		(void) array_add(values, data_new_string(valstr, lt_free));
+		(void) adr_array_add(values,
+		    adr_data_new_string(valstr, LT_FREE));
 	}
 	if (err != 0) {
 		if (scf_error() == SCF_ERROR_PERMISSION_DENIED)
@@ -382,10 +387,10 @@
 			return (smfu_maperr(scf_error()));
 	}
 
-	data_t *result = data_new_struct(&t__Property);
-	struct_set(result, "name", data_new_string(name, lt_copy));
-	struct_set(result, "type", create_PropertyType(type));
-	struct_set(result, "values", values);
+	adr_data_t *result = adr_data_new_struct(&t__Property);
+	adr_struct_set(result, "name", adr_data_new_string(name, LT_COPY));
+	adr_struct_set(result, "type", create_PropertyType(type));
+	adr_struct_set(result, "values", values);
 	*ret = result;
 
 	return (SE_OK);
@@ -393,14 +398,14 @@
 
 svcerr_t
 create_Properties(scf_handle_t *scfhandle, scf_propertygroup_t *pg,
-    data_t **ret, data_t **error)
+    adr_data_t **ret, adr_data_t **error)
 {
 	svcerr_t se = SE_OK;
 	scf_iter_t *piter = scf_iter_create(scfhandle);
 	scf_iter_t *viter = scf_iter_create(scfhandle);
 	scf_value_t *value = scf_value_create(scfhandle);
 	scf_property_t *prop = scf_property_create(scfhandle);
-	data_t *result = data_new_array(&t_array__Property, 5);
+	adr_data_t *result = adr_data_new_array(&t_array__Property, 5);
 
 	if (piter == NULL || viter == NULL || value == NULL || prop == NULL) {
 		se = SE_FATAL;
@@ -414,18 +419,18 @@
 
 	int err;
 	while ((err = scf_iter_next_property(piter, prop)) > 0) {
-		data_t *propdata = NULL;
+		adr_data_t *propdata = NULL;
 		if ((se = create_Property(prop, viter, value, &propdata,
 		    error)) != SE_OK)
 			goto out;
-		(void) array_add(result, propdata);
+		(void) adr_array_add(result, propdata);
 	}
 	if (err != 0)
 		se = smfu_maperr(scf_error());
 
 out:
 	if (se != SE_OK)
-		data_free(result);
+		adr_data_free(result);
 	else
 		*ret = result;
 
@@ -439,15 +444,15 @@
 
 svcerr_t
 create_ExtendedState(scf_handle_t *scfhandle, scf_instance_t *instance,
-    data_t **ret)
+    adr_data_t **ret)
 {
 	scf_propertygroup_t *pg = scf_pg_create(scfhandle);
 	scf_property_t *prop = scf_property_create(scfhandle);
 	scf_value_t *value = scf_value_create(scfhandle);
-	data_t *result = data_new_struct(&t__ExtendedState);
+	adr_data_t *result = adr_data_new_struct(&t__ExtendedState);
 	svcerr_t se = SE_FATAL;
 	int serr;
-	data_t *dstr;
+	adr_data_t *dstr;
 	char *str;
 	int64_t sec;
 	int32_t nsec;
@@ -465,7 +470,7 @@
 		goto scferror;
 	if (smfu_value_get_string(value, &str) != 0)
 		goto error;
-	struct_set(result, "state", create_SMFState(str));
+	adr_struct_set(result, "state", create_SMFState(str));
 	free(str);
 
 	if (scf_pg_get_property(pg, SCF_PROPERTY_NEXT_STATE, prop) == -1 ||
@@ -473,7 +478,7 @@
 		goto scferror;
 	if (smfu_value_get_string(value, &str) != 0)
 		goto error;
-	struct_set(result, "nextState", create_SMFState(str));
+	adr_struct_set(result, "nextState", create_SMFState(str));
 	free(str);
 
 	if (scf_pg_get_property(pg, SCF_PROPERTY_AUX_STATE, prop) == -1 ||
@@ -481,27 +486,28 @@
 		goto scferror;
 	if (smfu_value_get_string(value, &str) != 0)
 		goto error;
-	if ((dstr = data_new_string(str, lt_free)) == NULL)
+	if ((dstr = adr_data_new_string(str, LT_FREE)) == NULL)
 		goto error;
-	struct_set(result, "auxstate", dstr);
+	adr_struct_set(result, "auxstate", dstr);
 
 	if (scf_pg_get_property(pg, SCF_PROPERTY_STATE_TIMESTAMP, prop) == -1 ||
 	    scf_property_get_value(prop, value) == -1 ||
 	    scf_value_get_time(value, &sec, &nsec) == -1)
 		goto scferror;
-	struct_set(result, "stime", data_new_time(sec, nsec));
+	adr_struct_set(result, "stime", adr_data_new_time(sec, nsec));
 
 	if (scf_pg_get_property(pg, SCF_PROPERTY_CONTRACT, prop) == -1 ||
 	    scf_property_get_value(prop, value) == -1) {
 		if (scf_error() == SCF_ERROR_NOT_FOUND)
-			struct_set(result, "contractid", data_new_integer(-1));
+			adr_struct_set(result, "contractid",
+			    adr_data_new_integer(-1));
 		else
 			goto scferror;
 	} else if (scf_value_get_count(value, &ctid) == -1) {
 		goto scferror;
 	} else {
-		struct_set(result, "contractid",
-		    data_new_integer(ctid <= INT_MAX ? ctid : -1));
+		adr_struct_set(result, "contractid",
+		    adr_data_new_integer(ctid <= INT_MAX ? ctid : -1));
 	}
 
 	if ((serr = smfu_read_enabled(instance, pg, prop, value, SCF_PG_GENERAL,
@@ -509,14 +515,15 @@
 		se = smfu_maperr(serr);
 		goto error;
 	}
-	data_t *persist = data_new_boolean(bool > 0);
-	struct_set(result, "enabled", persist);
+	adr_data_t *persist = adr_data_new_boolean(bool > 0);
+	adr_struct_set(result, "enabled", persist);
 
 	if ((serr = smfu_read_enabled(instance, pg, prop, value,
 	    SCF_PG_GENERAL_OVR, &bool)) == 0) {
-		struct_set(result, "enabled_temp", data_new_boolean(bool > 0));
+		adr_struct_set(result, "enabled_temp",
+		    adr_data_new_boolean(bool > 0));
 	} else if (serr == SCF_ERROR_NOT_FOUND) {
-		struct_set(result, "enabled_temp", data_ref(persist));
+		adr_struct_set(result, "enabled_temp", adr_data_ref(persist));
 	} else {
 		se = smfu_maperr(serr);
 		goto error;
@@ -529,42 +536,42 @@
 scferror:
 	se = smfu_maperr(scf_error());
 error:
-	data_free(result);
+	adr_data_free(result);
 	return (se);
 }
 
 svcerr_t
-create_PGTemplate(scf_pg_tmpl_t *pgtmpl, const char *locale, data_t **ret)
+create_PGTemplate(scf_pg_tmpl_t *pgtmpl, const char *locale, adr_data_t **ret)
 {
-	data_t *pt = data_new_struct(&t__PGTemplate);
-	data_t *dstr;
+	adr_data_t *pt = adr_data_new_struct(&t__PGTemplate);
+	adr_data_t *dstr;
 	char *str;
 	svcerr_t se = SE_FATAL;
 
 	if (scf_tmpl_pg_name(pgtmpl, &str) == -1)
 		goto scferror;
-	struct_set(pt, "pgname", data_new_string(str, lt_free));
+	adr_struct_set(pt, "pgname", adr_data_new_string(str, LT_FREE));
 
 	if (scf_tmpl_pg_type(pgtmpl, &str) == -1)
 		goto scferror;
-	struct_set(pt, "pgtype", data_new_string(str, lt_free));
+	adr_struct_set(pt, "pgtype", adr_data_new_string(str, LT_FREE));
 
 	if (scf_tmpl_pg_common_name(pgtmpl, locale, &str) == -1) {
 		if (scf_error() != SCF_ERROR_NOT_FOUND)
 			goto scferror;
 	} else {
-		if ((dstr = data_new_string(str, lt_free)) == NULL)
+		if ((dstr = adr_data_new_string(str, LT_FREE)) == NULL)
 			goto error;
-		struct_set(pt, "name", dstr);
+		adr_struct_set(pt, "name", dstr);
 	}
 
 	if (scf_tmpl_pg_description(pgtmpl, locale, &str) == -1) {
 		if (scf_error() != SCF_ERROR_NOT_FOUND)
 			goto scferror;
 	} else {
-		if ((dstr = data_new_string(str, lt_free)) == NULL)
+		if ((dstr = adr_data_new_string(str, LT_FREE)) == NULL)
 			goto error;
-		struct_set(pt, "description", dstr);
+		adr_struct_set(pt, "description", dstr);
 	}
 
 	uint8_t req;
@@ -573,7 +580,7 @@
 			goto scferror;
 		req = 0;
 	}
-	struct_set(pt, "required", data_new_boolean(req > 0));
+	adr_struct_set(pt, "required", adr_data_new_boolean(req > 0));
 
 	*ret = pt;
 	return (SE_OK);
@@ -581,21 +588,22 @@
 scferror:
 	se = smfu_maperr(scf_error());
 error:
-	data_free(pt);
+	adr_data_free(pt);
 	return (se);
 }
 
 svcerr_t
-create_PropTemplate(scf_prop_tmpl_t *proptmpl, const char *locale, data_t **ret)
+create_PropTemplate(scf_prop_tmpl_t *proptmpl, const char *locale,
+    adr_data_t **ret)
 {
-	data_t *pt = data_new_struct(&t__PropTemplate);
-	data_t *dstr;
+	adr_data_t *pt = adr_data_new_struct(&t__PropTemplate);
+	adr_data_t *dstr;
 	char *str;
 	svcerr_t se = SE_FATAL;
 
 	if (scf_tmpl_prop_name(proptmpl, &str) == -1)
 		goto error;
-	struct_set(pt, "propname", data_new_string(str, lt_free));
+	adr_struct_set(pt, "propname", adr_data_new_string(str, LT_FREE));
 
 	scf_type_t type;
 	if (scf_tmpl_prop_type(proptmpl, &type) == -1) {
@@ -603,33 +611,33 @@
 			goto scferror;
 		type = SCF_TYPE_INVALID;
 	}
-	struct_set(pt, "proptype", create_PropertyType(type));
+	adr_struct_set(pt, "proptype", create_PropertyType(type));
 
 	if (scf_tmpl_prop_common_name(proptmpl, locale, &str) == -1) {
 		if (scf_error() != SCF_ERROR_NOT_FOUND)
 			goto scferror;
 	} else {
-		if ((dstr = data_new_string(str, lt_free)) == NULL)
+		if ((dstr = adr_data_new_string(str, LT_FREE)) == NULL)
 			goto error;
-		struct_set(pt, "name", dstr);
+		adr_struct_set(pt, "name", dstr);
 	}
 
 	if (scf_tmpl_prop_description(proptmpl, locale, &str) == -1) {
 		if (scf_error() != SCF_ERROR_NOT_FOUND)
 			goto scferror;
 	} else {
-		if ((dstr = data_new_string(str, lt_free)) == NULL)
+		if ((dstr = adr_data_new_string(str, LT_FREE)) == NULL)
 			goto error;
-		struct_set(pt, "description", dstr);
+		adr_struct_set(pt, "description", dstr);
 	}
 
 	if (scf_tmpl_prop_units(proptmpl, locale, &str) == -1) {
 		if (scf_error() != SCF_ERROR_NOT_FOUND)
 			goto scferror;
 	} else {
-		if ((dstr = data_new_string(str, lt_free)) == NULL)
+		if ((dstr = adr_data_new_string(str, LT_FREE)) == NULL)
 			goto error;
-		struct_set(pt, "units", dstr);
+		adr_struct_set(pt, "units", dstr);
 	}
 
 	uint8_t req;
@@ -638,7 +646,7 @@
 			goto scferror;
 		req = 0;
 	}
-	struct_set(pt, "required", data_new_boolean(req > 0));
+	adr_struct_set(pt, "required", adr_data_new_boolean(req > 0));
 
 	uint64_t min, max;
 	if (scf_tmpl_prop_cardinality(proptmpl, &min, &max) == -1) {
@@ -646,8 +654,8 @@
 			goto scferror;
 		min = max = 0;
 	}
-	struct_set(pt, "cardinality_min", data_new_ulong(min));
-	struct_set(pt, "cardinality_max", data_new_ulong(max));
+	adr_struct_set(pt, "cardinality_min", adr_data_new_ulong(min));
+	adr_struct_set(pt, "cardinality_max", adr_data_new_ulong(max));
 
 	uint8_t vis;
 	if (scf_tmpl_prop_visibility(proptmpl, &vis) == -1) {
@@ -655,20 +663,20 @@
 			goto scferror;
 		vis = SCF_TMPL_VISIBILITY_READWRITE;
 	}
-	struct_set(pt, "visibility", create_PropertyVisibility(vis));
+	adr_struct_set(pt, "visibility", create_PropertyVisibility(vis));
 
 	scf_values_t values;
 	if (scf_tmpl_prop_internal_seps(proptmpl, &values) == 0) {
-		data_t *array =
-		    data_new_array(&t_array_string, values.value_count);
+		adr_data_t *array =
+		    adr_data_new_array(&adr_t_array_string, values.value_count);
 		for (int i = 0; i < values.value_count; i++)
-			(void) array_add(array, data_new_string(
-			    values.values_as_strings[i], lt_copy));
-		if (!data_verify(array, NULL, B_TRUE)) {
-			data_free(array);
+			(void) adr_array_add(array, adr_data_new_string(
+			    values.values_as_strings[i], LT_COPY));
+		if (!adr_data_verify(array, NULL, B_TRUE)) {
+			adr_data_free(array);
 			goto error;
 		}
-		struct_set(pt, "separators", array);
+		adr_struct_set(pt, "separators", array);
 		scf_values_destroy(&values);
 	} else {
 		if (scf_error() != SCF_ERROR_NOT_FOUND)
@@ -681,14 +689,14 @@
 scferror:
 	se = smfu_maperr(scf_error());
 error:
-	data_free(pt);
+	adr_data_free(pt);
 	return (se);
 }
 
 
 svcerr_t
 create_Instance(scf_instance_t *instance, const char *sname, const char *iname,
-    data_t **data, scf_propertygroup_t *pg, scf_property_t *prop,
+    adr_data_t **data, scf_propertygroup_t *pg, scf_property_t *prop,
     scf_value_t *val)
 {
 	char statestr[MAX_SCF_STATE_STRING_SZ];
@@ -713,16 +721,16 @@
 	    scf_value_get_time(val, &seconds, &nsec) != 0)
 		return (smfu_maperr(scf_error()));
 
-	data_t *inst = data_new_struct(&t__Instance);
-	struct_set(inst, "fmri",
-	    data_new_string(smfu_fmri_alloc(sname, iname), lt_free));
-	struct_set(inst, "objectName",
-	    data_new_name(smfu_name_alloc(sname, iname)));
-	struct_set(inst, "stime", data_new_time(seconds, nsec));
-	struct_set(inst, "state", create_SMFState(statestr));
+	adr_data_t *inst = adr_data_new_struct(&t__Instance);
+	adr_struct_set(inst, "fmri",
+	    adr_data_new_string(smfu_fmri_alloc(sname, iname), LT_FREE));
+	adr_struct_set(inst, "objectName",
+	    adr_data_new_name(smfu_name_alloc(sname, iname)));
+	adr_struct_set(inst, "stime", adr_data_new_time(seconds, nsec));
+	adr_struct_set(inst, "state", create_SMFState(statestr));
 
-	if (!data_verify(inst, NULL, B_TRUE)) {
-		data_free(inst);
+	if (!adr_data_verify(inst, NULL, B_TRUE)) {
+		adr_data_free(inst);
 		return (SE_FATAL);
 	}
 
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/datatype.h	Fri Jun 29 12:23:11 2012 -0700
+++ b/components/visual-panels/smf/src/cmd/rad/mod/smf/datatype.h	Sat Jun 30 06:30:16 2012 -0700
@@ -37,27 +37,28 @@
 extern "C" {
 #endif
 
-data_t *create_SMFState(const char *);
-scf_type_t from_PropertyType(data_t *);
+adr_data_t *create_SMFState(const char *);
+scf_type_t from_PropertyType(adr_data_t *);
 
-svcerr_t create_Dependency(scf_handle_t *, scf_propertygroup_t *, data_t **);
-svcerr_t create_Manpage(scf_handle_t *, scf_propertygroup_t *, data_t **);
-svcerr_t create_Doclink(scf_handle_t *, scf_propertygroup_t *, data_t **);
+svcerr_t create_Dependency(scf_handle_t *, scf_propertygroup_t *,
+    adr_data_t **);
+svcerr_t create_Manpage(scf_handle_t *, scf_propertygroup_t *, adr_data_t **);
+svcerr_t create_Doclink(scf_handle_t *, scf_propertygroup_t *, adr_data_t **);
 
-svcerr_t create_PropertyGroup(scf_propertygroup_t *, data_t **);
+svcerr_t create_PropertyGroup(scf_propertygroup_t *, adr_data_t **);
 
 svcerr_t create_Property(scf_property_t *, scf_iter_t *, scf_value_t *,
-    data_t **, data_t **);
-svcerr_t create_Properties(scf_handle_t *, scf_propertygroup_t *, data_t **,
-    data_t **);
+    adr_data_t **, adr_data_t **);
+svcerr_t create_Properties(scf_handle_t *, scf_propertygroup_t *, adr_data_t **,
+    adr_data_t **);
 
-svcerr_t create_ExtendedState(scf_handle_t *, scf_instance_t *, data_t **);
+svcerr_t create_ExtendedState(scf_handle_t *, scf_instance_t *, adr_data_t **);
 
-svcerr_t create_PGTemplate(scf_pg_tmpl_t *, const char *, data_t **);
-svcerr_t create_PropTemplate(scf_prop_tmpl_t *, const char *, data_t **);
+svcerr_t create_PGTemplate(scf_pg_tmpl_t *, const char *, adr_data_t **);
+svcerr_t create_PropTemplate(scf_prop_tmpl_t *, const char *, adr_data_t **);
 
 svcerr_t create_Instance(scf_instance_t *, const char *, const char *,
-    data_t **, scf_propertygroup_t *, scf_property_t *, scf_value_t *);
+    adr_data_t **, scf_propertygroup_t *, scf_property_t *, scf_value_t *);
 
 #ifdef	__cplusplus
 }
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/instance.c	Fri Jun 29 12:23:11 2012 -0700
+++ b/components/visual-panels/smf/src/cmd/rad/mod/smf/instance.c	Sat Jun 30 06:30:16 2012 -0700
@@ -41,17 +41,18 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_read_instance(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	smfobj_t *smfo = instance_getdata(inst);
-	*data = data_new_string(smfo->iname, lt_copy);
+	*data = adr_data_new_string(smfo->iname, LT_COPY);
 	return (*data == NULL ? ce_nomem : ce_ok);
 }
 
 
 /*ARGSUSED*/
 static svcerr_t
-rt_read_restarter(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_read_restarter(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	smfobj_t *smfo = arg;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
@@ -75,7 +76,8 @@
 
 	if (scf_pg_get_property(pg, SCF_PROPERTY_RESTARTER, prop) == -1) {
 		if (scf_error() == SCF_ERROR_NOT_FOUND)
-			*ret = data_new_string(SCF_SERVICE_STARTD, lt_const);
+			*ret = adr_data_new_string(SCF_SERVICE_STARTD,
+			    LT_CONST);
 		else
 			se = smfu_maperr(scf_error());
 		goto done;
@@ -87,7 +89,7 @@
 		goto done;
 	}
 
-	*ret = data_new_string(fmri, lt_copy);
+	*ret = adr_data_new_string(fmri, LT_COPY);
 
 done:
 	scf_value_destroy(value);
@@ -101,7 +103,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_read_restarter(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	return (smfu_rtrun(rt_read_restarter, instance_getdata(inst), data,
 	    error));
@@ -110,7 +112,8 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_read_enabled(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_read_enabled(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	smfobj_t *smfo = arg;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
@@ -136,7 +139,7 @@
 		    value, SCF_PG_GENERAL, &bool);
 
 	if (serr == 0)
-		*ret = data_new_boolean(bool > 0);
+		*ret = adr_data_new_boolean(bool > 0);
 	else
 		se = smfu_maperr(serr);
 
@@ -152,7 +155,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_read_enabled(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	return (smfu_rtrun(rt_read_enabled, instance_getdata(inst), data,
 	    error));
@@ -161,7 +164,7 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_read_state(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_read_state(scf_handle_t *h, void *arg, adr_data_t **ret, adr_data_t **error)
 {
 	smfobj_t *smfo = arg;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
@@ -200,7 +203,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_read_state(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	return (smfu_rtrun(rt_read_state, instance_getdata(inst), data, error));
 }
@@ -208,7 +211,8 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_read_ex_state(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_read_ex_state(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	smfobj_t *smfo = arg;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
@@ -225,7 +229,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_read_ex_state(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	return (smfu_rtrun(rt_read_ex_state, instance_getdata(inst), data,
 	    error));
@@ -234,7 +238,8 @@
 
 /*ARGSUSED*/
 static svcerr_t
-rt_read_snapshots(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_read_snapshots(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	smfobj_t *smfo = arg;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
@@ -243,7 +248,7 @@
 
 	scf_snapshot_t *snap = scf_snapshot_create(h);
 	scf_iter_t *iter = scf_iter_create(h);
-	data_t *rdata = data_new_array(&t_array_string, 6);
+	adr_data_t *rdata = adr_data_new_array(&adr_t_array_string, 6);
 
 	if (snap == NULL || iter == NULL) {
 		se = SE_FATAL;
@@ -264,7 +269,8 @@
 			se = smfu_maperr(scf_error());
 			goto done;
 		}
-		(void) array_add(rdata, data_new_string(sname, lt_copy));
+		(void) adr_array_add(rdata,
+		    adr_data_new_string(sname, LT_COPY));
 	}
 	if (e != 0)
 		se = smfu_maperr(scf_error());
@@ -281,7 +287,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_read_snapshots(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	return (smfu_rtrun(rt_read_snapshots, instance_getdata(inst), data,
 	    error));
@@ -289,20 +295,20 @@
 
 
 static svcerr_t
-rt_invoke_readSnapshotPGs(scf_handle_t *h, void *arg, data_t **ret,
-    data_t **error)
+rt_invoke_readSnapshotPGs(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	radarg_t *ra = arg;
 	smfobj_t *smfo = instance_getdata(ra->inst);
 	const char *snapname =
-	    ra->args[0] == NULL ? NULL : data_to_string(ra->args[0]);
+	    ra->args[0] == NULL ? NULL : adr_data_to_string(ra->args[0]);
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
 	svcerr_t se = SE_OK;
 	scf_error_t serr;
 
 	scf_propertygroup_t *pg = scf_pg_create(h);
 	scf_iter_t *iter = scf_iter_create(h);
-	data_t *result = data_new_array(&t_array__PropertyGroup, 5);
+	adr_data_t *result = adr_data_new_array(&t_array__PropertyGroup, 5);
 
 	if (pg == NULL || iter == NULL) {
 		se = SE_FATAL;
@@ -324,10 +330,10 @@
 
 	int e;
 	while ((e = scf_iter_next_pg(iter, pg)) > 0) {
-		data_t *dep;
+		adr_data_t *dep;
 		if ((se = create_PropertyGroup(pg, &dep)) != SE_OK)
 			goto done;
-		(void) array_add(result, dep);
+		(void) adr_array_add(result, dep);
 	}
 	if (e != 0)
 		se = smfu_maperr(scf_error());
@@ -343,7 +349,8 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_invoke_readSnapshotPGs(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	radarg_t ra = { .inst = inst, .args = args };
 	return (smfu_rtrun(rt_invoke_readSnapshotPGs, &ra, ret, error));
@@ -351,14 +358,14 @@
 
 
 static svcerr_t
-rt_invoke_readSnapshotProperties(scf_handle_t *h, void *arg, data_t **ret,
-    data_t **error)
+rt_invoke_readSnapshotProperties(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	radarg_t *ra = arg;
 	smfobj_t *smfo = instance_getdata(ra->inst);
 	const char *snapname =
-	    ra->args[0] == NULL ? NULL : data_to_string(ra->args[0]);
-	const char *pgname = data_to_string(ra->args[1]);
+	    ra->args[0] == NULL ? NULL : adr_data_to_string(ra->args[0]);
+	const char *pgname = adr_data_to_string(ra->args[1]);
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
 	svcerr_t se = SE_OK;
 
@@ -386,7 +393,8 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_invoke_readSnapshotProperties(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	radarg_t ra = { .inst = inst, .args = args };
 	return (smfu_rtrun(rt_invoke_readSnapshotProperties, &ra, ret, error));
@@ -394,15 +402,15 @@
 
 
 static svcerr_t
-rt_invoke_readSnapshotProperty(scf_handle_t *h, void *arg, data_t **ret,
-    data_t **error)
+rt_invoke_readSnapshotProperty(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	radarg_t *ra = arg;
 	smfobj_t *smfo = instance_getdata(ra->inst);
 	const char *snapname =
-	    ra->args[0] == NULL ? NULL : data_to_string(ra->args[0]);
-	const char *pgname = data_to_string(ra->args[1]);
-	const char *propname = data_to_string(ra->args[2]);
+	    ra->args[0] == NULL ? NULL : adr_data_to_string(ra->args[0]);
+	const char *pgname = adr_data_to_string(ra->args[1]);
+	const char *propname = adr_data_to_string(ra->args[2]);
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
 	svcerr_t se = SE_OK;
 
@@ -446,7 +454,8 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_invoke_readSnapshotProperty(rad_instance_t *inst,
-    adr_method_t *meth, data_t **ret, data_t **args, int count, data_t **error)
+    adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
+    adr_data_t **error)
 {
 	radarg_t ra = { .inst = inst, .args = args };
 	return (smfu_rtrun(rt_invoke_readSnapshotProperty, &ra, ret, error));
@@ -457,7 +466,7 @@
  * Custom retry implementation for smf_*_instance() routines.
  */
 static boolean_t
-smf_action(conerr_t *result, data_t **error, int rval)
+smf_action(conerr_t *result, adr_data_t **error, int rval)
 {
 	if (rval == 0) {
 		*result = ce_ok;
@@ -496,10 +505,10 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_invoke_clear(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	smfobj_t *smfo = instance_getdata(inst);
-	/* boolean_t sync = data_to_boolean(args[0]); */
+	/* boolean_t sync = adr_data_to_boolean(args[0]); */
 
 	conerr_t res;
 	while (smf_action(&res, error, smf_restore_instance(smfo->fmri)))
@@ -510,10 +519,10 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_invoke_restart(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	smfobj_t *smfo = instance_getdata(inst);
-	/* boolean_t sync = data_to_boolean(args[0]); */
+	/* boolean_t sync = adr_data_to_boolean(args[0]); */
 
 	conerr_t res;
 	while (smf_action(&res, error, smf_restart_instance(smfo->fmri)))
@@ -524,10 +533,10 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_invoke_refresh(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	smfobj_t *smfo = instance_getdata(inst);
-	/* boolean_t sync = data_to_boolean(args[0]); */
+	/* boolean_t sync = adr_data_to_boolean(args[0]); */
 
 	conerr_t res;
 	while (smf_action(&res, error, smf_refresh_instance(smfo->fmri)))
@@ -538,12 +547,12 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_invoke_maintain(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	smfobj_t *smfo = instance_getdata(inst);
-	boolean_t imm = data_to_boolean(args[0]);
-	boolean_t temp = data_to_boolean(args[1]);
-	/* boolean_t sync = data_to_boolean(args[2]); */
+	boolean_t imm = adr_data_to_boolean(args[0]);
+	boolean_t temp = adr_data_to_boolean(args[1]);
+	/* boolean_t sync = adr_data_to_boolean(args[2]); */
 
 	int flags = 0;
 	if (imm)
@@ -561,11 +570,11 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_invoke_enable(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	smfobj_t *smfo = instance_getdata(inst);
-	boolean_t temp = data_to_boolean(args[0]);
-	/* boolean_t sync = data_to_boolean(args[1]); */
+	boolean_t temp = adr_data_to_boolean(args[0]);
+	/* boolean_t sync = adr_data_to_boolean(args[1]); */
 
 	int flags = 0;
 	if (temp)
@@ -580,11 +589,11 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_invoke_disable(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
 	smfobj_t *smfo = instance_getdata(inst);
-	boolean_t temp = data_to_boolean(args[0]);
-	/* boolean_t sync = data_to_boolean(args[1]); */
+	boolean_t temp = adr_data_to_boolean(args[0]);
+	/* boolean_t sync = adr_data_to_boolean(args[1]); */
 
 	int flags = 0;
 	if (temp)
@@ -598,7 +607,7 @@
 
 
 static svcerr_t
-rt_get_logfile(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_get_logfile(scf_handle_t *h, void *arg, adr_data_t **ret, adr_data_t **error)
 {
 	smfobj_t *smfo = arg;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
@@ -635,7 +644,7 @@
 		goto done;
 	}
 
-	*ret = data_new_string(logfile, lt_free);
+	*ret = adr_data_new_string(logfile, LT_FREE);
 done:
 	scf_pg_destroy(pg);
 	scf_property_destroy(prop);
@@ -647,46 +656,46 @@
 /*ARGSUSED*/
 conerr_t
 interface_Instance_invoke_getLogInfo(rad_instance_t *inst, adr_method_t *meth,
-    data_t **ret, data_t **args, int count, data_t **error)
+    adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
 {
-	data_t *logfile = NULL;
+	adr_data_t *logfile = NULL;
 	conerr_t ce = smfu_rtrun(rt_get_logfile, instance_getdata(inst),
 	    &logfile, error);
 	if (ce != ce_ok)
 		return (ce);
 
 	struct stat st;
-	if (stat(data_to_string(logfile), &st) != 0) {
-		data_free(logfile);
+	if (stat(adr_data_to_string(logfile), &st) != 0) {
+		adr_data_free(logfile);
 		(void) error_scf(error, &e__ErrorCode_NOTFOUND, NULL, NULL,
 		    NULL);
 		return (ce_object);
 	}
 
-	int max_size = data_to_integer(args[0]);
+	int max_size = adr_data_to_integer(args[0]);
 	int bsize = max_size >= 0 && max_size < st.st_size ?
 	    max_size : st.st_size;
 
 	char *buffer = malloc(bsize);
 	if (buffer == NULL) {
 		(void) internal_error(error, NULL);
-		data_free(logfile);
+		adr_data_free(logfile);
 		return (ce_object);
 	}
 
 	int fd;
-	if ((fd = open(data_to_string(logfile), O_RDONLY)) == -1) {
+	if ((fd = open(adr_data_to_string(logfile), O_RDONLY)) == -1) {
 		(void) error_scf(error, (errno == EACCES) ?
 		    &e__ErrorCode_DENIED : &e__ErrorCode_INTERNAL,
 		    NULL, NULL, NULL);
-		data_free(logfile);
+		adr_data_free(logfile);
 		free(buffer);
 		return (ce_object);
 	}
 
 	if (pread(fd, buffer, bsize, st.st_size - bsize) != bsize) {
 		(void) internal_error(error, NULL);
-		data_free(logfile);
+		adr_data_free(logfile);
 		free(buffer);
 		(void) close(fd);
 		return (ce_object);
@@ -694,13 +703,14 @@
 
 	(void) close(fd);
 
-	data_t *result = data_new_struct(&t__LogInfo);
-	struct_set(result, "name", logfile);
-	struct_set(result, "size", data_new_integer(st.st_size));
-	struct_set(result, "MTime", data_new_time_ts(&st.st_mtim));
-	struct_set(result, "contents", data_new_opaque(buffer, bsize, lt_free));
+	adr_data_t *result = adr_data_new_struct(&t__LogInfo);
+	adr_struct_set(result, "name", logfile);
+	adr_struct_set(result, "size", adr_data_new_integer(st.st_size));
+	adr_struct_set(result, "MTime", adr_data_new_time_ts(&st.st_mtim));
+	adr_struct_set(result, "contents",
+	    adr_data_new_opaque(buffer, bsize, LT_FREE));
 
-	if ((*ret = data_purify(result)) == NULL) {
+	if ((*ret = adr_data_purify(result)) == NULL) {
 		(void) internal_error(error, NULL);
 		return (ce_object);
 	}
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/mod_smf.c	Fri Jun 29 12:23:11 2012 -0700
+++ b/components/visual-panels/smf/src/cmd/rad/mod/smf/mod_smf.c	Sat Jun 30 06:30:16 2012 -0700
@@ -75,8 +75,8 @@
  */
 
 struct read_services_data {
-	data_t *rsd_result;
-	data_t *rsd_insts;
+	adr_data_t *rsd_result;
+	adr_data_t *rsd_insts;
 };
 
 /*
@@ -91,7 +91,8 @@
 	struct read_services_data *rsd = arg;
 
 	assert(rsd->rsd_insts != NULL);
-	(void) array_add(rsd->rsd_insts, data_new_string(iname, lt_copy));
+	(void) adr_array_add(rsd->rsd_insts,
+	    adr_data_new_string(iname, LT_COPY));
 
 	return (SE_OK);
 }
@@ -109,24 +110,25 @@
 {
 	struct read_services_data *rsd = arg;
 
-	rsd->rsd_insts = data_new_array(&t_array_string, 5);
+	rsd->rsd_insts = adr_data_new_array(&adr_t_array_string, 5);
 
-	data_t *sdata = data_new_struct(&t__Service);
-	struct_set(sdata, "fmri",
-	    data_new_string(smfu_fmri_alloc(sname, NULL), lt_free));
-	struct_set(sdata, "objectName",
-	    data_new_name(smfu_name_alloc(sname, NULL)));
-	struct_set(sdata, "instances", rsd->rsd_insts);
-	(void) array_add(rsd->rsd_result, sdata);
+	adr_data_t *sdata = adr_data_new_struct(&t__Service);
+	adr_struct_set(sdata, "fmri",
+	    adr_data_new_string(smfu_fmri_alloc(sname, NULL), LT_FREE));
+	adr_struct_set(sdata, "objectName",
+	    adr_data_new_name(smfu_name_alloc(sname, NULL)));
+	adr_struct_set(sdata, "instances", rsd->rsd_insts);
+	(void) adr_array_add(rsd->rsd_result, sdata);
 
 	return (SE_OK);
 }
 
 /*ARGSUSED*/
 static svcerr_t
-rt_read_services(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_read_services(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
-	data_t *result = data_new_array(&t_array__Service, 200);
+	adr_data_t *result = adr_data_new_array(&t_array__Service, 200);
 	struct read_services_data rsd = { result, NULL };
 
 	svcerr_t se = smfu_iter_svcs(h, read_services_svc_cb,
@@ -139,13 +141,13 @@
 /* ARGSUSED */
 conerr_t
 interface_Master_read_services(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	return (smfu_rtrun(rt_read_services, NULL, data, error));
 }
 
 struct read_instances_data {
-	data_t *rid_result;
+	adr_data_t *rid_result;
 
 	/*
 	 * For efficiency, reuse a single set of objects.
@@ -170,10 +172,10 @@
 	struct read_instances_data *rid = arg;
 	svcerr_t se;
 
-	data_t *inst = NULL;
+	adr_data_t *inst = NULL;
 	if ((se = create_Instance(instance, sname, iname, &inst,
 	    rid->rid_pg, rid->rid_prop, rid->rid_val)) == SE_OK)
-		(void) array_add(rid->rid_result, inst);
+		(void) adr_array_add(rid->rid_result, inst);
 
 	return (se == SE_NOTFOUND ? SE_OK : se);
 }
@@ -185,7 +187,8 @@
  */
 /*ARGSUSED*/
 static svcerr_t
-rt_read_instances(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_read_instances(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	struct read_instances_data rid;
 	svcerr_t se;
@@ -199,7 +202,7 @@
 		goto out;
 	}
 
-	rid.rid_result = data_new_array(&t_array__Instance, 200);
+	rid.rid_result = adr_data_new_array(&t_array__Instance, 200);
 	se = smfu_iter_svcs(h, NULL, read_instances_cb, &rid);
 
 out:
@@ -214,14 +217,14 @@
 /* ARGSUSED */
 conerr_t
 interface_Master_read_instances(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	return (smfu_rtrun(rt_read_instances, NULL, data, error));
 }
 
 struct listdata {
 	adr_name_t *ld_pattern;
-	data_t *ld_result;
+	adr_data_t *ld_result;
 };
 
 /*
@@ -246,8 +249,8 @@
 		return (SE_FATAL);
 
 	if (adr_name_match(name, ld->ld_pattern))
-		(void) array_add(ld->ld_result,
-		    data_new_string(adr_name_tostr(name), lt_free));
+		(void) adr_array_add(ld->ld_result,
+		    adr_data_new_string(adr_name_tostr(name), LT_FREE));
 	adr_name_rele(name);
 
 	return (SE_OK);
@@ -268,8 +271,8 @@
 		return (SE_FATAL);
 
 	if (adr_name_match(name, ld->ld_pattern))
-		(void) array_add(ld->ld_result,
-		    data_new_string(adr_name_tostr(name), lt_free));
+		(void) adr_array_add(ld->ld_result,
+		    adr_data_new_string(adr_name_tostr(name), LT_FREE));
 	adr_name_rele(name);
 
 	return (SE_OK);
@@ -286,10 +289,10 @@
  */
 /*ARGSUSED*/
 static svcerr_t
-rt_listf(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_listf(scf_handle_t *h, void *arg, adr_data_t **ret, adr_data_t **error)
 {
 	struct arg_listf *rtarg = (struct arg_listf *)arg;
-	data_t *result = data_new_array(&t_array_string, 300);
+	adr_data_t *result = adr_data_new_array(&adr_t_array_string, 300);
 	struct listdata ld = { rtarg->pattern, result };
 
 	svcerr_t se = smfu_iter_svcs(h, rtarg->instance ? NULL : list_svcs,
@@ -303,7 +306,7 @@
  * Dynamic namespace list handler.
  */
 static conerr_t
-smf_listf(adr_name_t *pattern, data_t **names, void *arg)
+smf_listf(adr_name_t *pattern, adr_data_t **names, void *arg)
 {
 	struct arg_listf rtarg = { pattern, (boolean_t)arg };
 
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/service.c	Fri Jun 29 12:23:11 2012 -0700
+++ b/components/visual-panels/smf/src/cmd/rad/mod/smf/service.c	Sat Jun 30 06:30:16 2012 -0700
@@ -39,13 +39,14 @@
  */
 /*ARGSUSED*/
 static svcerr_t
-rt_read_instances(scf_handle_t *h, void *arg, data_t **ret, data_t **error)
+rt_read_instances(scf_handle_t *h, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	smfobj_t *smfo = arg;
 	char iname[max_name + 1];
 	svcerr_t se;
 	smfu_entity_t entity = SMFU_ENTITY_INIT;
-	data_t *array = data_new_array(&t_array_string, 5);
+	adr_data_t *array = adr_data_new_array(&adr_t_array_string, 5);
 
 	scf_instance_t *instance = scf_instance_create(h);
 	scf_iter_t *iter = scf_iter_create(h);
@@ -70,7 +71,8 @@
 			se = smfu_maperr(scf_error());
 			goto done;
 		}
-		(void) array_add(array, data_new_string(iname, lt_copy));
+		(void) adr_array_add(array,
+		    adr_data_new_string(iname, LT_COPY));
 	}
 
 	if (err != 0)
@@ -88,7 +90,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Service_read_instances(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	return (smfu_rtrun(rt_read_instances, instance_getdata(inst), data,
 	    error));
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/smfutil.c	Fri Jun 29 12:23:11 2012 -0700
+++ b/components/visual-panels/smf/src/cmd/rad/mod/smf/smfutil.c	Sat Jun 30 06:30:16 2012 -0700
@@ -51,28 +51,30 @@
 ssize_t max_pgtype;
 
 svcerr_t
-error_scf(data_t **error, data_t *code, data_t *target, const char *aux,
-    const char *msg)
+error_scf(adr_data_t **error, adr_data_t *code, adr_data_t *target,
+    const char *aux, const char *msg)
 {
-	assert(data_type(code) == &t__ErrorCode);
-	assert(target == NULL || data_type(target) == &t__ErrorTarget);
+	assert(adr_data_type(code) == &t__ErrorCode);
+	assert(target == NULL || adr_data_type(target) == &t__ErrorTarget);
 
 	if (error != NULL) {
-		data_t *e = data_new_struct(&t__SmfError);
-		struct_set(e, "error", code);
-		struct_set(e, "target", target == NULL ?
+		adr_data_t *e = adr_data_new_struct(&t__SmfError);
+		adr_struct_set(e, "error", code);
+		adr_struct_set(e, "target", target == NULL ?
 		    &e__ErrorTarget_NONE : target);
 		if (aux != NULL)
-			struct_set(e, "aux", data_new_string(aux, lt_copy));
+			adr_struct_set(e, "aux",
+			    adr_data_new_string(aux, LT_COPY));
 		if (msg != NULL)
-			struct_set(e, "message", data_new_string(msg, lt_copy));
-		*error = data_purify(e);
+			adr_struct_set(e, "message",
+			    adr_data_new_string(msg, LT_COPY));
+		*error = adr_data_purify(e);
 	}
 	return (SE_FATAL);
 }
 
 svcerr_t
-internal_error(data_t **error, const char *msg)
+internal_error(adr_data_t **error, const char *msg)
 {
 	return (error_scf(error, &e__ErrorCode_INTERNAL, NULL, NULL, msg));
 }
@@ -153,7 +155,7 @@
 svcerr_t
 smfu_instance_get_composed_pg(scf_handle_t *handle, scf_instance_t *instance,
     const char *snapname, const char *pgname, scf_propertygroup_t *pg,
-    data_t **error)
+    adr_data_t **error)
 {
 	svcerr_t se = SE_OK;
 	scf_snapshot_t *snap = NULL;
@@ -344,7 +346,7 @@
  */
 svcerr_t
 smfu_get_pg(smfu_entity_t *entity, const char *name,
-    scf_propertygroup_t *pg, data_t **error)
+    scf_propertygroup_t *pg, adr_data_t **error)
 {
 	svcerr_t se = SE_OK;
 
@@ -600,16 +602,16 @@
  * Calls cb() repeatedly while it returns SE_RETRY, reconnecting to the
  * repository as necessary.
  *
- * For the convenience of the callback, if a data_t pointer is stored
+ * For the convenience of the callback, if a adr_data_t pointer is stored
  * in its result argument on failure it is freed.  Also verifies the
  * result on success.
  */
 static conerr_t
-smfu_rtrun_int(smfu_rtfunc_t cb, void *arg, data_t **ret, data_t **error,
-    boolean_t nullable)
+smfu_rtrun_int(smfu_rtfunc_t cb, void *arg, adr_data_t **ret,
+    adr_data_t **error, boolean_t nullable)
 {
 	svcerr_t se = SE_OK;
-	data_t *result = NULL;
+	adr_data_t *result = NULL;
 
 	do {
 		rad_handle_t *rh = rh_fetch();
@@ -619,7 +621,7 @@
 			se = cb(rh_hdl(rh), arg, &result, error);
 
 		if (se != SE_OK && result != NULL) {
-			data_free(result);
+			adr_data_free(result);
 			result = NULL;
 		}
 
@@ -631,10 +633,10 @@
 	assert(ret != NULL || result == NULL);
 	if (ret != NULL && se == SE_OK) {
 		if ((nullable && result == NULL) ||
-		    data_verify(result, NULL, B_TRUE)) {
+		    adr_data_verify(result, NULL, B_TRUE)) {
 			*ret = result;
 		} else {
-			data_free(result);
+			adr_data_free(result);
 			se = internal_error(error, NULL);
 		}
 	}
@@ -656,13 +658,14 @@
 }
 
 conerr_t
-smfu_rtrun_opt(smfu_rtfunc_t cb, void *arg, data_t **ret, data_t **error)
+smfu_rtrun_opt(smfu_rtfunc_t cb, void *arg, adr_data_t **ret,
+    adr_data_t **error)
 {
 	return (smfu_rtrun_int(cb, arg, ret, error, B_TRUE));
 }
 
 conerr_t
-smfu_rtrun(smfu_rtfunc_t cb, void *arg, data_t **ret, data_t **error)
+smfu_rtrun(smfu_rtfunc_t cb, void *arg, adr_data_t **ret, adr_data_t **error)
 {
 	return (smfu_rtrun_int(cb, arg, ret, error, B_FALSE));
 }
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/smfutil.h	Fri Jun 29 12:23:11 2012 -0700
+++ b/components/visual-panels/smf/src/cmd/rad/mod/smf/smfutil.h	Sat Jun 30 06:30:16 2012 -0700
@@ -108,8 +108,9 @@
 /*
  * Error handling routines
  */
-svcerr_t error_scf(data_t **, data_t *, data_t *, const char *, const char *);
-svcerr_t internal_error(data_t **error, const char *msg);
+svcerr_t error_scf(adr_data_t **, adr_data_t *, adr_data_t *, const char *,
+    const char *);
+svcerr_t internal_error(adr_data_t **error, const char *msg);
 svcerr_t smfu_maperr(scf_error_t);
 
 typedef svcerr_t (*svc_callback_t)(scf_handle_t *, scf_service_t *,
@@ -125,7 +126,7 @@
 scf_error_t smfu_value_get_string(scf_value_t *val, char **strp);
 svcerr_t smfu_instance_get_composed_pg(scf_handle_t *handle,
     scf_instance_t *instance, const char *snapname, const char *pgname,
-    scf_propertygroup_t *pg, data_t **error);
+    scf_propertygroup_t *pg, adr_data_t **error);
 scf_error_t smfu_instance_iter_composed_pgs(scf_handle_t *handle,
     scf_instance_t *instance, const char *snapname, const char *pgtype,
     scf_iter_t *iter);
@@ -137,7 +138,7 @@
  * Operate on directly-attached property groups.
  */
 svcerr_t smfu_get_pg(smfu_entity_t *entity, const char *name,
-    scf_propertygroup_t *pg, data_t **);
+    scf_propertygroup_t *pg, adr_data_t **);
 svcerr_t smfu_iter_pg(smfu_entity_t *entity, const char *type,
     scf_iter_t *iter);
 
@@ -168,12 +169,13 @@
 /* A frequently used lexical scope surrogate */
 typedef struct radarg {
 	rad_instance_t *inst;
-	data_t **args;
+	adr_data_t **args;
 } radarg_t;
 
-typedef svcerr_t (*smfu_rtfunc_t)(scf_handle_t *, void *, data_t **, data_t **);
-conerr_t smfu_rtrun(smfu_rtfunc_t, void *, data_t **, data_t **);
-conerr_t smfu_rtrun_opt(smfu_rtfunc_t, void *, data_t **, data_t **);
+typedef svcerr_t (*smfu_rtfunc_t)(scf_handle_t *, void *, adr_data_t **,
+    adr_data_t **);
+conerr_t smfu_rtrun(smfu_rtfunc_t, void *, adr_data_t **, adr_data_t **);
+conerr_t smfu_rtrun_opt(smfu_rtfunc_t, void *, adr_data_t **, adr_data_t **);
 
 void smfu_init();
 
--- a/components/visual-panels/time/src/cmd/rad/mod/time/mod_time.c	Fri Jun 29 12:23:11 2012 -0700
+++ b/components/visual-panels/time/src/cmd/rad/mod/time/mod_time.c	Sat Jun 30 06:30:16 2012 -0700
@@ -51,9 +51,9 @@
 /*ARGSUSED*/
 conerr_t
 interface_Time_read_time(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
-	*data = data_new_time_now();
+	*data = adr_data_new_time_now();
 	return (ce_ok);
 }
 
@@ -62,10 +62,10 @@
 /*ARGSUSED*/
 conerr_t
 interface_Time_write_time(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t *data, data_t **error)
+    adr_data_t *data, adr_data_t **error)
 {
-	long long seconds = data_to_time_secs(data);
-	int nanos = data_to_time_nsecs(data);
+	long long seconds = adr_data_to_time_secs(data);
+	int nanos = adr_data_to_time_nsecs(data);
 	int micros = nanos / NSPERUS;
 	time_t newtime;
 	struct timeval adj;
@@ -97,7 +97,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Time_read_defaultTimeZone(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	char zonefile[PATH_MAX];
 	int n = snprintf(zonefile, PATH_MAX, "%s", ZONEINFO_DIR);
@@ -116,7 +116,7 @@
 		    strncmp(resolved, ZONEINFO_DIR, n) == 0) {
 			tz = resolved + n;
 		}
-		*data = data_new_string(tz, lt_copy);
+		*data = adr_data_new_string(tz, LT_COPY);
 	}
 
 	return (err);
@@ -125,10 +125,10 @@
 /*ARGSUSED*/
 conerr_t
 interface_Time_write_defaultTimeZone(rad_instance_t *inst,
-    adr_attribute_t *attr, data_t *data, data_t **error)
+    adr_attribute_t *attr, adr_data_t *data, adr_data_t **error)
 {
 	conerr_t err = smfu_set_property((char *)SCF_INSTANCE_ENV,
-	    SMF_TZ_PGNAME, SMF_TZ_PROPNAME, (char *)data_to_string(data));
+	    SMF_TZ_PGNAME, SMF_TZ_PROPNAME, (char *)adr_data_to_string(data));
 	return (err);
 }
 
@@ -153,43 +153,43 @@
 static const char * const si_server_path[] = { "server", NULL };
 
 static void
-disable(data_t *array, const char *srv, int len)
+disable(adr_data_t *array, const char *srv, int len)
 {
-	if (array_nsearch(array, srv, len, si_server_path) >= 0)
+	if (adr_array_nsearch(array, srv, len, si_server_path) >= 0)
 		return;
-	data_t *entry = data_new_struct(&t__ServerInfo);
-	struct_set(entry, "server", data_new_nstring(srv, len));
-	struct_set(entry, "enabled", data_new_boolean(B_FALSE));
-	(void) array_add(array, entry);
+	adr_data_t *entry = adr_data_new_struct(&t__ServerInfo);
+	adr_struct_set(entry, "server", adr_data_new_nstring(srv, len));
+	adr_struct_set(entry, "enabled", adr_data_new_boolean(B_FALSE));
+	(void) adr_array_add(array, entry);
 }
 
 static void
-enable(data_t *array, const char *srv, int len)
+enable(adr_data_t *array, const char *srv, int len)
 {
-	int index = array_nsearch(array, srv, len, si_server_path);
+	int index = adr_array_nsearch(array, srv, len, si_server_path);
 	if (index >= 0) {
-		struct_set(array_get(array, index), "enabled",
-		    data_new_boolean(B_TRUE));
+		adr_struct_set(adr_array_get(array, index), "enabled",
+		    adr_data_new_boolean(B_TRUE));
 		return;
 	}
-	data_t *entry = data_new_struct(&t__ServerInfo);
-	struct_set(entry, "server", data_new_nstring(srv, len));
-	struct_set(entry, "enabled", data_new_boolean(B_TRUE));
-	(void) array_add(array, entry);
+	adr_data_t *entry = adr_data_new_struct(&t__ServerInfo);
+	adr_struct_set(entry, "server", adr_data_new_nstring(srv, len));
+	adr_struct_set(entry, "enabled", adr_data_new_boolean(B_TRUE));
+	(void) adr_array_add(array, entry);
 }
 
 /*ARGSUSED*/
 conerr_t
 interface_Time_read_ntpServers(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
-	data_t *result = data_new_array(&t_array__ServerInfo, 4);
+	adr_data_t *result = adr_data_new_array(&t_array__ServerInfo, 4);
 	for (int i = 0; i < RAD_COUNT(ntpservers); i++) {
-		data_t *si = data_new_struct(&t__ServerInfo);
-		struct_set(si, "server",
-		    data_new_string(ntpservers[i], lt_copy));
-		struct_set(si, "enabled", data_new_boolean(B_FALSE));
-		(void) array_add(result, si);
+		adr_data_t *si = adr_data_new_struct(&t__ServerInfo);
+		adr_struct_set(si, "server",
+		    adr_data_new_string(ntpservers[i], LT_COPY));
+		adr_struct_set(si, "enabled", adr_data_new_boolean(B_FALSE));
+		(void) adr_array_add(result, si);
 	}
 
 	FILE *file = fopen(NTP_CONF, "r");
@@ -229,21 +229,21 @@
 /*ARGSUSED*/
 conerr_t
 interface_Time_read_sufficientlyPrivileged(rad_instance_t *inst,
-    adr_attribute_t *attr, data_t **data, data_t **error)
+    adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
 {
 	/* XXX: Crude */
-	*data = data_new_boolean(getuid() == 0);
+	*data = adr_data_new_boolean(getuid() == 0);
 	return (ce_ok);
 }
 
 /*ARGSUSED*/
 conerr_t
 interface_Time_read_continents(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	FILE *file = fopen("/usr/share/lib/zoneinfo/tab/continent.tab", "r");
 	char str[1024];
-	data_t *result = data_new_array(&t_array__Continent, 5);
+	adr_data_t *result = adr_data_new_array(&t_array__Continent, 5);
 	while (fgets(str, sizeof (str), file) != NULL) {
 		if (str[0] == '#')
 			continue;
@@ -252,12 +252,12 @@
 		char *eq = strchr(str, '\t');
 		if (eq == NULL)
 			continue;
-		data_t *name = data_new_nstring(str, eq - str);
-		data_t *desc = data_new_string(eq + 1, lt_copy);
-		data_t *cont = data_new_struct(&t__Continent);
-		struct_set(cont, "name", name);
-		struct_set(cont, "description", desc);
-		(void) array_add(result, cont);
+		adr_data_t *name = adr_data_new_nstring(str, eq - str);
+		adr_data_t *desc = adr_data_new_string(eq + 1, LT_COPY);
+		adr_data_t *cont = adr_data_new_struct(&t__Continent);
+		adr_struct_set(cont, "name", name);
+		adr_struct_set(cont, "description", desc);
+		(void) adr_array_add(result, cont);
 	}
 	(void) fclose(file);
 	*data = result;
@@ -268,11 +268,11 @@
 /*ARGSUSED*/
 conerr_t
 interface_Time_read_countries(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	FILE *file = fopen("/usr/share/lib/zoneinfo/tab/country.tab", "r");
 	char str[1024];
-	data_t *result = data_new_array(&t_array__Country, 5);
+	adr_data_t *result = adr_data_new_array(&t_array__Country, 5);
 	while (fgets(str, sizeof (str), file) != NULL) {
 		if (str[0] == '#')
 			continue;
@@ -285,12 +285,12 @@
 		    rad_strccmp("we", str, eq - str) == 0 ||
 		    rad_strccmp("me", str, eq - str) == 0)
 			continue;
-		data_t *code = data_new_nstring(str, eq - str);
-		data_t *desc = data_new_string(eq + 1, lt_copy);
-		data_t *country = data_new_struct(&t__Country);
-		struct_set(country, "code", code);
-		struct_set(country, "description", desc);
-		(void) array_add(result, country);
+		adr_data_t *code = adr_data_new_nstring(str, eq - str);
+		adr_data_t *desc = adr_data_new_string(eq + 1, LT_COPY);
+		adr_data_t *country = adr_data_new_struct(&t__Country);
+		adr_struct_set(country, "code", code);
+		adr_struct_set(country, "description", desc);
+		(void) adr_array_add(result, country);
 	}
 	(void) fclose(file);
 	*data = result;
@@ -326,7 +326,7 @@
 	}
 }
 
-static data_t *
+static adr_data_t *
 parse_coords(const char *str, int len)
 {
 	int isnorth, iseast;
@@ -354,24 +354,26 @@
 	    !parse_coord(eq + 1, len - (eq - str + 1), &east))
 		return (NULL);
 
-	data_t *result = data_new_struct(&t__Coordinates);
-	struct_set(result, "degreesE", data_new_integer(east.deg * iseast));
-	struct_set(result, "minutesE", data_new_integer(east.min));
-	struct_set(result, "secondsE", data_new_integer(east.sec));
-	struct_set(result, "degreesN", data_new_integer(north.deg * isnorth));
-	struct_set(result, "minutesN", data_new_integer(north.min));
-	struct_set(result, "secondsN", data_new_integer(north.sec));
+	adr_data_t *result = adr_data_new_struct(&t__Coordinates);
+	adr_struct_set(result, "degreesE",
+	    adr_data_new_integer(east.deg * iseast));
+	adr_struct_set(result, "minutesE", adr_data_new_integer(east.min));
+	adr_struct_set(result, "secondsE", adr_data_new_integer(east.sec));
+	adr_struct_set(result, "degreesN",
+	    adr_data_new_integer(north.deg * isnorth));
+	adr_struct_set(result, "minutesN", adr_data_new_integer(north.min));
+	adr_struct_set(result, "secondsN", adr_data_new_integer(north.sec));
 	return (result);
 }
 
 /*ARGSUSED*/
 conerr_t
 interface_Time_read_timeZones(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t **data, data_t **error)
+    adr_data_t **data, adr_data_t **error)
 {
 	FILE *file = fopen("/usr/share/lib/zoneinfo/tab/zone_sun.tab", "r");
 	char buf[1024];
-	data_t *result = data_new_array(&t_array__TimeZoneInfo, 5);
+	adr_data_t *result = adr_data_new_array(&t_array__TimeZoneInfo, 5);
 	while (fgets(buf, sizeof (buf), file) != NULL) {
 		char *str = buf;
 		if (str[0] == '#')
@@ -385,25 +387,26 @@
 		    rad_strccmp("we", str, eq - str) == 0 ||
 		    rad_strccmp("me", str, eq - str) == 0)
 			continue;
-		data_t *timezone = data_new_struct(&t__TimeZoneInfo);
-		struct_set(timezone, "countryCode",
-		    data_new_nstring(str, eq - str));
+		adr_data_t *timezone = adr_data_new_struct(&t__TimeZoneInfo);
+		adr_struct_set(timezone, "countryCode",
+		    adr_data_new_nstring(str, eq - str));
 
 		str = eq + 1;
 		eq = strchr(str, '\t');
-		data_t *coords;
+		adr_data_t *coords;
 		if (eq == NULL ||
 		    (coords = parse_coords(str, eq - str)) == NULL) {
-			data_free(timezone);
+			adr_data_free(timezone);
 			continue;
 		}
-		struct_set(timezone, "coordinates", coords);
+		adr_struct_set(timezone, "coordinates", coords);
 
 		str = eq + 1;
 		eq = strchr(str, '\t');
-		data_t *tz = eq != NULL ? data_new_nstring(str, eq - str) :
-		    data_new_string(str, lt_copy);
-		struct_set(timezone, "name", tz);
+		adr_data_t *tz = eq != NULL ?
+		    adr_data_new_nstring(str, eq - str) :
+		    adr_data_new_string(str, LT_COPY);
+		adr_struct_set(timezone, "name", tz);
 		if (eq == NULL)
 			goto done;
 
@@ -411,22 +414,22 @@
 		eq = strchr(str, '\t');
 		if (eq != NULL) {
 			if (rad_strccmp("-", str, eq - str) != 0)
-				struct_set(timezone, "altName",
-				    data_new_nstring(str, eq - str));
+				adr_struct_set(timezone, "altName",
+				    adr_data_new_nstring(str, eq - str));
 		} else {
 			if (strcmp("-", str) != 0)
-				struct_set(timezone, "altName",
-				    data_new_string(str, lt_copy));
+				adr_struct_set(timezone, "altName",
+				    adr_data_new_string(str, LT_COPY));
 			goto done;
 		}
 
 		str = eq + 1;
 		if (*str != '\0' && strcmp(str, "-") != 0)
-			struct_set(timezone, "comments",
-			    data_new_string(str, lt_copy));
+			adr_struct_set(timezone, "comments",
+			    adr_data_new_string(str, LT_COPY));
 
 done:
-		(void) array_add(result, timezone);
+		(void) adr_array_add(result, timezone);
 	}
 	(void) fclose(file);
 	*data = result;
@@ -437,7 +440,7 @@
 /*ARGSUSED*/
 conerr_t
 interface_Time_write_ntpServers(rad_instance_t *inst, adr_attribute_t *attr,
-    data_t *data, data_t **error)
+    adr_data_t *data, adr_data_t **error)
 {
 	FILE *from, *to, *tmp; /* Read, write, & temp files */
 	int err = 0; /* Indicates an error */
@@ -488,13 +491,13 @@
 		goto errorout;
 	}
 
-	for (int i = 0; i < array_size(data); i++) {
-		data_t *entry = array_get(data, i);
-		data_t *enabled = struct_get(entry, "enabled");
-		data_t *server = struct_get(entry, "server");
+	for (int i = 0; i < adr_array_size(data); i++) {
+		adr_data_t *entry = adr_array_get(data, i);
+		adr_data_t *enabled = adr_struct_get(entry, "enabled");
+		adr_data_t *server = adr_struct_get(entry, "server");
 		if (fprintf(tmp,
-		    data_to_boolean(enabled) ? "server %s\n" : "# server %s\n",
-		    data_to_string(server)) < 0)
+		    adr_data_to_boolean(enabled) ? "server %s\n" :
+		    "# server %s\n", adr_data_to_string(server)) < 0)
 			goto writefailed;
 	}
 	if (fclose(tmp) == EOF)