Sophie

Sophie

distrib > Mageia > 3 > i586 > by-pkgid > 201a9f979540fcfb8136ebdbfe063650 > files > 4

ocaml-lwt-doc-2.4.2-5.mga3.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="Lwt_engine.html">
<link rel="next" href="Pa_lwt.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class attributes" rel=Appendix href="index_attributes.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of classes" rel=Appendix href="index_classes.html">
<link title="Index of class types" rel=Appendix href="index_class_types.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Lwt_condition" rel="Chapter" href="Lwt_condition.html">
<link title="Lwt_list" rel="Chapter" href="Lwt_list.html">
<link title="Lwt" rel="Chapter" href="Lwt.html">
<link title="Lwt_mutex" rel="Chapter" href="Lwt_mutex.html">
<link title="Lwt_mvar" rel="Chapter" href="Lwt_mvar.html">
<link title="Lwt_pool" rel="Chapter" href="Lwt_pool.html">
<link title="Lwt_sequence" rel="Chapter" href="Lwt_sequence.html">
<link title="Lwt_stream" rel="Chapter" href="Lwt_stream.html">
<link title="Lwt_switch" rel="Chapter" href="Lwt_switch.html">
<link title="Lwt_util" rel="Chapter" href="Lwt_util.html">
<link title="Lwt_pqueue" rel="Chapter" href="Lwt_pqueue.html">
<link title="Lwt_lib" rel="Chapter" href="Lwt_lib.html">
<link title="Lwt_glib" rel="Chapter" href="Lwt_glib.html">
<link title="Lwt_preemptive" rel="Chapter" href="Lwt_preemptive.html">
<link title="Lwt_event" rel="Chapter" href="Lwt_event.html">
<link title="Lwt_signal" rel="Chapter" href="Lwt_signal.html">
<link title="Lwt_react" rel="Chapter" href="Lwt_react.html">
<link title="Lwt_ssl" rel="Chapter" href="Lwt_ssl.html">
<link title="Lwt_text" rel="Chapter" href="Lwt_text.html">
<link title="Lwt_term" rel="Chapter" href="Lwt_term.html">
<link title="Lwt_read_line" rel="Chapter" href="Lwt_read_line.html">
<link title="Lwt_top" rel="Chapter" href="Lwt_top.html">
<link title="Lwt_chan" rel="Chapter" href="Lwt_chan.html">
<link title="Lwt_daemon" rel="Chapter" href="Lwt_daemon.html">
<link title="Lwt_gc" rel="Chapter" href="Lwt_gc.html">
<link title="Lwt_io" rel="Chapter" href="Lwt_io.html">
<link title="Lwt_log" rel="Chapter" href="Lwt_log.html">
<link title="Lwt_main" rel="Chapter" href="Lwt_main.html">
<link title="Lwt_process" rel="Chapter" href="Lwt_process.html">
<link title="Lwt_throttle" rel="Chapter" href="Lwt_throttle.html">
<link title="Lwt_timeout" rel="Chapter" href="Lwt_timeout.html">
<link title="Lwt_unix" rel="Chapter" href="Lwt_unix.html">
<link title="Lwt_sys" rel="Chapter" href="Lwt_sys.html">
<link title="Lwt_engine" rel="Chapter" href="Lwt_engine.html">
<link title="Lwt_bytes" rel="Chapter" href="Lwt_bytes.html">
<link title="Pa_lwt" rel="Chapter" href="Pa_lwt.html">
<link title="Pa_lwt_log" rel="Chapter" href="Pa_lwt_log.html"><link title="Access" rel="Section" href="#6_Access">
<link title="Conversions" rel="Section" href="#6_Conversions">
<link title="Copying" rel="Section" href="#6_Copying">
<link title="Filling" rel="Section" href="#6_Filling">
<link title="IOs" rel="Section" href="#6_IOs">
<link title="Memory mapped files" rel="Section" href="#6_Memorymappedfiles">
<title>Lwt_bytes</title>
</head>
<body>
<div class="navbar"><a class="pre" href="Lwt_engine.html" title="Lwt_engine">Previous</a>
&nbsp;<a class="up" href="index.html" title="Index">Up</a>
&nbsp;<a class="post" href="Pa_lwt.html" title="Pa_lwt">Next</a>
</div>
<h1>Module <a href="type_Lwt_bytes.html">Lwt_bytes</a></h1>
<pre><span class="keyword">module</span> Lwt_bytes: <code class="code"><span class="keyword">sig</span></code> <a href="Lwt_bytes.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info">
Byte arrays<br>
</div>
<hr width="100%">
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = <code class="type">(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t</code> </pre>
<div class="info">
Type of array of bytes.<br>
</div>

<pre><span id="VALcreate"><span class="keyword">val</span> create</span> : <code class="type">int -> <a href="Lwt_bytes.html#TYPEt">t</a></code></pre><div class="info">
Creates a new byte array of the given size.<br>
</div>
<pre><span id="VALlength"><span class="keyword">val</span> length</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int</code></pre><div class="info">
Returns the length of the given byte array.<br>
</div>
<br>
<h6 id="6_Access">Access</h6><br>
<pre><span id="VALget"><span class="keyword">val</span> get</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> char</code></pre><div class="info">
<code class="code">get buffer offset</code> returns the byte at offset <code class="code">offset</code> in
      <code class="code">buffer</code>.<br>
</div>
<pre><span id="VALset"><span class="keyword">val</span> set</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> char -> unit</code></pre><div class="info">
<code class="code">get buffer offset value</code> changes the value of the byte at
      offset <code class="code">offset</code> in <code class="code">buffer</code> to <code class="code">value</code>.<br>
</div>
<pre><span id="VALunsafe_get"><span class="keyword">val</span> unsafe_get</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> char</code></pre><div class="info">
Same as <a href="Lwt_bytes.html#VALget"><code class="code"><span class="constructor">Lwt_bytes</span>.get</code></a> but without bound checking.<br>
</div>
<pre><span id="VALunsafe_set"><span class="keyword">val</span> unsafe_set</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> char -> unit</code></pre><div class="info">
Same as <a href="Lwt_bytes.html#VALset"><code class="code"><span class="constructor">Lwt_bytes</span>.set</code></a> but without bound checking.<br>
</div>
<br>
<h6 id="6_Conversions">Conversions</h6><br>
<pre><span id="VALof_string"><span class="keyword">val</span> of_string</span> : <code class="type">string -> <a href="Lwt_bytes.html#TYPEt">t</a></code></pre><div class="info">
<code class="code">of_string str</code> returns a newly allocated byte array with the
      same contents as <code class="code">str</code>.<br>
</div>
<pre><span id="VALto_string"><span class="keyword">val</span> to_string</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> string</code></pre><div class="info">
<code class="code">to_string buf</code> returns a newly allocated string with the same
      contents as <code class="code">buf</code>.<br>
</div>
<br>
<h6 id="6_Copying">Copying</h6><br>
<pre><span id="VALblit"><span class="keyword">val</span> blit</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> <a href="Lwt_bytes.html#TYPEt">t</a> -> int -> int -> unit</code></pre><div class="info">
<code class="code">blit buf1 ofs1 buf2 ofs2 len</code> copy <code class="code">len</code> bytes from <code class="code">buf1</code>
      starting at offset <code class="code">ofs1</code> to <code class="code">buf2</code> starting at offset <code class="code">ofs2</code>.<br>
</div>
<pre><span id="VALblit_string_bytes"><span class="keyword">val</span> blit_string_bytes</span> : <code class="type">string -> int -> <a href="Lwt_bytes.html#TYPEt">t</a> -> int -> int -> unit</code></pre><div class="info">
Same as blit but the first buffer is a string instead of a byte
      array.<br>
</div>
<pre><span id="VALblit_bytes_string"><span class="keyword">val</span> blit_bytes_string</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> string -> int -> int -> unit</code></pre><div class="info">
Same as blit but the second buffer is a string instead of a byte
      array.<br>
</div>
<pre><span id="VALunsafe_blit"><span class="keyword">val</span> unsafe_blit</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> <a href="Lwt_bytes.html#TYPEt">t</a> -> int -> int -> unit</code></pre><div class="info">
Same as <a href="Lwt_bytes.html#VALblit"><code class="code"><span class="constructor">Lwt_bytes</span>.blit</code></a> but without bound checking.<br>
</div>
<pre><span id="VALunsafe_blit_string_bytes"><span class="keyword">val</span> unsafe_blit_string_bytes</span> : <code class="type">string -> int -> <a href="Lwt_bytes.html#TYPEt">t</a> -> int -> int -> unit</code></pre><div class="info">
Same as <a href="Lwt_bytes.html#VALblit_string_bytes"><code class="code"><span class="constructor">Lwt_bytes</span>.blit_string_bytes</code></a> but without bound checking.<br>
</div>
<pre><span id="VALunsafe_blit_bytes_string"><span class="keyword">val</span> unsafe_blit_bytes_string</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> string -> int -> int -> unit</code></pre><div class="info">
Same as <a href="Lwt_bytes.html#VALblit_bytes_string"><code class="code"><span class="constructor">Lwt_bytes</span>.blit_bytes_string</code></a> but without bound checking.<br>
</div>
<pre><span id="VALproxy"><span class="keyword">val</span> proxy</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> int -> <a href="Lwt_bytes.html#TYPEt">t</a></code></pre><div class="info">
<code class="code">proxy buffer offset length</code> creates a ``proxy''. The returned
      byte array share the data of <code class="code">buffer</code> but with different
      bounds.<br>
</div>
<pre><span id="VALextract"><span class="keyword">val</span> extract</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> int -> <a href="Lwt_bytes.html#TYPEt">t</a></code></pre><div class="info">
<code class="code">extract buffer offset length</code> creates a new byte array of
      length <code class="code">length</code> and copy the <code class="code">length</code> bytes of <code class="code">buffer</code> at
      <code class="code">offset</code> into it.<br>
</div>
<pre><span id="VALcopy"><span class="keyword">val</span> copy</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> <a href="Lwt_bytes.html#TYPEt">t</a></code></pre><div class="info">
<code class="code">copy buffer</code> creates a copy of the given byte array.<br>
</div>
<br>
<h6 id="6_Filling">Filling</h6><br>
<pre><span id="VALfill"><span class="keyword">val</span> fill</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> int -> char -> unit</code></pre><div class="info">
<code class="code">fill buffer offset length value</code> puts <code class="code">value</code> in all <code class="code">length</code>
      bytes of <code class="code">buffer</code> starting at offset <code class="code">offset</code>.<br>
</div>
<pre><span id="VALunsafe_fill"><span class="keyword">val</span> unsafe_fill</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> int -> char -> unit</code></pre><div class="info">
Same as <a href="Lwt_bytes.html#VALfill"><code class="code"><span class="constructor">Lwt_bytes</span>.fill</code></a> but without bound checking.<br>
</div>
<br>
<h6 id="6_IOs">IOs</h6><br>
<br>
The following functions does the same as the functions in
    <a href="Lwt_unix.html"><code class="code"><span class="constructor">Lwt_unix</span></code></a> except that they use byte arrays instead of
    strings.<br>
<pre><span id="VALread"><span class="keyword">val</span> read</span> : <code class="type"><a href="Lwt_unix.html#TYPEfile_descr">Lwt_unix.file_descr</a> -> <a href="Lwt_bytes.html#TYPEt">t</a> -> int -> int -> int <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span id="VALwrite"><span class="keyword">val</span> write</span> : <code class="type"><a href="Lwt_unix.html#TYPEfile_descr">Lwt_unix.file_descr</a> -> <a href="Lwt_bytes.html#TYPEt">t</a> -> int -> int -> int <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span id="VALrecv"><span class="keyword">val</span> recv</span> : <code class="type"><a href="Lwt_unix.html#TYPEfile_descr">Lwt_unix.file_descr</a> -><br>       <a href="Lwt_bytes.html#TYPEt">t</a> -> int -> int -> Unix.msg_flag list -> int <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span id="VALsend"><span class="keyword">val</span> send</span> : <code class="type"><a href="Lwt_unix.html#TYPEfile_descr">Lwt_unix.file_descr</a> -><br>       <a href="Lwt_bytes.html#TYPEt">t</a> -> int -> int -> Unix.msg_flag list -> int <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span id="VALrecvfrom"><span class="keyword">val</span> recvfrom</span> : <code class="type"><a href="Lwt_unix.html#TYPEfile_descr">Lwt_unix.file_descr</a> -><br>       <a href="Lwt_bytes.html#TYPEt">t</a> -><br>       int -> int -> Unix.msg_flag list -> (int * Unix.sockaddr) <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span id="VALsendto"><span class="keyword">val</span> sendto</span> : <code class="type"><a href="Lwt_unix.html#TYPEfile_descr">Lwt_unix.file_descr</a> -><br>       <a href="Lwt_bytes.html#TYPEt">t</a> -> int -> int -> Unix.msg_flag list -> Unix.sockaddr -> int <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><code><span id="TYPEio_vector"><span class="keyword">type</span> <code class="type"></code>io_vector</span> = {</code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTio_vector.iov_buffer">iov_buffer</span>&nbsp;:<code class="type"><a href="Lwt_bytes.html#TYPEt">t</a></code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTio_vector.iov_offset">iov_offset</span>&nbsp;:<code class="type">int</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTio_vector.iov_length">iov_length</span>&nbsp;:<code class="type">int</code>;</code></td>

</tr></table>
}


<pre><span id="VALio_vector"><span class="keyword">val</span> io_vector</span> : <code class="type">buffer:<a href="Lwt_bytes.html#TYPEt">t</a> -> offset:int -> length:int -> <a href="Lwt_bytes.html#TYPEio_vector">io_vector</a></code></pre><pre><span id="VALrecv_msg"><span class="keyword">val</span> recv_msg</span> : <code class="type">socket:<a href="Lwt_unix.html#TYPEfile_descr">Lwt_unix.file_descr</a> -><br>       io_vectors:<a href="Lwt_bytes.html#TYPEio_vector">io_vector</a> list -> (int * Unix.file_descr list) <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><div class="info">
This call is not available on windows.<br>
</div>
<pre><span id="VALsend_msg"><span class="keyword">val</span> send_msg</span> : <code class="type">socket:<a href="Lwt_unix.html#TYPEfile_descr">Lwt_unix.file_descr</a> -><br>       io_vectors:<a href="Lwt_bytes.html#TYPEio_vector">io_vector</a> list -> fds:Unix.file_descr list -> int <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><div class="info">
This call is not available on windows.<br>
</div>
<br>
<h6 id="6_Memorymappedfiles">Memory mapped files</h6><br>
<pre><span id="VALmap_file"><span class="keyword">val</span> map_file</span> : <code class="type">fd:Unix.file_descr -><br>       ?pos:int64 -> shared:bool -> ?size:int -> unit -> <a href="Lwt_bytes.html#TYPEt">t</a></code></pre><div class="info">
<code class="code">map_file ~fd ?pos ~shared ?size ()</code> maps the file descriptor
      <code class="code">fd</code> to an array of bytes.<br>
</div>
<pre><span id="VALmapped"><span class="keyword">val</span> mapped</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> bool</code></pre><div class="info">
<code class="code">mapped buffer</code> returns <code class="code"><span class="keyword">true</span></code> iff <code class="code">buffer</code> is a memory mapped
      file.<br>
</div>
<pre><code><span id="TYPEadvice"><span class="keyword">type</span> <code class="type"></code>advice</span> = </code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTadvice.MADV_NORMAL"><span class="constructor">MADV_NORMAL</span></span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTadvice.MADV_RANDOM"><span class="constructor">MADV_RANDOM</span></span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTadvice.MADV_SEQUENTIAL"><span class="constructor">MADV_SEQUENTIAL</span></span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTadvice.MADV_WILLNEED"><span class="constructor">MADV_WILLNEED</span></span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTadvice.MADV_DONTNEED"><span class="constructor">MADV_DONTNEED</span></span></code></td>

</tr></table>

<div class="info">
Type of advise that can be sent to the kernel by the program. See
    the manual madvise(2) for a description of each advices.<br>
</div>

<pre><span id="VALmadvise"><span class="keyword">val</span> madvise</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> int -> <a href="Lwt_bytes.html#TYPEadvice">advice</a> -> unit</code></pre><div class="info">
<code class="code">madvise buffer pos len advice</code> advise the kernel about how the
      program is going to use the part of the memory mapped file
      between <code class="code">pos</code> and <code class="code">pos + len</code>.
<p>

      This call is not available on windows.<br>
</div>
<pre><span id="VALpage_size"><span class="keyword">val</span> page_size</span> : <code class="type">int</code></pre><div class="info">
Size of pages.<br>
</div>
<pre><span id="VALmincore"><span class="keyword">val</span> mincore</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> bool array -> unit</code></pre><div class="info">
<code class="code">mincore buffer offset states</code> tests whether the given pages are
      in the system memory (the RAM). The <code class="code">offset</code> argument must be a
      multiple of <a href="Lwt_bytes.html#VALpage_size"><code class="code"><span class="constructor">Lwt_bytes</span>.page_size</code></a>. <code class="code">states</code> is used to store the result;
      each cases is <code class="code"><span class="keyword">true</span></code> if the corresponding page in the RAM and
      <code class="code"><span class="keyword">false</span></code> otherwise.
<p>

      This call is not available on windows.<br>
</div>
<pre><span id="VALwait_mincore"><span class="keyword">val</span> wait_mincore</span> : <code class="type"><a href="Lwt_bytes.html#TYPEt">t</a> -> int -> unit <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><div class="info">
<code class="code">wait_mincore buffer offset</code> waits until the page containing the
      byte at offset <code class="code">offset</code> in the the RAM.
<p>

      This functions is not available on windows.<br>
</div>
</body></html>