curs\_print(3X) Library calls curs\_print(3X)

# [NAME](#NAME)

**mcprint** - write data to printer using *terminfo* capabilities

# [SYNOPSIS](#SYNOPSIS)

```
#include <curses.h>
```

```
int mcprint(char * data, int len);
```

# [DESCRIPTION](#DESCRIPTION)

**mcprint**, an *ncurses* extension to the *curses* library, uses the terminal's **prtr\_non** (**mc5p**) or **prtr\_on** (**mc5**) and **prtr\_off** (**mc4**) media copy capabilities, if defined, to send *len* bytes of the given string *data* to a printer attached to the terminal.

**mcprint** has no means of flow control to the printer nor of knowing how much buffering it has. Your application is responsible for keeping the rate of writes to the printer below its continuous throughput rate, typically about half of its nominal characters-per-second (cps) rating. Dot-matrix printers and 6-page-per-minute laser printers can typically handle 80 cps, so a conservative rule of thumb is to sleep for one second after sending an 80-character line.

# [RETURN VALUE](#RETURN_VALUE)

On success, **mcprint** returns the number of characters sent to the printer.

**mcprint** returns **ERR** if the write operation fails for any reason. In that event, **errno** contains either a value set by [*write*(2)](/man/os/ncurses/write.2), or one of the following.

[**ENODEV**](#ENODEV)

The terminal lacks relevant media copy capabilities.

[**ENOMEM**](#ENOMEM)

*ncurses* could not allocate sufficient memory to buffer the write operation.

# [EXTENSIONS](#EXTENSIONS)

**mcprint** is an [**ncurses**(3X)](/man/os/ncurses/ncurses.3X) extension, and is not found in SVr4 *curses*, 4.4BSD *curses*, or any other previous *curses* implementation.

# [PORTABILITY](#PORTABILITY)

Applications employing this *ncurses* extension should condition its use on the visibility of the **NCURSES\_VERSION** preprocessor macro.

# [HISTORY](#HISTORY)

*ncurses* introduced *mcprint* prior to version 1.9.9g (1996).

# [BUGS](#BUGS)

Padding in the **prtr\_non** (**mc5p**), **prtr\_on** (**mc5**), and **prtr\_off** (**mc4**) capabilities is not interpreted.

# [SEE ALSO](#SEE_ALSO)

[**curses**(3X)](/man/os/ncurses/curses.3X)

2026-09-19 ncurses 6.6

---

Document: curs_print(3x) from ncurses 6.6.20261010-r0 (Chainguard OS)
Source: https://github.com/ThomasDickey/ncurses-snapshots
