pr_popiolayer.rst (1303B)
1 PR_PopIOLayer 2 ============= 3 4 Removes a layer from the stack. 5 6 7 Syntax 8 ------ 9 10 .. code:: 11 12 #include <prio.h> 13 14 PRFileDesc *PR_PopIOLayer( 15 PRFileDesc *stack, 16 PRDescIdentity id); 17 18 19 Parameters 20 ~~~~~~~~~~ 21 22 The function has the following parameters: 23 24 ``stack`` 25 A pointer to a :ref:`PRFileDesc` object representing the stack from 26 which the specified layer is to be removed. 27 ``id`` 28 Identity of the layer to be removed from the stack. 29 30 31 Returns 32 ~~~~~~~ 33 34 The function returns one of the following values: 35 36 - If the layer is successfully removed from the stack, a pointer to the 37 removed layer. 38 - If the layer is not found in the stack or cannot be popped (for 39 example, the bottommost layer), the function returns ``NULL`` with 40 the error code ``PR_INVALID_ARGUMENT_ERROR``. 41 42 43 Description 44 ----------- 45 46 :ref:`PR_PopIOLayer` pops the specified layer from the stack. If the object 47 to be removed is found, :ref:`PR_PopIOLayer` returns a pointer to the 48 removed object The object then becomes the responsibility of the caller. 49 50 Even if the identity indicates the top layer of the stack, the reference 51 returned is not the file descriptor for the stack and that file 52 descriptor remains valid. In other words, ``stack`` continues to point 53 to the top of the stack after the function returns.