Complete batch 20261016-C-embedded-2: 45 verified GLM/Pi samples, independent regrades and archives; preserve difficulty misses and Salty blockage.
29 lines
1.0 KiB
C
29 lines
1.0 KiB
C
#ifndef ABI_TEXT_H
|
|
#define ABI_TEXT_H
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
|
|
enum { TEXT_LINE = 16384, TEXT_WORDS = 32, TEXT_BYTES = 4096 };
|
|
|
|
typedef struct {
|
|
char line[TEXT_LINE];
|
|
char *word[TEXT_WORDS];
|
|
size_t count;
|
|
unsigned long number;
|
|
int failed;
|
|
} text_reader;
|
|
|
|
void text_init(text_reader *reader);
|
|
int text_next(text_reader *reader, FILE *stream);
|
|
int text_count(text_reader *reader, size_t expected);
|
|
int text_u64(const char *word, uint64_t maximum, uint64_t *value);
|
|
int text_i64(const char *word, int64_t minimum, int64_t maximum, int64_t *value);
|
|
int text_unsigned(text_reader *reader, size_t index, unsigned maximum, unsigned *value);
|
|
int text_signed(text_reader *reader, size_t index, int minimum, int maximum, int *value);
|
|
int text_bytes(const char *word, uint8_t *data, size_t capacity, size_t *length);
|
|
void text_hex(FILE *stream, const uint8_t *data, size_t length);
|
|
uint32_t text_hash(const uint8_t *data, size_t length);
|
|
void text_error(const text_reader *reader, const char *message);
|
|
#endif
|