---
name: "menu_items"
section: "3x"
platform: "macos"
package: "ncurses"
version: "79"
release: "macOS 26.5"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/menu_items/3x"
---

# menu\_items(3x)

make and break connections between items and menus

## NAME

**menu\_items** - make and break connections between items and menus

## 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

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

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**

  The routine succeeded.

- **E\_BAD\_ARGUMENT**

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

- **E\_NOT\_CONNECTED**

  No items are connected to the menu.

- **E\_POSTED**

  The menu is already posted.

- **E\_SYSTEM\_ERROR**

  System error occurred (see **errno**).

## SEE ALSO

**curses**(3X), **menu**(3X).

## NOTES

The header file **\<menu.h\>** automatically includes the header file **\<curses.h\>**.

## 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

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