int cil_resolve_blockinherit_link(struct cil_tree_node *current, void *extra_args)
{
	struct cil_blockinherit *inherit = current->data;
	struct cil_symtab_datum *block_datum = NULL;
	struct cil_tree_node *node = NULL;
	int rc = SEPOL_ERR;

	rc = cil_resolve_name(current, inherit->block_str, CIL_SYM_BLOCKS, extra_args, &block_datum);
	if (rc != SEPOL_OK) {
		goto exit;
	}

	node = NODE(block_datum);

	if (node->flavor != CIL_BLOCK) {
		cil_log(CIL_ERR, "%s is not a block\n", cil_node_to_string(node));
		rc = SEPOL_ERR;
		goto exit;
	}

	inherit->block = (struct cil_block *)block_datum;

	if (inherit->block->bi_nodes == NULL) {
		cil_list_init(&inherit->block->bi_nodes, CIL_NODE);
	}
	cil_list_append(inherit->block->bi_nodes, CIL_NODE, current);

	return SEPOL_OK;

exit:
	return rc;
}
int cil_resolve_blockinherit_link(struct cil_tree_node *current, void *extra_args)
{
	struct cil_blockinherit *inherit = current->data;
	struct cil_symtab_datum *block_datum = NULL;
	struct cil_tree_node *node = NULL;
	int rc = SEPOL_ERR;

	rc = cil_resolve_name(current, inherit->block_str, CIL_SYM_BLOCKS, extra_args, &block_datum);
	if (rc != SEPOL_OK) {
		goto exit;
	}

	node = NODE(block_datum);

	if (node->flavor != CIL_BLOCK) {
		cil_log(CIL_ERR, "%s is not a block\n", cil_node_to_string(node));
		rc = SEPOL_ERR;
		goto exit;
	}

	inherit->block = (struct cil_block *)block_datum;

	if (inherit->block->bi_nodes == NULL) {
		cil_list_init(&inherit->block->bi_nodes, CIL_NODE);
	}
	cil_list_append(inherit->block->bi_nodes, CIL_NODE, current);

	return SEPOL_OK;

exit:
	return rc;
}