add event_buffer_set_callback() description

and update event_set() manual


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@300690 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Antony Dovgal 2010-06-23 08:40:29 +00:00
parent 8b6932f5b8
commit 39ab813510
2 changed files with 115 additions and 6 deletions

View file

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 297028 $ -->
<refentry xml:id="function.event-buffer-new" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>event_buffer_set_callback</refname>
<refpurpose>Set or reset callbacks for a buffered event</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>event_buffer_set_callback</methodname>
<methodparam><type>resource</type><parameter>event</parameter></methodparam>
<methodparam><type>mixed</type><parameter>readcb</parameter></methodparam>
<methodparam><type>mixed</type><parameter>writecb</parameter></methodparam>
<methodparam><type>mixed</type><parameter>errorcb</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>arg</parameter></methodparam>
</methodsynopsis>
<para>
Sets or changess existing callbacks for the buffered <parameter>event</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>event</parameter></term>
<listitem>
<para>
Valid buffered event resource.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>readcb</parameter></term>
<listitem>
<para>
Callback to invoke where there is data to read, or <type>NULL</type> if
no callback is desired.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>writecb</parameter></term>
<listitem>
<para>
Callback to invoke where the descriptor is ready for writing,
or <type>NULL</type> if no callback is desired.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>errorcb</parameter></term>
<listitem>
<para>
Callback to invoke where there is an error on the descriptor, cannot be
<type>NULL</type>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>arg</parameter></term>
<listitem>
<para>
An argument that will be passed to each of the callbacks (optional).
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<function>event_buffer_set_callback</function> returns &true; on success or &false; on failure.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -11,7 +11,7 @@
<methodsynopsis>
<type>bool</type><methodname>event_set</methodname>
<methodparam><type>resource</type><parameter>event</parameter></methodparam>
<methodparam><type>resource</type><parameter>fd</parameter></methodparam>
<methodparam><type>mixed</type><parameter>fd</parameter></methodparam>
<methodparam><type>int</type><parameter>events</parameter></methodparam>
<methodparam><type>mixed</type><parameter>callback</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>arg</parameter></methodparam>
@ -21,9 +21,14 @@
is prepared to call the function specified by the <parameter>callback</parameter>
on the events specified in parameter <parameter>events</parameter>, which
is a set of the following flags: <constant>EV_TIMEOUT</constant>,
<constant>EV_SIGNAL</constant>, <constant>EV_READ</constant> and
<constant>EV_WRITE</constant>.
<constant>EV_SIGNAL</constant>, <constant>EV_READ</constant>,
<constant>EV_WRITE</constant>, <constant>EV_PERSIST</constant> and
<constant>EV_SIGNAL</constant>.
</para>
<para>
If <constant>EV_SIGNAL</constant> bit is set in parameter <parameter>events</parameter>,
the <parameter>fd</parameter> is interpreted as signal number.
</para>
<para>
After initializing the event, use <function>event_base_set</function> to
associate the event with its event base.
@ -36,7 +41,7 @@
<term><parameter>fd</parameter></term>
<listitem>
<para>
Resource indicating the stream.
Signal number or resource indicating the stream.
</para>
</listitem>
</varlistentry>
@ -44,9 +49,10 @@
<term><parameter>events</parameter></term>
<listitem>
<para>
A flag indicating the event. Can be one of the following:
A flag indicating the event. Consists of the following flags:
<constant>EV_TIMEOUT</constant>, <constant>EV_SIGNAL</constant>,
<constant>EV_READ</constant> or <constant>EV_WRITE</constant>.
<constant>EV_READ</constant>, <constant>EV_WRITE</constant>,
<constant>EV_PERSIST</constant> and <constant>EV_SIGNAL</constant>.
</para>
</listitem>
</varlistentry>