hal_set_constructor(3hal)

hal_set_constructor3hal

Sets the constructor function for this component

Usage

typedef int (*hal_constructor_t)(const char *prefix, const char *arg); int hal_set_constructor(int comp_id, hal_constructor_t constructor)

Arguments

comp_id A HAL component identifier returned by an earlier call to hal_init.

prefix The prefix to be given to the pins, parameters, and functions in the new instance

arg An argument that may be used by the component to customize this instance.

Overview

As an experimental feature in HAL 2.1, components may be constructable. Such a component may create pins and parameters not only at the time the module is loaded, but it may create additional pins and parameters, and functions on demand.

Return value

Returns a HAL status code.

Releases

Unchanged in 2 releases since Debian 12 (Bookworm).

  1. 12–13

From linuxcnc-uspace-dev 1:2.9.4-2+deb13u1 in Debian 13 (Trixie). Parsed by carta from the page's man source.