|
| YAPB_Result_t | YAPB_pop_next (YAPB_Packet_t *pkt, YAPB_Element_t *out) |
| | Pop the next element regardless of its type.
|
| YAPB_Result_t | YAPB_pop_i8 (YAPB_Packet_t *pkt, int8_t *out) |
| | Pop a signed 8-bit integer.
|
| YAPB_Result_t | YAPB_pop_i16 (YAPB_Packet_t *pkt, int16_t *out) |
| | Pop a signed 16-bit integer.
|
| YAPB_Result_t | YAPB_pop_i32 (YAPB_Packet_t *pkt, int32_t *out) |
| | Pop a signed 32-bit integer.
|
| YAPB_Result_t | YAPB_pop_i64 (YAPB_Packet_t *pkt, int64_t *out) |
| | Pop a signed 64-bit integer.
|
| YAPB_Result_t | YAPB_pop_float (YAPB_Packet_t *pkt, float *out) |
| | Pop a single-precision float.
|
| YAPB_Result_t | YAPB_pop_double (YAPB_Packet_t *pkt, double *out) |
| | Pop a double-precision float.
|
| YAPB_Result_t | YAPB_pop_blob (YAPB_Packet_t *pkt, const uint8_t **data, uint16_t *len) |
| | Pop a raw byte blob.
|
| YAPB_Result_t | YAPB_pop_nested (YAPB_Packet_t *pkt, YAPB_Packet_t *out) |
| | Pop a nested packet.
|
Functions to read typed elements from a packet in read mode.
All pop functions validate the next type tag and set a sticky error on mismatch. Output values are not modified on error or YAPB_STS_COMPLETE, enabling forward-compatible reads with default values.
◆ YAPB_pop_blob()
Pop a raw byte blob.
Returns a pointer directly into the packet buffer. The pointer is valid as long as the underlying data buffer is alive. Do not free it.
- Parameters
-
| pkt | Packet in read mode. |
| data | Output: pointer into packet buffer (unchanged on error). |
| len | Output: blob length in bytes (unchanged on error). |
- Returns
- YAPB_OK, YAPB_STS_COMPLETE, or error code.
◆ YAPB_pop_double()
Pop a double-precision float.
- Parameters
-
| pkt | Packet in read mode. |
| out | Output value (unchanged on error). |
- Returns
- YAPB_OK, YAPB_STS_COMPLETE, or error code.
◆ YAPB_pop_float()
Pop a single-precision float.
- Parameters
-
| pkt | Packet in read mode. |
| out | Output value (unchanged on error). |
- Returns
- YAPB_OK, YAPB_STS_COMPLETE, or error code.
◆ YAPB_pop_i16()
Pop a signed 16-bit integer.
- Parameters
-
| pkt | Packet in read mode. |
| out | Output value (unchanged on error). |
- Returns
- YAPB_OK, YAPB_STS_COMPLETE, or error code.
◆ YAPB_pop_i32()
Pop a signed 32-bit integer.
- Parameters
-
| pkt | Packet in read mode. |
| out | Output value (unchanged on error). |
- Returns
- YAPB_OK, YAPB_STS_COMPLETE, or error code.
◆ YAPB_pop_i64()
Pop a signed 64-bit integer.
- Parameters
-
| pkt | Packet in read mode. |
| out | Output value (unchanged on error). |
- Returns
- YAPB_OK, YAPB_STS_COMPLETE, or error code.
◆ YAPB_pop_i8()
Pop a signed 8-bit integer.
- Parameters
-
| pkt | Packet in read mode. |
| out | Output value (unchanged on error). |
- Returns
- YAPB_OK, YAPB_STS_COMPLETE, or error code.
◆ YAPB_pop_nested()
Pop a nested packet.
The output packet is set up in read mode, pointing into the parent's data buffer. The parent buffer must remain valid.
- Parameters
-
| pkt | Packet in read mode. |
| out | Output: nested packet ready for reading (unchanged on error). |
- Returns
- YAPB_OK, YAPB_STS_COMPLETE, or error code.
◆ YAPB_pop_next()
Pop the next element regardless of its type.
Reads the type tag, then dispatches to the appropriate typed pop function. The result is returned in a tagged union. This is useful for generic iteration over packet contents.
- Parameters
-
| pkt | Packet in read mode. |
| out | Output: tagged union with type and value. |
- Returns
- YAPB_OK, YAPB_STS_COMPLETE, or error code.