It seems like the browser you are using has JavaScript disabled. As a result, the site will not function properly. We really want you to enable it so you may experience our site as we intended it. If you have no idea what we are talking about or if you need help, visit http://www.enable-javascript.com×
This website uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Find out more on our cookie page.×

Oops, it seems like you're using an old browser that we do not fully support. If you're able to, please upgrade your browser here.×
This website uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Find out more on our cookie page.×

resmgr_open_bind()

Synopsis:

Since:

Arguments:

A pointer to a
resmgr_context_t
structure that the resource-manager library uses to pass context information
between functions.

ocb

A pointer to the Open Control Block that you want to bind to the open
request.
An OCB is usually a structure of type
iofunc_ocb_t,
but you can define your own.

iofuncs

A pointer to the
resmgr_io_funcs_t
structure that defines the I/O functions for the resource manager.

Library:

libc

Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.

Description:

The resmgr_open_bind() function
is the lowest-level call in the resource
manager library used for handling open messages.
It associates the Open Control Block (OCB)
with a process identified by the id
and info members of ctp.

You must use this function as part of the handling of an
_IO_OPEN message.
In practice, you don't call this function directly; you
typically use either
iofunc_open_default()
or
iofunc_ocb_attach().
(The iofunc_open_default() function calls
iofunc_ocb_attach(), which in turn calls
resmgr_open_bind()).

An internal data structure is allocated that maintains the
number of links to the OCB. On a file descriptor dup(),
the link count is incremented and on a close() it's
decremented. When the count reaches zero, the
close_ocb() callout specified in io_funcs
is called.

In the most general case, the OCB is an arbitrary structure that
you define that can hold
information describing an open file, or just a simple int to
hold the open mode for checking in the read() and
write() callouts.

In the typical case, however, the OCB is a structure that contains
at least the members as defined by the typedef
iofunc_ocb_t.
This typedef defines a common OCB structure that can then be used by the POSIX
layer helper functions (all functions beginning with the name iofunc_*).
The advantage of this approach is that your resource manager gets POSIX
behavior for free, without any additional work on your part.

The attr argument to the open() callout
is also typically saved in the OCB. The well defined iofunc_ocb_t
has a member called attr to which you must assign the value of
the attr argument.
This lets the POSIX helper functions access information about the current
open session (as stored in the OCB) as well as information about the
device itself (as stored in the attributes structure, ocb -> attr).

1. Download the tools

Before you start developing, you'll need to visit the Downloads tab. Here you'll find downloads for the BlackBerry 10 Native SDK, BlackBerry 10 Device Simulator, and some other useful tools.

2. Try the sample apps

Now featuring a filter control, the Sample apps tab allows you to search for samples by name or by feature.

Select either the Core or Cascades radio buttons to display the samples relevant to you.

3. Educate yourself

The Documentation tab contains tons of examples, tutorials, and best practices to guide you along the path towards building an awesome app.

You can access all the documentation that you need in the left-hand navigation.

4. Start developing

The Reference tab is where you'll find essential details about how to use our APIs.

You can use the left-hand navigation to choose how you would like to browse the reference: by module, by topic, or alphabetically. If you have an idea of what you are looking for, start typing it in the Filter box.