HANDLE osOpenFlags( SYSNAME Name );
The name of the flags object to be opened.
Upon success, the function returns a handle to the opened flags object. On failure, it returns NULL_HANDLE. Call the osGetLastError function to retrieve extended error information.
This function opens an existing flags object by its assigned name.
A flags object is a set of bit-flags typically used to signal the occurrence of various events. The number of available bit-flags depends on the architecture's configuration and is calculated as 8 * sizeof(INDEX). The object is considered to be in a signaled state if at least one bit-flag is set; otherwise, it is in a non-signaled state.
During creation, an optional name may be assigned to the flags object, enabling tasks to access it using the osOpenFlags function. When a flags object handle is no longer required, it should be closed using osCloseHandle. The flags object is formally deleted only after it has been closed by all tasks that held an open handle. Further details are available in the system objects management section.
If all osOpen* functions are disabled in the configuration, the system will ignore object names, and the code dedicated to name management will be excluded from the build. This optimization reduces the final size of the output code. For more information regarding naming and object access, refer to the system objects management section.
For further details on flags objects, refer to the flags objects section.
This function is available only when both the OS_USE_FLAGS and OS_OPEN_FLAGS_FUNC constants are set to 1. If the function is not required, set OS_OPEN_FLAGS_FUNC to 0 to reduce the compiled code size.
| Version: | 1.0 |
|---|---|
| Header file: | OS_Flags.h (include OS_API.h) |
| See also: | flags, HANDLE, NULL_HANDLE, OS_OPEN_FLAGS_FUNC, osCloseHandle, osCreateFlags, osGetLastError, SYSNAME, system objects management |