mux.h revision 156230
12894Sfparain/*- 212953Scoleenp * Copyright (c) 2003-2004, Maxime Henrion <mux@FreeBSD.org> 32894Sfparain * All rights reserved. 42894Sfparain * 52894Sfparain * Redistribution and use in source and binary forms, with or without 62894Sfparain * modification, are permitted provided that the following conditions 72894Sfparain * are met: 82894Sfparain * 1. Redistributions of source code must retain the above copyright 92894Sfparain * notice, this list of conditions and the following disclaimer. 102894Sfparain * 2. Redistributions in binary form must reproduce the above copyright 112894Sfparain * notice, this list of conditions and the following disclaimer in the 122894Sfparain * documentation and/or other materials provided with the distribution. 132894Sfparain * 142894Sfparain * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 152894Sfparain * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 162894Sfparain * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 172894Sfparain * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 182894Sfparain * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 192894Sfparain * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 202894Sfparain * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 212894Sfparain * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 222894Sfparain * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 232894Sfparain * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 242894Sfparain * SUCH DAMAGE. 252894Sfparain * 262894Sfparain * $FreeBSD: vendor/csup/dist/contrib/csup/mux.h 156230 2006-03-03 04:11:29Z mux $ 2710762Sjprovino */ 287864Sstefank#ifndef _MUX_H_ 2913184Skbarrett#define _MUX_H_ 302894Sfparain 312894Sfparainstruct mux; 322894Sfparainstruct chan; 332894Sfparain 342894Sfparainstruct mux *mux_open(int, struct chan **); 352894Sfparainvoid mux_shutdown(struct mux *, const char *, int); 362894Sfparainint mux_close(struct mux *); 372894Sfparain 382894Sfparainvoid chan_wait(struct chan *); 392894Sfparainint chan_listen(struct mux *); 402894Sfparainstruct chan *chan_accept(struct mux *, int); 412894Sfparainssize_t chan_read(struct chan *, void *, size_t); 422894Sfparainssize_t chan_write(struct chan *, const void *, size_t); 432894Sfparainint chan_close(struct chan *); 442894Sfparain 452894Sfparain#endif /* !_MUX_H_ */ 462894Sfparain