---
name: "sp_funcs"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/assume_default_colors_sp"
---

# sp\_funcs(3)

curses screen-pointer extension

Part of [assume\_default\_colors\_sp(3)](/assume_default_colors_sp/3.md).

## NAME

**curs\_sp\_funcs** - *curses* screen-pointer extension

## SYNOPSIS

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

**int alloc\_pair\_sp(SCREEN \*** *sp***, int** *fg***, int** *bg***);** **int assume\_default\_colors\_sp(SCREEN \*** *sp***, int** *fg***, int** *bg***);** **int baudrate\_sp(SCREEN \*** *sp***);** **int beep\_sp(SCREEN \*** *sp***);** **bool can\_change\_color\_sp(SCREEN \*** *sp***);** **int cbreak\_sp(SCREEN \*** *sp***);** **int color\_content\_sp(SCREEN \*** *sp***, short** *color***, short \*** *r***, short \*** *g***, short \*** *b***);** **int curs\_set\_sp(SCREEN \*** *sp***, int** *visibility***);** **int def\_prog\_mode\_sp(SCREEN \*** *sp***);** **int def\_shell\_mode\_sp(SCREEN \*** *sp***);**

**int define\_key\_sp(SCREEN \*** *sp***, const char \*** *definition***, int** *keycode***);** **int delay\_output\_sp(SCREEN \*** *sp***, int** *ms***);** **int doupdate\_sp(SCREEN \*** *sp***);** **int echo\_sp(SCREEN \*** *sp***);** **int endwin\_sp(SCREEN \*** *sp***);** **char erasechar\_sp(SCREEN \*** *sp***);** **int erasewchar\_sp(SCREEN \*** *sp***, wchar\_t \****wc***);** **int extended\_color\_content\_sp(SCREEN \*** *sp***, int** *color***, int \*** *r***, int \*** *g***, int \*** *b***);** **int extended\_pair\_content\_sp(SCREEN \*** *sp***, int** *pair***, int \*** *fg***, int \*** *bg***);** **int extended\_slk\_color\_sp(SCREEN \*** *sp***, int** *pair***);**

**void filter\_sp(SCREEN \*** *sp***);** **int find\_pair\_sp(SCREEN \*** *sp***, int** *fg***, int** *bg***);** **int flash\_sp(SCREEN \*** *sp***);** **int flushinp\_sp(SCREEN \*** *sp***);** **int free\_pair\_sp(SCREEN \*** *sp***, int** *pair***);** **int get\_escdelay\_sp(SCREEN \*** *sp***);** **int getmouse\_sp(SCREEN \*** *sp***, MEVENT \*** *event***);** **WINDOW \* getwin\_sp(SCREEN \*** *sp***, FILE \*** *filep***);** **int halfdelay\_sp(SCREEN \*** *sp***, int** *tenths***);** **bool has\_colors\_sp(SCREEN \*** *sp***);**

**bool has\_ic\_sp(SCREEN \*** *sp***);** **bool has\_il\_sp(SCREEN \*** *sp***);** **int has\_key\_sp(SCREEN \*** *sp***, int** *c***);** **bool has\_mouse\_sp(SCREEN \*** *sp***);** **int init\_color\_sp(SCREEN \*** *sp***, short** *color***, short** *r***, short** *g***, short** *b***);** **int init\_extended\_color\_sp(SCREEN \*** *sp***, int** *color***, int** *r***, int** *g***, int** *b***);** **int init\_extended\_pair\_sp(SCREEN \*** *sp***, int** *pair***, int** *fg***, int** *bg***);** **int init\_pair\_sp(SCREEN \*** *sp***, short** *pair***, short** *fg***, short** *bg***);** **int intrflush\_sp(SCREEN \*** *sp***, WINDOW \*** *win***, bool** *bf***);** **int is\_cbreak\_sp(SCREEN \*** *sp***);**

**int is\_echo\_sp(SCREEN \*** *sp***);** **int is\_nl\_sp(SCREEN \*** *sp***);** **int is\_raw\_sp(SCREEN \*** *sp***);** **bool is\_term\_resized\_sp(SCREEN \*** *sp***, int** *lines***, int** *columns***);** **bool isendwin\_sp(SCREEN \*** *sp***);** **int key\_defined\_sp(SCREEN \*** *sp***, const char \****definition***);** **char \* keybound\_sp(SCREEN \*** *sp***, int** *keycode***, int** *count***);** **NCURSES\_CONST char \* keyname\_sp(SCREEN \*** *sp***, int** *c***);** **int keyok\_sp(SCREEN \*** *sp***, int** *keycode***, bool** *enable***);** **char killchar\_sp(SCREEN \*** *sp***);**

**int killwchar\_sp(SCREEN \*** *sp***, wchar\_t \****wc***);** **char \* longname\_sp(SCREEN \*** *sp***);** **int mcprint\_sp(SCREEN \*** *sp***, char \****data***, int** *len***);** **int mouseinterval\_sp(SCREEN \*** *sp***, int** *erval***);** **mmask\_t mousemask\_sp(SCREEN \*** *sp***, mmask\_t** *newmask***, mmask\_t \****oldmask***);** **int mvcur\_sp(SCREEN \*** *sp***, int** *oldrow***, int** *oldcol***, int** *newrow***, int** *newcol***);** **int napms\_sp(SCREEN \*** *sp***, int** *ms***);** **WINDOW \* newpad\_sp(SCREEN \*** *sp***, int** *nrows***, int** *ncols***);** **SCREEN \* new\_prescr(void);** **SCREEN \* newterm\_sp(SCREEN \*** *sp***, const char \****type***, FILE \****outf***, FILE \****inf***);**

**WINDOW \* newwin\_sp(SCREEN \*** *sp***, int** *nlines***, int** *ncols***, int** *begin\_y***, int** *begin\_x***);** **int nl\_sp(SCREEN \*** *sp***);** **int nocbreak\_sp(SCREEN \*** *sp***);** **int noecho\_sp(SCREEN \*** *sp***);** **void nofilter\_sp(SCREEN \*** *sp***);** **int nonl\_sp(SCREEN \*** *sp***);** **void noqiflush\_sp(SCREEN \*** *sp***);** **int noraw\_sp(SCREEN \*** *sp***);** **int pair\_content\_sp(SCREEN \*** *sp***, short** *pair***, short \*** *fg***, short \*** *bg***);** **void qiflush\_sp(SCREEN \*** *sp***);**

**int raw\_sp(SCREEN \*** *sp***);** **void reset\_color\_pairs\_sp(SCREEN \*** *sp***);** **int reset\_prog\_mode\_sp(SCREEN \*** *sp***);** **int reset\_shell\_mode\_sp(SCREEN \*** *sp***);** **int resetty\_sp(SCREEN \*** *sp***);** **int resize\_term\_sp(SCREEN \*** *sp***, int** *lines***, int** *columns***);** **int resizeterm\_sp(SCREEN \*** *sp***, int** *lines***, int** *columns***);** **int ripoffline\_sp(SCREEN \*** *sp***, int** *line***, int (\****init***)(WINDOW \*** *win***, int** *fmt***));** **int savetty\_sp(SCREEN \*** *sp***);** **int scr\_init\_sp(SCREEN \*** *sp***, const char \****filename***);**

**int scr\_restore\_sp(SCREEN \*** *sp***, const char \****filename***);** **int scr\_set\_sp(SCREEN \*** *sp***, const char \****filename***);** **int set\_escdelay\_sp(SCREEN \*** *sp***, int** *ms***);** **int set\_tabsize\_sp(SCREEN \*** *sp***, int** *cols***);** **int slk\_attrset\_sp(SCREEN \*** *sp***, const chtype** *a***);** **int slk\_attr\_set\_sp(SCREEN \*** *sp***, const attr\_t** *attrs***, short** *pair***, void \****opts***);** **int slk\_attroff\_sp(SCREEN \*** *sp***, const chtype** *a***);** **int slk\_attron\_sp(SCREEN \*** *sp***, const chtype** *a***);** **attr\_t slk\_attr\_sp(SCREEN \*** *sp***);** **int slk\_clear\_sp(SCREEN \*** *sp***);**

**int slk\_color\_sp(SCREEN \*** *sp***, short** *pair***);** **int slk\_init\_sp(SCREEN \*** *sp***, int** *fmt***);** **char \* slk\_label\_sp(SCREEN \*** *sp***, int** *labnum***);** **int slk\_noutrefresh\_sp(SCREEN \*** *sp***);** **int slk\_refresh\_sp(SCREEN \*** *sp***);** **int slk\_restore\_sp(SCREEN \*** *sp***);** **int slk\_set\_sp(SCREEN \*** *sp***, int** *labnum***, const char \*** *label***, int** *fmt***);** **int slk\_touch\_sp(SCREEN \*** *sp***);** **int start\_color\_sp(SCREEN \*** *sp***);** **attr\_t term\_attrs\_sp(SCREEN \*** *sp***);**

**chtype termattrs\_sp(SCREEN \*** *sp***);** **char \* termname\_sp(SCREEN \*** *sp***);** **int typeahead\_sp(SCREEN \*** *sp***, int** *fd***);** **int unget\_wch\_sp(SCREEN \*** *sp***, const wchar\_t** *wc***);** **int ungetch\_sp(SCREEN \*** *sp***, int** *c***);** **int ungetmouse\_sp(SCREEN \*** *sp***, MEVENT \*** *event***);** **int use\_default\_colors\_sp(SCREEN \*** *sp***);** **void use\_env\_sp(SCREEN \*** *sp***, bool** *bf***);** **int use\_legacy\_coding\_sp(SCREEN \*** *sp***, int** *level***);** **void use\_tioctl\_sp(SCREEN \****sp***, bool** *bf***);**

**int vid\_attr\_sp(SCREEN \*** *sp***, attr\_t** *attrs***, short** *pair***, void \*** *opts***);** **int vid\_puts\_sp(SCREEN \*** *sp***, attr\_t** *attrs***, short** *pair***, void \*** *opts***, NCURSES\_SP\_OUTC** *putc***);** **int vidattr\_sp(SCREEN \*** *sp***, chtype** *attrs***);** **int vidputs\_sp(SCREEN \*** *sp***, chtype** *attrs***, NCURSES\_SP\_OUTC** *putc***);** **wchar\_t \* wunctrl\_sp(SCREEN \*** *sp***, cchar\_t \****wch***);**

**#include \<form.h\>**

**FORM \* new\_form\_sp(SCREEN \*** *sp***, FIELD \*\****fields***);**

**#include \<menu.h\>**

**MENU \* new\_menu\_sp(SCREEN \*** *sp***, ITEM \*\****items***);**

**#include \<panel.h\>**

**PANEL \* ceiling\_panel(SCREEN \*** *sp***);** **PANEL \* ground\_panel(SCREEN \*** *sp***);** **void update\_panels\_sp(SCREEN \*** *sp***);**

**#include \<term.h\>**

**int del\_curterm\_sp(SCREEN \*** *sp***, TERMINAL \****oterm***);** **int putp\_sp(SCREEN \*** *sp***, const char \****str***);** **int restartterm\_sp(SCREEN \*** *sp***, NCURSES\_CONST char \****term***, int** *filedes***, int \****errret***);** **TERMINAL \* set\_curterm\_sp(SCREEN \*** *sp***, TERMINAL \****nterm***);** **int tgetent\_sp(SCREEN \*** *sp***, char \****bp***, const char \****name***);** **int tgetflag\_sp(SCREEN \*** *sp***, const char \****capname***);** **int tgetnum\_sp(SCREEN \*** *sp***, const char \****capname***);** **char \* tgetstr\_sp(SCREEN \*** *sp***, const char \****capname***, char \*\****area***);** **char \* tgoto\_sp(SCREEN \*** *sp***, const char \****capname***, int** *col***, int** *row***);** **int tigetflag\_sp(SCREEN \*** *sp***, const char \****capname***);**

**int tigetnum\_sp(SCREEN \*** *sp***, const char \****capname***);** **char \* tigetstr\_sp(SCREEN \*** *sp***, const char \****capname***);** */\* tparm\_sp may use 9 long parameters rather than being variadic \*/* **char \* tparm\_sp(SCREEN \*** *sp***, const char \****str***, ...);** **int tputs\_sp(SCREEN \*** *sp***, const char \****str***, int** *affcnt***, NCURSES\_SP\_OUTC** *putc***);**

**#include \<unctrl.h\>**

**NCURSES\_CONST char \* unctrl\_sp(SCREEN \*** *sp***, chtype** *ch***);**

## DESCRIPTION

**This implementation can be configured to provide a set of functions which** **improve the ability to manage multiple screens.** **This feature can be added to any of the configurations supported by** *ncurses***;** **it adds new symbols** **without changing the meaning of any of the existing ones.**

### Improved Functions

**Most of the functions are new versions of existing functions.** **A parameter is added at the front of the parameter list.** **It is a** *SCREEN* **pointer.**

**The existing functions all use the current screen,** **which is a static variable.** **The extended functions use the specified screen,** **thereby reducing the number of variables which must be modified** **to update multiple screens.**

### New Functions

**Here are the new functions:**

- **ceiling\_panel**

  **this returns a pointer to the topmost panel in the given screen.**

- **ground\_panel**

  **this returns a pointer to the lowest panel in the given screen.**

- **new\_prescr**

  **when creating a new screen, the library uses static variables which** **have been preset, e.g., by use\_env(3X), filter(3X), etc.** **With the screen-pointer extension,** **there are situations where it must create a current screen before** **the unextended library does.** **The new\_prescr function is used internally to handle these cases.** **It is also provided to allow applications to customize library** **initialization.**

## NOTES

**This extension introduces some new names:**

- **NCURSES\_SP\_FUNCS**

  **This is set to the library patch-level number.** **In the unextended library, this is zero (0),** **to make it useful for checking if the extension is provided.**

- **NCURSES\_SP\_NAME**

  **The new functions are named using the macro** *NCURSES\_SP\_NAME***,** **which hides the actual implementation.** **Currently this adds a “\_sp” suffix** **to the name of the unextended function.** **This manual page indexes the extensions showing the full name.** **However the proper usage of these functions uses the macro,** **to provide for the possibility of changing the naming convention** **for specific library configurations.**

- **NCURSES\_SP\_OUTC**

  **This is a new function-pointer type to use in the screen-pointer functions** **where an** *NCURSES\_OUTC* **is used in the unextended library.**

- **NCURSES\_OUTC**

  **This is a function-pointer type used for the cases where a function passes** **characters to the output stream, e.g., vidputs(3X).**

## PORTABILITY

**These routines are specific to** *ncurses***.** **They were not supported on Version 7, BSD or System V implementations.** **It is recommended that any code depending on** *ncurses* **extensions** **be conditioned using** *NCURSES\_SP\_FUNCS***.**

## SEE ALSO

**curses(3X),** **curs\_opaque(3X),** **curs\_threads(3X)**
