float_sto_set

Read a serialized amount into an XFL

Concepts

Behaviour

  • Read a serialized floating point number.

  • If there are more fields/data after the serialized floating pointer number then ignore them.

  • Return it as an XFL enclosing number

Definition

C

int64_t float_sto_set (
    uint32_t read_ptr,
    uint32_t read_len
);

Example

C

int64_t vault_pusd = float_sto_set(vault, 8);
if (vault_pusd < 0)
  rollback("Failed to parse serialized float.", 33, 1);

Parameters

Name
Type
Description

read_ptr

uint32_t

Pointer to a buffer contianing the serialized XFL. May be null.

read_len

uint32_t

The length of the buffer.

Return Code

Type
Description

int64_t

The number of bytes written to the output buffer. If negative, an error: NOT_AN_OBJECT - the supplied buffer did not contain a valid serialized floating point number OUT_OF_BOUNDS - pointers/lengths specified outside of hook memory.

Last updated