idname
RB_ENTRY(idname) entry;
idname_cmp(struct idname *a, struct idname *b)
RB_HEAD(idname_tree, idname);
RB_GENERATE_STATIC(idname_tree, idname, entry, idname_cmp)
idname_free(struct idname *idname)
if (idname == NULL)
free(idname->name);
free(idname);
struct idname *idname;
if ((idname = xcalloc(1, sizeof(*idname))) == NULL)
idname->id = id;
idname->name = xstrdup(name);
if (RB_INSERT(idname_tree, tree, idname) != NULL)
idname_free(idname);
struct idname idname, *found;
memset(&idname, 0, sizeof(idname));
idname.id = id;
if ((found = RB_FIND(idname_tree, tree, &idname)) != NULL)
char idname[16];
snprintf(idname, sizeof(idname), "%ju", portlist->cur_id);
nvlist_move_string(cur_port->host_list, idname, str);
snprintf(idname, sizeof(idname), "%ju", portlist->cur_id);
nvlist_move_string(cur_port->init_list, idname, str);
snprintf(idname, sizeof(idname), "%ju", portlist->cur_id);
nvlist_move_string(cur_port->lun_list, idname, str);