Functions that work with any object


Defines

#define obProlog(src)   (sat_peek((src), 5))
 Get an object's prolog.

Functions

bool fixedSize (int prolog)
 Are all objects with this prolog fixed in size.
bool isOb (SatAddr src)
 Is there a recognized HP object at src?
int obNibbles (SatAddr src)
 Return the size in nibbles of object or pointer at src.
SatAddr skipOb (SatAddr src)
 Return the address of the object after src, which can point to an object or an indirect pointer. This is basically the C version of skipOb.
bool obCopy (SatAddr src, SatAddr dst)
 Copy an object or pointer from src to dst, but only if the object at dst is the same size as the one at src.

Define Documentation

#define obProlog ( src   )     (sat_peek((src), 5))

Get an object's prolog.

Parameters:
src Saturn address of an object
Returns:
The object's prolog.


Function Documentation

bool fixedSize ( int  prolog  ) 

Are all objects with this prolog fixed in size.

Parameters:
prolog An object prolog
Returns:
true if all objects with this prolog have the same size, otherwise false.

bool isOb ( SatAddr  src  ) 

Is there a recognized HP object at src?

This function is very fast but not 100% accurate. It works by assuming that src contains an object and inspecting the first nibble at the object's prolog address. For real objects, this value is always the same. Note however that it's possible to get a false positive result. That is, isOb() may return true when in fact "src" doesn't contain an object.

If you need to be certain that an object exists at the address, call obSize() and see if the result is greater than zero.

Parameters:
src A Saturn address
Returns:
true if there appears to be an object at Src. Otherwise false.
See also:
obSize()

bool obCopy ( SatAddr  src,
SatAddr  dst 
)

Copy an object or pointer from src to dst, but only if the object at dst is the same size as the one at src.

Parameters:
src Saturn address of the source object or pointer
dst Saturn address of the desination
Returns:
true what was at src and dst were the same sizes and src was copied to the dst. False otherwise.
Warning:
If anything in the calculator

int obNibbles ( SatAddr  src  ) 

Return the size in nibbles of object or pointer at src.

Parameters:
src Saturn address of an object or indirect pointer
Returns:
The size of the object or indirect pointer.

SatAddr skipOb ( SatAddr  src  ) 

Return the address of the object after src, which can point to an object or an indirect pointer. This is basically the C version of skipOb.

Parameters:
src Saturn address of an object, or a pointer to an object
Returns:
The address right after the object or pointer. This just returns src+obSize(src).
See also:
obSize()


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