HPGCC3 Documentation 3.0 R003

Variable name (ID object) functions

Functions

SAT_OBJECT sat3_createid_str (SAT_OBJECT where, char *string)
 Create an ID object from a C-style string.
BOOL sat3_convertid_str (SAT_OBJECT cstr, char *string, int maxchars)
 Extract a C-style string from a calculator ID.
int sat3_idlen (SAT_OBJECT idnt)
 Get the number of characters in an ID.

Detailed Description

This group includes all functions used to create/convert ID objects.


Function Documentation

BOOL sat3_convertid_str ( SAT_OBJECT  cstr,
char *  string,
int  maxchars 
)

Extract a C-style string from a calculator ID.

Stores the string on a preallocated buffer and appends a null char at the end.

Parameters:
cstrCalculator string.
stringPointer to a preallocateed buffer that is to receive the string.
maxcharsSize of the preallocated buffer.
Returns:
TRUE if successful, FALSE otherwise. If the size of the ID is greater than the buffer size, the ID will be truncated at maxchars.
See also:
sat3_convertcstr_bytes sat3_convertcstr_substr sat3_idlen Object creation and manipulation
SAT_OBJECT sat3_createid_str ( SAT_OBJECT  where,
char *  string 
)

Create an ID object from a C-style string.

Create an ID object from the given string, without the ending null char.

Parameters:
whereDefines where to allocate memory from. Can be one of the following constants: ALLOC_HEAP Allocates from the C-heap using malloc() ALLOC_TEMPOB Allocates memory from the TEMPOB calculator area or... it can be an element (SAT_OBJECT) within a composite object, (array, list or any other).
stringPointer to a null-terminated string.
Returns:
SAT_OBJECT with the new string, or zero if it fails. When a SAT_OBJECT is given to the 'where' parameter, the same SAT_OBJECT is returned or 0 if error.
See also:
Object creation and manipulation
int sat3_idlen ( SAT_OBJECT  idnt)

Get the number of characters in an ID.

Parameters:
idntVariable name (ID object).
Returns:
Number of characters in the given ID, or 0 if not an ID.