view src/lib/iostream-internal.h @ 953:411006be3c66 HEAD

Naming change for function typedefs.
author Timo Sirainen <tss@iki.fi>
date Sat, 11 Jan 2003 21:55:56 +0200
parents fd8888f6f037
children c972ea085643
line wrap: on
line source

#ifndef __IOSTREAM_INTERNAL_H
#define __IOSTREAM_INTERNAL_H

/* This file is private to IStream and OStream implementation */

struct _iostream {
	pool_t pool;
	int refcount;

	void (*close)(struct _iostream *stream);
	void (*destroy)(struct _iostream *stream);
	void (*set_max_buffer_size)(struct _iostream *stream, size_t max_size);
	void (*set_blocking)(struct _iostream *stream, int timeout_msecs,
			     void (*timeout_cb)(void *), void *context);
};

void _io_stream_init(pool_t pool, struct _iostream *stream);
void _io_stream_ref(struct _iostream *stream);
void _io_stream_unref(struct _iostream *stream);
void _io_stream_close(struct _iostream *stream);
void _io_stream_set_max_buffer_size(struct _iostream *stream, size_t max_size);
void _io_stream_set_blocking(struct _iostream *stream, int timeout_msecs,
			     void (*timeout_cb)(void *), void *context);

#define GET_TIMEOUT_TIME(fstream) \
        ((fstream)->timeout_msecs == 0 ? 0 : \
	 time(NULL) + ((fstream)->timeout_msecs / 1000))
#define STREAM_IS_BLOCKING(fstream) \
	((fstream)->timeout_msecs != 0)

#endif