* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Markus Friedl.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* RCSID("$Id$"); */
+/* RCSID("$OpenBSD: nchan.h,v 1.10 2001/02/28 08:54:55 markus Exp $"); */
#ifndef NCHAN_H
#define NCHAN_H
#define CHAN_OUTPUT_WAIT_IEOF 0x40
#define CHAN_OUTPUT_CLOSED 0x80
-/* EVENTS for the input state */
-void chan_rcvd_oclose(Channel * c);
-void chan_read_failed(Channel * c);
-void chan_ibuf_empty(Channel * c);
+#define CHAN_CLOSE_SENT 0x01
+#define CHAN_CLOSE_RCVD 0x02
-/* EVENTS for the output state */
-void chan_rcvd_ieof(Channel * c);
-void chan_write_failed(Channel * c);
-void chan_obuf_empty(Channel * c);
+
+/* Channel EVENTS */
+typedef void chan_event_fn(Channel * c);
+
+/* for the input state */
+extern chan_event_fn *chan_rcvd_oclose;
+extern chan_event_fn *chan_read_failed;
+extern chan_event_fn *chan_ibuf_empty;
+
+/* for the output state */
+extern chan_event_fn *chan_rcvd_ieof;
+extern chan_event_fn *chan_write_failed;
+extern chan_event_fn *chan_obuf_empty;
+
+int chan_is_dead(Channel * c);
void chan_init_iostates(Channel * c);
+void chan_init(void);
#endif