zt_pack_unsigned(3)

zt_pack_unsigned3

Pack an unsigned integer into a variant

Usage

#include <zt.h>

zt_value

zt_pack_unsigned(uintmax_t value, const char *source);

Overview

zt_pack_unsigned packs an unsigned integer, as well as the string describing the expression evaluated to obtain it, into a variant-like zt_value. The source argument is retained by the value and is typically a constant string literal produced by the preprocessor.

Implementation notes

zt_pack_unsigned is only provided as a static inline function.

Return values

The packed value.

Releases

Unchanged in 3 releases since Debian 11 (Bullseye).

  1. 11–13

History

zt_pack_unsigned first appeared in libzt 0.1

In libzt 0.3 the type of the first argument changed to uintmax_t, to accommodate for wider values. The resulting value structure encodes the new corresponding kind, ZT_UINTMAX. Note that zt_value objects created by programs compiled with earlier versions of libzt are still valid and are internally promoted to the wider type.

Authors

Zygmunt Krynicki ⟨[email protected]⟩

From libzt-doc 0.3.1-4 in Debian 13 (Trixie). Parsed by carta from the page's mdoc source.