summaryrefslogtreecommitdiffstats
path: root/src/H5FDstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FDstream.c')
-rw-r--r--src/H5FDstream.c157
1 files changed, 78 insertions, 79 deletions
diff --git a/src/H5FDstream.c b/src/H5FDstream.c
index e2d4736..0ca16ac 100644
--- a/src/H5FDstream.c
+++ b/src/H5FDstream.c
@@ -25,18 +25,17 @@
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5FD_stream_mask
-#include "H5private.h" /* library function */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FDpublic.h" /* Public file drivers */
+#include "H5FDstream.h" /* Stream file driver */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Pprivate.h" /* Property lists */
/* Only build this driver if it was configured with --with-Stream-VFD */
#ifdef H5_HAVE_STREAM
-#include "H5Eprivate.h" /* error handling */
-#include "H5FDpublic.h" /* Public VFD header */
-#include "H5FDstream.h" /* Stream VFD header */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* memory allocation */
-#include "H5Pprivate.h" /* property prototypes */
-
#ifdef H5FD_STREAM_HAVE_UNIX_SOCKETS
#ifdef H5_HAVE_SYS_TYPES_H
#include <sys/types.h> /* socket stuff */
@@ -228,7 +227,7 @@ hid_t H5FD_stream_init (void)
{
hid_t ret_value=H5FD_STREAM_g; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_stream_init, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_stream_init, FAIL)
if (H5I_VFL != H5Iget_type (H5FD_STREAM_g)) {
H5FD_STREAM_g = H5FDregister (&H5FD_stream_g);
@@ -246,7 +245,7 @@ hid_t H5FD_stream_init (void)
ret_value=H5FD_STREAM_g;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -276,15 +275,15 @@ herr_t H5Pset_fapl_stream (hid_t fapl_id, H5FD_stream_fapl_t *fapl)
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Pset_fapl_stream, FAIL);
+ FUNC_ENTER_API(H5Pset_fapl_stream, FAIL)
H5TRACE2 ("e", "ix", fapl_id, fapl);
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR (H5E_PLIST, H5E_BADTYPE, FAIL, "not a fapl");
+ HGOTO_ERROR (H5E_PLIST, H5E_BADTYPE, FAIL, "not a fapl")
if (fapl) {
if (! fapl->do_socket_io && fapl->broadcast_fn == NULL)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "read broadcast function pointer is NULL");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "read broadcast function pointer is NULL")
user_fapl = *fapl;
if (fapl->increment == 0)
@@ -296,7 +295,7 @@ herr_t H5Pset_fapl_stream (hid_t fapl_id, H5FD_stream_fapl_t *fapl)
ret_value = H5P_set_driver (plist, H5FD_STREAM, &default_fapl);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -321,21 +320,21 @@ herr_t H5Pget_fapl_stream(hid_t fapl_id, H5FD_stream_fapl_t *fapl /* out */)
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Pget_fapl_stream, FAIL);
+ FUNC_ENTER_API(H5Pget_fapl_stream, FAIL)
H5TRACE2("e","ix",fapl_id,fapl);
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR (H5E_PLIST, H5E_BADTYPE, FAIL, "not a fapl");
+ HGOTO_ERROR (H5E_PLIST, H5E_BADTYPE, FAIL, "not a fapl")
if (H5FD_STREAM != H5P_get_driver (plist))
- HGOTO_ERROR (H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
+ HGOTO_ERROR (H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
if (NULL == (this_fapl = H5P_get_driver_info (plist)))
- HGOTO_ERROR (H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info");
+ HGOTO_ERROR (H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
if (fapl)
*fapl = *this_fapl;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -361,10 +360,10 @@ H5FD_stream_fapl_get (H5FD_t *_stream)
H5FD_stream_fapl_t *fapl;
void *ret_value;
- FUNC_ENTER_NOAPI(H5FD_stream_fapl_get, NULL);
+ FUNC_ENTER_NOAPI(H5FD_stream_fapl_get, NULL)
if ((fapl = H5MM_calloc (sizeof (H5FD_stream_fapl_t))) == NULL)
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
+ HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
*fapl = stream->fapl;
@@ -372,7 +371,7 @@ H5FD_stream_fapl_get (H5FD_t *_stream)
ret_value=fapl;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -389,20 +388,20 @@ H5FD_stream_open_socket (const char *filename, int o_flags,
int on = 1;
H5FD_STREAM_SOCKET_TYPE ret_value=H5FD_STREAM_INVALID_SOCKET;
- FUNC_ENTER_NOINIT(H5FD_stream_open_socket);
+ FUNC_ENTER_NOINIT(H5FD_stream_open_socket)
/* Parse "hostname:port" from filename argument */
for (separator = filename; *separator != ':' && *separator; separator++)
;
if (separator == filename || !*separator) {
- HGOTO_ERROR(H5E_ARGS,H5E_BADVALUE,H5FD_STREAM_INVALID_SOCKET,"invalid host address");
+ HGOTO_ERROR(H5E_ARGS,H5E_BADVALUE,H5FD_STREAM_INVALID_SOCKET,"invalid host address")
} else {
tmp = separator;
if (! tmp[1])
- HGOTO_ERROR(H5E_ARGS,H5E_BADVALUE,H5FD_STREAM_INVALID_SOCKET,"no port number");
+ HGOTO_ERROR(H5E_ARGS,H5E_BADVALUE,H5FD_STREAM_INVALID_SOCKET,"no port number")
while (*++tmp) {
if (! isdigit (*tmp))
- HGOTO_ERROR(H5E_ARGS,H5E_BADVALUE,H5FD_STREAM_INVALID_SOCKET,"invalid port number");
+ HGOTO_ERROR(H5E_ARGS,H5E_BADVALUE,H5FD_STREAM_INVALID_SOCKET,"invalid port number")
}
}
@@ -410,7 +409,7 @@ H5FD_stream_open_socket (const char *filename, int o_flags,
/* Return if out of memory */
if (hostname == NULL)
- HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"memory allocation failed");
+ HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"memory allocation failed")
HDstrncpy (hostname, filename, (size_t)(separator - filename));
hostname[separator - filename] = 0;
@@ -421,9 +420,9 @@ H5FD_stream_open_socket (const char *filename, int o_flags,
server.sin_port = htons (fapl->port);
if (! (he = gethostbyname (hostname))) {
- HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to get host address");
+ HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to get host address")
} else if (H5FD_STREAM_ERROR_CHECK (sock = socket (AF_INET, SOCK_STREAM, 0)))
- HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to open socket");
+ HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to open socket")
if (O_RDONLY == o_flags) {
HDmemcpy (&server.sin_addr, he->h_addr, (size_t)he->h_length);
@@ -432,18 +431,18 @@ H5FD_stream_open_socket (const char *filename, int o_flags,
hostname, fapl->port);
#endif
if (connect (sock, (struct sockaddr *) &server, sizeof (server)) < 0)
- HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to connect");
+ HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to connect")
}
else {
server.sin_addr.s_addr = INADDR_ANY;
if (H5FD_STREAM_IOCTL_SOCKET (sock, FIONBIO, &on) < 0) {
- HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to set non-blocking mode for socket");
+ HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to set non-blocking mode for socket")
} else if (setsockopt (sock, IPPROTO_TCP, TCP_NODELAY, (const char *) &on,
sizeof(on)) < 0) {
- HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to set socket option TCP_NODELAY");
+ HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to set socket option TCP_NODELAY")
} else if (setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, (const char *) &on,
sizeof(on)) < 0) {
- HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to set socket option SO_REUSEADDR");
+ HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to set socket option SO_REUSEADDR")
} else {
/* Try to bind the socket to the given port.
If maxhunt is given try some successive ports also. */
@@ -460,10 +459,10 @@ H5FD_stream_open_socket (const char *filename, int o_flags,
}
if (fapl->port > first_port + fapl->maxhunt) {
fapl->port = 0;
- HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to bind socket");
+ HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to bind socket")
}
else if (listen (sock, fapl->backlog) < 0)
- HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to listen on socket");
+ HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to listen on socket")
}
}
@@ -481,7 +480,7 @@ done:
H5FD_STREAM_CLOSE_SOCKET(sock);
} /* end if */
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -493,7 +492,7 @@ H5FD_stream_read_from_socket (H5FD_stream_t *stream)
unsigned char *ptr=NULL;
herr_t ret_value=SUCCEED;
- FUNC_ENTER_NOINIT(H5FD_stream_read_from_socket);
+ FUNC_ENTER_NOINIT(H5FD_stream_read_from_socket)
stream->eof = 0;
stream->mem = NULL;
@@ -510,7 +509,7 @@ H5FD_stream_read_from_socket (H5FD_stream_t *stream)
max_size++;
ptr = H5MM_realloc (stream->mem, (size_t) (stream->eof + max_size));
if (! ptr)
- HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,FAIL,"unable to allocate file space buffer");
+ HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,FAIL,"unable to allocate file space buffer")
stream->mem = ptr;
ptr += stream->eof;
}
@@ -521,7 +520,7 @@ H5FD_stream_read_from_socket (H5FD_stream_t *stream)
if (size < 0 && (EINTR == errno || EAGAIN == errno || EWOULDBLOCK))
continue;
if (size < 0)
- HGOTO_ERROR(H5E_IO,H5E_READERROR,FAIL,"error reading from file from socket");
+ HGOTO_ERROR(H5E_IO,H5E_READERROR,FAIL,"error reading from file from socket")
if (! size)
break;
max_size -= (size_t) size;
@@ -538,7 +537,7 @@ H5FD_stream_read_from_socket (H5FD_stream_t *stream)
(int) stream->eof);
#endif
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -574,15 +573,15 @@ H5FD_stream_open (const char *filename,
H5P_genplist_t *plist=NULL; /* Property list pointer */
H5FD_t *ret_value; /* Function return value */
- FUNC_ENTER_NOAPI(H5FD_stream_open, NULL);
+ FUNC_ENTER_NOAPI(H5FD_stream_open, NULL)
/* Check arguments */
if (filename == NULL|| *filename == '\0')
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, NULL,"invalid file name");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, NULL,"invalid file name")
if (maxaddr == 0 || HADDR_UNDEF == maxaddr)
- HGOTO_ERROR (H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr")
if (ADDR_OVERFLOW (maxaddr))
- HGOTO_ERROR (H5E_ARGS, H5E_OVERFLOW, NULL, "maxaddr overflow");
+ HGOTO_ERROR (H5E_ARGS, H5E_OVERFLOW, NULL, "maxaddr overflow")
/* Build the open flags */
o_flags = (H5F_ACC_RDWR & flags) ? O_RDWR : O_RDONLY;
@@ -591,17 +590,17 @@ H5FD_stream_open (const char *filename,
if (H5F_ACC_EXCL & flags) o_flags |= O_EXCL;
if ((O_RDWR & o_flags) && ! (O_CREAT & o_flags))
- HGOTO_ERROR (H5E_ARGS, H5E_UNSUPPORTED, NULL, "open stream for read/write not supported");
+ HGOTO_ERROR (H5E_ARGS, H5E_UNSUPPORTED, NULL, "open stream for read/write not supported")
#ifdef WIN32
if (WSAStartup (MAKEWORD (2, 0), &wsadata))
- HGOTO_ERROR (H5E_IO, H5E_CANTINIT, NULL, "Couldn't start Win32 socket layer");
+ HGOTO_ERROR (H5E_IO, H5E_CANTINIT, NULL, "Couldn't start Win32 socket layer")
#endif
fapl = NULL;
if (H5P_FILE_ACCESS_DEFAULT != fapl_id) {
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
fapl = H5P_get_driver_info (plist);
}
if (fapl == NULL)
@@ -610,7 +609,7 @@ H5FD_stream_open (const char *filename,
/* Create the new file struct */
stream = (H5FD_stream_t *) H5MM_calloc (sizeof (H5FD_stream_t));
if (stream == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct")
stream->fapl = *fapl;
stream->socket = H5FD_STREAM_INVALID_SOCKET;
@@ -631,7 +630,7 @@ H5FD_stream_open (const char *filename,
H5P_set_driver (plist, H5FD_STREAM, &stream->fapl);
}
else
- HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "can't open internal socket");
+ HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "can't open internal socket")
}
}
@@ -642,18 +641,18 @@ H5FD_stream_open (const char *filename,
fprintf (stderr, "Stream VFD: reading file from socket\n");
#endif
if(H5FD_stream_read_from_socket (stream)<0)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "can't read file from socket");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "can't read file from socket")
}
/* Now call the user's broadcast routine if given */
if (fapl->broadcast_fn) {
if ((fapl->broadcast_fn) (&stream->mem, &stream->eof,
fapl->broadcast_arg) < 0)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "broadcast error");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "broadcast error")
/* check for filesize of zero bytes */
if (stream->eof == 0)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "zero filesize");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "zero filesize")
}
/* For files which are read from a socket:
@@ -677,7 +676,7 @@ done:
} /* end if */
}
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -710,7 +709,7 @@ H5FD_stream_flush (H5FD_t *_stream, hid_t UNUSED dxpl_id, unsigned UNUSED closin
H5FD_STREAM_SOCKET_TYPE sock;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_stream_flush, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_stream_flush, FAIL)
/* Write to backing store */
if (stream->dirty && ! H5FD_STREAM_ERROR_CHECK (stream->socket)) {
@@ -750,7 +749,7 @@ H5FD_stream_flush (H5FD_t *_stream, hid_t UNUSED dxpl_id, unsigned UNUSED closin
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -775,7 +774,7 @@ H5FD_stream_close (H5FD_t *_stream)
H5FD_stream_t *stream = (H5FD_stream_t *) _stream;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_stream_close, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_stream_close, FAIL)
/* Release resources */
if (! H5FD_STREAM_ERROR_CHECK (stream->socket) && stream->internal_socket)
@@ -786,7 +785,7 @@ H5FD_stream_close (H5FD_t *_stream)
H5MM_xfree (stream);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -813,7 +812,7 @@ H5FD_stream_query(const H5FD_t UNUSED * _f,
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_stream_query, SUCCEED);
+ FUNC_ENTER_NOAPI(H5FD_stream_query, SUCCEED)
/* Set the VFL feature flags that this driver supports */
if (flags) {
@@ -824,7 +823,7 @@ H5FD_stream_query(const H5FD_t UNUSED * _f,
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -851,13 +850,13 @@ H5FD_stream_get_eoa (H5FD_t *_stream)
H5FD_stream_t *stream = (H5FD_stream_t *) _stream;
haddr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_stream_get_eoa, HADDR_UNDEF);
+ FUNC_ENTER_NOAPI(H5FD_stream_get_eoa, HADDR_UNDEF)
/* Set return value */
ret_value=stream->eoa;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -884,15 +883,15 @@ H5FD_stream_set_eoa (H5FD_t *_stream, haddr_t addr)
H5FD_stream_t *stream = (H5FD_stream_t *) _stream;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_stream_set_eoa, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_stream_set_eoa, FAIL)
if (ADDR_OVERFLOW (addr))
- HGOTO_ERROR (H5E_ARGS, H5E_OVERFLOW, FAIL, "address overflow");
+ HGOTO_ERROR (H5E_ARGS, H5E_OVERFLOW, FAIL, "address overflow")
stream->eoa = addr;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -921,13 +920,13 @@ H5FD_stream_get_eof (H5FD_t *_stream)
H5FD_stream_t *stream = (H5FD_stream_t *) _stream;
haddr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_stream_get_eof, HADDR_UNDEF);
+ FUNC_ENTER_NOAPI(H5FD_stream_get_eof, HADDR_UNDEF)
/* Set return value */
ret_value= MAX (stream->eof, stream->eoa);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -951,15 +950,15 @@ 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);
+ FUNC_ENTER_NOAPI(H5FD_stream_get_handle, FAIL)
if(!file_handle)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
*file_handle = &(file->socket);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -994,18 +993,18 @@ H5FD_stream_read (H5FD_t *_stream,
size_t nbytes;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_stream_read, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_stream_read, FAIL)
assert (stream && stream->pub.cls);
assert (buf);
/* Check for overflow conditions */
if (HADDR_UNDEF == addr)
- HGOTO_ERROR (H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed");
+ HGOTO_ERROR (H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed")
if (REGION_OVERFLOW (addr, size))
- HGOTO_ERROR (H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed");
+ HGOTO_ERROR (H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed")
if (addr + size > stream->eoa)
- HGOTO_ERROR (H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed");
+ HGOTO_ERROR (H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed")
/* Read the part which is before the EOF marker */
if (addr < stream->eof) {
@@ -1021,7 +1020,7 @@ H5FD_stream_read (H5FD_t *_stream,
HDmemset (buf, 0, size);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1053,16 +1052,16 @@ H5FD_stream_write (H5FD_t *_stream,
H5FD_stream_t *stream = (H5FD_stream_t *) _stream;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_stream_write, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_stream_write, FAIL)
assert (stream && stream->pub.cls);
assert (buf);
/* Check for overflow conditions */
if (REGION_OVERFLOW (addr, size))
- HGOTO_ERROR (H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed");
+ HGOTO_ERROR (H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed")
if (addr + size > stream->eoa)
- HGOTO_ERROR (H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed");
+ HGOTO_ERROR (H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed")
/*
* Allocate more memory if necessary, careful of overflow. Also, if the
@@ -1082,7 +1081,7 @@ H5FD_stream_write (H5FD_t *_stream,
else
x = H5MM_realloc (stream->mem, (size_t) new_eof);
if (x == NULL)
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block");
+ HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block")
stream->mem = x;
stream->eof = new_eof;
}
@@ -1092,7 +1091,7 @@ H5FD_stream_write (H5FD_t *_stream,
stream->dirty = TRUE;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
#endif /* H5_HAVE_STREAM */