10369 }
10370 if (ret != 0)
10371 scfdie();
10372 }
10373
10374 if (elts->parameter == NULL)
10375 elts->parameter = param;
10376 else
10377 (void) xmlAddSibling(elts->parameter, param);
10378 }
10379
10380 /*
10381 * Process notification parameters for a service or instance
10382 */
10383 static void
10384 export_notify_params(scf_propertygroup_t *pg, struct entity_elts *elts)
10385 {
10386 xmlNodePtr n, event, *type;
10387 struct params_elts *eelts;
10388 int ret, err, i;
10389
10390 n = xmlNewNode(NULL, (xmlChar *)"notification_parameters");
10391 event = xmlNewNode(NULL, (xmlChar *)"event");
10392 if (n == NULL || event == NULL)
10393 uu_die(emsg_create_xml);
10394
10395 /* event value */
10396 if (scf_pg_get_name(pg, exp_str, max_scf_name_len + 1) < 0)
10397 scfdie();
10398 safe_setprop(event, value_attr, exp_str);
10399
10400 (void) xmlAddChild(n, event);
10401
10402 if ((type = calloc(URI_SCHEME_NUM, sizeof (xmlNodePtr))) == NULL ||
10403 (eelts = calloc(URI_SCHEME_NUM,
10404 sizeof (struct params_elts))) == NULL)
10405 uu_die(gettext("Out of memory.\n"));
10406
10407 err = 0;
10408
10409 if (scf_iter_pg_properties(exp_prop_iter, pg) != SCF_SUCCESS)
10410 scfdie();
10411
10412 while ((ret = scf_iter_next_property(exp_prop_iter, exp_prop)) == 1) {
10413 char *t, *p;
10414
10415 if (scf_property_get_name(exp_prop, exp_str, exp_str_sz) < 0)
10416 scfdie();
10417
|
10369 }
10370 if (ret != 0)
10371 scfdie();
10372 }
10373
10374 if (elts->parameter == NULL)
10375 elts->parameter = param;
10376 else
10377 (void) xmlAddSibling(elts->parameter, param);
10378 }
10379
10380 /*
10381 * Process notification parameters for a service or instance
10382 */
10383 static void
10384 export_notify_params(scf_propertygroup_t *pg, struct entity_elts *elts)
10385 {
10386 xmlNodePtr n, event, *type;
10387 struct params_elts *eelts;
10388 int ret, err, i;
10389 char *s;
10390
10391 n = xmlNewNode(NULL, (xmlChar *)"notification_parameters");
10392 event = xmlNewNode(NULL, (xmlChar *)"event");
10393 if (n == NULL || event == NULL)
10394 uu_die(emsg_create_xml);
10395
10396 /* event value */
10397 if (scf_pg_get_name(pg, exp_str, max_scf_name_len + 1) < 0)
10398 scfdie();
10399 /* trim SCF_NOTIFY_PG_POSTFIX appended to name on import */
10400 if ((s = strchr(exp_str, ',')) != NULL)
10401 *s = '\0';
10402 safe_setprop(event, value_attr, exp_str);
10403
10404 (void) xmlAddChild(n, event);
10405
10406 if ((type = calloc(URI_SCHEME_NUM, sizeof (xmlNodePtr))) == NULL ||
10407 (eelts = calloc(URI_SCHEME_NUM,
10408 sizeof (struct params_elts))) == NULL)
10409 uu_die(gettext("Out of memory.\n"));
10410
10411 err = 0;
10412
10413 if (scf_iter_pg_properties(exp_prop_iter, pg) != SCF_SUCCESS)
10414 scfdie();
10415
10416 while ((ret = scf_iter_next_property(exp_prop_iter, exp_prop)) == 1) {
10417 char *t, *p;
10418
10419 if (scf_property_get_name(exp_prop, exp_str, exp_str_sz) < 0)
10420 scfdie();
10421
|