mmr_context_create()

Create a context.

Synopsis:

#include <mm/renderer/renderer.h>
 
mmr_context_t* mmr_context_create(mmr_connection_t *connection,
                                  const char *name,
                                  unsigned flags,
                                  mode_t mode)

Since:

BlackBerry 10.0.0

Arguments:

connection

An mm-renderer connection handle.

name

The name of the context. This must be a valid filename that is unique system wide.

flags

Must be zero. No 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 access the context. The r and x bits provide access to mm-renderer events related to the context. In this bitfield, the user permissions apply to the caller and to any process with the same effective user ID (euid). You must set these permissions appropriately to grant your application (or other applications running with the same euid) sufficient access to the context being created. The group permissions apply to processes with an effective group ID (egid) or a supplementary group ID matching the caller's egid. The other permissions apply to all other processes.

Library:

libmmrndclient (For the qcc command, use the -l mrndclient option to link against this library)

Description:

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 in the pathname space, with its file mode flags 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. The description of mode explains how permissions specified in the function call are interpreted.

When successful, the function returns a handle, called the primary handle, for accessing the newly created context. You can create any number of secondary handles by calling mmr_context_open(), passing the same name used to create the primary handle.

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. When you close a primary handle, mm-renderer destroys the associated context. At this point, 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.

Returns:

A handle on success, or a null pointer on failure (check errno).

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus