summaryrefslogtreecommitdiffstats
path: root/src/H5FDstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FDstream.c')
-rw-r--r--src/H5FDstream.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/H5FDstream.c b/src/H5FDstream.c
index 2883d13..ee3ca99 100644
--- a/src/H5FDstream.c
+++ b/src/H5FDstream.c
@@ -159,6 +159,7 @@ static herr_t H5FD_stream_query(const H5FD_t *_f1, unsigned long *flags);
static haddr_t H5FD_stream_get_eoa (H5FD_t *_stream);
static herr_t H5FD_stream_set_eoa (H5FD_t *_stream, haddr_t addr);
static haddr_t H5FD_stream_get_eof (H5FD_t *_stream);
+static herr_t H5FD_stream_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle);
static herr_t H5FD_stream_read (H5FD_t *_stream, H5FD_mem_t type,
hid_t fapl_id, haddr_t addr,
size_t size, void *buf);
@@ -191,6 +192,7 @@ static const H5FD_class_t H5FD_stream_g =
H5FD_stream_get_eoa, /* get_eoa */
H5FD_stream_set_eoa, /* set_eoa */
H5FD_stream_get_eof, /* get_eof */
+ H5FD_stream_get_handle, /* get_handle */
H5FD_stream_read, /* read */
H5FD_stream_write, /* write */
H5FD_stream_flush, /* flush */
@@ -929,6 +931,38 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5FD_stream_get_handle
+ *
+ * Purpose: Returns the file handle of stream file driver.
+ *
+ * Returns: Non-negative if succeed or negative if fails.
+ *
+ * Programmer: Raymond Lu
+ * Sept. 16, 2002
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_stream_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle)
+{
+ H5FD_stream_t *file = (H5FD_stream_t *)_file;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI(H5FD_stream_get_handle, FAIL);
+
+ if(!file_handle)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid");
+
+ *file_handle = &(file->socket);
+
+done:
+ FUNC_LEAVE(ret_value);
+}
+
+
+/*-------------------------------------------------------------------------
* Function: H5FD_stream_read
*
* Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR