2 * UCW Library -- Fast Buffered I/O on Sockets with Timeouts
4 * (c) 2008 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU Lesser General Public License.
10 #ifndef _UCW_FB_SOCKET_H
11 #define _UCW_FB_SOCKET_H
13 #include <ucw/fastbuf.h>
15 #ifdef CONFIG_UCW_CLEAN_ABI
16 #define fbsock_create ucw_fbsock_create
19 struct fbsock_params { /** Configuration of socket fastbuf. **/
24 void (*err)(void *data, uns flags, char *msg);
25 void *data; // Passed to the err callback
28 enum fbsock_err_flags { /** Description of a socket error **/
29 FBSOCK_READ = 1, // Happened during read
30 FBSOCK_WRITE = 2, // Happened during write
31 FBSOCK_TIMEOUT = 4, // The error is a timeout
35 * Create a new socket fastbuf.
36 * All information is passed by @par.
38 struct fastbuf *fbsock_create(struct fbsock_params *par);