Reading a layout wire string without parsing the whole thing. More...
#include <stdbool.h>Go to the source code of this file.
Macros | |
| #define | LAYOUT_INT_MAX 9999 |
| The biggest number a layout field holds. Nothing the builder writes comes close. | |
Functions | |
| int | layout_parse_int (const char **cursor) |
| Reads a run of digits and moves the cursor past them. | |
| bool | layout_has_any_block (const char *layout, int type_count) |
| Whether a layout string holds at least one placeable block. | |
Reading a layout wire string without parsing the whole thing.
A layout reaches the watch as a run of records separated by semicolons, each starting with the module that goes there. Before any of it is worth parsing, something has to answer whether the string holds anything at all, because a face that swaps between layouts has to know which of them are real and which are empty.
The bound on a module number comes in from the caller, since each family of faces has its own catalogue. Nothing here touches a watch, which is what keeps it host-testable.