form(3X) Library calls form(3X)

# [NAME](#NAME)

**form** - present user-fillable forms in *curses* windows

# [SYNOPSIS](#SYNOPSIS)

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

# [DESCRIPTION](#DESCRIPTION)

The **form** library provides terminal-independent facilities for composing form screens on character-cell terminals. The library includes: field routines, which create and modify form fields; and form routines, which group fields into forms, display forms on the screen, and handle interaction with the user.

The **form** library uses the **curses** libraries. To use the **form** library, link with the options **-lform -lcurses**.

Your program should set up the locale, e.g.,

**setlocale(LC\_ALL, "");**

so that input/output processing will work.

A curses initialization routine such as **initscr** must be called before using any of these functions.

## [Current Default Values for Field Attributes](#Current_Default_Values_for_Field_Attributes)

The **form** library maintains a default value for field attributes. You can get or set this default by calling the appropriate **set\_** or retrieval routine with a *NULL* field pointer. Changing this default with a **set\_** function affects future field creations, but does not change the rendering of fields already created.

## [Routine Name Index](#Routine_Name_Index)

The following table lists each **form** routine and the name of the manual page on which it is described. Routines flagged with “\*” are *ncurses*-specific, not present in SVr4.

**curses** Routine Name Manual Page Name current\_field [**form\_page**(3X)](/man/os/ncurses/form_page.3X) data\_ahead [**form\_data**(3X)](/man/os/ncurses/form_data.3X) data\_behind [**form\_data**(3X)](/man/os/ncurses/form_data.3X) dup\_field [**form\_field\_new**(3X)](/man/os/ncurses/form_field_new.3X) dynamic\_field\_info [**form\_field\_info**(3X)](/man/os/ncurses/form_field_info.3X) field\_arg [**form\_field\_validation**(3X)](/man/os/ncurses/form_field_validation.3X) field\_back [**form\_field\_attributes**(3X)](/man/os/ncurses/form_field_attributes.3X) field\_buffer [**form\_field\_buffer**(3X)](/man/os/ncurses/form_field_buffer.3X) field\_count [**form\_field**(3X)](/man/os/ncurses/form_field.3X) field\_fore [**form\_field\_attributes**(3X)](/man/os/ncurses/form_field_attributes.3X) field\_index [**form\_page**(3X)](/man/os/ncurses/form_page.3X) field\_info [**form\_field\_info**(3X)](/man/os/ncurses/form_field_info.3X) field\_init [**form\_hook**(3X)](/man/os/ncurses/form_hook.3X) field\_just [**form\_field\_just**(3X)](/man/os/ncurses/form_field_just.3X) field\_opts [**form\_field\_opts**(3X)](/man/os/ncurses/form_field_opts.3X) field\_opts\_off [**form\_field\_opts**(3X)](/man/os/ncurses/form_field_opts.3X) field\_opts\_on [**form\_field\_opts**(3X)](/man/os/ncurses/form_field_opts.3X) field\_pad [**form\_field\_attributes**(3X)](/man/os/ncurses/form_field_attributes.3X) field\_status [**form\_field\_buffer**(3X)](/man/os/ncurses/form_field_buffer.3X) field\_term [**form\_hook**(3X)](/man/os/ncurses/form_hook.3X) field\_type [**form\_field\_validation**(3X)](/man/os/ncurses/form_field_validation.3X) field\_userptr [**form\_field\_userptr**(3X)](/man/os/ncurses/form_field_userptr.3X) form\_driver [**form\_driver**(3X)](/man/os/ncurses/form_driver.3X) form\_driver\_w [**form\_driver**(3X)](/man/os/ncurses/form_driver.3X)* form\_fields [**form\_field**(3X)](/man/os/ncurses/form_field.3X) form\_init [**form\_hook**(3X)](/man/os/ncurses/form_hook.3X) form\_opts [**form\_opts**(3X)](/man/os/ncurses/form_opts.3X) form\_opts\_off [**form\_opts**(3X)](/man/os/ncurses/form_opts.3X) form\_opts\_on [**form\_opts**(3X)](/man/os/ncurses/form_opts.3X) form\_page [**form\_page**(3X)](/man/os/ncurses/form_page.3X) form\_request\_by\_name [**form\_requestname**(3X)](/man/os/ncurses/form_requestname.3X)* form\_request\_name [**form\_requestname**(3X)](/man/os/ncurses/form_requestname.3X)* form\_sub [**form\_win**(3X)](/man/os/ncurses/form_win.3X) form\_term [**form\_hook**(3X)](/man/os/ncurses/form_hook.3X) form\_userptr [**form\_userptr**(3X)](/man/os/ncurses/form_userptr.3X) form\_win [**form\_win**(3X)](/man/os/ncurses/form_win.3X) free\_field [**form\_field\_new**(3X)](/man/os/ncurses/form_field_new.3X) free\_fieldtype [**form\_fieldtype**(3X)](/man/os/ncurses/form_fieldtype.3X) free\_form [**form\_new**(3X)](/man/os/ncurses/form_new.3X) link\_field [**form\_field\_new**(3X)](/man/os/ncurses/form_field_new.3X) link\_fieldtype [**form\_fieldtype**(3X)](/man/os/ncurses/form_fieldtype.3X) move\_field [**form\_field**(3X)](/man/os/ncurses/form_field.3X) new\_field [**form\_field\_new**(3X)](/man/os/ncurses/form_field_new.3X) new\_fieldtype [**form\_fieldtype**(3X)](/man/os/ncurses/form_fieldtype.3X) new\_form [**form\_new**(3X)](/man/os/ncurses/form_new.3X) new\_page [**form\_new\_page**(3X)](/man/os/ncurses/form_new_page.3X) pos\_form\_cursor [**form\_cursor**(3X)](/man/os/ncurses/form_cursor.3X) post\_form [**form\_post**(3X)](/man/os/ncurses/form_post.3X) scale\_form [**form\_win**(3X)](/man/os/ncurses/form_win.3X) set\_current\_field [**form\_page**(3X)](/man/os/ncurses/form_page.3X) set\_field\_back [**form\_field\_attributes**(3X)](/man/os/ncurses/form_field_attributes.3X) set\_field\_buffer [**form\_field\_buffer**(3X)](/man/os/ncurses/form_field_buffer.3X) set\_field\_fore [**form\_field\_attributes**(3X)](/man/os/ncurses/form_field_attributes.3X) set\_field\_init [**form\_hook**(3X)](/man/os/ncurses/form_hook.3X) set\_field\_just [**form\_field\_just**(3X)](/man/os/ncurses/form_field_just.3X) set\_field\_opts [**form\_field\_opts**(3X)](/man/os/ncurses/form_field_opts.3X) set\_field\_pad [**form\_field\_attributes**(3X)](/man/os/ncurses/form_field_attributes.3X) set\_field\_status [**form\_field\_buffer**(3X)](/man/os/ncurses/form_field_buffer.3X) set\_field\_term [**form\_hook**(3X)](/man/os/ncurses/form_hook.3X) set\_field\_type [**form\_field\_validation**(3X)](/man/os/ncurses/form_field_validation.3X) set\_field\_userptr [**form\_field\_userptr**(3X)](/man/os/ncurses/form_field_userptr.3X) set\_fieldtype\_arg [**form\_fieldtype**(3X)](/man/os/ncurses/form_fieldtype.3X) set\_fieldtype\_choice [**form\_fieldtype**(3X)](/man/os/ncurses/form_fieldtype.3X) set\_form\_fields [**form\_field**(3X)](/man/os/ncurses/form_field.3X) set\_form\_init [**form\_hook**(3X)](/man/os/ncurses/form_hook.3X) set\_form\_opts [**form\_field\_opts**(3X)](/man/os/ncurses/form_field_opts.3X) set\_form\_page [**form\_page**(3X)](/man/os/ncurses/form_page.3X) set\_form\_sub [**form\_win**(3X)](/man/os/ncurses/form_win.3X) set\_form\_term [**form\_hook**(3X)](/man/os/ncurses/form_hook.3X) set\_form\_userptr [**form\_userptr**(3X)](/man/os/ncurses/form_userptr.3X) set\_form\_win [**form\_win**(3X)](/man/os/ncurses/form_win.3X) set\_max\_field [**form\_field\_buffer**(3X)](/man/os/ncurses/form_field_buffer.3X) set\_new\_page [**form\_new\_page**(3X)](/man/os/ncurses/form_new_page.3X) unfocus\_current\_field [**form\_page**(3X)](/man/os/ncurses/form_page.3X)* unpost\_form [**form\_post**(3X)](/man/os/ncurses/form_post.3X)

# [RETURN VALUE](#RETURN_VALUE)

Routines that return pointers return *NULL* on error, and set **errno** to the corresponding error-code returned by functions returning an integer. Routines that return an integer return one of the following error codes:

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

The routine succeeded.

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

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

[**E\_BAD\_STATE**](#E_BAD_STATE)

Routine was called from an initialization or termination function.

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

The field is already connected to a form.

[**E\_INVALID\_FIELD**](#E_INVALID_FIELD)

Contents of a field are not valid.

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

No fields are connected to the form.

[**E\_NOT\_POSTED**](#E_NOT_POSTED)

The form has not been posted.

[**E\_NO\_ROOM**](#E_NO_ROOM)

Form is too large for its window.

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

The form is already posted.

[**E\_REQUEST\_DENIED**](#E_REQUEST_DENIED)

The form driver could not process the request.

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

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

[**E\_UNKNOWN\_COMMAND**](#E_UNKNOWN_COMMAND)

The form driver code saw an unknown request code.

# [NOTES](#NOTES)

The header file *form.h* itself includes *curses.h*.

# [PORTABILITY](#PORTABILITY)

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

A form facility was documented in SVr4.2's *Character User Interface Programming* document.

It is not part of X/Open Curses.

Aside from *ncurses*, there are few implementations:

- systems based on SVr4 source code, e.g., Solaris.
- NetBSD curses.

A few functions in this implementation are extensions added for *ncurses*, but not provided by other implementations, e.g., **form\_driver\_w**, **unfocus\_current\_field**.

# [AUTHORS](#AUTHORS)

Juergen Pfeifer. Manual pages and adaptation for *ncurses* by Eric S. Raymond.

# [SEE ALSO](#SEE_ALSO)

[**curses**(3X)](/man/os/ncurses/curses.3X) and related pages whose names begin “form\_” for detailed descriptions of the entry points.

2025-11-11 ncurses 6.6

---

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