/ scripts / gen_c_from_schema.sh
gen_c_from_schema.sh
 1  #!/usr/bin/env bash
 2  # SPDX-License-Identifier: AGPL-3.0-or-later
 3  # SPDX-FileCopyrightText: 2025 Hyperpolymath Contributors
 4  set -euo pipefail
 5  
 6  SCHEMA="${1:-schemas/sensors.bop}"
 7  OUTDIR="${2:-implementations/zig/generated}"
 8  
 9  if ! command -v bebopc >/dev/null 2>&1; then
10    echo "bebopc not found on PATH. Install Bebop compiler or point to it explicitly." >&2
11    exit 1
12  fi
13  
14  mkdir -p "$OUTDIR"
15  bebopc "$SCHEMA" --lang c --out "$OUTDIR"
16  echo "Generated C bindings into $OUTDIR"