skip to content
==> include/mesh/source_hash.h <==
1/* @ajax/mesh-source-hash: a native program's source identity (build-programs.sh's source_hash): the
2 * SHA-256 of every source file under some folders, each as "path\0content" in byte order of the
3 * paths, its first 16 hex digits. Every member that built the same tree shares it. */
4#ifndef MESH_SOURCE_HASH_H
5#define MESH_SOURCE_HASH_H
6#include <stdbool.h>
7#include <stddef.h>
8/* Hashes the files under root/dirs[i] (paths relative to root, as the script's `find` prints them;
9 * a missing folder adds nothing) whose names end in .c or .h or are sexc.json or program.toml,
10 * outside any .sexc folder. out: 16 hex digits and a NUL. False on a read error. */
11bool mesh_source_hash(const char *root, const char *const *dirs, size_t ndirs, char out[17]);
12#endif