int cil_resolve_expandtypeattribute(struct cil_tree_node *current, void *extra_args)
{
	struct cil_expandtypeattribute *expandattr = current->data;
	struct cil_symtab_datum *attr_datum = NULL;
	struct cil_tree_node *attr_node = NULL;
	struct cil_list_item *curr;
	int used;
	int rc = SEPOL_ERR;

	cil_list_init(&expandattr->attr_datums, CIL_TYPE);

	cil_list_for_each(curr, expandattr->attr_strs) {
		rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_TYPES, extra_args, &attr_datum);
		if (rc != SEPOL_OK) {
			goto exit;
		}

		attr_node = NODE(attr_datum);

		if (attr_node->flavor != CIL_TYPEATTRIBUTE) {
			rc = SEPOL_ERR;
			cil_log(CIL_ERR, "Attribute type not an attribute\n");
			goto exit;
		}
		used = expandattr->expand ? CIL_ATTR_EXPAND_TRUE : CIL_ATTR_EXPAND_FALSE;
		cil_type_used(attr_datum, used);
		cil_list_append(expandattr->attr_datums, CIL_TYPE, attr_datum);
	}

	return SEPOL_OK;
exit:
	return rc;
}
int cil_resolve_expandtypeattribute(struct cil_tree_node *current, void *extra_args)
{
	struct cil_expandtypeattribute *expandattr = current->data;
	struct cil_symtab_datum *attr_datum = NULL;
	struct cil_tree_node *attr_node = NULL;
	struct cil_list_item *curr;
	int used;
	int rc = SEPOL_ERR;

	cil_list_init(&expandattr->attr_datums, CIL_TYPE);

	cil_list_for_each(curr, expandattr->attr_strs) {
		rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_TYPES, extra_args, &attr_datum);
		if (rc != SEPOL_OK) {
			goto exit;
		}

		attr_node = NODE(attr_datum);

		if (attr_node->flavor != CIL_TYPEATTRIBUTE) {
			rc = SEPOL_ERR;
			cil_log(CIL_ERR, "Attribute type not an attribute\n");
			goto exit;
		}
		used = expandattr->expand ? CIL_ATTR_EXPAND_TRUE : CIL_ATTR_EXPAND_FALSE;
		cil_type_used(attr_datum, used);
		cil_list_append(expandattr->attr_datums, CIL_TYPE, attr_datum);
	}

	return SEPOL_OK;
exit:
	return rc;
}