---
name: "field_init"
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/field_init"
---

# field\_init(3)

set hooks for automatic invocation by applications

## NAME

**form\_hook** - set hooks for automatic invocation by applications

## SYNOPSIS

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

**int set\_field\_init(FORM \****form***, Form\_Hook** *func***);** **Form\_Hook field\_init(const FORM \****form***);**

**int set\_field\_term(FORM \****form***, Form\_Hook** *func***);** **Form\_Hook field\_term(const FORM \****form***);**

**int set\_form\_init(FORM \****form***, Form\_Hook** *func***);** **Form\_Hook form\_init(const FORM \****form***);**

**int set\_form\_term(FORM \****form***, Form\_Hook** *func***);** **Form\_Hook form\_term(const FORM \****form***);**

## DESCRIPTION

**These functions make it possible to set hook functions to be called at various** **points in the automatic processing of input event codes by form\_driver.**

### set\_field\_init

**sets a hook to be called at form-post time** **and each time the selected field changes (after the change).**

### field\_init

**returns the current field init hook, if any** (*NULL* **if there is no such hook).**

### set\_field\_term

**sets a hook to be called at form-unpost time** **and each time the selected field changes (before the change).**

### field\_term

**returns the current field term hook, if any** (*NULL* **if there is no such hook).**

### set\_form\_init

**sets a hook to be called at form-post time and** **just after a page change once it is posted.**

### form\_init

**returns the current form init hook,** **if any** (*NULL* **if there is no such hook).**

### set\_form\_term

**sets a hook to be called at form-unpost time** **and just before a page change once it is posted.**

### form\_term

**returns the current form term hook, if any** (*NULL* **if there is no such hook).**

## RETURN VALUE

**Routines that return pointers return** *NULL* **on error.** **Other routines** **return one of the following:**

- **E\_OK**

  **The routine succeeded.**

- **E\_SYSTEM\_ERROR**

  **System error occurred (see [errno(3)](/errno/3.md)).**

## PORTABILITY

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

## AUTHORS

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

## SEE ALSO

**curses(3X),** **form(3X)**
