[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference cookie::mru

Title:MRU Internal Bug Reports
Moderator:COOKIE::STMARTIN
Created:Wed Sep 20 1995
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:346
Total number of notes:1175

322.0. "OP:HIGH Owe Steve an example for MRD.3mrd." by NABETH::alan (Dr. File System's Home for Wayward Inodes.) Thu Apr 10 1997 20:49

	There is a section of the MRD.3mrd manual page that had the
	mrd_eject.c example.  Unfortunately, this example wasn't
	appropriate in the context of the text.  I have been promising
	Steve an example for entirely too long...
T.RTitleUserPersonal
Name
DateLines
322.1Close this when Steve uses it.NABETH::alanDr. File System's Home for Wayward Inodes.Thu Apr 10 1997 21:0324
	The section needing the example is the description of the
	Operating System interface routines using absolute element
	addresses.

	/*
	 *	Given an robot_info_t initialized with mrd_startup(3mrd)
	 *	or mrd_show(3mrd), an element type and a relative element
	 *	address, convert it to an absolute address.
	 */
	convert_relative(robot_info_t *robot_info, int type, int element)
	{
		switch( type )
		case SLOT:
			return element + robot_info->slot_start ;
		case TRANSPORT:
			return element + robot_info->transport_start ;
		case DRIVE:
			return element + robot_info->device_start ;
		case PORT:
			return element + robot_info->port_start ;
		default:
			return -1 ;
		}
	}