mmr_context_create()
Create a context
Synopsis:
#include <mm/renderer.h>
mmr_context_t* mmr_context_create(mmr_connection_t *connection,
const char *name,
unsigned flags,
mode_t mode)Arguments:
- connection
- An mm-renderer connection handle
- name
- The name of the context. This can be any string.
- flags
- Must be zero; no context flags are defined for now.
- mode
- Permission flags controlling which processes can access the context. These flags are specified in a standard POSIX permissions bitfield. The w bits control which processes can open secondary handles to the context. The r and x bits are not currently used.
Library:
mmrndclientDescription:
Create the specified context and open a handle to it. If a context with the same name already exists, the function fails. The name can be any string that appropriately identifies the context.
The value given for mode is a standard POSIX permissions bitfield but only the w bits are meaningful; the mode argument description explains how these bits control which other processes can open handles to the context.
When successful, the function returns a handle, called the primary handle, for accessing the new context. You may be able to create secondary handles to the context by calling mmr_context_open(), depending on the mm-renderer command-line options.
To avoid memory leaks, every context handle needs to eventually be closed, either explicitly through an API call or implicitly by disconnecting from mm-renderer or terminating the process.
Returns:
A handle on success, or a NULL pointer on failure (check errno)
