zt_value3
Variant type for passing data into claim verifiers
Usage
#include <zt.h>
typedef struct zt_value { ... } zt_value;
| Type | Entry | Description |
| zt_value_kind | kind | Discriminator for the union |
| const char * | source | Source code used to compute the value |
| union { ... } | as | Union containing the actual value |
| bool | as.boolean | Value when used as ZT_BOOLEAN |
| int | as.integer | Value when used as ZT_INTEGER |
| unsigned | as.unsigned_integer | Value when used as ZT_UNSIGNED |
| int | as.rune | Value when used as ZT_RUNE |
| const char * | as.string | Value when used as ZT_STRING |
| const void * | as.pointer | Value when used as ZT_POINTER |
| intmax_t | as.intmax | Value when used as ZT_INTMAX |
| uintmax_t | as.uintmax | Value when used as ZT_UINTMAX |
typedef enum zt_value_kind { ... } zt_value_kind;
| Kind | Description |
| ZT_NOTHING | Placeholder for unused values |
| ZT_BOOLEAN | zt_value.as.boolean is valid |
| ZT_INTEGER | zt_value.as.integer is valid (deprecated) |
| ZT_UNSIGNED | zt_value.as.unsigned_integer is valid (deprecated) |
| ZT_RUNE | zt_value.as.rune is valid |
| ZT_STRING | zt_value.as.string is valid |
| ZT_POINTER | zt_value.as.pointer is valid |
| ZT_INTMAX | zt_value.as.intmax is valid |
| ZT_UINTMAX | zt_value.as.uintmax is valid |
Overview
zt_value is a variant-like type that is used to pass values around libzt internals. It is comprised of the kind enumeration, the as union as well as the source string.
zt_value_kind describes type of verification function arguments.
Implementation notes
zt_value exists to pass packed values of several types from the test source code, through the zt_claim type and into private verification functions that determine test outcome.
Tests using binary relations encode the operator as an argument of kind ZT_STRING.
Releases
Unchanged in 3 releases since Debian 11 (Bullseye).