Scroll to navigation

ZT_NULL(3) Library Functions Manual (prm) ZT_NULL(3)

NAME

ZT_NULL, zt_nullconstruct a claim that a pointer is NULL

SYNOPSIS

#include <zt.h>

#define ZT_NULL(value) \
  zt_null( \
    ZT_CURRENT_LOCATION(), \
    zt_pack_pointer((value), #value))

zt_claim
zt_null(zt_location location, zt_value value);

DESCRIPTION

() constructs a claim that a given pointer is NULL. It should be used through the macro ZT_NULL(), which passes source code location and packs argument.

() can be useful, when coupled with (), to ensure that something that the reminder of the test relies on did not happen, for example that no error had occurred.

IMPLEMENTATION NOTES

ZT_NULL() evaluates only once.

RETURN VALUES

Both the macro and the function return a zt_claim structure with the appropriate attributes set. The returned claim is usually passed to zt_check() or to zt_assert().

SEE ALSO

zt_assert(3), zt_check(3), zt_claim(3), ZT_CMP_BOOL(3), ZT_CMP_RUNE(3), ZT_CMP_CSTR(3), ZT_CMP_INT(3), ZT_CMP_PTR(3), ZT_CMP_UINT(3), ZT_FALSE(3), ZT_NOT_NULL(3), ZT_NULL(3) zt_value(3),

HISTORY

The ZT_NULL() macro and the zt_null() function first appeared in libzt 0.1

AUTHORS

Zygmunt Krynicki <me@zygoon.pl>

January 12, 2020 libzt 0.3.1