mozilla

Revision 201453 of PRFileDesc

  • Revision slug: PRFileDesc
  • Revision title: PRFileDesc
  • Revision id: 201453
  • Created:
  • Creator: Rappo
  • Is current revision? No
  • Comment

Revision Content

{{template.Nsprapiref("I/O Types")}}

A file descriptor used to represent any open file, such as a normal file, an end point of a pipe, or a socket (end point of network communication).

Syntax

#include <prio.h>

struct PRFileDesc {
  PRIOMethods *methods;
  PRFilePrivate *secret;
  PRFileDesc *lower, *higher;
  void (*dtor)(PRFileDesc *fd);
  PRDescIdentity identity;
};

typedef struct PRFileDesc PRFileDesc;

Parameters

methods
The I/O methods table. See PRIOMethods.
secret
Layer-dependent implementation data. See PRFilePrivate.
lower
Pointer to lower layer.
higher
Pointer to higher layer.
dtor
A destructor function for the layer.
identity
Identity of this particular layer. See PRDescIdentity.

Description

The fields of this structure are significant only if you are implementing a layer on top of NSPR, such as SSL. Otherwise, you use functions such as PR_Open and PR_NewTCPSocket to obtain a file descriptor, which you should treat as an opaque structure.

For more details about the use of PRFileDesc and related structures, see File Descriptor Types.

Revision Source

<p>
{{template.Nsprapiref("I/O Types")}}
</p><p>A file descriptor used to represent any open file, such as a normal file, an end point of a pipe, or a socket (end point of network communication).
</p>
<h3 name="Syntax"> Syntax </h3>
<pre class="eval">#include &lt;prio.h&gt;

struct PRFileDesc {
  PRIOMethods *methods;
  PRFilePrivate *secret;
  PRFileDesc *lower, *higher;
  void (*dtor)(PRFileDesc *fd);
  PRDescIdentity identity;
};

typedef struct PRFileDesc PRFileDesc;
</pre>
<h3 name="Parameters"> Parameters </h3>
<dl><dt><code>methods</code>
</dt><dd>The I/O methods table. See <code><a href="en/PRIOMethods">PRIOMethods</a></code>.
</dd><dt><code>secret</code>
</dt><dd>Layer-dependent implementation data. See <code><a href="en/PRFilePrivate">PRFilePrivate</a></code>.
</dd><dt><code>lower</code>
</dt><dd>Pointer to lower layer.
</dd><dt><code>higher</code>
</dt><dd>Pointer to higher layer.
</dd><dt><code>dtor</code>
</dt><dd>A destructor function for the layer.
</dd><dt><code>identity</code>
</dt><dd>Identity of this particular layer. See <code><a href="en/PRDescIdentity">PRDescIdentity</a></code>.
</dd></dl>
<h3 name="Description"> Description </h3>
<p>The fields of this structure are significant only if you are implementing a layer on top of NSPR, such as SSL. Otherwise, you use functions such as <code><a href="en/PR_Open">PR_Open</a></code> and <code><a href="en/PR_NewTCPSocket">PR_NewTCPSocket</a></code> to obtain a file descriptor, which you should treat as an opaque structure.
</p><p>For more details about the use of <code>PRFileDesc</code> and related structures, see <a href="en/NSPR_API_Reference/I%2f%2fO_Types#File_Descriptor_Types">File Descriptor Types</a>.
</p>
Revert to this revision