tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

prfiledesc.rst (1247B)


      1 PRFileDesc
      2 ==========
      3 
      4 A file descriptor used to represent any open file, such as a normal
      5 file, an end point of a pipe, or a socket (end point of network
      6 communication).
      7 
      8 
      9 Syntax
     10 ------
     11 
     12 .. code::
     13 
     14   #include <prio.h>
     15 
     16   struct PRFileDesc {
     17     PRIOMethods *methods;
     18     PRFilePrivate *secret;
     19     PRFileDesc *lower, *higher;
     20     void (*dtor)(PRFileDesc *fd);
     21     PRDescIdentity identity;
     22   };
     23 
     24   typedef struct PRFileDesc PRFileDesc;
     25 
     26 
     27 Parameters
     28 ~~~~~~~~~~
     29 
     30 ``methods``
     31   The I/O methods table. See :ref:`PRIOMethods`.
     32 ``secret``
     33   Layer-dependent implementation data. See :ref:`PRFilePrivate`.
     34 ``lower``
     35   Pointer to lower layer.
     36 ``higher``
     37   Pointer to higher layer.
     38 ``dtor``
     39   A destructor function for the layer.
     40 ``identity``
     41   Identity of this particular layer. See :ref:`PRDescIdentity`.
     42 
     43 
     44 Description
     45 -----------
     46 
     47 The fields of this structure are significant only if you are
     48 implementing a layer on top of NSPR, such as SSL. Otherwise, you use
     49 functions such as :ref:`PR_Open` and :ref:`PR_NewTCPSocket` to obtain a file
     50 descriptor, which you should treat as an opaque structure.
     51 
     52 For more details about the use of :ref:`PRFileDesc` and related structures,
     53 see `File Descriptor Types <I_O_Types#File_Descriptor_Types>`__.