---
name: "tickit_string"
section: "7"
platform: "linux"
package: "libtickit-dev"
version: "0.4.3-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/tickit_string"
---

# tickit\_string(7)

a reference-counted string buffer

## NAME

TickitString - a reference-counted string buffer

## SYNOPSIS

```
#include <tickit.h>

typedef struct TickitString;
```

## DESCRIPTION

A **TickitString** instance stores a NUL-terminated character buffer (i.e. a plain C string) and a reference count. It allows string buffers to be efficiently shared while their usage is tracked, and reclaimed once no longer required.

## FUNCTIONS

A new **TickitString** instance is created by calling [**tickit\_string\_new**(3)](/tickit_string_new/3.md). Once constructed, its buffer can be read by calling [**tickit\_string\_get**(3)](/tickit_string_get/3.md) and its length queried by [**tickit\_string\_len**(3)](/tickit_string_len/3.md). The buffer should be considered immutable; it cannot be modified.

A string instance maintains a reference count to make it easier for applications to share and manage the lifetime of these buffers. A new string starts with a count of one, and it can be adjusted using [**tickit\_string\_ref**(3)](/tickit_string_ref/3.md) and [**tickit\_string\_unref**(3)](/tickit_string_unref/3.md). When the count reaches zero the instance is destroyed.

## SEE ALSO

[**tickit**(7)](/tickit/7.md)
