pub unsafe extern "C" fn hal_export_funct(
    name: *const c_char,
    funct: Option<unsafe extern "C" fn(arg1: *mut c_void, arg2: c_long)>,
    arg: *mut c_void,
    uses_fp: c_int,
    reentrant: c_int,
    comp_id: c_int
) -> c_int
Expand description

hal_export_funct() makes a realtime function provided by a component available to the system. A subsequent call to hal_add_funct_to_thread() can be used to schedule the execution of the function as needed by the system. ‘name’ is the name of the new function. It must be no longer than HAL_NAME_LEN. This is the name as it would appear in an ini file, which does not need to be the same as the C function name. ‘funct’ is a pointer to the function code. ‘funct’ must be the address of a function that accepts a void pointer and a long int. The pointer will be set to the value ‘arg’ below, and the long will be set to the thread period in nanoseconds. ‘arg’ is a void pointer that will be passed to the function each time it is called. This is useful when one actual C function will be exported several times with different HAL names, perhaps to deal with multiple instances of a hardware device. ‘uses_fp’ should be non-zero if the function uses floating point. When in doubt, make it non-zero. If you are sure that the function doesn’t use the FPU, then set ‘uses_fp’ to zero. ‘reentrant’ should be zero unless the function (and any hardware it accesses) is completely reentrant. If reentrant is non-zero, the function may be prempted and called again before the first call completes. ‘comp_id’ is the ID of the calling component, as returned by a call to hal_init(). On success, hal_export_funct() returns 0, on failure it returns a negative error code. Call only from realtime init code, not from user space or realtime code.