# screen_write_collect_trim

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L2009
- **Page:** https://libtmux.org/en/tmux/latest/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_collect_insert`](/en/tmux/latest/reference/c-function-screen-write-c-screen_write_collect_insert/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L2310)

## Calls

- [`log_debug`](/en/tmux/latest/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L2025)
- [`screen_write_free_citem`](/en/tmux/latest/reference/c-function-screen-write-c-screen_write_free_citem/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L2043)
- [`screen_write_get_citem`](/en/tmux/latest/reference/c-function-screen-write-c-screen_write_get_citem/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L2074)

## Referenced declarations

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