Lime Parser Generator 0.1.0
Runtime-extensible LALR(1) parser with SIMD tokenization and LLVM JIT
Loading...
Searching...
No Matches
snapshot_diff.h
1/*
2 * @file snapshot_diff.h
3 * @brief Binary diff/patch for ParserSnapshots.
4 *
5 * Enables incremental composition: when a multi-extension daemon
6 * startup composes the same set of grammars repeatedly with one
7 * extension swapped, the diff between consecutive composed
8 * snapshots is small. Computing and applying the diff is faster
9 * than rebuilding the full LALR table from grammar source.
10 *
11 * Available since v0.6.x. No production consumer wires this into
12 * compose_snapshots() yet; the API ships as a building block for
13 * future incremental-composition work.
14 */
15
16#ifndef LIME_SNAPSHOT_DIFF_H
17#define LIME_SNAPSHOT_DIFF_H
18
19#include <stddef.h>
20#include <stdint.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26struct ParserSnapshot;
27
28typedef struct LimeSnapshotDiff LimeSnapshotDiff;
29
47int lime_snapshot_diff(const struct ParserSnapshot *old_snap,
48 const struct ParserSnapshot *new_snap,
49 LimeSnapshotDiff **out_diff,
50 char **error);
51
68int lime_snapshot_apply_diff(const struct ParserSnapshot *base,
69 const LimeSnapshotDiff *diff,
70 struct ParserSnapshot **out_snap,
71 char **error);
72
76void lime_snapshot_diff_release(LimeSnapshotDiff *diff);
77
91size_t lime_snapshot_diff_summary(const LimeSnapshotDiff *diff,
92 char *buf,
93 size_t buflen);
94
95#ifdef __cplusplus
96}
97#endif
98
99#endif /* LIME_SNAPSHOT_DIFF_H */
Opaque snapshot handle.
Definition snapshot.h:177