zt_pack_integer(3)

packs an integer, as well as the string describing the expression evaluated to obtain it, into a variant-like The source

Section 3 libzt-doc bookworm source

Description

UNTITLED() LOCAL UNTITLED()

NAME

zt_pack_integer — pack an integer into a variant

SYNOPSIS

#include <zt.h>

zt_value

zt_pack_integer(intmax_t value, const char *source);

DESCRIPTION

zt_pack_integer packs an 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_integer is only provided as a static inline function.

RETURN VALUES

The packed value.

SEE ALSO

zt_pack_nothing(3), zt_pack_integer(3), zt_pack_rune(3), zt_pack_integer(3), zt_pack_unsigned(3), zt_pack_string(3), zt_pack_pointer(3) zt_value(3),

HISTORY

zt_pack_integer first appeared in libzt 0.1

In libzt 0.3 the type of the first argument changed to intmax_t, to accommodate for wider values. The resulting value structure encodes the new corresponding kind, ZT_INTMAX. 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 <me@zygoon.pl> libzt 0.3.1 January 12, 2020 zt_pack_integer(3)