ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS/gnome-vfs2-2.3.8-1.src.rpm
[gnome-vfs-httpcaptive.git] / doc / html / gnome-vfs-20-gnome-vfs-socket-buffer.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gnome-vfs-socket-buffer</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.0"><meta name="generator" content="GTK-Doc V1.1 (XML mode)"><style type="text/css">
2         .synopsis, .classsynopsis {
3             background: #eeeeee;
4             border: solid 1px #aaaaaa;
5             padding: 0.5em;
6         }
7         .programlisting {
8             background: #eeeeff;
9             border: solid 1px #aaaaff;
10             padding: 0.5em;
11         }
12         .variablelist {
13             padding: 4px;
14             margin-left: 3em;
15         }
16         .navigation {
17             background: #ffeeee;
18             border: solid 1px #ffaaaa;
19             margin-top: 0.5em;
20             margin-bottom: 0.5em;
21         }
22         .navigation a {
23             color: #770000;
24         }
25         .navigation a:visited {
26             color: #550000;
27         }
28         .navigation .title {
29             font-size: 200%;
30         }
31       </style><link rel="home" href="index.html" title="GnomeVFS - Filesystem Abstraction library"><link rel="up" href="modules.html" title="Filesystem Modules"><link rel="previous" href="gnome-vfs-20-gnome-vfs-socket.html" title="gnome-vfs-socket"><link rel="next" href="gnome-vfs-20-gnome-vfs-transform.html" title="gnome-vfs-transform"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="gnome-vfs-20-gnome-vfs-socket.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="modules.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GnomeVFS - Filesystem Abstraction library</th><td><a accesskey="n" href="gnome-vfs-20-gnome-vfs-transform.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="gnome-vfs-20-gnome-vfs-socket-buffer"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">gnome-vfs-socket-buffer</span></h2><p>gnome-vfs-socket-buffer &#8212; </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
32
33
34
35 GnomeVFSSocketBuffer* <a href="gnome-vfs-20-gnome-vfs-socket-buffer.html#gnome-vfs-socket-buffer-new">gnome_vfs_socket_buffer_new</a>
36                                             (GnomeVFSSocket *socket);
37 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-20-gnome-vfs-socket-buffer.html#gnome-vfs-socket-buffer-destroy">gnome_vfs_socket_buffer_destroy</a>
38                                             (GnomeVFSSocketBuffer *socket_buffer,
39                                              <a
40 href="../glib/glib-Basic-Types.html#gboolean"
41 >gboolean</a> close_socket);
42 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-20-gnome-vfs-socket-buffer.html#gnome-vfs-socket-buffer-read">gnome_vfs_socket_buffer_read</a> (GnomeVFSSocketBuffer *socket_buffer,
43                                              <a
44 href="../glib/glib-Basic-Types.html#gpointer"
45 >gpointer</a> buffer,
46                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
47                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_read);
48 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-20-gnome-vfs-socket-buffer.html#gnome-vfs-socket-buffer-peekc">gnome_vfs_socket_buffer_peekc</a>
49                                             (GnomeVFSSocketBuffer *socket_buffer,
50                                              char *character);
51 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-20-gnome-vfs-socket-buffer.html#gnome-vfs-socket-buffer-write">gnome_vfs_socket_buffer_write</a>
52                                             (GnomeVFSSocketBuffer *socket_buffer,
53                                              <a
54 href="../glib/glib-Basic-Types.html#gconstpointer"
55 >gconstpointer</a> buffer,
56                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
57                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_written);
58 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-20-gnome-vfs-socket-buffer.html#gnome-vfs-socket-buffer-flush">gnome_vfs_socket_buffer_flush</a>
59                                             (GnomeVFSSocketBuffer *socket_buffer);
60 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
61
62 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="gnome-vfs-socket-buffer-new"></a>gnome_vfs_socket_buffer_new ()</h3><a class="indexterm" name="id2988190"></a><pre class="programlisting">GnomeVFSSocketBuffer* gnome_vfs_socket_buffer_new
63                                             (GnomeVFSSocket *socket);</pre><p>
64 Create a socket buffer around <i class="parameter"><tt>socket</tt></i>. A buffered
65 socket allows data to be poked at without reading it
66 as it will be buffered. A future read will retrieve
67 the data again.</p><p>
68
69 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>socket</tt></i> :</span></td><td> socket to be buffered
70 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated GnomeVFSSocketBuffer
71 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-socket-buffer-destroy"></a>gnome_vfs_socket_buffer_destroy ()</h3><a class="indexterm" name="id2988289"></a><pre class="programlisting"><a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_buffer_destroy
72                                             (GnomeVFSSocketBuffer *socket_buffer,
73                                              <a
74 href="../glib/glib-Basic-Types.html#gboolean"
75 >gboolean</a> close_socket);</pre><p>
76 Free the socket buffer.</p><p>
77
78 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>socket_buffer</tt></i> :</span></td><td> buffered socket to destray
79 </td></tr><tr><td><span class="term"><i class="parameter"><tt>close_socket</tt></i> :</span></td><td> if <tt class="literal">TRUE</tt> the socket being buffered will be closed too
80 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> GnomeVFSResult indicating the success of the operation
81 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-socket-buffer-read"></a>gnome_vfs_socket_buffer_read ()</h3><a class="indexterm" name="id2988413"></a><pre class="programlisting"><a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_buffer_read (GnomeVFSSocketBuffer *socket_buffer,
82                                              <a
83 href="../glib/glib-Basic-Types.html#gpointer"
84 >gpointer</a> buffer,
85                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
86                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_read);</pre><p>
87 Read <i class="parameter"><tt>bytes</tt></i> bytes of data from the <i class="parameter"><tt>socket</tt></i> into <i class="parameter"><tt>socket_buffer</tt></i>.</p><p>
88
89 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>socket_buffer</tt></i> :</span></td><td> buffered socket to read data from
90 </td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> allocated buffer of at least <i class="parameter"><tt>bytes</tt></i> bytes to be read into
91 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes</tt></i> :</span></td><td> number of bytes to read from <i class="parameter"><tt>socket</tt></i> into <i class="parameter"><tt>socket_buffer</tt></i>
92 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes_read</tt></i> :</span></td><td> pointer to a GnomeVFSFileSize, will contain
93 the number of bytes actually read from the socket on return.
94 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> GnomeVFSResult indicating the success of the operation
95 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-socket-buffer-peekc"></a>gnome_vfs_socket_buffer_peekc ()</h3><a class="indexterm" name="id2988624"></a><pre class="programlisting"><a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_buffer_peekc
96                                             (GnomeVFSSocketBuffer *socket_buffer,
97                                              char *character);</pre><p>
98 Peek at the next character in <i class="parameter"><tt>socket_buffer</tt></i> without actually reading
99 the character in. The next read will retrieve <i class="parameter"><tt>c</tt></i> (as well as any following
100 data if requested).</p><p>
101
102 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>socket_buffer</tt></i> :</span></td><td> the socket buffer to read from
103 </td></tr><tr><td><span class="term"><i class="parameter"><tt>character</tt></i> :</span></td><td> pointer to a char, will contain a character on return from
104 a successful "peek"
105 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> GnomeVFSResult indicating the success of the operation
106 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-socket-buffer-write"></a>gnome_vfs_socket_buffer_write ()</h3><a class="indexterm" name="id2988758"></a><pre class="programlisting"><a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_buffer_write
107                                             (GnomeVFSSocketBuffer *socket_buffer,
108                                              <a
109 href="../glib/glib-Basic-Types.html#gconstpointer"
110 >gconstpointer</a> buffer,
111                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
112                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_written);</pre><p>
113 Write <i class="parameter"><tt>bytes</tt></i> bytes of data from <i class="parameter"><tt>buffer</tt></i> to <i class="parameter"><tt>socket_buffer</tt></i>.</p><p>
114
115 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>socket_buffer</tt></i> :</span></td><td> buffered socket to write data to
116 </td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> data to write to the socket
117 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes</tt></i> :</span></td><td> number of bytes from <i class="parameter"><tt>buffer</tt></i> to write to <i class="parameter"><tt>socket_buffer</tt></i>
118 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes_written</tt></i> :</span></td><td> pointer to a GnomeVFSFileSize, will contain
119 the number of bytes actually written to the socket on return.
120 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> GnomeVFSResult indicating the success of the operation
121 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-socket-buffer-flush"></a>gnome_vfs_socket_buffer_flush ()</h3><a class="indexterm" name="id2988965"></a><pre class="programlisting"><a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_buffer_flush
122                                             (GnomeVFSSocketBuffer *socket_buffer);</pre><p>
123 Write all outstanding data to <i class="parameter"><tt>socket_buffer</tt></i>.</p><p>
124
125 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>socket_buffer</tt></i> :</span></td><td> buffer to flush
126 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> GnomeVFSResult indicating the success of the operation
127 </td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="gnome-vfs-20-gnome-vfs-socket.html"><b>&lt;&lt; gnome-vfs-socket</b></a></td><td align="right"><a accesskey="n" href="gnome-vfs-20-gnome-vfs-transform.html"><b>gnome-vfs-transform &gt;&gt;</b></a></td></tr></table></body></html>