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

# tickit\_stringpos\_limit\_bytes(3)

set limit fields in string position counters

## NAME

tickit\_stringpos\_limit\_... - set limit fields in string position counters

## SYNOPSIS

```
#include <tickit.h>

void tickit_stringpos_limit_bytes(TickitStringPos *pos, size_t bytes);
void tickit_stringpos_limit_codepoints(TickitStringPos *pos, int codepoints);
void tickit_stringpos_limit_graphemes(TickitStringPos *pos, int graphemes);
void tickit_stringpos_limit_columns(TickitStringPos *pos, int columns);
void tickit_stringpos_limit_none(TickitStringPos *pos);

#define INIT_TICKIT_STRINGPOS_LIMIT_BYTES(bytes)
#define INIT_TICKIT_STRINGPOS_LIMIT_CODEPOINTS(codepoints)
#define INIT_TICKIT_STRINGPOS_LIMIT_GRAPHEMES(grahpemes)
#define INIT_TICKIT_STRINGPOS_LIMIT_COLUMNS(columns)
#define INIT_TICKIT_STRINGPOS_LIMIT_NONE
```

Link with *-ltickit*.

## DESCRIPTION

The first four of these functions each set one of the counter fields in *pos* to the given value, and the other three to -1. This is useful to create a limit counter to stop [**tickit\_utf8\_count**(3)](/tickit_utf8_count/3.md) or **tickit\_utf8\_countmore**(3) at the given position. The final function initialises all four fields to -1.

Each is also available as a macro which can be used to initialise a new **TickitStringPos** variable.

```
  TickitStringPos limit = INIT_TICKIT_STRINGPOS_LIMIT_BYTES(b);
```

## RETURN VALUE

The functions all return no value. The macros expand to a struct initialiser expression.

## SEE ALSO

[**tickit\_utf8\_count**(3)](/tickit_utf8_count/3.md), [**tickit\_stringpos\_zero**(3)](/tickit_stringpos_zero/3.md), [**tickit**(7)](/tickit/7.md)
