|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
Base-16 conversion between raw bytes and their ASCII digits. More...
#include "protocore_config.h"Go to the source code of this file.
Classes | |
| struct | HexStorage |
| The two digit tables: the only thing this module owns. More... | |
| struct | HexArgs |
| What a digit conversion names: one nibble, or one character. More... | |
| struct | HexIoArgs |
| The buffers a run conversion moves between. More... | |
| struct | HexVars |
| struct | HexNs |
| The entries. More... | |
Functions | |
| void | protocore_hex_digit (uint8_t *work) |
| void | protocore_hex_val (uint8_t *work) |
| void | protocore_hex_u32 (uint8_t *work) |
| void | protocore_hex_encode (uint8_t *work) |
| void | protocore_hex_decode (uint8_t *work) |
Variables | |
| const HexStorage | PROTOCORE_HEX |
| The digit tables every hex site reads. | |
| HexVars | HexV |
| The operands and the outcome. | |
Base-16 conversion between raw bytes and their ASCII digits.
Four operations cover every hex site in the library: one nibble out, one digit in, a machine word out, and a byte run in either direction. Each writes into a caller-owned buffer, takes no heap and no <stdlib.h>, and is inline so an unused one costs nothing.
The decoders report failure through a negative return rather than a sentinel digit, so a malformed byte can never be mistaken for a valid zero.
Definition in file hex.h.
| void protocore_hex_digit | ( | uint8_t * | work | ) |
| void protocore_hex_val | ( | uint8_t * | work | ) |
| void protocore_hex_u32 | ( | uint8_t * | work | ) |
| void protocore_hex_encode | ( | uint8_t * | work | ) |
| void protocore_hex_decode | ( | uint8_t * | work | ) |
|
extern |
The digit tables every hex site reads.
|
extern |
The operands and the outcome.