From dcebf9c7f954a55350b68d0ead1935612c4e2e05 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Thu, 15 Oct 2026 13:04:01 +0300 Subject: Rename the library to wsap_vtcore ncurses installs and defines struct term. In a file that includes both headers, an ncurses TERMINAL * and this library's terminal are silently the same type. The name wsap_vtcore avoids the clash. The public header is now . Every global symbol uses the wsap_vtcore_ prefix, every macro uses WSAP_VTCORE_, and the shared library is libwsap_vtcore.so.0. The default terminal name is now "wsap_vtcore". The ISA override variable is WSAP_VTCORE_ISA. No other behavior changes. The amalgamation writes wsap_vtcore.c and wsap_vtcore.h. Co-Authored-By: Claude Haiku 5.5 --- tests/symbols_test.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/symbols_test.sh') diff --git a/tests/symbols_test.sh b/tests/symbols_test.sh index 0343eb0..d787b72 100644 --- a/tests/symbols_test.sh +++ b/tests/symbols_test.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash -# Every global symbol of the term library starts with term_. A host links +# Every global symbol of the library starts with wsap_vtcore_. A host links # the library next to its own code, so a bare name such as palette_init can -# collide with a host symbol. Every function that term.h declares is also +# collide with a host symbol. Every function that wsap_vtcore.h declares is also # defined, so the library cannot leave one out. A shared build exports -# exactly the functions of term.h. +# exactly the functions of wsap_vtcore.h. set -euo pipefail lib=$1 -src=${2:-$(dirname "$0")/../include/term} +src=${2:-$(dirname "$0")/../include/wsap_vtcore} nm=${NM:-nm} defined_args=(-g --defined-only -P) @@ -21,14 +21,14 @@ defined=$(awk 'NF >= 2 && $2 ~ /^[A-Z]$/ && $2 != "U" { print $1 }' <<<"$syms" | grep -v '^_*odr_asan\.' | sed 's/^_//' | sort -u) status=0 -bad=$(grep -v '^term_' <<<"$defined" || true) +bad=$(grep -v '^wsap_vtcore_' <<<"$defined" || true) if [[ -n $bad ]]; then - echo "$lib: global symbols without the term_ prefix:" >&2 + echo "$lib: global symbols without the wsap_vtcore_ prefix:" >&2 echo "$bad" >&2 status=1 fi -declared=$("${CC:-cc}" -std=c11 -E -P -I"$src" "$src/term.h" | python3 -c ' +declared=$("${CC:-cc}" -std=c11 -E -P -I"$src" "$src/wsap_vtcore.h" | python3 -c ' import re, sys text = re.sub(r"\s+", " ", sys.stdin.read()) depth, flat = 0, [] @@ -42,18 +42,18 @@ for ch in text: for stmt in "".join(flat).split(";"): if "static" in stmt or "typedef" in stmt: continue - m = re.search(r"\b(term_\w+)\s*\(", stmt) + m = re.search(r"\b(wsap_vtcore_\w+)\s*\(", stmt) if m: print(m.group(1)) ' | sort -u) missing=$(comm -23 <(echo "$declared") <(echo "$defined")) if [[ -n $missing ]]; then - echo "$lib: functions declared in term.h but not defined:" >&2 + echo "$lib: functions declared in wsap_vtcore.h but not defined:" >&2 echo "$missing" >&2 status=1 fi -# The shared library exports term.h and nothing else. +# The shared library exports wsap_vtcore.h and nothing else. shared=${3:-} if [[ -n $shared ]]; then exported=$("$nm" "${exported_args[@]}" "$shared" | awk '$2 ~ /^[TDBRVW]$/ { print $1 }' | @@ -61,8 +61,8 @@ if [[ -n $shared ]]; then extra=$(comm -13 <(echo "$declared") <(echo "$exported")) absent=$(comm -23 <(echo "$declared") <(echo "$exported")) if [[ -n $extra || -n $absent ]]; then - echo "$shared: exports differ from term.h" >&2 - [[ -n $extra ]] && echo "not in term.h: $extra" >&2 + echo "$shared: exports differ from wsap_vtcore.h" >&2 + [[ -n $extra ]] && echo "not in wsap_vtcore.h: $extra" >&2 [[ -n $absent ]] && echo "not exported: $absent" >&2 status=1 fi -- cgit v1.2.3