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:

mmrndclient

Description:

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.

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)