kernels/linux-2.4.0/arch/ia64/sn/io/labelcl.c
/*
 * labelcl_info_replace_LBL - Replace an existing label entry with the 
 *	given new information.
 *
 *	Label entry must exist.
 */
Replace an existing label entry with the
given new information.

Label entry must exist.
Replace an existing label entry with the given new information . Label entry must exist .
int
labelcl_info_replace_LBL(devfs_handle_t de,
			char *info_name,
			arb_info_desc_t info_desc,
			arbitrary_info_t info,
			arb_info_desc_t *old_info_desc,
			arbitrary_info_t *old_info)
{
	labelcl_info_t	*labelcl_info = NULL;
	int num_labels;
	label_info_t *label_list;
	int i;
	if (de == NULL)
		return(-1);
	labelcl_info = devfs_get_info(de);
	if (labelcl_info == NULL)
		return(-1);
	if (labelcl_info->hwcl_magic != LABELCL_MAGIC)
		return(-1);
	num_labels = labelcl_info->num_labels;
	if (num_labels == 0) {
		return(-1);
	}
	if (info_name == NULL)
		return(-1);
	label_list = labelcl_info->label_list;
	for (i=0; i<num_labels; i++)
		if (!strcmp(info_name, label_list[i].name)) {
			if (old_info != NULL)
				*old_info = label_list[i].info;
			if (old_info_desc != NULL)
				*old_info_desc = label_list[i].desc;
			label_list[i].info = info;
			label_list[i].desc = info_desc;
			return(0);
		}
	return(-1);
}
int labelcl_info_replace_LBL ( devfs_handle_t de , char * info_name , arb_info_desc_t info_desc , arbitrary_info_t info , arb_info_desc_t * old_info_desc , arbitrary_info_t * old_info ) { labelcl_info_t * labelcl_info = NULL ; int num_labels ; label_info_t * label_list ; int i ; if ( de == NULL ) return ( -1 ) ; labelcl_info = devfs_get_info ( de ) ; if ( labelcl_info == NULL ) return ( -1 ) ; if ( labelcl_info -> hwcl_magic != LABELCL_MAGIC ) return ( -1 ) ; num_labels = labelcl_info -> num_labels ; if ( num_labels == 0 ) { return ( -1 ) ; } if ( info_name == NULL ) return ( -1 ) ; label_list = labelcl_info -> label_list ; for ( i = 0 ; i < num_labels ; i ++ ) if ( ! strcmp ( info_name , label_list [ i ] . name ) ) { if ( old_info != NULL ) * old_info = label_list [ i ] . info ; if ( old_info_desc != NULL ) * old_info_desc = label_list [ i ] . desc ; label_list [ i ] . info = info ; label_list [ i ] . desc = info_desc ; return ( 0 ) ; } return ( -1 ) ; }
labelcl_info_replace_LBL - Replace an existing label entry with the
      given new information.
labelcl_info_replace_LBL - Replace an existing label entry with the given new information .
/* 
	 * Verify that information under info_name already exists.
	 */