diff options
| author | peter <peter@pmikkelsen.com> | 2026-08-21 10:55:30 +0000 |
|---|---|---|
| committer | peter <peter@pmikkelsen.com> | 2026-08-21 10:55:30 +0000 |
| commit | 8af7b7fc0a8dbe3502a7cd43c6a10fdcc6013677 (patch) | |
| tree | 68f2456a9f31044ca088a26a2c3306c98e6cce2b /src/lib/memory.c | |
| parent | 86feda786f115cb4468957f00b8968b986ed7c54 (diff) | |
Start working on the scanner.
For now, all that is implemented is some functionality which imports UTF-8 into the
memory managed by aplwc, after checking that the data is in fact valid UTF-8.
FossilOrigin-Name: c861e88777d8180cb7b37c11fc7016a900f9d5821a7e3c8e8aab54118d2fca94
Diffstat (limited to 'src/lib/memory.c')
| -rw-r--r-- | src/lib/memory.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/memory.c b/src/lib/memory.c index 187137e..136c7e6 100644 --- a/src/lib/memory.c +++ b/src/lib/memory.c @@ -53,3 +53,35 @@ memory_free_aplwc(struct memory *m, struct aplwc *p) UNUSED_PARAMETER(m); UNUSED_PARAMETER(p); } + +struct aplwc_line * +memory_alloc_aplwc_line(struct memory *m) +{ + struct aplwc_line *p; + + p = alloc(m, sizeof(struct aplwc_line), alignof(struct aplwc_line)); + return p; +} + +void +memory_free_aplwc_line(struct memory *m, struct aplwc_line *p) +{ + UNUSED_PARAMETER(m); + UNUSED_PARAMETER(p); +} + +struct string * +memory_alloc_string(struct memory *m, size_t bytes) +{ + struct string *p; + + p = alloc(m, sizeof(struct string) + bytes, alignof(struct string)); + return p; +} + +void +memory_free_string(struct memory *m, struct string *p) +{ + UNUSED_PARAMETER(m); + UNUSED_PARAMETER(p); +} |