Commit 2f48aee1 2f48aee1dc1182e00a078f2f2ada22a0de6de9d2 by Sergey Poznyakoff

(stream_get_fd2): New function.

(stream_set_fd): Changed type of the second arg.
1 parent e0622312
......@@ -62,7 +62,8 @@ extern void stream_destroy __P ((stream_t *, void *owner));
extern int stream_open __P ((stream_t));
extern int stream_close __P ((stream_t));
extern int stream_is_seekable __P ((stream_t));
extern int stream_get_fd __P ((stream_t , int *));
extern int stream_get_fd __P ((stream_t, int *));
extern int stream_get_fd2 __P ((stream_t, int *, int *));
extern int stream_read __P ((stream_t, char *, size_t, off_t,
size_t *));
extern int stream_readline __P ((stream_t, char *, size_t, off_t,
......@@ -105,7 +106,7 @@ extern int stream_set_close __P ((stream_t,
int (*_close) __PMT ((stream_t)), void *owner));
extern int stream_set_fd __P ((stream_t,
int (*_get_fd) __PMT ((stream_t, int *)), void *owner));
int (*_get_fd) __PMT ((stream_t, int *, int *)), void *owner));
extern int stream_set_read __P ((stream_t,
int (*_read) __PMT ((stream_t, char *, size_t, off_t, size_t *)),
......
......@@ -427,7 +427,15 @@ stream_get_fd (stream_t stream, int *pfd)
{
if (stream == NULL || stream->_get_fd == NULL)
return EINVAL;
return stream->_get_fd (stream, pfd);
return stream->_get_fd (stream, pfd, NULL);
}
int
stream_get_fd2 (stream_t stream, int *pfd1, int *pfd2)
{
if (stream == NULL || stream->_get_fd == NULL)
return EINVAL;
return stream->_get_fd (stream, pfd1, pfd2);
}
int
......@@ -544,7 +552,8 @@ stream_set_close (stream_t stream, int (*_close) (stream_t), void *owner)
}
int
stream_set_fd (stream_t stream, int (*_get_fd) (stream_t, int *), void *owner)
stream_set_fd (stream_t stream, int (*_get_fd) (stream_t, int *, int *),
void *owner)
{
if (stream == NULL)
return EINVAL;
......