Internal Scan Implementation.
More...
Internal Scan Implementation.
Provides a common implementation for scanning formatted input, any function that needs to scan formatted input should define the _SCAN_GET() and _SCAN_UNGET() macros before including this file.
The _SCAN_GET(ctx) macro should evaluate to an expression that returns the next character from the input source and takes a pointer to the current scan_ctx_t as an argument.
The_SCAN_UNGET(ctx, c) macro should evaluate to an expression that pushes back the character c to the input source and takes a pointer to the current scan_ctx_t and the character to push back as argument.
- Todo:
- Implement floating point scanning.
- See also
- https://cplusplus.com/reference/cstdio/scanf/ for details on the format specifiers.
|
| static int | _scan_next (_scan_ctx_t *ctx) |
| |
| static void | _scan_undo (_scan_ctx_t *ctx, int c) |
| |
| static int | _scan_whitespace (_scan_ctx_t *ctx) |
| |
| static int | _scan_asign_signed_int (_scan_ctx_t *ctx, _scan_format_ctx_t *format, int64_t value) |
| |
| static int | _scan_asign_unsigned_int (_scan_ctx_t *ctx, _scan_format_ctx_t *format, uint64_t value) |
| |
| static int | _scan_format_integer (_scan_ctx_t *ctx, _scan_format_ctx_t *format, uint32_t base, _scan_format_integer_flags_t flags) |
| |
| static int | _scan_format_float (_scan_ctx_t *ctx, _scan_format_ctx_t *format) |
| |
| static int | _scan_format_char (_scan_ctx_t *ctx, _scan_format_ctx_t *format) |
| |
| static int | _scan_format_string (_scan_ctx_t *ctx, _scan_format_ctx_t *format) |
| |
| static void | _scanset_set (_scanset_t *scanset, uint8_t c) |
| |
| static bool | _scanset_get (_scanset_t *scanset, uint8_t c) |
| |
| static int | _scan_format_scanset (_scan_ctx_t *ctx, _scan_format_ctx_t *format) |
| |
| static int | _scan_format_count (_scan_ctx_t *ctx, _scan_format_ctx_t *format) |
| |
| static int | _scan_format_percent (_scan_ctx_t *ctx, _scan_format_ctx_t *format) |
| |
| static int | _scan_format (_scan_ctx_t *ctx) |
| |
| static int | _scan (const char *_RESTRICT format, va_list arg, void *private) |
| |
◆ _scan_format_flags_t
| Enumerator |
|---|
| _SCAN_SUPPRESS_ASSIGNMENT | |
Definition at line 108 of file scan.h.
◆ _scan_format_length_t
| Enumerator |
|---|
| _SCAN_DEFAULT | |
| _SCAN_HH | |
| _SCAN_H | |
| _SCAN_L | |
| _SCAN_LL | |
| _SCAN_J | |
| _SCAN_Z | |
| _SCAN_T | |
Definition at line 113 of file scan.h.
◆ _scan_format_integer_flags_t
| Enumerator |
|---|
| _SCAN_INTEGER_UNSIGNED | |
| _SCAN_INTEGER_SIGNED | |
Definition at line 202 of file scan.h.
◆ _scan_next()
◆ _scan_undo()
◆ _scan_whitespace()
◆ _scan_asign_signed_int()
◆ _scan_asign_unsigned_int()
◆ _scan_format_integer()
◆ _scan_format_float()
- Todo:
- Implement floating point scanning
Definition at line 314 of file scan.h.
◆ _scan_format_char()
◆ _scan_format_string()
◆ _scanset_set()
◆ _scanset_get()
◆ _scan_format_scanset()
◆ _scan_format_count()
◆ _scan_format_percent()
◆ _scan_format()
◆ _scan()