Create a context.
#include <mm/renderer.h>
mmr_context_t* mmr_context_create( mmr_connection_t *connection, const char *name, unsigned flags, mode_t mode )
Create and open a new context with the specified name. Fail if a context with that name already exists. The name must be a valid filename and will show up as a directory in the pathname space, with its file permissions set based on the mode argument. Note that there's not a direct mapping between the value given in mode and the file permissions assigned to the context directory. For an explanation of how the permissions specified in the function call are interpreted, see the mode argument.
When successful, the function returns a handle, called the primary handle, for accessing the newly created context. Depending on your configuration, you may be able to create any number of secondary handles by calling mmr_context_open().
To avoid memory leaks, every handle opened with mmr_context_create() needs to be closed, either explicitly through an API call or implicitly by terminating the process. The mm-renderer configuration also determines whether closing the primary handle also destroys the context. If this option is set and you do close the primary handle of a context, you can no longer use any secondary handles to that context, so you must close those handles by calling mmr_context_close() on each one. If this option isn't set, you can call mmr_context_close() to close the primary handle without destroying the context, which lets you keep using that context by accessing it with secondary handles.
A handle on success, or a null pointer on failure (check errno).
QNX Neutrino
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |