1/* @ajax/mesh-catalog-toml: what building the program catalog reads from a program.toml, line by line,
2 * exactly as alpha-rust-mesh scripts/build-programs.sh's grep and sed do (no TOML parser: the
3 * same lines, the same answers). */
4#ifndef MESH_CATALOG_TOML_H
5#define MESH_CATALOG_TOML_H
6#include <stdbool.h>
7#include <stddef.h>
8/* The first `name = "x"` line's x (sed -n 's/^name *= *"\(.*\)"/\1/p' | head -1). False if none. */
9bool mesh_catalog_toml_name(const char *text, char *out, size_t cap);
10/* A native program: a line `backends = [ "native" ]` (spaces optional) and nothing else in the list. */
11bool mesh_catalog_toml_native(const char *text);
12/* A `backends` line exists (grep -q '^backends'). */
13bool mesh_catalog_toml_has_backends(const char *text);
14/* A `backends = ...` line mentions "b" (grep -q '^backends *=.*"b"'). */
15bool mesh_catalog_toml_backend(const char *text, const char *b);
16/* The value of a `# key: value` comment line (the script's sed of it). Every match counts, as the
17 * script's command substitution keeps every line: here the lines are joined with '\n'). False if none. */
18bool mesh_catalog_toml_comment(const char *text, const char *key, char *out, size_t cap);
19#endif