Hex String (HXS)


Functions

bool isHXS (SatAddr src)
 is the object at src a HXS
bool HXSdecodell (SatAddr src, unsigned long long *dst)
 decode a HXS into an unsigned long long.
SatAddr HXSencodell (unsigned long long i, SatAddr dst)
 Convert an unsigned long long to a HXS object.
bool HXSdecode (SatAddr src, char *buf, int *nibbles)
 Extract the data and/or size of an HXS.
SatAddr HXSencode (char *buf, int nibbles, SatAddr dst)
 Create an HXS object from a data buffer.
int HXSnibbles (SatAddr src)
 Return the size in nibbles of the HXS object at src.
int HXSbytes (SatAddr src)
 Return the number of bytes required to store the data in an HXS.
SatAddr makeHXS (int nibbles)
 Create an HXS.

Detailed Description

A Hex String is simply a block of data. These can be used to store binary numbers or unspecified data. Functions are provided to convert to/from long long integers or buffers of any data.

Function Documentation

int HXSbytes ( SatAddr  src  ) 

Return the number of bytes required to store the data in an HXS.

Parameters:
src Saturn address of an HXS
Returns:
The number of bytes, or -1 on error

bool HXSdecode ( SatAddr  src,
char *  buf,
int *  nibbles 
)

Extract the data and/or size of an HXS.

Parameters:
src The Saturn address of a HXS
buf A charcter buffer to receive the data, or zero if you don't want to copy the data
nibbles If non zero, the number of data nibbles in the HXS will be copied here.
Returns:
true on success, false if src doesn't point to an HXS.

bool HXSdecodell ( SatAddr  src,
unsigned long long *  dst 
)

decode a HXS into an unsigned long long.

Parameters:
src The Saturn address of a HXS
dst pointer to where the result will be stored.
Returns:
true on success, false if src isn't a HXS or if the HXS won't fit in an unsigned long long, or if dst is NULL.
See also:
HXSencodell()

SatAddr HXSencode ( char *  buf,
int  nibbles,
SatAddr  dst 
)

Create an HXS object from a data buffer.

Parameters:
buf pointer to the data to put in the HXS
nibbles number of nibbles in buf to copy.
dst The Saturn address of the buffer to recieve the HXS, or zero to create a new buffer.
Returns:
Saturn address of the resulting HXS, or zero on error.

SatAddr HXSencodell ( unsigned long long  i,
SatAddr  dst 
)

Convert an unsigned long long to a HXS object.

Parameters:
i the unsigned long long to convert
dst Saturn address where the HXS will be stored, or zero to allocate a new one.
Returns:
The address of the HXS, or zero on error

int HXSnibbles ( SatAddr  src  ) 

Return the size in nibbles of the HXS object at src.

Parameters:
src Saturn address of an HXS
Returns:
The size in nibbles of the HXS object, or -1 if src doesn't point to an HXS.

bool isHXS ( SatAddr  src  ) 

is the object at src a HXS

Parameters:
src Saturn address of an object
Returns:
true if the object at src is a HXS

SatAddr makeHXS ( int  nibbles  ) 

Create an HXS.

Parameters:
nibbles the number of data nibbles in the HXS
Returns:
the Saturn address of the new HSX, or 0 on error


Generated on Sat Apr 3 16:38:31 2010 for HPObjects by  doxygen 1.5.0