ref/hare/ ships only ast/lex/parse/module/unparse — no checker. Every bail-fix landing in A.6.2.1 (helper bail audit, N_IDENT bail audit, enum fold) needs a `ref/harec/...` cite anchor so divergence rationale isn't claimed against memory. PLAN.md L16, L35. Snapshot of upstream commit ee640c6b2c17f57e8014d277a3028b262ffb7952 (`rt/+openbsd/start.ha: remove outdated comment about crt0`). 20 files: 5 src (check.c, eval.c, scope.c, types.c, type_store.c), 14 transitive include/ headers (no parser/codegen surface), and COPYING. License GPLv3 (COPYING included). Vendored as read-only reference per CLAUDE.md rule 6 — no redistribution as binary, no edits.
27 lines
501 B
C
27 lines
501 B
C
#ifndef HAREC_UTF8_H
|
|
#define HAREC_UTF8_H
|
|
#include <stdint.h>
|
|
#include <limits.h>
|
|
#include <stdio.h>
|
|
|
|
#define UTF8_MAX_SIZE 4
|
|
|
|
#define UTF8_INVALID UINT32_MAX
|
|
|
|
/**
|
|
* Grabs the next UTF-8 codepoint and advances the string pointer
|
|
*/
|
|
uint32_t utf8_decode(const char **str);
|
|
|
|
/**
|
|
* Encodes a codepoint as UTF-8 and returns the length of that codepoint.
|
|
*/
|
|
size_t utf8_encode(char *str, uint32_t ch);
|
|
|
|
/**
|
|
* Reads and returns the next codepoint from the file.
|
|
*/
|
|
uint32_t utf8_get(FILE *f);
|
|
|
|
#endif
|