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>
76 lines
2.0 KiB
C
76 lines
2.0 KiB
C
#ifndef DECIMAL_GATEWAY_H
|
|
#define DECIMAL_GATEWAY_H
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#define DF_FRAME_MAX 128u
|
|
#define DF_HISTORY_MAX 16u
|
|
#define DF_ENCODED_MAX 41u
|
|
typedef enum {
|
|
DF_OK = 0,
|
|
DF_EMPTY = 1,
|
|
DF_LENGTH = 2,
|
|
DF_CHAR = 3,
|
|
DF_RANGE = 4,
|
|
DF_SYNTAX = 5,
|
|
DF_KEY = 6,
|
|
DF_DUP = 7,
|
|
DF_SEQUENCE = 8,
|
|
DF_BUDGET = 9,
|
|
DF_OVERFLOW = 10,
|
|
DF_HISTORY = 11,
|
|
DF_CAPACITY = 12
|
|
} df_status;
|
|
typedef struct {
|
|
uint32_t seq;
|
|
uint32_t rate;
|
|
uint32_t window;
|
|
uint32_t channel;
|
|
} df_config;
|
|
typedef struct {
|
|
df_config current;
|
|
uint32_t accepted;
|
|
uint32_t rejected;
|
|
int last;
|
|
df_config history[DF_HISTORY_MAX];
|
|
size_t history_head;
|
|
size_t history_count;
|
|
} df_state;
|
|
typedef struct {
|
|
unsigned char pending[DF_FRAME_MAX];
|
|
size_t length;
|
|
int discarding;
|
|
uint32_t bytes;
|
|
uint32_t frames;
|
|
} df_stream;
|
|
int df_number(const unsigned char *data,
|
|
size_t length,
|
|
unsigned width,
|
|
uint32_t minimum,
|
|
uint32_t maximum,
|
|
uint32_t *out);
|
|
const char *df_status_name(int status);
|
|
unsigned df_changed_mask(const df_config *before, const df_config *after);
|
|
void df_init(df_state *state);
|
|
int df_validate(const df_config *config);
|
|
int df_apply(df_state *state,
|
|
const unsigned char *data,
|
|
size_t length);
|
|
int df_reject(df_state *state, int status);
|
|
size_t df_history_size(const df_state *state);
|
|
int df_history(const df_state *state,
|
|
size_t age,
|
|
df_config *out);
|
|
int df_encode(const df_config *config,
|
|
char *out,
|
|
size_t capacity,
|
|
size_t *written);
|
|
void df_stream_init(df_stream *stream);
|
|
size_t df_feed(df_stream *stream,
|
|
df_state *state,
|
|
const unsigned char *data,
|
|
size_t length);
|
|
int df_finish(df_stream *stream, df_state *state);
|
|
size_t df_pending(const df_stream *stream);
|
|
int df_discarding(const df_stream *stream);
|
|
#endif
|