# tty_clamp_area

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L1253
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-tty-c-tty_clamp_area/

```c
static int tty_clamp_area(struct tty *tty, const struct tty_ctx *ctx, u_int px, u_int py, u_int nx, u_int ny, u_int *i, u_int *j, u_int *x, u_int *y, u_int *rx, u_int *ry)
```

## Parameters

- `tty` (`struct tty *`)
- `ctx` (`const struct tty_ctx *`)
- `px` (`u_int`)
- `py` (`u_int`)
- `nx` (`u_int`)
- `ny` (`u_int`)
- `i` (`u_int *`)
- `j` (`u_int *`)
- `x` (`u_int *`)
- `y` (`u_int *`)
- `rx` (`u_int *`)
- `ry` (`u_int *`)

## Called by

- [`tty_clear_pane_area`](/en/tmux/latest/reference/c-function-tty-c-tty_clear_pane_area/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L1396)

## Calls

- [`fatalx`](/en/tmux/latest/reference/c-function-fatalx/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L1284)
- [`tty_is_visible`](/en/tmux/latest/reference/c-function-tty-c-tty_is_visible/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L1259)

## Referenced declarations

- [`visible_range.nx`](/en/tmux/latest/reference/c-struct-visible_range-nx/) (attribute)
- [`visible_range.px`](/en/tmux/latest/reference/c-struct-visible_range-px/) (attribute)
- [`tty_ctx.rxoff`](/en/tmux/latest/reference/c-struct-tty_ctx-rxoff/) (attribute)
- [`tty_ctx.ryoff`](/en/tmux/latest/reference/c-struct-tty_ctx-ryoff/) (attribute)
- [`tty`](/en/tmux/latest/reference/c-struct-tty/) (struct)
- [`tty_ctx`](/en/tmux/latest/reference/c-struct-tty_ctx/) (struct)
- [`tty_ctx.wox`](/en/tmux/latest/reference/c-struct-tty_ctx-wox/) (attribute)
- [`tty_ctx.woy`](/en/tmux/latest/reference/c-struct-tty_ctx-woy/) (attribute)
- [`tty_ctx.wsx`](/en/tmux/latest/reference/c-struct-tty_ctx-wsx/) (attribute)
- [`tty_ctx.wsy`](/en/tmux/latest/reference/c-struct-tty_ctx-wsy/) (attribute)
- [`tty_ctx.xoff`](/en/tmux/latest/reference/c-struct-tty_ctx-xoff/) (attribute)
- [`tty_ctx.yoff`](/en/tmux/latest/reference/c-struct-tty_ctx-yoff/) (attribute)
