Commit 9723db64 authored by Niels Möller's avatar Niels Möller
Browse files

* src/io.h (close_callback): Deleted old close_callback code.

Moved classes io_backend and callout to io.c.

Rev: src/io.h:1.67
parent 1fca65f4
......@@ -33,6 +33,8 @@
#include <time.h>
#include <netdb.h>
/* For sig_atomic_t */
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
......@@ -42,33 +44,10 @@
#include "io.h.x"
#if 0
/* Close callbacks are called with a reason as argument. */
/* End of file while reading.
* Or when a closed write_buffer has been flushed successfully.
* Or when poll() returns POLLHUP. */
/* FIXME: Should we use separate codes for these two events? */
#define CLOSE_EOF 1
/* EPIPE when writing */
/* #define CLOSE_READ_FAILED 4 */
/* ;; GABA:
(name close_callback)
(f method void "int reason")))
#define CLOSE_CALLBACK(c, r) ((c)->f((c), (r)))
/* Declare the class object, so that io_commands.c can refer to it for
* type-checking. */
extern struct lsh_class io_backend_class;
/* GABA:
......@@ -214,30 +193,6 @@ struct listen_value *
make_listen_value(struct lsh_fd *fd,
struct address_info *peer);
/* Scheduled calls. FIXME: For now, no scheduling in time. */
/* GABA:
(name callout)
(next object callout)
(action object lsh_callback)))
;; (when . time_t)
/* GABA:
(name io_backend)
; Linked list of fds.
(files object lsh_fd)
; Stack of closed files
;; (closed object lsh_fd)
; Callouts
(callouts object callout)))
/* I/O exceptions */
/* GABA:
......@@ -261,11 +216,25 @@ make_io_exception(UINT32 type, struct lsh_fd *fd, int error, const char *msg);
extern const struct exception finish_read_exception;
extern const struct exception finish_io_exception;
struct io_backend *
#if 0
void init_backend(struct io_backend *b);
int io_iter(struct io_backend *b);
void io_run(struct io_backend *b);
struct resource *
io_signal_handler(struct io_backend *b,
sig_atomic_t *flag,
struct lsh_callback *action);
struct resource *
io_callout(struct io_backend *b,
UINT32 delay,
struct lsh_callback *action);
int blocking_read(int fd, struct read_handler *r);
int get_portno(const char *service, const char *protocol);
Markdown is supported
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