form\_new(3X) Library calls form\_new(3X)

# [NAME](#NAME)

**new\_form**, **free\_form** - create and destroy forms

# [SYNOPSIS](#SYNOPSIS)

```
#include <form.h>
```

```
FORM *new_form(FIELD **fields);
int free_form(FORM *form);
```

# [DESCRIPTION](#DESCRIPTION)

The function **new\_form** creates a new form connected to a specified field pointer array (which must be *NULL*-terminated).

The function **free\_form** disconnects *form* from its field array and frees the storage allocated for the form.

# [RETURN VALUE](#RETURN_VALUE)

The function **new\_form** returns *NULL* on error. It sets **errno** according to the function's success:

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

The routine succeeded.

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

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

[**E\_CONNECTED**](#E_CONNECTED)

The field is already connected to a form.

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

System error occurred, e.g., malloc failure.

The function **free\_form** returns one of the following:

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

The routine succeeded.

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

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

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

The form has already been posted.

# [PORTABILITY](#PORTABILITY)

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

# [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), [**form**(3X)](/man/os/ncurses/form.3X)

2024-12-28 ncurses 6.6

---

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