[][src]Function linuxcnc_hal_sys::hal_param_new

pub unsafe extern "C" fn hal_param_new(
    name: *const c_char,
    type_: hal_type_t,
    dir: hal_param_dir_t,
    data_addr: *mut c_void,
    comp_id: c_int
) -> c_int

'hal_param_new()' creates a new 'parameter' object. It is a generic version of the eight functions above. It is provided ONLY for those special cases where a generic function is needed. It is STRONGLY recommended that the functions above be used instead, because they check the type of 'data_addr' against the parameter type at compile time. Using this function requires a cast of the 'data_addr' argument that defeats type checking and can cause subtle bugs. 'name', 'data_addr' and 'comp_id' are the same as in the functions above. 'type' is the hal type of the new parameter - the type of data that will be stored in the parameter. 'dir' is the parameter direction. HAL_RO parameters are read only from outside, and are written to by the component itself, typically to provide a view "into" the component for testing or troubleshooting. HAL_RW parameters are writable from outside and also sometimes modified by the component itself as well. If successful, hal_param_new() returns 0. On failure it returns a negative error code.