Functions to append typed elements to a packet in write mode.
All push functions check for sufficient buffer space and set a sticky error on failure. Values are stored in network byte order.
◆ YAPB_push_blob()
Push a raw byte blob.
- Parameters
-
| pkt | Packet in write mode. |
| data | Pointer to blob data (may be NULL if len is 0). |
| len | Length of the blob (max 65535). |
- Returns
- YAPB_OK on success, error code otherwise.
◆ YAPB_push_double()
Push a double-precision float.
- Parameters
-
| pkt | Packet in write mode. |
| val | Pointer to the value. |
- Returns
- YAPB_OK on success, error code otherwise.
◆ YAPB_push_float()
Push a single-precision float.
- Parameters
-
| pkt | Packet in write mode. |
| val | Pointer to the value. |
- Returns
- YAPB_OK on success, error code otherwise.
◆ YAPB_push_i16()
Push a signed 16-bit integer.
- Parameters
-
| pkt | Packet in write mode. |
| val | Pointer to the value. |
- Returns
- YAPB_OK on success, error code otherwise.
◆ YAPB_push_i32()
Push a signed 32-bit integer.
- Parameters
-
| pkt | Packet in write mode. |
| val | Pointer to the value. |
- Returns
- YAPB_OK on success, error code otherwise.
◆ YAPB_push_i64()
Push a signed 64-bit integer.
- Parameters
-
| pkt | Packet in write mode. |
| val | Pointer to the value. |
- Returns
- YAPB_OK on success, error code otherwise.
◆ YAPB_push_i8()
Push a signed 8-bit integer.
- Parameters
-
| pkt | Packet in write mode. |
| val | Pointer to the value. |
- Returns
- YAPB_OK on success, error code otherwise.
◆ YAPB_push_nested()
Push a finalized nested packet.
The nested packet (including its header) is copied into the parent.
- Parameters
-
| pkt | Packet in write mode. |
| nested | Finalized packet to embed. |
- Returns
- YAPB_OK on success, error code otherwise.