# screen_write_collect_trim

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1422
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-screen-write-c-screen_write_collect_trim/

```c
static struct screen_write_citem * screen_write_collect_trim(struct screen_write_ctx *, u_int, u_int, u_int, int *)
```

## Parameters

- `ctx` (`struct screen_write_ctx *`)
- `y` (`u_int`)
- `x` (`u_int`)
- `used` (`u_int`)
- `wrapped` (`int *`)

## Called by

- [`screen_write_clearendofline`](/en/tmux/3.2a/reference/c-function-screen_write_clearendofline/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1150)
- [`screen_write_clearstartofline`](/en/tmux/3.2a/reference/c-function-screen_write_clearstartofline/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1180)
- [`screen_write_collect_end`](/en/tmux/3.2a/reference/c-function-screen_write_collect_end/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1626)

## Calls

- [`log_debug`](/en/tmux/3.2a/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1438)
- [`screen_write_free_citem`](/en/tmux/3.2a/reference/c-function-screen-write-c-screen_write_free_citem/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1456)
- [`screen_write_get_citem`](/en/tmux/3.2a/reference/c-function-screen-write-c-screen_write_get_citem/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1487)

## Referenced declarations

- [`screen_write_citem.bg`](/en/tmux/3.2a/reference/c-struct-screen_write_citem-bg/) (attribute)
- [`screen_write_citem.entry`](/en/tmux/3.2a/reference/c-struct-screen_write_citem-entry/) (attribute)
- [`screen_write_citem.gc`](/en/tmux/3.2a/reference/c-struct-screen_write_citem-gc/) (attribute)
- [`screen_write_cline.items`](/en/tmux/3.2a/reference/c-struct-screen_write_cline-items/) (attribute)
- [`screen_write_ctx.s`](/en/tmux/3.2a/reference/c-struct-screen_write_ctx-s/) (attribute)
- [`screen_write_citem`](/en/tmux/3.2a/reference/c-struct-screen_write_citem/) (struct)
- [`screen_write_ctx`](/en/tmux/3.2a/reference/c-struct-screen_write_ctx/) (struct)
- [`screen_write_citem.type`](/en/tmux/3.2a/reference/c-struct-screen_write_citem-type/) (attribute)
- [`screen_write_citem.used`](/en/tmux/3.2a/reference/c-struct-screen_write_citem-used/) (attribute)
- [`screen_write_citem.wrapped`](/en/tmux/3.2a/reference/c-struct-screen_write_citem-wrapped/) (attribute)
- [`screen.write_list`](/en/tmux/3.2a/reference/c-struct-screen-write_list/) (attribute)
- [`screen_write_citem.x`](/en/tmux/3.2a/reference/c-struct-screen_write_citem-x/) (attribute)
