From 0c9bd3d4e27b7188825c6e71fc47931fdfb8ed1c Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 22 Jan 2007 22:46:31 -0500 Subject: [svn-r13176] Description: Push code further toward shared message method calling refactor. Tested on: FreeBSD/32 6.2 (duty) Too minor to require h5committest --- src/H5Oalloc.c | 2 +- src/H5Oattr.c | 36 ++++++++++++----------------------- src/H5Obogus.c | 19 ++++++++----------- src/H5Ocache.c | 2 +- src/H5Ocont.c | 7 +++---- src/H5Ocopy.c | 4 ++-- src/H5Odtype.c | 15 +++++---------- src/H5Oefl.c | 9 +++------ src/H5Ofill.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++------- src/H5Oginfo.c | 11 ++++------- src/H5Olayout.c | 23 +++++----------------- src/H5Olinfo.c | 11 +++++------ src/H5Olink.c | 9 +++++---- src/H5Omessage.c | 6 +++--- src/H5Omtime.c | 26 ++++++++++++------------- src/H5Oname.c | 19 ++++++++----------- src/H5Onull.c | 6 +++--- src/H5Opkg.h | 6 +++--- src/H5Opline.c | 21 ++++++++++++++++++-- src/H5Osdspace.c | 26 +++++++------------------ src/H5Oshared.c | 12 +++++------- src/H5Oshared.h | 2 +- src/H5Ostab.c | 13 +++++-------- 23 files changed, 171 insertions(+), 172 deletions(-) diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index bb23c2b..9c29783 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -1349,7 +1349,7 @@ H5O_remove_empty_chunks(H5F_t *f, H5O_t *oh, hid_t dxpl_id) /* Decode current continuation message if necessary */ if(NULL == cont_msg->native) { HDassert(H5O_MSG_CONT->decode); - cont_msg->native = (H5O_MSG_CONT->decode)(f, dxpl_id, cont_msg->raw); + cont_msg->native = (H5O_MSG_CONT->decode)(f, dxpl_id, 0, cont_msg->raw); if(NULL == cont_msg->native) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to decode message") } /* end if */ diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 1aba244..0503618 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -29,7 +29,7 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_attr_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static void *H5O_attr_copy(const void *_mesg, void *_dest); static size_t H5O_attr_size(const H5F_t *f, const void *_mesg); static herr_t H5O_attr_free(void *mesg); @@ -119,33 +119,21 @@ H5FL_EXTERN(H5S_extent_t); Decode a attribute message and return a pointer to a memory struct with the decoded information USAGE - void *H5O_attr_decode(f, raw_size, p) + void *H5O_attr_decode(f, dxpl_id, mesg_flags, p) H5F_t *f; IN: pointer to the HDF5 file struct - size_t raw_size; IN: size of the raw information buffer - const uint8_t *p; IN: the raw information buffer + hid_t dxpl_id; IN: DXPL for any I/O + unsigned mesg_flags; IN: Message flags to influence decoding + const uint8_t *p; IN: the raw information buffer RETURNS Pointer to the new message in native order on success, NULL on failure DESCRIPTION This function decodes the "raw" disk form of a attribute message into a struct in memory native format. The struct is allocated within this function using malloc() and is returned to the caller. - * - * Modifications: - * Robb Matzke, 17 Jul 1998 - * Added padding for alignment. - * - * Robb Matzke, 20 Jul 1998 - * Added a version number at the beginning. - * - * Raymond Lu, 8 April 2004 - * Changed Dataspace operation on H5S_simple_t to H5S_extent_t. - * - * James Laird, 15 November 2005 - * Added character encoding (version 3) - * --------------------------------------------------------------------------*/ static void * -H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p) +H5O_attr_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, + const uint8_t *p) { H5A_t *attr = NULL; H5S_extent_t *extent; /*extent dimensionality information */ @@ -202,7 +190,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p) H5O_shared_t *shared; /* Shared information */ /* Get the shared information */ - if(NULL == (shared = (H5O_shared_t *)(H5O_MSG_SHARED->decode)(f, dxpl_id, p))) + if(NULL == (shared = (H5O_shared_t *)(H5O_MSG_SHARED->decode)(f, dxpl_id, mesg_flags, p))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode shared message") /* Get the actual datatype information */ @@ -213,7 +201,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p) H5O_msg_free_real(H5O_MSG_SHARED, shared); } /* end if */ else { - if((attr->dt = (H5T_t *)(H5O_MSG_DTYPE->decode)(f, dxpl_id, p)) == NULL) + if((attr->dt = (H5T_t *)(H5O_MSG_DTYPE->decode)(f, dxpl_id, mesg_flags, p)) == NULL) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute datatype") } /* end else */ if(version < H5O_ATTR_VERSION_2) @@ -227,11 +215,11 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p) if(NULL == (attr->ds = H5FL_CALLOC(H5S_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - if (flags & H5O_ATTR_FLAG_SPACE_SHARED) { + if(flags & H5O_ATTR_FLAG_SPACE_SHARED) { H5O_shared_t *shared; /* Shared information */ /* Get the shared information */ - if(NULL == (shared = (H5O_shared_t *)(H5O_MSG_SHARED->decode)(f, dxpl_id, p))) + if(NULL == (shared = (H5O_shared_t *)(H5O_MSG_SHARED->decode)(f, dxpl_id, mesg_flags, p))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode shared message") /* Get the actual datatype information */ @@ -242,7 +230,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p) H5O_msg_free_real(H5O_MSG_SHARED, shared); } /* end if */ else { - if((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)(f, dxpl_id, p)) == NULL) + if((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)(f, dxpl_id, mesg_flags, p)) == NULL) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute dataspace") } /* end else */ diff --git a/src/H5Obogus.c b/src/H5Obogus.c index 627977e..93475cd 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -24,22 +24,20 @@ * correct operation when parsing unknown object header * messages. * - * Modifications: - * *------------------------------------------------------------------------- */ #define H5O_PACKAGE /*suppress error about including H5Opkg */ -#include "H5private.h" -#include "H5Eprivate.h" -#include "H5MMprivate.h" -#include "H5Opkg.h" /* Object header functions */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Opkg.h" /* Object headers */ #ifdef H5O_ENABLE_BOGUS /* PRIVATE PROTOTYPES */ -static void *H5O_bogus_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_bogus_decode(H5F_t *f, hid_t dxpl_id, unsigned UNUSED mesg_flags, const uint8_t *p); static herr_t H5O_bogus_encode(H5F_t *f, uint8_t *p, const void *_mesg); static size_t H5O_bogus_size(const H5F_t *f, const void *_mesg); static herr_t H5O_bogus_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, @@ -83,14 +81,13 @@ const H5O_msg_class_t H5O_MSG_BOGUS[1] = {{ * koziol@ncsa.uiuc.edu * Jan 21 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5O_bogus_decode(H5F_t UNUSED *f, hid_t dxpl_id, const uint8_t *p) +H5O_bogus_decode(H5F_t UNUSED *f, hid_t dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *p) { - H5O_bogus_t *mesg=NULL; + H5O_bogus_t *mesg = NULL; void *ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_bogus_decode); diff --git a/src/H5Ocache.c b/src/H5Ocache.c index dd09c0a..4309aa0 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -535,7 +535,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1, H5O_cont_t *cont; /* Decode continuation message */ - cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(f, dxpl_id, oh->mesg[curmesg].raw); + cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(f, dxpl_id, 0, oh->mesg[curmesg].raw); cont->chunkno = oh->nchunks; /*the next chunk to allocate */ /* Save 'native' form of continuation message */ diff --git a/src/H5Ocont.c b/src/H5Ocont.c index 8a83f0a..6146df8 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -36,7 +36,7 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_cont_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_cont_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static herr_t H5O_cont_encode(H5F_t *f, uint8_t *p, const void *_mesg); static size_t H5O_cont_size(const H5F_t *f, const void *_mesg); static herr_t H5O_cont_free(void *mesg); @@ -86,12 +86,11 @@ H5FL_DEFINE(H5O_cont_t); * matzke@llnl.gov * Aug 6 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5O_cont_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p) +H5O_cont_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *p) { H5O_cont_t *cont = NULL; void *ret_value; diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index f51533b..c1d7d04 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -420,7 +420,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, if(NULL == mesg_src->native) { /* Decode the message if necessary */ HDassert(copy_type->decode); - if(NULL == (mesg_src->native = (copy_type->decode)(oloc_src->file, dxpl_id, mesg_src->raw))) + if(NULL == (mesg_src->native = (copy_type->decode)(oloc_src->file, dxpl_id, mesg_src->flags, mesg_src->raw))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to decode a message") } /* end if (NULL == mesg_src->native) */ @@ -502,7 +502,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, if(NULL == mesg_src->native) { /* Decode the message if necessary */ HDassert(copy_type->decode); - if(NULL == (mesg_src->native = (copy_type->decode)(oloc_src->file, dxpl_id, mesg_src->raw))) + if(NULL == (mesg_src->native = (copy_type->decode)(oloc_src->file, dxpl_id, mesg_dst->flags, mesg_src->raw))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to decode a message") } /* end if (NULL == mesg_src->native) */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 2b06ea4..b1a0dc6 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -28,7 +28,7 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_dtype_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_dtype_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_dtype_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static void *H5O_dtype_copy(const void *_mesg, void *_dest); static size_t H5O_dtype_size(const H5F_t *f, const void *_mesg); static herr_t H5O_dtype_reset(void *_mesg); @@ -122,12 +122,6 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{ * Programmer: Robb Matzke * Monday, December 8, 1997 * - * Modifications: - * Robb Matzke, Thursday, May 20, 1999 - * Added support for bitfields and opaque datatypes. - * - * Raymond Lu. Monday, Mar 13, 2006 - * Added support for VAX floating-point types. *------------------------------------------------------------------------- */ static herr_t @@ -944,9 +938,10 @@ done: Decode a message and return a pointer to a memory struct with the decoded information USAGE - void *H5O_dtype_decode(f, raw_size, p) + void *H5O_dtype_decode(f, dxpl_id, mesg_flags, p) H5F_t *f; IN: pointer to the HDF5 file struct - size_t raw_size; IN: size of the raw information buffer + hid_t dxpl_id; IN: DXPL for any I/O + unsigned mesg_flags; IN: Message flags to influence decoding const uint8 *p; IN: the raw information buffer RETURNS Pointer to the new message in native order on success, NULL on failure @@ -956,7 +951,7 @@ done: function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_dtype_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p) +H5O_dtype_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, const uint8_t *p) { H5T_t *dt = NULL; void *ret_value; /* Return value */ diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 5035e17..ce6a9e5 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -28,7 +28,7 @@ #include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ -static void *H5O_efl_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_efl_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static herr_t H5O_efl_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_efl_copy(const void *_mesg, void *_dest); static size_t H5O_efl_size(const H5F_t *f, const void *_mesg); @@ -79,14 +79,11 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ * Programmer: Robb Matzke * Tuesday, November 25, 1997 * - * Modifications: - * Robb Matzke, 1998-07-20 - * Rearranged the message to add a version number near the beginning. - * *------------------------------------------------------------------------- */ static void * -H5O_efl_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p) +H5O_efl_decode(H5F_t *f, hid_t dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *p) { H5O_efl_t *mesg = NULL; int version; diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 4a0b4f3..a901ece 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -26,16 +26,16 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Opkg.h" /* Object header functions */ +#include "H5Opkg.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ -static void *H5O_fill_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_fill_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static herr_t H5O_fill_encode(H5F_t *f, uint8_t *p, const void *_mesg); static size_t H5O_fill_size(const H5F_t *f, const void *_mesg); static herr_t H5O_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent, int fwidth); -static void *H5O_fill_new_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_fill_new_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static herr_t H5O_fill_new_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_fill_new_copy(const void *_mesg, void *_dest); static size_t H5O_fill_new_size(const H5F_t *f, const void *_mesg); @@ -105,6 +105,50 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ /* Declare a free list to manage the H5O_fill_t struct */ H5FL_DEFINE(H5O_fill_t); +/* Set up & include shared message "interface" info */ +#define H5O_SHARED_TYPE H5O_MSG_FILL +#define H5O_SHARED_DECODE H5O_fill_shared_decode +#define H5O_SHARED_DECODE_REAL H5O_fill_decode +#define H5O_SHARED_ENCODE H5O_fill_shared_encode +#define H5O_SHARED_ENCODE_REAL H5O_fill_encode +#define H5O_SHARED_SIZE H5O_fill_shared_size +#define H5O_SHARED_SIZE_REAL H5O_fill_size +#define H5O_SHARED_DELETE H5O_fill_shared_delete +#undef H5O_SHARED_DELETE_REAL +#define H5O_SHARED_LINK H5O_fill_shared_link +#undef H5O_SHARED_LINK_REAL +#define H5O_SHARED_COPY_FILE H5O_fill_shared_copy_file +#undef H5O_SHARED_COPY_FILE_REAL +#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ + +/* Set up & include shared message "interface" info */ +/* (Kludgy 'undef's in order to re-include the H5Oshared.h header) */ +#undef H5O_SHARED_TYPE +#define H5O_SHARED_TYPE H5O_MSG_FILL_NEW +#undef H5O_SHARED_DECODE +#define H5O_SHARED_DECODE H5O_fill_new_shared_decode +#undef H5O_SHARED_DECODE_REAL +#define H5O_SHARED_DECODE_REAL H5O_fill_new_decode +#undef H5O_SHARED_ENCODE +#define H5O_SHARED_ENCODE H5O_fill_new_shared_encode +#undef H5O_SHARED_ENCODE_REAL +#define H5O_SHARED_ENCODE_REAL H5O_fill_new_encode +#undef H5O_SHARED_SIZE +#define H5O_SHARED_SIZE H5O_fill_new_shared_size +#undef H5O_SHARED_SIZE_REAL +#define H5O_SHARED_SIZE_REAL H5O_fill_new_size +#undef H5O_SHARED_DELETE +#define H5O_SHARED_DELETE H5O_fill_new_shared_delete +#undef H5O_SHARED_DELETE_REAL +#undef H5O_SHARED_LINK +#define H5O_SHARED_LINK H5O_fill_new_shared_link +#undef H5O_SHARED_LINK_REAL +#undef H5O_SHARED_COPY_FILE +#define H5O_SHARED_COPY_FILE H5O_fill_new_shared_copy_file +#undef H5O_SHARED_COPY_FILE_REAL +#undef H5Oshared_H +#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ + /*------------------------------------------------------------------------- * Function: H5O_fill_new_decode @@ -120,12 +164,11 @@ H5FL_DEFINE(H5O_fill_t); * Programmer: Raymond Lu * Feb 26, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p) +H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *p) { H5O_fill_t *mesg = NULL; int version; @@ -195,7 +238,8 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_fill_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p) +H5O_fill_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *p) { H5O_fill_t *mesg = NULL; /* Decoded fill value message */ void *ret_value; /* Return value */ diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index 152f5d3..d0fb5da 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -20,12 +20,10 @@ * * Purpose: Group Information messages. * - * Modifications: - * *------------------------------------------------------------------------- */ -#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 */ @@ -34,7 +32,7 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_ginfo_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_ginfo_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static herr_t H5O_ginfo_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_ginfo_copy(const void *_mesg, void *_dest); static size_t H5O_ginfo_size(const H5F_t *f, const void *_mesg); @@ -92,12 +90,11 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t); * koziol@ncsa.uiuc.edu * Aug 30 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5O_ginfo_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p) +H5O_ginfo_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *p) { H5O_ginfo_t *ginfo = NULL; /* Pointer to group information message */ unsigned char flags; /* Flags for encoding group info */ diff --git a/src/H5Olayout.c b/src/H5Olayout.c index daa303d..6e9a71f 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -19,8 +19,7 @@ */ #define H5D_PACKAGE /*suppress error about including H5Dpkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ - +#define H5O_PACKAGE /*suppress error about including H5Opkg */ #include "H5private.h" /* Generic Functions */ #include "H5Dpkg.h" /* Dataset functions */ @@ -31,8 +30,9 @@ #include "H5Opkg.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ + /* PRIVATE PROTOTYPES */ -static void *H5O_layout_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_layout_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static herr_t H5O_layout_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_layout_copy(const void *_mesg, void *_dest); static size_t H5O_layout_size(const H5F_t *f, const void *_mesg); @@ -94,24 +94,11 @@ H5FL_DEFINE(H5O_layout_t); * Programmer: Robb Matzke * Wednesday, October 8, 1997 * - * Modifications: - * Robb Matzke, 1998-07-20 - * Rearranged the message to add a version number at the beginning. - * - * Raymond Lu, 2002-2-26 - * Added version number 2 case depends on if space has been allocated - * at the moment when layout header message is updated. - * - * Quincey Koziol, 2004-5-21 - * Added version number 3 case to straighten out problems with contiguous - * layout's sizes (was encoding them as 4-byte values when they were - * really n-byte values (where n usually is 8)) and additionally clean up - * the information written out. - * *------------------------------------------------------------------------- */ static void * -H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p) +H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *p) { H5O_layout_t *mesg = NULL; unsigned u; diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index 2e62ee2..6b286d9 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -20,13 +20,11 @@ * * Purpose: Link Information messages. * - * Modifications: - * *------------------------------------------------------------------------- */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#define H5O_PACKAGE /*suppress error about including H5Opkg */ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -36,7 +34,7 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_linfo_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_linfo_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static herr_t H5O_linfo_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_linfo_copy(const void *_mesg, void *_dest); static size_t H5O_linfo_size(const H5F_t *f, const void *_mesg); @@ -112,7 +110,8 @@ H5FL_DEFINE_STATIC(H5O_linfo_t); *------------------------------------------------------------------------- */ static void * -H5O_linfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p) +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 */ diff --git a/src/H5Olink.c b/src/H5Olink.c index 1920635..b77446e 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -23,8 +23,8 @@ *------------------------------------------------------------------------- */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#define H5O_PACKAGE /*suppress error about including H5Opkg */ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -37,7 +37,7 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_link_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_link_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static herr_t H5O_link_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_link_copy(const void *_mesg, void *_dest); static size_t H5O_link_size(const H5F_t *f, const void *_mesg); @@ -106,7 +106,8 @@ H5FL_DEFINE_STATIC(H5O_link_t); *------------------------------------------------------------------------- */ static void * -H5O_link_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p) +H5O_link_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *p) { H5O_link_t *lnk = NULL; /* Pointer to link message */ size_t len; /* Length of a string in the message */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 628b3e9..d9d590f 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -59,7 +59,7 @@ \ /* Decode the message */ \ HDassert(decode_type->decode); \ - if(NULL == ((MSG)->native = (decode_type->decode)((F), (DXPL), (MSG)->raw))) \ + if(NULL == ((MSG)->native = (decode_type->decode)((F), (DXPL), (MSG)->flags, (MSG)->raw))) \ HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, ERR, "unable to decode message") \ \ /* Set the message's "creation index", if it has one */ \ @@ -1814,7 +1814,7 @@ H5O_msg_decode(H5F_t *f, hid_t dxpl_id, unsigned type_id, const unsigned char *b HDassert(type); /* decode */ - if((ret_value = (type->decode)(f, dxpl_id, buf)) == NULL) + if((ret_value = (type->decode)(f, dxpl_id, 0, buf)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode message") done: @@ -2150,7 +2150,7 @@ H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_mesg_t *mesg, hbool_t adj_link) /* Decode the message if necessary. */ if(NULL == mesg->native) { HDassert(type->decode); - if(NULL == (mesg->native = (type->decode)(f, dxpl_id, mesg->raw))) + if(NULL == (mesg->native = (type->decode)(f, dxpl_id, mesg->flags, mesg->raw))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to decode message") /* Set the message's "creation index", if it has one */ diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 77d9c87..5015264 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -18,13 +18,13 @@ * Purpose: The object modification time message. */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#include "H5private.h" -#include "H5Eprivate.h" -#include "H5FLprivate.h" /*Free Lists */ -#include "H5MMprivate.h" -#include "H5Opkg.h" /* Object header functions */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free lists */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Opkg.h" /* Object headers */ #if defined (WIN32) && !defined (__MWERKS__) #include @@ -32,11 +32,11 @@ #endif -static void *H5O_mtime_new_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_mtime_new_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static herr_t H5O_mtime_new_encode(H5F_t *f, uint8_t *p, const void *_mesg); static size_t H5O_mtime_new_size(const H5F_t *f, const void *_mesg); -static void *H5O_mtime_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_mtime_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static herr_t H5O_mtime_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_mtime_copy(const void *_mesg, void *_dest); static size_t H5O_mtime_size(const H5F_t *f, const void *_mesg); @@ -120,12 +120,11 @@ H5FL_DEFINE(time_t); * koziol@ncsa.uiuc.edu * Jan 3 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5O_mtime_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p) +H5O_mtime_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *p) { time_t *mesg; uint32_t tmp_time; /* Temporary copy of the time */ @@ -174,12 +173,11 @@ done: * matzke@llnl.gov * Jul 24 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p) +H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *p) { time_t *mesg, the_time; int i; diff --git a/src/H5Oname.c b/src/H5Oname.c index 002d7e8..4b528b8 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -20,21 +20,19 @@ * * Purpose: Object name message. * - * Modifications: - * *------------------------------------------------------------------------- */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#include "H5private.h" -#include "H5Eprivate.h" -#include "H5MMprivate.h" -#include "H5Opkg.h" /* Object header functions */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ -static void *H5O_name_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_name_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static herr_t H5O_name_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_name_copy(const void *_mesg, void *_dest); static size_t H5O_name_size(const H5F_t *f, const void *_mesg); @@ -82,12 +80,11 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ * matzke@llnl.gov * Aug 12 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5O_name_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p) +H5O_name_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *p) { H5O_name_t *mesg; void *ret_value; /* Return value */ diff --git a/src/H5Onull.c b/src/H5Onull.c index 5399112..20a3254 100644 --- a/src/H5Onull.c +++ b/src/H5Onull.c @@ -23,10 +23,10 @@ *------------------------------------------------------------------------- */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#include "H5private.h" -#include "H5Opkg.h" /* Object header functions */ +#include "H5private.h" /* Generic Functions */ +#include "H5Opkg.h" /* Object headers */ /* This message derives from H5O message class */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index f1e57e9..9458e55 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -163,10 +163,10 @@ struct H5O_msg_class_t { unsigned id; /*message type ID on disk */ const char *name; /*for debugging */ size_t native_size; /*size of native message */ - void *(*decode)(H5F_t*, hid_t, const uint8_t*); - herr_t (*encode)(H5F_t*, uint8_t*, const void*); + void *(*decode)(H5F_t*, hid_t, unsigned, const uint8_t *); + herr_t (*encode)(H5F_t*, uint8_t*, const void *); void *(*copy)(const void *, void *); /*copy native value */ - size_t (*raw_size)(const H5F_t*, const void*);/*sizeof encoded message */ + size_t (*raw_size)(const H5F_t *, const void *);/*sizeof encoded message */ herr_t (*reset)(void *); /*free nested data structs */ herr_t (*free)(void *); /*free main data struct */ herr_t (*del)(H5F_t *, hid_t, const void *, hbool_t); /* Delete space in file referenced by this message */ diff --git a/src/H5Opline.c b/src/H5Opline.c index 194b8b6..2adebf5 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -30,7 +30,7 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_pline_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_pline_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_pline_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static void *H5O_pline_copy(const void *_mesg, void *_dest); static size_t H5O_pline_size(const H5F_t *f, const void *_mesg); static herr_t H5O_pline_reset(void *_mesg); @@ -85,6 +85,22 @@ const H5O_msg_class_t H5O_MSG_PLINE[1] = {{ /* Declare a free list to manage the H5O_pline_t struct */ H5FL_DEFINE(H5O_pline_t); +/* Set up & include shared message "interface" info */ +#define H5O_SHARED_TYPE H5O_MSG_PLINE +#define H5O_SHARED_DECODE H5O_pline_shared_decode +#define H5O_SHARED_DECODE_REAL H5O_pline_decode +#define H5O_SHARED_ENCODE H5O_pline_shared_encode +#define H5O_SHARED_ENCODE_REAL H5O_pline_encode +#define H5O_SHARED_SIZE H5O_pline_shared_size +#define H5O_SHARED_SIZE_REAL H5O_pline_size +#define H5O_SHARED_DELETE H5O_pline_shared_delete +#undef H5O_SHARED_DELETE_REAL +#define H5O_SHARED_LINK H5O_pline_shared_link +#undef H5O_SHARED_LINK_REAL +#define H5O_SHARED_COPY_FILE H5O_pline_shared_copy_file +#undef H5O_SHARED_COPY_FILE_REAL +#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ + /*------------------------------------------------------------------------- * Function: H5O_pline_decode @@ -100,7 +116,8 @@ H5FL_DEFINE(H5O_pline_t); *------------------------------------------------------------------------- */ static void * -H5O_pline_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p) +H5O_pline_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *p) { H5O_pline_t *pline = NULL; /* Pipeline message */ H5Z_filter_info_t *filter; /* Filter to decode */ diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index dc5ab95..c6dad3f 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -25,7 +25,7 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_sdspace_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_sdspace_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_sdspace_copy(const void *_mesg, void *_dest); static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg); @@ -107,9 +107,10 @@ H5FL_ARR_EXTERN(hsize_t); Decode a simple dimensionality message and return a pointer to a memory struct with the decoded information USAGE - void *H5O_sdspace_decode(f, raw_size, p) - H5F_t *f; IN: pointer to the HDF5 file struct - size_t raw_size; IN: size of the raw information buffer + void *H5O_sdspace_decode(f, dxpl_id, mesg_flags, p) + H5F_t *f; IN: pointer to the HDF5 file struct + hid_t dxpl_id; IN: DXPL for any I/O + unsigned mesg_flags; IN: Message flags to influence decoding const uint8 *p; IN: the raw information buffer RETURNS Pointer to the new message in native order on success, NULL on failure @@ -117,23 +118,10 @@ H5FL_ARR_EXTERN(hsize_t); This function decodes the "raw" disk form of a simple dimensionality message into a struct in memory native format. The struct is allocated within this function using malloc() and is returned to the caller. - - MODIFICATIONS - Robb Matzke, 1998-04-09 - The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes - instead of just four bytes. - - Robb Matzke, 1998-07-20 - Added a version number and reformatted the message for aligment. - - Raymond Lu - April 8, 2004 - Added the type of dataspace into this header message using a reserved - byte. - --------------------------------------------------------------------------*/ static void * -H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p) +H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *p) { H5S_extent_t *sdim = NULL;/* New extent dimensionality structure */ void *ret_value; diff --git a/src/H5Oshared.c b/src/H5Oshared.c index 19673a5..001b094 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -25,8 +25,8 @@ * the global heap. */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#define H5O_PACKAGE /*suppress error about including H5Opkg */ #include "H5private.h" /* Generic Functions */ @@ -39,7 +39,7 @@ #include "H5Opkg.h" /* Object headers */ #include "H5SMprivate.h" /* Shared object header messages */ -static void *H5O_shared_decode(H5F_t*, hid_t dxpl_id, const uint8_t*); +static void *H5O_shared_decode(H5F_t*, hid_t dxpl_id, unsigned mesg_flags, const uint8_t*); static herr_t H5O_shared_encode(H5F_t*, uint8_t*, const void*); static void *H5O_shared_copy(const void *_mesg, void *_dest); static size_t H5O_shared_size(const H5F_t*, const void *_mesg); @@ -353,13 +353,11 @@ done: * Programmer: Robb Matzke * Thursday, April 2, 1998 * - * Modifications: - * Robb Matzke, 1998-07-20 - * Added a version number to the beginning of the message. *------------------------------------------------------------------------- */ static void * -H5O_shared_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *buf) +H5O_shared_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *buf) { H5O_shared_t *mesg = NULL; unsigned version; diff --git a/src/H5Oshared.h b/src/H5Oshared.h index 29bdc35..2da769b 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -77,7 +77,7 @@ H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p } /* end if */ else { /* Decode native message directly */ - if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, dxpl_id, p))) + if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, dxpl_id, mesg_flags, p))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode native message") } /* end else */ diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 850abab..eb04b95 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -20,13 +20,11 @@ * * Purpose: Symbol table messages. * - * Modifications: - * *------------------------------------------------------------------------- */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#define H5O_PACKAGE /*suppress error about including H5Opkg */ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -37,7 +35,7 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_stab_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p); +static void *H5O_stab_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, const uint8_t *p); static herr_t H5O_stab_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_stab_copy(const void *_mesg, void *_dest); static size_t H5O_stab_size(const H5F_t *f, const void *_mesg); @@ -93,12 +91,11 @@ H5FL_DEFINE_STATIC(H5O_stab_t); * matzke@llnl.gov * Aug 6 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5O_stab_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p) +H5O_stab_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, + const uint8_t *p) { H5O_stab_t *stab=NULL; void *ret_value; /* Return value */ -- cgit v0.12 r> commit2509c4647a862758676661f35e5e16d3e08ca162 (patch) tree14f39e6f616fa7c6e1322285b7513c0ea2df1327 /doc/Utf.3 parent22f99d42b260461aacb728ca3326315bd4eb2041 (diff)downloadtcl-2509c4647a862758676661f35e5e16d3e08ca162.zip
tcl-2509c4647a862758676661f35e5e16d3e08ca162.tar.gz
tcl-2509c4647a862758676661f35e5e16d3e08ca162.tar.bz2
* Several typo and formatting corrections discovered
during conversion to TMML. Thanks to Joe English. [Patch 490514]