Detailed Description
This group includes all functions used to create/convert hex string objects.
Define Documentation
#define sat3_hxssize |
( |
|
hxs | ) |
sat3_strsize(hxs) |
Get the number of nibbles in a hex string.
- Parameters:
-
- Returns:
- Number of nibbles in the given hex string, or 0 if not a string.
Definition at line 2128 of file sat3.h.
Function Documentation
BOOL sat3_converthxs_bytes |
( |
SAT_OBJECT |
hxs, |
|
|
char * |
data, |
|
|
int |
maxbytes |
|
) |
| |
Extract a sequence of bytes from a hex string.
Useful to read arbitrary data from a calculator string.
- Parameters:
-
hxs | Hex string to get bytes from. |
data | Pointer to a preallocateed buffer that is to receive the bytes. |
maxbytes | Size of the preallocated buffer. |
- Returns:
- TRUE if successful, FALSE otherwise. If the size of the string is greater than the buffer size, only up to maxbytes will be extracted.
- See also:
- sat3_converthxs_int sat3_converthxs_llong sat3_hxssize Object creation and manipulation
Extract an integer from a hex string.
Reads the first 8 nibbles of a hex string as a 32-bit integer. If the hex string contains less than 8 nibbles, the number will be zero-padded in the upper nibbles (no sign extension).
- Parameters:
-
- Returns:
- Number extracted from the hex string, or zero if the object is invalid.
- See also:
- sat3_converthxs_bytes sat3_converthxs_llong Object creation and manipulation
Extract a 64-bit integer from a hex string.
Reads the first 16 nibbles of a hex string as a 64-bit integer. If the hex string contains less than 16 nibbles, the number will be zero-padded in the upper nibbles (no sign extension).
- Parameters:
-
- Returns:
- Number extracted from the hex string, or zero if the object is invalid.
- See also:
- sat3_converthxs_bytes sat3_converthxs_int Object creation and manipulation
Create a hex string object from a sequence of bytes.
Useful to include arbitrary data on a calculator hex string.
- Parameters:
-
where | Defines 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). |
data | Pointer to the buffer containing the bytes to extract. |
nbytes | Number of bytes to include on the hex string. |
- Returns:
- SAT_OBJECT with the new hex 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:
- sat3_createhxs_int sat3_createhxs_llong Object creation and manipulation
Create a hex string object from a 32-bit integer.
Creates an 8-nibble hex string containing the integer.
- Parameters:
-
where | Defines 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). |
value | Number to insert into the hxs string. |
- Returns:
- SAT_OBJECT with the new hexxx 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:
- sat3_createhxs_llong sat3_createchxs_bytes Object creation and manipulation
Create a hex string object from a 64-bit integer.
Creates an 16-nibble hex string containing the integer.
- Parameters:
-
where | Defines 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). |
value | Number to insert into the hxs string. |
- Returns:
- SAT_OBJECT with the new hexxx 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:
- sat3_createhxs_int sat3_createchxs_bytes Object creation and manipulation