amos 8b7616bfd8 Batch 22 (20261027-C-hwe-hard-22): add 63 calibrated HWE hard-design tasks
From the 101 lk/man/pth code-gen sources: 63 tasks (C11 36, C++17 27,
11 canonical families), 38 skipped for scope or duplication. Each task
has at least one independent contract-edge defect, boundary types
rotate, and public docs state trap clauses as plain contract prose.
Claude reviewed 63/63 USABLE against current digests. Difficulty is
unmeasured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:14:57 +08:00

29 lines
675 B
C++

#include "internal.hpp"
namespace frames {
bool valid_attr(const Attr& a) {
return (a.mode==NORMAL || a.mode==RECURSIVE) && a.limit>=1 && a.limit<=MAX_DEPTH;
}
int attr_init(Attr* a) {
if (!a) return ARG;
a->mode=NORMAL;
a->limit=1;
return OK;
}
int attr_mode(Attr* a,int mode) {
if (!a || (mode!=NORMAL && mode!=RECURSIVE)) return ARG;
a->mode=mode;
return OK;
}
int attr_limit(Attr* a,unsigned n) {
if (!a || n<1 || n>MAX_DEPTH) return ARG;
a->limit=n;
return OK;
}
int attr_read(const Attr* a,AttrView* out) {
if (!a || !out || !valid_attr(*a)) return ARG;
out->mode=a->mode;
out->limit=a->limit;
return OK;
}
}