summaryrefslogtreecommitdiffstats
path: root/src/H5Olinfo.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-03-06 20:38:01 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-03-06 20:38:01 (GMT)
commit25bcff76811f8f038875f639688a09f641ff34ef (patch)
tree82d96f9e9e23ebc6d4e621a45ec4a13a79df1734 /src/H5Olinfo.c
parent5c4bffc0d1defb6ef33757a351f744e718c8488d (diff)
downloadhdf5-25bcff76811f8f038875f639688a09f641ff34ef.zip
hdf5-25bcff76811f8f038875f639688a09f641ff34ef.tar.gz
hdf5-25bcff76811f8f038875f639688a09f641ff34ef.tar.bz2
[svn-r13472] Description:
Add new object header message to track attribute information (unused currently). Tested on: Mac OS X/32 10.4.8 (amazon)
Diffstat (limited to 'src/H5Olinfo.c')
-rw-r--r--src/H5Olinfo.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c
index 6184d07..e3ea8fd 100644
--- a/src/H5Olinfo.c
+++ b/src/H5Olinfo.c
@@ -77,8 +77,9 @@ const H5O_msg_class_t H5O_MSG_LINFO[1] = {{
#define H5O_LINFO_VERSION 0
/* Flags for link info index flag encoding */
-#define H5O_LINFO_INDEX_NAME 0x01
-#define H5O_LINFO_INDEX_CORDER 0x02
+#define H5O_LINFO_INDEX_NAME 0x01
+#define H5O_LINFO_INDEX_CORDER 0x02
+#define H5O_LINFO_ALL_FLAGS (H5O_LINFO_INDEX_NAME | H5O_LINFO_INDEX_CORDER)
/* Data exchange structure to use when copying links from src to dst */
typedef struct {
@@ -89,18 +90,16 @@ typedef struct {
H5O_copy_t *cpy_info; /* Information for copy operation */
} H5O_linfo_postcopy_ud_t;
-/* Declare a free list to manage the hsize_t struct */
+/* Declare a free list to manage the H5O_linfo_t struct */
H5FL_DEFINE_STATIC(H5O_linfo_t);
/*-------------------------------------------------------------------------
* Function: H5O_linfo_decode
*
- * Purpose: Decode a message and return a pointer to
- * a newly allocated one.
- *
- * Return: Success: Ptr to new message in native order.
+ * Purpose: Decode a message and return a pointer to a newly allocated one.
*
+ * Return: Success: Ptr to new message in native form.
* Failure: NULL
*
* Programmer: Quincey Koziol
@@ -113,8 +112,8 @@ static void *
H5O_linfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags,
const uint8_t *p)
{
- unsigned char index_flags; /* Flags for encoding link index info */
H5O_linfo_t *linfo = NULL; /* Link info */
+ unsigned char index_flags; /* Flags for encoding link index info */
void *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5O_linfo_decode)
@@ -134,6 +133,8 @@ H5O_linfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags,
/* Get the index flags for the group */
index_flags = *p++;
HDassert(index_flags & H5O_LINFO_INDEX_NAME);
+ if(index_flags & ~H5O_LINFO_ALL_FLAGS)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad flag value for message")
linfo->index_corder = (index_flags & H5O_LINFO_INDEX_CORDER) ? TRUE : FALSE;
/* Number of links in the group */
@@ -231,7 +232,6 @@ H5O_linfo_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void
* necessary.
*
* Return: Success: Ptr to _DEST
- *
* Failure: NULL
*
* Programmer: Quincey Koziol
@@ -273,7 +273,6 @@ done:
* This function doesn't take into account alignment.
*
* Return: Success: Message data size in bytes without alignment.
- *
* Failure: zero
*
* Programmer: Quincey Koziol