---
name: "zt_value"
section: "3"
platform: "linux"
package: "libzt-doc"
version: "0.3.1-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/zt_value"
---

# zt\_value(3)

variant type for passing data into claim verifiers

## NAME

**zt\_value**, **zt\_value\_kind**, – variant type for passing data into claim verifiers

## SYNOPSIS

**#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 |

## DESCRIPTION

**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*.

## BUGS

On some architectures **ZT\_INTEGER** and **ZT\_UNSIGNED** are too short to handle **size\_t** and **ssize\_t** values correctly. They are now deprecated and automatically promoted to **ZT\_INTMAX** and **ZT\_UINTMAX** respectively.

## SEE ALSO

[zt\_visit\_test\_case(3)](/zt_visit_test_case/3.md), zt\_visit\_test\_suite(3)

## HISTORY

**zt\_value** and **zt\_value\_kind** first appeared in libzt 0.1

**ZT\_INTMAX**, **ZT\_UINTMAX** and the corresponding union members first appeared in libzt 0.3.

## AUTHORS

Zygmunt Krynicki ⟨*me@zygoon.pl*⟩
