summaryrefslogtreecommitdiffstats
path: root/docs/nspr/reference/pr_createiolayerstub.rst
blob: 3deb061db29aa36f133f4d5597f9da5bfeedda6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
PR_CreateIOLayerStub
====================

Creates a new layer.


Syntax
------

.. code::

   #include <prio.h>

   PRFileDesc* PR_CreateIOLayerStub(
     PRDescIdentity ident
     PRIOMethods const *methods);


Parameters
~~~~~~~~~~

The function has the following parameters:

``ident``
   The identity to be associated with the new layer.
``methods``
   A pointer to the :ref:`PRIOMethods` structure specifying the functions
   for the new layer.


Returns
~~~~~~~

A new file descriptor for the specified layer.


Description
-----------

A new layer may be allocated by calling :ref:`PR_CreateIOLayerStub`. The
file descriptor returned contains the pointer to the I/O methods table
provided. The runtime neither modifies the table nor tests its
correctness.

The caller should override appropriate contents of the file descriptor
returned before pushing it onto the protocol stack.