summaryrefslogtreecommitdiffstats
path: root/src/H5Odrvinfo.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-10-01 16:47:45 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-10-01 16:47:45 (GMT)
commit1ba1f2f3222cbe8df0bf601929a4bffd478d7e02 (patch)
treeae51dfc33cf40432dad25a5088767115a98f195e /src/H5Odrvinfo.c
parent8eef7d295cc3dd134aef0a826f1de4287629996d (diff)
downloadhdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.zip
hdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.tar.gz
hdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.tar.bz2
Source formatted
Diffstat (limited to 'src/H5Odrvinfo.c')
-rw-r--r--src/H5Odrvinfo.c129
1 files changed, 60 insertions, 69 deletions
diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c
index fd8ad6b..7a84df5 100644
--- a/src/H5Odrvinfo.c
+++ b/src/H5Odrvinfo.c
@@ -11,7 +11,6 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
* Thursday, March 1, 2007
*
@@ -19,50 +18,49 @@
* in the superblock extension.
*/
-#define H5O_PACKAGE /*suppress error about including H5Opkg */
+#define H5O_PACKAGE /*suppress error about including H5Opkg */
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Opkg.h" /* Object headers */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Opkg.h" /* Object headers */
+#include "H5MMprivate.h" /* Memory management */
-static void *H5O_drvinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
+static void * H5O_drvinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void *H5O_drvinfo_copy(const void *_mesg, void *_dest);
+static void * H5O_drvinfo_copy(const void *_mesg, void *_dest);
static size_t H5O_drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O_drvinfo_reset(void *_mesg);
-static herr_t H5O_drvinfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream,
- int indent, int fwidth);
+static herr_t H5O_drvinfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent,
+ int fwidth);
/* This message derives from H5O message class */
const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{
- H5O_DRVINFO_ID, /*message id number */
- "driver info", /*message name for debugging */
- sizeof(H5O_drvinfo_t), /*native message size */
- 0, /* messages are sharable? */
- H5O_drvinfo_decode, /*decode message */
- H5O_drvinfo_encode, /*encode message */
- H5O_drvinfo_copy, /*copy the native value */
- H5O_drvinfo_size, /*raw message size */
- H5O_drvinfo_reset, /*free internal memory */
- NULL, /* free method */
- NULL, /* file delete method */
- NULL, /* link method */
- NULL, /*set share method */
- NULL, /*can share method */
- NULL, /* pre copy native value to file */
- NULL, /* copy native value to file */
- NULL, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O_drvinfo_debug /*debug the message */
+ H5O_DRVINFO_ID, /*message id number */
+ "driver info", /*message name for debugging */
+ sizeof(H5O_drvinfo_t), /*native message size */
+ 0, /* messages are sharable? */
+ H5O_drvinfo_decode, /*decode message */
+ H5O_drvinfo_encode, /*encode message */
+ H5O_drvinfo_copy, /*copy the native value */
+ H5O_drvinfo_size, /*raw message size */
+ H5O_drvinfo_reset, /*free internal memory */
+ NULL, /* free method */
+ NULL, /* file delete method */
+ NULL, /* link method */
+ NULL, /*set share method */
+ NULL, /*can share method */
+ NULL, /* pre copy native value to file */
+ NULL, /* copy native value to file */
+ NULL, /* post copy native value to file */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O_drvinfo_debug /*debug the message */
}};
/* Current version of driver info information */
-#define H5O_DRVINFO_VERSION 0
+#define H5O_DRVINFO_VERSION 0
-
/*-------------------------------------------------------------------------
* Function: H5O_drvinfo_decode
*
@@ -79,11 +77,11 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{
*/
static void *
H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
- size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
- H5O_drvinfo_t *mesg; /* Native message */
- void *ret_value; /* Return value */
+ H5O_drvinfo_t *mesg; /* Native message */
+ void * ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -92,12 +90,12 @@ H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t
HDassert(p);
/* Version of message */
- if(*p++ != H5O_DRVINFO_VERSION)
+ if (*p++ != H5O_DRVINFO_VERSION)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for message")
/* Allocate space for message */
- if(NULL == (mesg = (H5O_drvinfo_t *)H5MM_calloc(sizeof(H5O_drvinfo_t))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for driver info message")
+ if (NULL == (mesg = (H5O_drvinfo_t *)H5MM_calloc(sizeof(H5O_drvinfo_t))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for driver info message")
/* Retrieve driver name */
HDmemcpy(mesg->name, p, 8);
@@ -109,9 +107,9 @@ H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t
HDassert(mesg->len);
/* Allocate space for buffer */
- if(NULL == (mesg->buf = (uint8_t *)H5MM_malloc(mesg->len))) {
+ if (NULL == (mesg->buf = (uint8_t *)H5MM_malloc(mesg->len))) {
mesg = (H5O_drvinfo_t *)H5MM_xfree(mesg);
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for driver info buffer")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for driver info buffer")
} /* end if */
/* Copy encoded driver info into buffer */
@@ -124,7 +122,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_drvinfo_decode() */
-
/*-------------------------------------------------------------------------
* Function: H5O_drvinfo_encode
*
@@ -138,7 +135,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
+H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
+ const void *_mesg)
{
const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
@@ -160,7 +158,6 @@ H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_share
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_drvinfo_encode() */
-
/*-------------------------------------------------------------------------
* Function: H5O_drvinfo_copy
*
@@ -178,26 +175,27 @@ H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_share
static void *
H5O_drvinfo_copy(const void *_mesg, void *_dest)
{
- const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
- H5O_drvinfo_t *dest = (H5O_drvinfo_t *)_dest;
- void *ret_value;
+ const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
+ H5O_drvinfo_t * dest = (H5O_drvinfo_t *)_dest;
+ void * ret_value;
FUNC_ENTER_NOAPI_NOINIT
/* Sanity check */
HDassert(mesg);
- if(!dest && NULL == (dest = (H5O_drvinfo_t *)H5MM_malloc(sizeof(H5O_drvinfo_t))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for shared message table message")
+ if (!dest && NULL == (dest = (H5O_drvinfo_t *)H5MM_malloc(sizeof(H5O_drvinfo_t))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
+ "memory allocation failed for shared message table message")
/* Shallow copy the fields */
*dest = *mesg;
/* Copy the buffer */
- if(NULL == (dest->buf = (uint8_t *)H5MM_malloc(mesg->len))) {
- if(dest != _dest)
+ if (NULL == (dest->buf = (uint8_t *)H5MM_malloc(mesg->len))) {
+ if (dest != _dest)
dest = (H5O_drvinfo_t *)H5MM_xfree(dest);
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
} /* end if */
HDmemcpy(dest->buf, mesg->buf, mesg->len);
@@ -208,7 +206,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_drvinfo_copy() */
-
/*-------------------------------------------------------------------------
* Function: H5O_drvinfo_size
*
@@ -227,7 +224,7 @@ static size_t
H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
- size_t ret_value;
+ size_t ret_value;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -235,15 +232,14 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s
HDassert(f);
HDassert(mesg);
- ret_value = 1 + /* Version number */
- 8 + /* Driver name */
- 2 + /* Buffer length */
- mesg->len; /* Buffer */
+ ret_value = 1 + /* Version number */
+ 8 + /* Driver name */
+ 2 + /* Buffer length */
+ mesg->len; /* Buffer */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_drvinfo_size() */
-
/*-------------------------------------------------------------------------
* Function: H5O_drvinfo_reset
*
@@ -261,7 +257,7 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s
static herr_t
H5O_drvinfo_reset(void *_mesg)
{
- H5O_drvinfo_t *mesg = (H5O_drvinfo_t *) _mesg;
+ H5O_drvinfo_t *mesg = (H5O_drvinfo_t *)_mesg;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -274,7 +270,6 @@ H5O_drvinfo_reset(void *_mesg)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_drvinfo_reset() */
-
/*-------------------------------------------------------------------------
* Function: H5O_drvinfo_debug
*
@@ -289,7 +284,7 @@ H5O_drvinfo_reset(void *_mesg)
*/
static herr_t
H5O_drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream,
- int indent, int fwidth)
+ int indent, int fwidth)
{
const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
@@ -302,12 +297,8 @@ H5O_drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const v
HDassert(indent >= 0);
HDassert(fwidth >= 0);
- HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Driver name:", mesg->name);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "Buffer size:", mesg->len);
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Driver name:", mesg->name);
+ HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Buffer size:", mesg->len);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_drvinfo_debug() */
-
-