menu\_items(3X) Library calls menu\_items(3X)

# [NAME](#NAME)

**set\_menu\_items**, **menu\_items**, **item\_count** - make and break connections between items and menus

# [SYNOPSIS](#SYNOPSIS)

```
#include <menu.h>
```

```
int set_menu_items(MENU *menu, ITEM **items);
ITEM **menu_items(const MENU *menu);
int item_count(const MENU *menu);
```

# [DESCRIPTION](#DESCRIPTION)

The function **set\_menu\_items** changes the item pointer array of the given *menu*. The array must be terminated by a *NULL*.

The function **menu\_items** returns the item array of the given menu.

The function **item\_count** returns the count of items in *menu*.

# [RETURN VALUE](#RETURN_VALUE)

The function **menu\_items** returns a pointer (which may be *NULL*). It does not set **errno**.

The function **item\_count** returns **ERR** (the general **curses** error return value) if its *menu* parameter is *NULL .*

The function **set\_menu\_items** returns one of the following codes on error:

[**E\_OK**](#E_OK)

The routine succeeded.

[**E\_BAD\_ARGUMENT**](#E_BAD_ARGUMENT)

Routine detected an incorrect or out-of-range argument.

[**E\_NOT\_CONNECTED**](#E_NOT_CONNECTED)

No items are connected to the menu.

[**E\_POSTED**](#E_POSTED)

The menu is already posted.

[**E\_SYSTEM\_ERROR**](#E_SYSTEM_ERROR)

System error occurred (see [**errno**(3)](/man/os/ncurses/errno.3)).

# [PORTABILITY](#PORTABILITY)

These routines emulate the System V menu library. They were not supported on Version 7 or BSD versions.

The SVr4 menu library documentation specifies the **item\_count** error value as -1 (which is the value of **ERR**).

# [AUTHORS](#AUTHORS)

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond.

# [SEE ALSO](#SEE_ALSO)

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

2024-12-28 ncurses 6.6

---

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