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

# zt\_visitor(3)

interface for discovering test suites and test cases

## NAME

**zt\_visitor**, **zt\_visitor\_vtab** – interface for discovering test suites and test cases

## SYNOPSIS

**#include \<zt.h\>**

*typedef* *struct* *zt\_visitor* *{* *...* *}* *zt\_visitor;*

| | | |
| --- | --- | --- |
| **Type** | **Entry** | **Description** |
| *void* *\** | id | Object implementing the interface |
| *struct* *zt\_visitor\_vtab* *\** | vtab | Table of interface functions |

## DESCRIPTION

**zt\_visitor** is an interface for exploring test suites and test cases. The visitor type is used as an argument to all test suites. Test suites can enumerate test cases and other test suites. It is a part of the implementation and is not expected to be implemented by library users.

**zt\_visitor\_vtab** is an opaque type comprised of functions that define the interface. The interface is only used internally so the implementation is private.

## IMPLEMENTATION NOTES

Interface values combine an object pointer with a function table pointer and are passed by value.

An interface can use the NULL pointer as an object pointer if there is no need to refer to any data specific to an instance. The function table pointer cannot be null as it defines the unique aspect of the implementation.

## SEE ALSO

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

## HISTORY

**zt\_visitor** first appeared in libzt 0.1

## AUTHORS

Zygmunt Krynicki ⟨*me@zygoon.pl*⟩
