hyle/purify.h(3)libhyle

NAME

hyle/purify.h - Row-level field validation and error collection.

SYNOPSIS

#include <stddef.h>
#include <stdint.h>
#include 'field.h'

Data Structures

struct hyle_purify_error_t

One validation violation reported for a row field.

Functions

int hyle_purify_row (const hyle_field_t *fields, size_t field_count, const char **values, hyle_purify_error_t **errors_out, size_t *error_count_out)

Validate a row's values against a field schema.

void hyle_purify_errors_free (hyle_purify_error_t *errors, size_t error_count)

Free the error array and its message strings.

Detailed Description

Row-level field validation and error collection.

Validates a row's values against the field schema and reports per-field violations without touching storage.

Function Documentation

void hyle_purify_errors_free (hyle_purify_error_t * errors, size_t error_count)

Free the error array and its message strings.

Parameters

errors Array returned by hyle_purify_row(), or NULL.
error_count Number of entries in errors.

int hyle_purify_row (const hyle_field_t * fields, size_t field_count, const char ** values, hyle_purify_error_t ** errors_out, size_t * error_count_out)

Validate a row's values against a field schema. Checks required presence, integer min/max, string length bounds and POSIX extended regex patterns without touching storage. On failure the violations are returned through errors_out; release them with hyle_purify_errors_free().

Parameters

fields Array of field descriptors.
field_count Number of entries in fields.
values Parallel array of raw string values, or NULL.
errors_out Receives the violation array, or NULL.
error_count_out Receives the number of violations, or NULL.

Returns

1 when the row failed validation (or an error was raised), 0 when the row is valid or the arguments are invalid.

Author

Generated automatically by Doxygen for libhyle from the source code.