ftp.nice.ch/pub/next/tools/scsi/SCSI2_ToolBox.941207.NI.bs.gnutar.gz#/SCSI2_ToolBox/SCSI2_Kit/Documentation/GeneralRef/Functions/SCSI2KitFunctions.rtf

This is SCSI2KitFunctions.rtf in view mode; [Download] [Up]

Copyright ©1994 by Christopher Wolf
($Id: SCSI2KitFunctions.rtf,v 0.2 94/10/10 16:16:10 chris Exp Locker: chris $)















S2K_ReadBigEndianLong(), S2K_ReadBigEndianShort(), S2K_ReadBigEndianValue()


	SUMMARY	Read a big-endian integer value


	DECLARED IN	SCSI2_Kit/SCSI2_Class/SCSI.h


	SYNOPSIS

int S2K_ReadBigEndianLong(void *address)
int S2K_ReadBigEndianShort(void *address)
int S2K_ReadBigEndianValue(void *address, int numBits)


	DESCRIPTION	Use this function to read an integer value stored in big-endian (MSB first) order from the specified address and return the value as an bit integer in native byte format.   This function should always be used when reading multi-byte fields in SCSI structures to insure that your code will work on both big-endian (Motorola) and little-endian (Intel) machines.
	
		The S2K_ReadBigEndianLong function reads a 32 bit value from address.  The S2K_ReadBigEndianShort function reads a 16 bit value from address.  The S2K_ReadBigEndianValue reads a value from address whose length, from 1-32 bits, is specifed in numBits.   Note that the return value, in native byte order, is always cast to a 32 bit integer even if the value being read is fewer bits. 


	RETURN	A 32 bit native byte-order integer value equal to the bit big-endian integer value stored at the indicated address.






S2K_WriteBigEndianLong,S2K_WriteBigEndianShort(),S2K_WriteBigEndianValue()


	SUMMARY	Write a big-endian integer value


	DECLARED IN	SCSI2_Kit/SCSI2_Class/SCSI.h


	SYNOPSIS

void S2K_WriteBigEndianLong(int value, void *address)
void S2K_WriteBigEndianShort(int value,  void *address)
void S2K_WriteBigEndianValue(int value, void *address, int numBits)


	DESCRIPTION	Use this function to store a value as a big-endian (MSB first) integer at the specified address.  This function should always be used when writing multi-byte integer fields in SCSI structures to insure that your code will work on both big-endian (Motorola) and little-endian (Intel) machines.
	
		The S2K_WriteBigEndianLong function writes to a 32 bit value to address.  The S2K_WriteBigEndianShort function write a 16 bit value to address.  The S2K_WriteBigEndianValue writes a value to address whose length, from 1-32 bits, is specifed in numBits.   Note that the specified value, in native byte order, must always be passed as a 32 bit integer even if the destination big endian value is being stored in fewer bits.


	RETURN	This function does not return any value. 	 





These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.