amos 9d633e9e67 Batch 15 (20261023-C-hwe-scale-15): 320 HWE-derived repair tasks
One user-space repair task per eligible HWE debug-diag / compile-deploy base
ID: 320 admitted (C 218, C++ 97, build scripts 5), 1 skipped by the content
filter. Each ships a public spec with a check-to-basis table, at least two
defects with single-fix fixtures, a symptom-masking fixture and an alternative
correct implementation. Claude re-checked all 320: structure, the HWE quality
items and trace6 Docker calibration receipts against current digests
(320/320 USABLE). Difficulty is unmeasured. Known follow-up: 212 tasks use 120
ad-hoc family names; the next batch maps them to the canonical list.
The batch's 1,256-line progress log stays in its factory report and the
36-local branch batch15-hwe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 01:55:56 +08:00

49 lines
1.0 KiB
C

#include "phase.h"
#include <string.h>
static int read_line(FILE *input, char *line, size_t size, int *too_long)
{
size_t used = 0;
int character;
int seen = 0;
*too_long = 0;
while ((character = fgetc(input)) != EOF) {
seen = 1;
if (character == '\n') {
break;
}
if (used + 1 < size) {
line[used++] = (char)character;
} else {
*too_long = 1;
}
}
line[used] = '\0';
if (used > 255) {
*too_long = 1;
}
return seen;
}
int timer_cli(FILE *input, FILE *output)
{
TimerBank bank;
char line[TIMER_LINE_SIZE];
int too_long;
timer_bank_reset(&bank, 0);
while (read_line(input, line, sizeof(line), &too_long)) {
if (too_long) {
fputs("ERR syntax\n", output);
} else {
(void)timer_wire(&bank, line, output);
}
}
if (ferror(input)) {
return 1;
}
if (fflush(output) != 0) {
return 1;
}
return 0;
}