Commit 404545e4 authored by Niels Möller's avatar Niels Möller
Browse files

Added prototypes.

Rev: src/io.h:1.4
parent a5cc244e
......@@ -5,6 +5,9 @@
#include <time.h>
#include <netdb.h>
#include "abstract_io.h"
#include "write_buffer.h"
......@@ -13,6 +16,8 @@ struct io_fd
struct io_fd *next;
int fd;
int please_close;
/* Reading */
struct read_handler *handler;
int on_hold; /* For flow control */
......@@ -27,7 +32,7 @@ struct fd_callback;
typedef int (*fd_callback_f)(struct callback *closure, int fd);
struct fd_callback
callback_f f;
fd_callback_f f;
#define FD_CALLBACK(c, fd) ((c)->f(c, (fd)))
......@@ -66,4 +71,29 @@ struct io_backend
struct callout *callouts;
void io_run(struct io_backend *b);
int get_inaddr(struct sockaddr_in * addr,
const char * host,
const char * service,
const char * protocol);
void io_set_nonblocking(int fd);
struct connect_fd *io_connect(struct io_backend *b,
struct sockaddr_in *remote,
struct sockaddr_in *local,
struct fd_callback *f);
struct listen_fd *io_listen(struct io_backend *b,
struct sockaddr_in *local,
struct fd_callback *callback);
struct abstract_write *io_read_write(struct io_backend *b,
int fd,
struct read_handler *read_callback,
UINT32 block_size,
struct callback *close_callback);
#endif /* LSH_IO_H_INCLUDED */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment