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)); ...@@ -62,7 +62,8 @@ extern void stream_destroy __P ((stream_t *, void *owner));
62 extern int stream_open __P ((stream_t)); 62 extern int stream_open __P ((stream_t));
63 extern int stream_close __P ((stream_t)); 63 extern int stream_close __P ((stream_t));
64 extern int stream_is_seekable __P ((stream_t)); 64 extern int stream_is_seekable __P ((stream_t));
65 extern int stream_get_fd __P ((stream_t , int *)); 65 extern int stream_get_fd __P ((stream_t, int *));
66 extern int stream_get_fd2 __P ((stream_t, int *, int *));
66 extern int stream_read __P ((stream_t, char *, size_t, off_t, 67 extern int stream_read __P ((stream_t, char *, size_t, off_t,
67 size_t *)); 68 size_t *));
68 extern int stream_readline __P ((stream_t, char *, size_t, off_t, 69 extern int stream_readline __P ((stream_t, char *, size_t, off_t,
...@@ -105,7 +106,7 @@ extern int stream_set_close __P ((stream_t, ...@@ -105,7 +106,7 @@ extern int stream_set_close __P ((stream_t,
105 int (*_close) __PMT ((stream_t)), void *owner)); 106 int (*_close) __PMT ((stream_t)), void *owner));
106 107
107 extern int stream_set_fd __P ((stream_t, 108 extern int stream_set_fd __P ((stream_t,
108 int (*_get_fd) __PMT ((stream_t, int *)), void *owner)); 109 int (*_get_fd) __PMT ((stream_t, int *, int *)), void *owner));
109 110
110 extern int stream_set_read __P ((stream_t, 111 extern int stream_set_read __P ((stream_t,
111 int (*_read) __PMT ((stream_t, char *, size_t, off_t, size_t *)), 112 int (*_read) __PMT ((stream_t, char *, size_t, off_t, size_t *)),
......
...@@ -427,7 +427,15 @@ stream_get_fd (stream_t stream, int *pfd) ...@@ -427,7 +427,15 @@ stream_get_fd (stream_t stream, int *pfd)
427 { 427 {
428 if (stream == NULL || stream->_get_fd == NULL) 428 if (stream == NULL || stream->_get_fd == NULL)
429 return EINVAL; 429 return EINVAL;
430 return stream->_get_fd (stream, pfd); 430 return stream->_get_fd (stream, pfd, NULL);
431 }
432
433 int
434 stream_get_fd2 (stream_t stream, int *pfd1, int *pfd2)
435 {
436 if (stream == NULL || stream->_get_fd == NULL)
437 return EINVAL;
438 return stream->_get_fd (stream, pfd1, pfd2);
431 } 439 }
432 440
433 int 441 int
...@@ -544,7 +552,8 @@ stream_set_close (stream_t stream, int (*_close) (stream_t), void *owner) ...@@ -544,7 +552,8 @@ stream_set_close (stream_t stream, int (*_close) (stream_t), void *owner)
544 } 552 }
545 553
546 int 554 int
547 stream_set_fd (stream_t stream, int (*_get_fd) (stream_t, int *), void *owner) 555 stream_set_fd (stream_t stream, int (*_get_fd) (stream_t, int *, int *),
556 void *owner)
548 { 557 {
549 if (stream == NULL) 558 if (stream == NULL)
550 return EINVAL; 559 return EINVAL;
......