prdescidentity.rst (1063B)
1 PRDescIdentity 2 ============== 3 4 The identity of a file descriptor's layer. 5 6 7 Syntax 8 ------ 9 10 .. code:: 11 12 #include <prio.h> 13 14 typedef PRUintn PRDescIdentity; 15 16 17 Description 18 ----------- 19 20 File descriptors may be layered. Each layer has it own identity. 21 Identities are allocated by the runtime and are to be associated (by the 22 layer implementer) with all file descriptors of that layer. It is then 23 possible to scan the chain of layers and find a layer that one 24 recognizes, then predict that it will implement a desired protocol. 25 26 There are three well-known identities: 27 28 - :ref:`PR_INVALID_IO_LAYER`, an invalid layer identity, for error return 29 - :ref:`PR_TOP_IO_LAYER`, the identity of the top of the stack 30 - :ref:`PR_NSPR_IO_LAYER`, the identity used by NSPR proper 31 32 Layers are created by :ref:`PR_GetUniqueIdentity`. A string may be 33 associated with a layer when the layer is created. The string is copied 34 by the runtime, and :ref:`PR_GetNameForIdentity` returns a reference to 35 that copy. There is no way to delete a layer's identity after the layer 36 is created.