From 265652fe5466dc9e30d7bdf60a24a355852f0bfe Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 21 Sep 2018 12:12:05 -0700 Subject: Normalization with vol_integration (property lists, file drivers, other misc). --- src/H5FD.c | 978 +++++++++++++++++++++++--------------------- src/H5FDint.c | 167 ++++---- src/H5FDmpi.c | 2 +- src/H5FDpkg.h | 7 +- src/H5FDprivate.h | 8 +- src/H5FDspace.c | 15 +- src/H5FS.c | 68 +-- src/H5FScache.c | 11 +- src/H5FSpkg.h | 16 +- src/H5FSsection.c | 297 +++++++------- src/H5G.c | 27 +- src/H5Gint.c | 44 +- src/H5Glink.c | 2 +- src/H5Gloc.c | 163 ++++---- src/H5Gname.c | 46 ++- src/H5Gobj.c | 3 +- src/H5Goh.c | 4 +- src/H5Gstab.c | 24 +- src/H5I.c | 13 +- src/H5Iprivate.h | 1 - src/H5Lexternal.c | 58 +-- src/H5Ocopy.c | 56 ++- src/H5P.c | 134 +++--- src/H5Pacpl.c | 42 +- src/H5Pdapl.c | 16 +- src/H5Pdcpl.c | 46 +-- src/H5Pdeprec.c | 4 +- src/H5Pdxpl.c | 46 +-- src/H5Pencdec.c | 2 +- src/H5Pfapl.c | 258 ++++++------ src/H5Pfcpl.c | 31 +- src/H5Pfmpl.c | 2 +- src/H5Pgcpl.c | 16 +- src/H5Pint.c | 589 +++++++++++++------------- src/H5Plapl.c | 14 +- src/H5Plcpl.c | 20 +- src/H5Pocpl.c | 24 +- src/H5Pocpypl.c | 6 +- src/H5Ppkg.h | 44 +- src/H5Pprivate.h | 1 - src/H5Pstrcpl.c | 2 +- src/H5Ptest.c | 6 +- test/testfiles/err_compat_1 | 4 +- 43 files changed, 1647 insertions(+), 1670 deletions(-) diff --git a/src/H5FD.c b/src/H5FD.c index d74ea31..5585f37 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -23,22 +23,22 @@ /* Module Setup */ /****************/ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /* Suppress error about including H5Fpkg */ #include "H5FDmodule.h" /* This source code file is part of the H5FD module */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5CXprivate.h" /* API Contexts */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ -#include "H5FDpkg.h" /* File Drivers */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* File access */ +#include "H5FDpkg.h" /* File Drivers */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ /****************/ /* Local Macros */ @@ -58,8 +58,8 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5FD_free_cls(H5FD_class_t *cls); -static int H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/); +static herr_t H5FD__free_cls(H5FD_class_t *cls); +static herr_t H5FD__query(const H5FD_t *f, unsigned long *flags/*out*/); /*********************/ /* Package Variables */ @@ -94,21 +94,20 @@ static unsigned long H5FD_file_serial_no_g; /* File driver ID class */ static const H5I_class_t H5I_VFL_CLS[1] = {{ - H5I_VFL, /* ID class value */ - 0, /* Class flags */ - 0, /* # of reserved IDs for class */ - (H5I_free_t)H5FD_free_cls /* Callback routine for closing objects of this class */ + H5I_VFL, /* ID class value */ + 0, /* Class flags */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5FD__free_cls /* Callback routine for closing objects of this class */ }}; /*------------------------------------------------------------------------- - * Function: H5FD__init_package + * Function: H5FD__init_package * - * Purpose: Initialize the virtual file layer. + * Purpose: Initialize the virtual file layer. * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -131,16 +130,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_term_package + * Function: H5FD_term_package + * + * Purpose: Terminate this interface: free all memory and reset global + * variables to their initial values. Release all ID groups + * associated with this interface. * - * Purpose: Terminate this interface: free all memory and reset global - * variables to their initial values. Release all ID groups - * associated with this interface. + * Return: Success: Positive if anything was done that might + * have affected other interfaces; zero + * otherwise. * - * Return: Success: Positive if anything was done that might - * have affected other interfaces; zero - * otherwise. - * Failure: Never fails. + * Failure: Never fails. * *------------------------------------------------------------------------- */ @@ -171,26 +171,24 @@ H5FD_term_package(void) /*------------------------------------------------------------------------- - * Function: H5FD_free_cls + * Function: H5FD__free_cls * - * Purpose: Frees a file driver class struct and returns an indication of - * success. This function is used as the free callback for the - * virtual file layer object identifiers (cf H5FD__init_package). - * - * Return: Success: Non-negative + * Purpose: Frees a file driver class struct and returns an indication of + * success. This function is used as the free callback for the + * virtual file layer object identifiers (cf H5FD__init_package). * - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ static herr_t -H5FD_free_cls(H5FD_class_t *cls) +H5FD__free_cls(H5FD_class_t *cls) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* Sanity check */ + /* Sanity checks */ HDassert(cls); /* If the file driver has a terminate callback, call it to give the file @@ -219,37 +217,37 @@ done: * library is closed or the driver is * unregistered. * - * Failure: A negative value. + * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- */ hid_t H5FDregister(const H5FD_class_t *cls) { - hid_t ret_value; - H5FD_mem_t type; + H5FD_mem_t type; + hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "*x", cls); /* Check arguments */ if(!cls) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "null class pointer is disallowed") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, H5I_INVALID_HID, "null class pointer is disallowed") if(!cls->open || !cls->close) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`open' and/or `close' methods are not defined") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, H5I_INVALID_HID, "'open' and/or 'close' methods are not defined") if(!cls->get_eoa || !cls->set_eoa) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eoa' and/or `set_eoa' methods are not defined") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, H5I_INVALID_HID, "'get_eoa' and/or 'set_eoa' methods are not defined") if(!cls->get_eof) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eof' method is not defined") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, H5I_INVALID_HID, "'get_eof' method is not defined") if(!cls->read || !cls->write) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`read' and/or `write' method is not defined") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, H5I_INVALID_HID, "'read' and/or 'write' method is not defined") for (type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,type)) if(cls->fl_map[type] < H5FD_MEM_NOLIST || cls->fl_map[type] >= H5FD_MEM_NTYPES) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid free-list mapping") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid free-list mapping") /* Create the new class ID */ if((ret_value = H5FD_register(cls, sizeof(H5FD_class_t), TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register file driver ID") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file driver ID") done: FUNC_LEAVE_API(ret_value) @@ -268,7 +266,7 @@ done: * library is closed or the driver is * unregistered. * - * Failure: A negative value. + * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- */ @@ -276,34 +274,35 @@ hid_t H5FD_register(const void *_cls, size_t size, hbool_t app_ref) { const H5FD_class_t *cls = (const H5FD_class_t *)_cls; - H5FD_class_t *saved = NULL; - H5FD_mem_t type; - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + H5FD_class_t *saved = NULL; + H5FD_mem_t type; + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI(H5I_INVALID_HID) - /* Check arguments */ + /* Sanity checks */ HDassert(cls); HDassert(cls->open && cls->close); HDassert(cls->get_eoa && cls->set_eoa); HDassert(cls->get_eof); HDassert(cls->read && cls->write); - for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) + for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) { HDassert(cls->fl_map[type] >= H5FD_MEM_NOLIST && cls->fl_map[type] < H5FD_MEM_NTYPES); + } /* Copy the class structure so the caller can reuse or free it */ if(NULL == (saved = (H5FD_class_t *)H5MM_malloc(size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for file driver class struct") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5I_INVALID_HID, "memory allocation failed for file driver class struct") HDmemcpy(saved, cls, size); /* Create the new class ID */ if((ret_value = H5I_register(H5I_VFL, saved, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register file driver ID") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file driver ID") done: - if(ret_value < 0) + if(H5I_INVALID_HID == ret_value) if(saved) - H5MM_xfree(saved); + saved = (H5FD_class_t *)H5MM_xfree(saved); FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_register() */ @@ -317,9 +316,7 @@ done: * this driver or files which are already opened under this * driver. * - * Return: Success: Non-negative - * - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -333,11 +330,11 @@ H5FDunregister(hid_t driver_id) /* Check arguments */ if(NULL == H5I_object_verify(driver_id, H5I_VFL)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file driver") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file driver") /* The H5FD_class_t struct will be freed by this function */ if(H5I_dec_app_ref(driver_id) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "unable to unregister file driver") + HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "unable to unregister file driver") done: FUNC_LEAVE_API(ret_value) @@ -345,19 +342,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_get_class + * Function: H5FD_get_class * - * Purpose: Obtains a pointer to the driver struct containing all the - * callback pointers, etc. The PLIST_ID argument can be a file - * access property list, a data transfer property list, or a - * file driver identifier. + * Purpose: Obtains a pointer to the driver struct containing all the + * callback pointers, etc. The PLIST_ID argument can be a file + * access property list, a data transfer property list, or a + * file driver identifier. * - * Return: Success: Ptr to the driver information. The pointer is - * only valid as long as the driver remains - * registered or some file or property list - * exists which references the driver. + * Return: Success: Ptr to the driver information. The pointer is + * only valid as long as the driver remains + * registered or some file or property list + * exists which references the driver. * - * Failure: NULL + * Failure: NULL * *------------------------------------------------------------------------- */ @@ -369,7 +366,7 @@ H5FD_get_class(hid_t id) FUNC_ENTER_NOAPI(NULL) if(H5I_VFL == H5I_get_type(id)) - ret_value = (H5FD_class_t *)H5I_object(id); + ret_value = (H5FD_class_t *)H5I_object(id); else { H5P_genplist_t *plist; /* Property list pointer */ @@ -394,29 +391,32 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_sb_size + * Function: H5FD_sb_size * - * Purpose: Obtains the number of bytes required to store the driver file - * access data in the HDF5 superblock. + * Purpose: Obtains the number of bytes required to store the driver file + * access data in the HDF5 superblock. * - * Return: Success: Number of bytes required. + * Return: Success: Number of bytes required. May be zero if the + * driver has no data to store in the superblock. * - * Failure: 0 if an error occurs or if the driver has no - * data to store in the superblock. + * Failure: This function cannot indicate errors. * *------------------------------------------------------------------------- */ hsize_t H5FD_sb_size(H5FD_t *file) { - hsize_t ret_value=0; + hsize_t ret_value = 0; FUNC_ENTER_NOAPI(0) - HDassert(file && file->cls); + /* Sanity checks */ + HDassert(file); + HDassert(file->cls); + /* Dispatch to driver */ if(file->cls->sb_size) - ret_value = (file->cls->sb_size)(file); + ret_value = (file->cls->sb_size)(file); done: FUNC_LEAVE_NOAPI(ret_value) @@ -424,31 +424,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_sb_encode + * Function: H5FD_sb_encode * - * Purpose: Encode driver-specific data into the output arguments. The - * NAME is a nine-byte buffer which should get an - * eight-character driver name and/or version followed by a null - * terminator. The BUF argument is a buffer to receive the - * encoded driver-specific data. The size of the BUF array is - * the size returned by the H5FD_sb_size() call. + * Purpose: Encode driver-specific data into the output arguments. The + * NAME is a nine-byte buffer which should get an + * eight-character driver name and/or version followed by a null + * terminator. The BUF argument is a buffer to receive the + * encoded driver-specific data. The size of the BUF array is + * the size returned by the H5FD_sb_size() call. * - * Return: Success: Non-negative - * - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(file && file->cls); + /* Sanity checks */ + HDassert(file); + HDassert(file->cls); + + /* Dispatch to driver */ if(file->cls->sb_encode && (file->cls->sb_encode)(file, name/*out*/, buf/*out*/) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_encode request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_encode request failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -456,12 +458,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD__sb_decode + * Function: H5FD__sb_decode * - * Purpose: Decodes the driver information block. + * Purpose: Decodes the driver information block. * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -472,11 +473,13 @@ H5FD__sb_decode(H5FD_t *file, const char *name, const uint8_t *buf) FUNC_ENTER_STATIC - HDassert(file && file->cls); + /* Sanity checks */ + HDassert(file); + HDassert(file->cls); - /* Decode driver information */ + /* Dispatch to driver */ if(file->cls->sb_decode && (file->cls->sb_decode)(file, name, buf) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_decode request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_decode request failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -484,12 +487,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_sb_load + * Function: H5FD_sb_load * - * Purpose: Validate and decode the driver information block. + * Purpose: Validate and decode the driver information block. * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -500,7 +502,9 @@ H5FD_sb_load(H5FD_t *file, const char *name, const uint8_t *buf) FUNC_ENTER_NOAPI(FAIL) - HDassert(file && file->cls); + /* Sanity checks */ + HDassert(file); + HDassert(file->cls); /* Check if driver matches driver information saved. Unfortunately, we can't push this * function to each specific driver because we're checking if the driver is correct. @@ -520,37 +524,41 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_fapl_get + * Function: H5FD_fapl_get + * + * Purpose: Gets the file access property list associated with a file. + * Usually the file will copy what it needs from the original + * file access property list when the file is created. The + * purpose of this function is to create a new file access + * property list based on the settings in the file, which may + * have been modified from the original file access property + * list. * - * Purpose: Gets the file access property list associated with a file. - * Usually the file will copy what it needs from the original - * file access property list when the file is created. The - * purpose of this function is to create a new file access - * property list based on the settings in the file, which may - * have been modified from the original file access property - * list. + * Return: Success: Pointer to a new file access property list + * with all members copied. If the file is + * closed then this property list lives on, and + * vice versa. * - * Return: Success: Pointer to a new file access property list - * with all members copied. If the file is - * closed then this property list lives on, and - * vice versa. + * This can be NULL if the file has no properties. * - * Failure: NULL, including when the file has no - * properties. + * Failure: This function cannot indicate errors. * *------------------------------------------------------------------------- */ void * H5FD_fapl_get(H5FD_t *file) { - void *ret_value=NULL; + void *ret_value = NULL; FUNC_ENTER_NOAPI(NULL) + /* Sanity checks */ HDassert(file); + HDassert(file->cls); + /* Dispatch to driver */ if(file->cls->fapl_get) - ret_value = (file->cls->fapl_get)(file); + ret_value = (file->cls->fapl_get)(file); done: FUNC_LEAVE_NOAPI(ret_value) @@ -558,12 +566,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_fapl_close + * Function: H5FD_fapl_close * - * Purpose: Closes a driver for a dataset transfer property list + * Purpose: Closes a driver for a dataset transfer property list * - * Return: Success: non-negative - * Failure: negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -574,7 +581,6 @@ H5FD_fapl_close(hid_t driver_id, const void *driver_info) FUNC_ENTER_NOAPI(FAIL) - /* Check args */ if(driver_id > 0) { H5FD_class_t *driver; @@ -589,7 +595,7 @@ H5FD_fapl_close(hid_t driver_id, const void *driver_info) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "driver free request failed") } /* end if */ else - H5MM_xfree((void *)driver_info); /* Casting away const OK -QAK */ + driver_info = H5MM_xfree((void *)driver_info); /* Casting away const OK -QAK */ } /* end if */ } /* end if */ @@ -599,59 +605,59 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDopen + * Function: H5FDopen * - * Purpose: Opens a file named NAME for the type(s) of access described - * by the bit vector FLAGS according to a file access property - * list FAPL_ID (which may be the constant H5P_DEFAULT). The - * file should expect to handle format addresses in the range [0, - * MAXADDR] (if MAXADDR is the undefined address then the caller - * doesn't care about the address range). + * Purpose: Opens a file named NAME for the type(s) of access described + * by the bit vector FLAGS according to a file access property + * list FAPL_ID (which may be the constant H5P_DEFAULT). The + * file should expect to handle format addresses in the range [0, + * MAXADDR] (if MAXADDR is the undefined address then the caller + * doesn't care about the address range). * - * Possible values for the FLAGS bits are: + * Possible values for the FLAGS bits are: * - * H5F_ACC_RDWR: Open the file for read and write access. If - * this bit is not set then open the file for - * read only access. It is permissible to open a - * file for read and write access when only read - * access is requested by the library (the - * library will never attempt to write to a file - * which it opened with only read access). + * H5F_ACC_RDWR: Open the file for read and write access. If + * this bit is not set then open the file for + * read only access. It is permissible to open a + * file for read and write access when only read + * access is requested by the library (the + * library will never attempt to write to a file + * which it opened with only read access). * - * H5F_ACC_CREATE: Create the file if it doesn't already exist. - * However, see H5F_ACC_EXCL below. + * H5F_ACC_CREATE: Create the file if it doesn't already exist. + * However, see H5F_ACC_EXCL below. * - * H5F_ACC_TRUNC: Truncate the file if it already exists. This - * is equivalent to deleting the file and then - * creating a new empty file. + * H5F_ACC_TRUNC: Truncate the file if it already exists. This + * is equivalent to deleting the file and then + * creating a new empty file. * - * H5F_ACC_EXCL: When used with H5F_ACC_CREATE, if the file - * already exists then the open should fail. - * Note that this is unsupported/broken with - * some file drivers (e.g., sec2 across nfs) and - * will contain a race condition when used to - * perform file locking. + * H5F_ACC_EXCL: When used with H5F_ACC_CREATE, if the file + * already exists then the open should fail. + * Note that this is unsupported/broken with + * some file drivers (e.g., sec2 across nfs) and + * will contain a race condition when used to + * perform file locking. * - * The MAXADDR is the maximum address which will be requested by - * the library during an allocation operation. Usually this is - * the same value as the MAXADDR field of the class structure, - * but it can be smaller if the driver is being used under some - * other driver. + * The MAXADDR is the maximum address which will be requested by + * the library during an allocation operation. Usually this is + * the same value as the MAXADDR field of the class structure, + * but it can be smaller if the driver is being used under some + * other driver. * - * Note that when the driver `open' callback gets control that - * the public part of the file struct (the H5FD_t part) will be - * incomplete and will be filled in after that callback returns. + * Note that when the driver 'open' callback gets control that + * the public part of the file struct (the H5FD_t part) will be + * incomplete and will be filled in after that callback returns. * - * Return: Success: Pointer to a new file driver struct. + * Return: Success: Pointer to a new file driver struct. * - * Failure: NULL + * Failure: NULL * *------------------------------------------------------------------------- */ H5FD_t * H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { - H5FD_t *ret_value=NULL; + H5FD_t *ret_value = NULL; FUNC_ENTER_API(NULL) H5TRACE4("*x", "*sIuia", name, flags, fapl_id, maxaddr); @@ -660,11 +666,12 @@ H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) if(H5P_DEFAULT == fapl_id) fapl_id = H5P_FILE_ACCESS_DEFAULT; else - if(TRUE!=H5P_isa_class(fapl_id,H5P_FILE_ACCESS)) + if(TRUE != H5P_isa_class(fapl_id,H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") - if(NULL==(ret_value=H5FD_open(name, flags, fapl_id, maxaddr))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to open file") + /* Call private function */ + if(NULL == (ret_value = H5FD_open(name, flags, fapl_id, maxaddr))) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to open file") done: FUNC_LEAVE_API(ret_value) @@ -672,13 +679,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_open + * Function: H5FD_open * - * Purpose: Private version of H5FDopen() + * Purpose: Private version of H5FDopen() * - * Return: Success: Pointer to a new file driver struct + * Return: Success: Pointer to a new file driver struct * - * Failure: NULL + * Failure: NULL * *------------------------------------------------------------------------- */ @@ -695,9 +702,9 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) FUNC_ENTER_NOAPI(NULL) - /* Sanity check */ + /* Sanity checks */ if(0 == maxaddr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "zero format address range") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "zero format address range") /* Get file access property list */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) @@ -709,9 +716,9 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) /* Get driver info */ if(NULL == (driver = (H5FD_class_t *)H5I_object(driver_prop.driver_id))) - HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "invalid driver ID in file access property list") + HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "invalid driver ID in file access property list") if(NULL == driver->open) - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "file driver has no `open' method") + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "file driver has no `open' method") /* Query driver flag */ if(H5FD_driver_query(driver, &driver_flags) < 0) @@ -731,13 +738,12 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) if(HADDR_UNDEF == maxaddr) maxaddr = driver->maxaddr; if(NULL == (file = (driver->open)(name, flags, fapl_id, maxaddr))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "open failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "open failed") /* Set the file access flags */ file->access_flags = flags; - /* - * Fill in public fields. We must increment the reference count on the + /* Fill in public fields. We must increment the reference count on the * driver ID to prevent it from being freed while this file is open. */ file->driver_id = driver_prop.driver_id; @@ -751,7 +757,7 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment") /* Retrieve the VFL driver feature flags */ - if(H5FD_query(file, &(file->feature_flags)) < 0) + if(H5FD__query(file, &(file->feature_flags)) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to query file driver") /* Increment the global serial number & assign it to this H5FD_t object */ @@ -775,32 +781,35 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDclose + * Function: H5FDclose * - * Purpose: Closes the file by calling the driver `close' callback, which - * should free all driver-private data and free the file struct. - * Note that the public part of the file struct (the H5FD_t part) - * will be all zero during the driver close callback like during - * the `open' callback. + * Purpose: Closes the file by calling the driver 'close' callback, which + * should free all driver-private data and free the file struct. + * Note that the public part of the file struct (the H5FD_t part) + * will be all zero during the driver close callback like during + * the 'open' callback. * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5FDclose(H5FD_t *file) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "*x", file); - if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") + /* Check arguments */ + if(!file) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file pointer cannot be NULL") + if(!file->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file class pointer cannot be NULL") + /* Call private function */ if(H5FD_close(file) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close file") + HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close file") done: FUNC_LEAVE_API(ret_value) @@ -808,12 +817,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_close + * Function: H5FD_close * - * Purpose: Private version of H5FDclose() + * Purpose: Private version of H5FDclose() * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -825,16 +833,16 @@ H5FD_close(H5FD_t *file) FUNC_ENTER_NOAPI(FAIL) - /* check args */ - HDassert(file && file->cls); + /* Sanity checks */ + HDassert(file); + HDassert(file->cls); /* Prepare to close file by clearing all public fields */ driver = file->cls; if(H5I_dec_ref(file->driver_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close driver ID") - /* - * Dispatch to the driver for actual close. If the driver fails to + /* Dispatch to the driver for actual close. If the driver fails to * close the file then the file will be in an unusable state. */ HDassert(driver->close); @@ -847,47 +855,48 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDcmp + * Function: H5FDcmp * - * Purpose: Compare the keys of two files using the file driver callback - * if the files belong to the same driver, otherwise sort the - * files by driver class pointer value. + * Purpose: Compare the keys of two files using the file driver callback + * if the files belong to the same driver, otherwise sort the + * files by driver class pointer value. * - * Return: Success: A value like strcmp() + * Return: Success: A value like strcmp() * - * Failure: Must never fail. If both file handles are - * invalid then they compare equal. If one file - * handle is invalid then it compares less than - * the other. If both files belong to the same - * driver and the driver doesn't provide a - * comparison callback then the file pointers - * themselves are compared. + * Failure: Must never fail. If both file handles are + * invalid then they compare equal. If one file + * handle is invalid then it compares less than + * the other. If both files belong to the same + * driver and the driver doesn't provide a + * comparison callback then the file pointers + * themselves are compared. * *------------------------------------------------------------------------- */ int H5FDcmp(const H5FD_t *f1, const H5FD_t *f2) { - int ret_value; + int ret_value = -1; - FUNC_ENTER_API(-1) /*return value is arbitrary*/ + FUNC_ENTER_API(-1) /* return value is arbitrary */ H5TRACE2("Is", "*x*x", f1, f2); + /* Call private function */ ret_value = H5FD_cmp(f1, f2); done: FUNC_LEAVE_API(ret_value) -} +} /* end H5FDcmp() */ /*------------------------------------------------------------------------- - * Function: H5FD_cmp + * Function: H5FD_cmp * - * Purpose: Private version of H5FDcmp() + * Purpose: Private version of H5FDcmp() * - * Return: Success: A value like strcmp() + * Return: Success: A value like strcmp() * - * Failure: Must never fail. + * Failure: Must never fail. * *------------------------------------------------------------------------- */ @@ -896,7 +905,7 @@ H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2) { int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI(-1) /*return value is arbitrary*/ + FUNC_ENTER_NOAPI(-1) /* return value is arbitrary */ if((!f1 || !f1->cls) && (!f2 || !f2->cls)) HGOTO_DONE(0) @@ -911,43 +920,50 @@ H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2) /* Files are same driver; no cmp callback */ if(!f1->cls->cmp) { - if(f1f2) + if(f1 > f2) HGOTO_DONE(1) - HGOTO_DONE(0) + HGOTO_DONE(0) } + /* Dispatch to driver */ ret_value = (f1->cls->cmp)(f1, f2); done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5FD_cmp() */ /*------------------------------------------------------------------------- - * Function: H5FDquery - * - * Purpose: Query a VFL driver for its feature flags. (listed in H5FDpublic.h) + * Function: H5FDquery * - * Return: Success: non-negative + * Purpose: Query a VFL driver for its feature flags. (listed in H5FDpublic.h) * - * Failure: negative + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ int -H5FDquery(const H5FD_t *f, unsigned long *flags/*out*/) +H5FDquery(const H5FD_t *file, unsigned long *flags/*out*/) { - int ret_value; + int ret_value = 0; - FUNC_ENTER_API(FAIL) - H5TRACE2("Is", "*xx", f, flags); + FUNC_ENTER_API((-1)) + H5TRACE2("Is", "*xx", file, flags); - HDassert(f); - HDassert(flags); + /* Check arguments */ + if(!file) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "file pointer cannot be NULL") + if(!file->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "file class pointer cannot be NULL") + if(!flags) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "flags parameter cannot be NULL") - ret_value = H5FD_query(f, flags); + /* Call private function */ + if(H5FD__query(file, flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, (-1), "unable to query feature flags") done: FUNC_LEAVE_API(ret_value) @@ -955,69 +971,72 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_query - * - * Purpose: Private version of H5FDquery() + * Function: H5FD_query * - * Return: Success: non-negative + * Purpose: Private version of H5FDquery() * - * Failure: negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ -static int -H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) +static herr_t +H5FD__query(const H5FD_t *file, unsigned long *flags/*out*/) { - int ret_value = 0; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC - HDassert(f); + /* Sanity checks */ + HDassert(file); + HDassert(file->cls); HDassert(flags); - /* Check for query driver and call it */ - if(f->cls->query) - ret_value = (f->cls->query)(f, flags); + /* Dispatch to driver (if available) */ + if(file->cls->query) { + if((file->cls->query)(file, flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to query feature flags") + } else *flags=0; +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_query() */ /*------------------------------------------------------------------------- - * Function: H5FDalloc + * Function: H5FDalloc * - * Purpose: Allocates SIZE bytes of memory from the FILE. The memory will - * be used according to the allocation class TYPE. First we try - * to satisfy the request from one of the free lists, according - * to the free list map provided by the driver. The free list - * array has one entry for each request type and the value of - * that array element can be one of four possibilities: + * Purpose: Allocates SIZE bytes of memory from the FILE. The memory will + * be used according to the allocation class TYPE. First we try + * to satisfy the request from one of the free lists, according + * to the free list map provided by the driver. The free list + * array has one entry for each request type and the value of + * that array element can be one of four possibilities: * - * It can be the constant H5FD_MEM_DEFAULT (or zero) which - * indicates that the identity mapping is used. In other - * words, the request type maps to its own free list. + * It can be the constant H5FD_MEM_DEFAULT (or zero) which + * indicates that the identity mapping is used. In other + * words, the request type maps to its own free list. * - * It can be the request type itself, which has the same - * effect as the H5FD_MEM_DEFAULT value above. + * It can be the request type itself, which has the same + * effect as the H5FD_MEM_DEFAULT value above. * - * It can be the ID for another request type, which - * indicates that the free list for the specified type - * should be used instead. + * It can be the ID for another request type, which + * indicates that the free list for the specified type + * should be used instead. * - * It can be the constant H5FD_MEM_NOLIST which means that - * no free list should be used for this type of request. + * It can be the constant H5FD_MEM_NOLIST which means that + * no free list should be used for this type of request. * - * If the request cannot be satisfied from a free list then - * either the driver's `alloc' callback is invoked (if one was - * supplied) or the end-of-address marker is extended. The - * `alloc' callback is always called with the same arguments as - * the H5FDalloc(). + * If the request cannot be satisfied from a free list then + * either the driver's 'alloc' callback is invoked (if one was + * supplied) or the end-of-address marker is extended. The + * 'alloc' callback is always called with the same arguments as + * the H5FDalloc(). * - * Return: Success: The format address of the new file memory. + * Return: Success: The format address of the new file memory. * - * Failure: The undefined address HADDR_UNDEF + * Failure: The undefined address HADDR_UNDEF * *------------------------------------------------------------------------- */ @@ -1029,13 +1048,15 @@ H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) FUNC_ENTER_API(HADDR_UNDEF) H5TRACE4("a", "*xMtih", file, type, dxpl_id, size); - /* Check args */ - if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") + /* Check arguments */ + if(!file) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "file pointer cannot be NULL") + if(!file->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "file class pointer cannot be NULL") if(type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid request type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid request type") if(size == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "zero-size request") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "zero-size request") if(H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; else @@ -1045,9 +1066,9 @@ H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) /* Set DXPL for operation */ H5CX_set_dxpl(dxpl_id); - /* Do the real work */ + /* Call private function */ if(HADDR_UNDEF == (ret_value = H5FD__alloc_real(file, type, size, NULL, NULL))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate file memory") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate file memory") /* (Note compensating for base address subtraction in internal routine) */ ret_value += file->base_addr; @@ -1058,32 +1079,32 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDfree + * Function: H5FDfree * - * Purpose: Frees format addresses starting with ADDR and continuing for - * SIZE bytes in the file FILE. The type of space being freed is - * specified by TYPE, which is mapped to a free list as - * described for the H5FDalloc() function above. If the request - * doesn't map to a free list then either the application `free' - * callback is invoked (if defined) or the memory is leaked. - * - * Return: Success: Non-negative + * Purpose: Frees format addresses starting with ADDR and continuing for + * SIZE bytes in the file FILE. The type of space being freed is + * specified by TYPE, which is mapped to a free list as + * described for the H5FDalloc() function above. If the request + * doesn't map to a free list then either the application 'free' + * callback is invoked (if defined) or the memory is leaked. * - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "*xMtiah", file, type, dxpl_id, addr, size); - /* Check args */ - if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") + /* Check arguments */ + if(!file) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file pointer cannot be NULL") + if(!file->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file class pointer cannot be NULL") if(type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid request type") if(H5P_DEFAULT == dxpl_id) @@ -1095,9 +1116,9 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz /* Set DXPL for operation */ H5CX_set_dxpl(dxpl_id); - /* Do the real work */ + /* Call private function */ /* (Note compensating for base address addition in internal routine) */ - if(H5FD_free_real(file, type, addr - file->base_addr, size) < 0) + if(H5FD__free_real(file, type, addr - file->base_addr, size) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "file deallocation request failed") done: @@ -1124,13 +1145,15 @@ H5FDget_eoa(H5FD_t *file, H5FD_mem_t type) FUNC_ENTER_API(HADDR_UNDEF) H5TRACE2("a", "*xMt", file, type); - /* Check args */ - if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") + /* Check arguments */ + if(!file) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "file pointer cannot be NULL") + if(!file->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "file class pointer cannot be NULL") if(type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file type") - /* The real work */ + /* Call private function */ if(HADDR_UNDEF == (ret_value = H5FD_get_eoa(file, type))) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eoa request failed") @@ -1171,15 +1194,17 @@ H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr) FUNC_ENTER_API(FAIL) H5TRACE3("e", "*xMta", file, type, addr); - /* Check args */ - if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") + /* Check arguments */ + if(!file) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file pointer cannot be NULL") + if(!file->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file class pointer cannot be NULL") if(type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file type") if(!H5F_addr_defined(addr) || addr > file->maxaddr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid end-of-address value") - /* The real work */ + /* Call private function */ /* (Note compensating for base address addition in internal routine) */ if(H5FD_set_eoa(file, type, addr - file->base_addr) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file set eoa request failed") @@ -1190,23 +1215,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDget_eof + * Function: H5FDget_eof * - * Purpose: Returns the end-of-file address, which is the greater of the - * end-of-format address and the actual EOF marker. This - * function is called after an existing file is opened in order - * for the library to learn the true size of the underlying file - * and to determine whether the hdf5 data has been truncated. + * Purpose: Returns the end-of-file address, which is the greater of the + * end-of-format address and the actual EOF marker. This + * function is called after an existing file is opened in order + * for the library to learn the true size of the underlying file + * and to determine whether the hdf5 data has been truncated. * - * It is also used when a file is first opened to learn whether - * the file is empty or not. + * It is also used when a file is first opened to learn whether + * the file is empty or not. * - * It is permissible for the driver to return the maximum address - * for the file size if the file is not empty. + * It is permissible for the driver to return the maximum address + * for the file size if the file is not empty. * - * Return: Success: The EOF address. + * Return: Success: The EOF address. * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * *------------------------------------------------------------------------- */ @@ -1219,10 +1244,12 @@ H5FDget_eof(H5FD_t *file, H5FD_mem_t type) H5TRACE2("a", "*xMt", file, type); /* Check arguments */ - if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") + if(!file) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "file pointer cannot be NULL") + if(!file->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "file class pointer cannot be NULL") - /* The real work */ + /* Call private function */ if(HADDR_UNDEF == (ret_value = H5FD_get_eof(file, type))) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eof request failed") @@ -1235,12 +1262,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_get_maxaddr + * Function: H5FD_get_maxaddr * - * Purpose: Private version of H5FDget_eof() + * Purpose: Private version of H5FDget_eof() * - * Return: Success: The maximum address allowed in the file. - * Failure: HADDR_UNDEF + * Return: Success: The maximum address allowed in the file. + * Failure: HADDR_UNDEF * *------------------------------------------------------------------------- */ @@ -1251,6 +1278,7 @@ H5FD_get_maxaddr(const H5FD_t *file) FUNC_ENTER_NOAPI(HADDR_UNDEF) + /* Sanity checks */ HDassert(file); /* Set return value */ @@ -1262,12 +1290,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_get_feature_flags + * Function: H5FD_get_feature_flags * - * Purpose: Retrieve the feature flags for the VFD + * Purpose: Retrieve the feature flags for the VFD * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1276,6 +1303,7 @@ H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags) { FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Sanity checks */ HDassert(file); HDassert(feature_flags); @@ -1287,12 +1315,11 @@ H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags) /*------------------------------------------------------------------------- - * Function: H5FD_set_feature_flags + * Function: H5FD_set_feature_flags * - * Purpose: Set the feature flags for the VFD + * Purpose: Set the feature flags for the VFD * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1301,6 +1328,7 @@ H5FD_set_feature_flags(H5FD_t *file, unsigned long feature_flags) { FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Sanity checks */ HDassert(file); /* Set the file's feature flags */ @@ -1311,12 +1339,11 @@ H5FD_set_feature_flags(H5FD_t *file, unsigned long feature_flags) /*------------------------------------------------------------------------- - * Function: H5FD_get_fs_type_map + * Function: H5FD_get_fs_type_map * - * Purpose: Retrieve the free space type mapping for the VFD + * Purpose: Retrieve the free space type mapping for the VFD * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1327,8 +1354,9 @@ H5FD_get_fs_type_map(const H5FD_t *file, H5FD_mem_t *type_map) FUNC_ENTER_NOAPI(FAIL) - /* Sanity check */ - HDassert(file && file->cls); + /* Sanity checks */ + HDassert(file); + HDassert(file->cls); HDassert(type_map); /* Check for VFD class providing a type map retrieval rouine */ @@ -1347,18 +1375,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDread + * Function: H5FDread * - * Purpose: Reads SIZE bytes from FILE beginning at address ADDR - * according to the data transfer property list DXPL_ID (which may - * be the constant H5P_DEFAULT). The result is written into the - * buffer BUF. + * Purpose: Reads SIZE bytes from FILE beginning at address ADDR + * according to the data transfer property list DXPL_ID (which may + * be the constant H5P_DEFAULT). The result is written into the + * buffer BUF. * - * Return: Success: Non-negative. The read result is written into - * the BUF buffer which should be allocated by - * the caller. + * Return: Success: SUCCEED + * The read result is written into the BUF buffer + * which should be allocated by the caller. * - * Failure: Negative. The contents of BUF is undefined. + * Failure: FAIL + * The contents of BUF are undefined. * *------------------------------------------------------------------------- */ @@ -1366,14 +1395,18 @@ herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "*xMtiazx", file, type, dxpl_id, addr, size, buf); - /* Check args */ - if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") + /* Check arguments */ + if(!file) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file pointer cannot be NULL") + if(!file->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file class pointer cannot be NULL") + if(!buf) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "result buffer parameter can't be NULL") /* Get the default dataset transfer property list if the user didn't provide one */ if(H5P_DEFAULT == dxpl_id) @@ -1381,16 +1414,14 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") - if(!buf) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null result buffer") /* Set DXPL for operation */ H5CX_set_dxpl(dxpl_id); - /* Do the real work */ + /* Call private function */ /* (Note compensating for base address addition in internal routine) */ if(H5FD_read(file, type, addr - file->base_addr, size, buf) < 0) - HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "file read request failed") + HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "file read request failed") done: FUNC_LEAVE_API(ret_value) @@ -1398,16 +1429,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDwrite + * Function: H5FDwrite * - * Purpose: Writes SIZE bytes to FILE beginning at address ADDR according - * to the data transfer property list DXPL_ID (which may be the - * constant H5P_DEFAULT). The bytes to be written come from the - * buffer BUF. - * - * Return: Success: Non-negative + * Purpose: Writes SIZE bytes to FILE beginning at address ADDR according + * to the data transfer property list DXPL_ID (which may be the + * constant H5P_DEFAULT). The bytes to be written come from the + * buffer BUF. * - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1415,30 +1444,33 @@ herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "*xMtiaz*x", file, type, dxpl_id, addr, size, buf); - /* Check args */ - if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") + /* Check arguments */ + if(!file) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file pointer cannot be NULL") + if(!file->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file class pointer cannot be NULL") + if(!buf) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "result buffer parameter can't be NULL") + /* Get the default dataset transfer property list if the user didn't provide one */ if(H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") - if(!buf) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null buffer") /* Set DXPL for operation */ H5CX_set_dxpl(dxpl_id); - /* The real work */ + /* Call private function */ /* (Note compensating for base address addition in internal routine) */ if(H5FD_write(file, type, addr - file->base_addr, size, buf) < 0) - HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "file write request failed") + HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "file write request failed") done: FUNC_LEAVE_API(ret_value) @@ -1446,17 +1478,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDflush - * - * Purpose: Notify driver to flush all cached data. If the driver has no - * flush method then nothing happens. - * - * Return: Success: Non-negative + * Function: H5FDflush * - * Failure: Negative + * Purpose: Notify driver to flush all cached data. If the driver has no + * flush method then nothing happens. * - * Programmer: Robb Matzke - * Thursday, July 29, 1999 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1468,9 +1495,12 @@ H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing) FUNC_ENTER_API(FAIL) H5TRACE3("e", "*xib", file, dxpl_id, closing); - /* Check args */ - if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") + /* Check arguments */ + if(!file) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file pointer cannot be NULL") + if(!file->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file class pointer cannot be NULL") + if(H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; else @@ -1480,9 +1510,9 @@ H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing) /* Set DXPL for operation */ H5CX_set_dxpl(dxpl_id); - /* Do the real work */ + /* Call private function */ if(H5FD_flush(file, closing) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTFLUSH, FAIL, "file flush request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTFLUSH, FAIL, "file flush request failed") done: FUNC_LEAVE_API(ret_value) @@ -1490,12 +1520,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_flush + * Function: H5FD_flush * - * Purpose: Private version of H5FDflush() + * Purpose: Private version of H5FDflush() * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1507,8 +1536,10 @@ H5FD_flush(H5FD_t *file, hbool_t closing) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file && file->cls); + HDassert(file); + HDassert(file->cls); + /* Dispatch to driver */ if(file->cls->flush && (file->cls->flush)(file, H5CX_get_dxpl(), closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver flush request failed") @@ -1518,12 +1549,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDtruncate + * Function: H5FDtruncate * - * Purpose: Notify driver to truncate the file back to the allocated size. + * Purpose: Notify driver to truncate the file back to the allocated size. * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1535,9 +1565,11 @@ H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing) FUNC_ENTER_API(FAIL) H5TRACE3("e", "*xib", file, dxpl_id, closing); - /* Check args */ - if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") + /* Check arguments */ + if(!file) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file pointer cannot be NULL") + if(!file->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file class pointer cannot be NULL") if(H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; else @@ -1547,9 +1579,9 @@ H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing) /* Set DXPL for operation */ H5CX_set_dxpl(dxpl_id); - /* Do the real work */ + /* Call private function */ if(H5FD_truncate(file, closing) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "file flush request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "file flush request failed") done: FUNC_LEAVE_API(ret_value) @@ -1559,22 +1591,22 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_truncate * - * Purpose: Private version of H5FDtruncate() + * Purpose: Private version of H5FDtruncate() * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5FD_truncate(H5FD_t *file, hbool_t closing) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file && file->cls); + HDassert(file); + HDassert(file->cls); /* Dispatch to driver */ if(file->cls->truncate && (file->cls->truncate)(file, H5CX_get_dxpl(), closing) < 0) @@ -1586,12 +1618,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDlock + * Function: H5FDlock * - * Purpose: Set a file lock + * Purpose: Set a file lock * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1603,13 +1634,15 @@ H5FDlock(H5FD_t *file, hbool_t rw) FUNC_ENTER_API(FAIL) H5TRACE2("e", "*xb", file, rw); - /* Check args */ - if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") + /* Check arguments */ + if(!file) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file pointer cannot be NULL") + if(!file->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file class pointer cannot be NULL") - /* The real work */ + /* Call private function */ if(H5FD_lock(file, rw) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file lock request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file lock request failed") done: FUNC_LEAVE_API(ret_value) @@ -1618,12 +1651,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_lock + * Function: H5FD_lock * - * Purpose: Private version of H5FDlock() + * Purpose: Private version of H5FDlock() * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1634,8 +1666,11 @@ H5FD_lock(H5FD_t *file, hbool_t rw) FUNC_ENTER_NOAPI(FAIL) - HDassert(file && file->cls); + /* Sanity checks */ + HDassert(file); + HDassert(file->cls); + /* Dispatch to driver */ if(file->cls->lock && (file->cls->lock)(file, rw) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "driver lock request failed") @@ -1645,12 +1680,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDunlock + * Function: H5FDunlock * - * Purpose: Remove a file lock + * Purpose: Remove a file lock * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1662,13 +1696,15 @@ H5FDunlock(H5FD_t *file) FUNC_ENTER_API(FAIL) H5TRACE1("e", "*x", file); - /* Check args */ - if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") + /* Check arguments */ + if(!file) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file pointer cannot be NULL") + if(!file->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file class pointer cannot be NULL") - /* The real work */ + /* Call private function */ if(H5FD_unlock(file) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file unlock request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file unlock request failed") done: FUNC_LEAVE_API(ret_value) @@ -1676,12 +1712,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_unlock + * Function: H5FD_unlock * - * Purpose: Private version of H5FDunlock() + * Purpose: Private version of H5FDunlock() * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1692,8 +1727,11 @@ H5FD_unlock(H5FD_t *file) FUNC_ENTER_NOAPI(FAIL) - HDassert(file && file->cls); + /* Sanity checks */ + HDassert(file); + HDassert(file->cls); + /* Dispatch to driver */ if(file->cls->unlock && (file->cls->unlock)(file) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "driver unlock request failed") @@ -1703,13 +1741,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_get_fileno + * Function: H5FD_get_fileno * - * Purpose: Quick and dirty routine to retrieve the file's 'fileno' value - * (Mainly added to stop non-file routines from poking about in the - * H5FD_t data structure) + * Purpose: Quick and dirty routine to retrieve the file's 'fileno' value + * (Mainly added to stop non-file routines from poking about in the + * H5FD_t data structure) * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1718,6 +1756,7 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum) { FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Sanity checks */ HDassert(file); HDassert(filenum); @@ -1734,28 +1773,36 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum) * Purpose: Returns a pointer to the file handle of low-level virtual * file driver. * - * Return: Non-negative if succeed; negative otherwise. - * - * Programmer: Raymond Lu - * Sep. 16, 2002 + * Return: SUCCEED/FAIL * *-------------------------------------------------------------------------- */ herr_t -H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void **file_handle) +H5FDget_vfd_handle(H5FD_t *file, hid_t fapl_id, void **file_handle) { - herr_t ret_value; + herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*xi**x", file, fapl, file_handle); + H5TRACE3("e", "*xi**x", file, fapl_id, file_handle); /* Check arguments */ - HDassert(file); - HDassert(file_handle); - - ret_value = H5FD_get_vfd_handle(file, fapl, file_handle); + if(!file) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file pointer cannot be NULL") + if(!file->cls) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file class pointer cannot be NULL") + if(FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fapl_id parameter is not a file access property list") + if(!file_handle) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle parameter cannot be NULL") + + /* Call private function */ + if(H5FD_get_vfd_handle(file, fapl_id, file_handle) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file handle for file driver") done: + if(FAIL == ret_value) + *file_handle = NULL; + FUNC_LEAVE_API(ret_value) } /* end H5FDget_vfd_handle() */ @@ -1763,29 +1810,28 @@ done: /*-------------------------------------------------------------------------- * Function: H5FD_get_vfd_handle * - * Purpose: Retrieve the file handle for file driver. + * Purpose: Private version of H5FDget_vfd_handle() * - * Return: Non-negative if succeed; negative if fails. - * - * Programmer: Raymond Lu - * Sep. 16, 2002 + * Return: SUCCEED/FAIL * *-------------------------------------------------------------------------- */ herr_t -H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void **file_handle) +H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl_id, void **file_handle) { herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) - /* Sanity check */ + /* Sanity checks */ HDassert(file); + HDassert(file->cls); HDassert(file_handle); + /* Dispatch to driver */ if(NULL == file->cls->get_handle) - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "file driver has no `get_vfd_handle' method") - if((file->cls->get_handle)(file, fapl, file_handle) < 0) + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "file driver has no `get_vfd_handle' method") + if((file->cls->get_handle)(file, fapl_id, file_handle) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file handle for file driver") done: @@ -1798,7 +1844,7 @@ done: * * Purpose: Set the base address for the file * - * Return: Non-negative if succeed; negative if fails. + * Return: SUCCEED (Can't fail) * *-------------------------------------------------------------------------- */ @@ -1807,6 +1853,7 @@ H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr) { FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Sanity checks */ HDassert(file); HDassert(H5F_addr_defined(base_addr)); @@ -1822,8 +1869,8 @@ H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr) * * Purpose: Get the base address for the file * - * Return: Success: The absolute base address of the file - * Failure: The undefined address (HADDR_UNDEF) + * Return: Success: The absolute base address of the file + * (Can't fail) * *-------------------------------------------------------------------------- */ @@ -1832,6 +1879,7 @@ H5FD_get_base_addr(const H5FD_t *file) { FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Sanity checks */ HDassert(file); /* Return the file's base address */ @@ -1844,7 +1892,7 @@ H5FD_get_base_addr(const H5FD_t *file) * * Purpose: Set "paged_aggr" for the file. * - * Return: Non-negative if succeed; negative if fails. + * Return: SUCCEED (Can't fail) * *-------------------------------------------------------------------------- */ @@ -1853,6 +1901,7 @@ H5FD_set_paged_aggr(H5FD_t *file, hbool_t paged) { FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Sanity checks */ HDassert(file); /* Indicate whether paged aggregation for handling file space is enabled or not */ @@ -1883,6 +1932,7 @@ H5FDdriver_query(hid_t driver_id, unsigned long *flags/*out*/) FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", driver_id, flags); + /* Check arguments */ if(NULL == flags) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "flags parameter cannot be NULL") diff --git a/src/H5FDint.c b/src/H5FDint.c index 023ff57..ea8c4d8 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -13,11 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5FDint.c - * Jan 17 2008 - * Quincey Koziol + * Created: H5FDint.c * - * Purpose: Internal routine for VFD operations + * Purpose: Internal routine for VFD operations * *------------------------------------------------------------------------- */ @@ -32,12 +30,12 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5CXprivate.h" /* API Contexts */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5FDpkg.h" /* File Drivers */ -#include "H5Iprivate.h" /* IDs */ +#include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5FDpkg.h" /* File Drivers */ +#include "H5Iprivate.h" /* IDs */ /****************/ @@ -83,26 +81,26 @@ * signature can appear at address 0, or any power of two * beginning with 512. * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: Robb Matzke - * Friday, November 7, 1997 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5FD_locate_signature(H5FD_t *file, haddr_t *sig_addr) { - haddr_t addr, eoa, eof; + haddr_t addr = HADDR_UNDEF; + haddr_t eoa = HADDR_UNDEF; + haddr_t eof = HADDR_UNDEF; uint8_t buf[H5F_SIGNATURE_LEN]; - unsigned n, maxpow; + unsigned n; + unsigned maxpow; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(file); + HDassert(sig_addr); /* Find the least N such that 2^N is larger than the file size */ eof = H5FD_get_eof(file, H5FD_MEM_SUPER); @@ -114,8 +112,7 @@ H5FD_locate_signature(H5FD_t *file, haddr_t *sig_addr) addr >>= 1; maxpow = MAX(maxpow, 9); - /* - * Search for the file signature at format address zero followed by + /* Search for the file signature at format address zero followed by * powers of two larger than 9. */ for(n = 8; n < maxpow; n++) { @@ -126,17 +123,16 @@ H5FD_locate_signature(H5FD_t *file, haddr_t *sig_addr) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to read file signature") if(!HDmemcmp(buf, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN)) break; - } /* end for */ + } - /* - * If the signature was not found then reset the EOA value and return + /* If the signature was not found then reset the EOA value and return * HADDR_UNDEF. */ if(n >= maxpow) { if(H5FD_set_eoa(file, H5FD_MEM_SUPER, eoa) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to reset EOA value") *sig_addr = HADDR_UNDEF; - } /* end if */ + } else /* Set return value */ *sig_addr = addr; @@ -147,44 +143,41 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_read - * - * Purpose: Private version of H5FDread() + * Function: H5FD_read * - * Return: Success: Non-negative - * Failure: Negative + * Purpose: Private version of H5FDread() * - * Programmer: Robb Matzke - * Wednesday, August 4, 1999 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t -H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, - void *buf/*out*/) +H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/) { - hid_t dxpl_id; /* DXPL for operation */ - herr_t ret_value = SUCCEED; /* Return value */ + hid_t dxpl_id = H5I_INVALID_HID; /* DXPL for operation */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file && file->cls); + HDassert(file); + HDassert(file->cls); HDassert(buf); /* Get proper DXPL for I/O */ dxpl_id = H5CX_get_dxpl(); #ifndef H5_HAVE_PARALLEL - /* Do not return early for Parallel mode since the I/O could be a */ - /* collective transfer. */ - /* The no-op case */ + /* The no-op case + * + * Do not return early for Parallel mode since the I/O could be a + * collective transfer. + */ if(0 == size) HGOTO_DONE(SUCCEED) #endif /* H5_HAVE_PARALLEL */ - /* - * If the file is open for SWMR read access, allow access to data past + /* If the file is open for SWMR read access, allow access to data past * the end of the allocated space (the 'eoa'). This is done because the * eoa stored in the file's superblock might be out of sync with the * objects being written within the file by the application performing @@ -198,7 +191,7 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, if((addr + file->base_addr + size) > eoa) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu, size = %llu, eoa = %llu", (unsigned long long)(addr + file->base_addr), (unsigned long long)size, (unsigned long long)eoa) - } /* end if */ + } /* Dispatch to driver */ if((file->cls->read)(file, type, dxpl_id, addr + file->base_addr, size, buf) < 0) @@ -210,45 +203,43 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_write - * - * Purpose: Private version of H5FDwrite() + * Function: H5FD_write * - * Return: Success: Non-negative - * Failure: Negative + * Purpose: Private version of H5FDwrite() * - * Programmer: Robb Matzke - * Wednesday, August 4, 1999 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t -H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, - const void *buf) +H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf) { - hid_t dxpl_id; /* DXPL for operation */ - haddr_t eoa = HADDR_UNDEF; /* EOA for file */ - herr_t ret_value = SUCCEED; /* Return value */ + hid_t dxpl_id; /* DXPL for operation */ + haddr_t eoa = HADDR_UNDEF; /* EOA for file */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file && file->cls); + HDassert(file); + HDassert(file->cls); HDassert(buf); /* Get proper DXPL for I/O */ dxpl_id = H5CX_get_dxpl(); #ifndef H5_HAVE_PARALLEL - /* Do not return early for Parallel mode since the I/O could be a */ - /* collective transfer. */ - /* The no-op case */ + /* The no-op case + * + * Do not return early for Parallel mode since the I/O could be a + * collective transfer. + */ if(0 == size) HGOTO_DONE(SUCCEED) #endif /* H5_HAVE_PARALLEL */ if(HADDR_UNDEF == (eoa = (file->cls->get_eoa)(file, type))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed") if((addr + file->base_addr + size) > eoa) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu, size=%llu, eoa=%llu", (unsigned long long)(addr+ file->base_addr), (unsigned long long)size, (unsigned long long)eoa) @@ -263,20 +254,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_set_eoa + * Function: H5FD_set_eoa * - * Purpose: Private version of H5FDset_eoa() + * Purpose: Private version of H5FDset_eoa() * * This function expects the EOA is a RELATIVE address, i.e. * relative to the base address. This is NOT the same as the * EOA stored in the superblock, which is an absolute * address. Object addresses are relative. * - * Return: Success: Non-negative - * Failure: Negative, no side effect - * - * Programmer: Robb Matzke - * Wednesday, August 4, 1999 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -292,7 +279,7 @@ H5FD_set_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr) /* Dispatch to driver, convert to absolute address */ if((file->cls->set_eoa)(file, type, addr + file->base_addr) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver set_eoa request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver set_eoa request failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -300,20 +287,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_get_eoa + * Function: H5FD_get_eoa * - * Purpose: Private version of H5FDget_eoa() + * Purpose: Private version of H5FDget_eoa() * * This function returns the EOA as a RELATIVE address, i.e. * relative to the base address. This is NOT the same as the * EOA stored in the superblock, which is an absolute * address. Object addresses are relative. * - * Return: Success: First byte after allocated memory. - * Failure: HADDR_UNDEF + * Return: Success: First byte after allocated memory * - * Programmer: Robb Matzke - * Wednesday, August 4, 1999 + * Failure: HADDR_UNDEF * *------------------------------------------------------------------------- */ @@ -328,7 +313,7 @@ H5FD_get_eoa(const H5FD_t *file, H5FD_mem_t type) /* Dispatch to driver */ if(HADDR_UNDEF == (ret_value = (file->cls->get_eoa)(file, type))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed") /* Adjust for base address in file (convert to relative address) */ ret_value -= file->base_addr; @@ -339,23 +324,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_get_eof + * Function: H5FD_get_eof * - * Purpose: Private version of H5FDget_eof() + * Purpose: Private version of H5FDget_eof() * * This function returns the EOF as a RELATIVE address, i.e. * relative to the base address. This will be different * from the end of the physical file if there is a user * block. * - * Return: Success: The EOF address. + * Return: Success: The EOF address. * - * Failure: HADDR_UNDEF - * - * Programmer: Robb Matzke - * Wednesday, August 4, 1999 - * - * Modifications: + * Failure: HADDR_UNDEF * *------------------------------------------------------------------------- */ @@ -370,11 +350,11 @@ H5FD_get_eof(const H5FD_t *file, H5FD_mem_t type) /* Dispatch to driver */ if(file->cls->get_eof) { - if(HADDR_UNDEF == (ret_value = (file->cls->get_eof)(file, type))) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "driver get_eof request failed") - } /* end if */ + if(HADDR_UNDEF == (ret_value = (file->cls->get_eof)(file, type))) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "driver get_eof request failed") + } else - ret_value = file->maxaddr; + ret_value = file->maxaddr; /* Adjust for base address in file (convert to relative address) */ ret_value -= file->base_addr; @@ -385,17 +365,14 @@ done: /*------------------------------------------------------------------------- -* Function: H5FD_driver_query -* -* Purpose: Similar to H5FD_query(), but intended for cases when we don't -* have a file available (e.g. before one is opened). Since we -* can't use the file to get the driver, the driver is passed in -* as a parameter. +* Function: H5FD_driver_query * -* Return: SUCCEED/FAIL +* Purpose: Similar to H5FD_query(), but intended for cases when we don't +* have a file available (e.g. before one is opened). Since we +* can't use the file to get the driver, the driver is passed in +* as a parameter. * -* Programmer: Jacob Gruber -* Wednesday, August 17, 2011 +* Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 4b42a73..7d58b7a 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -153,7 +153,7 @@ done: * * Return: Success: SUCCEED * - * Failure: Negative + * Failure: FAIL * * Programmer: John Mainzer * 4/4/17 diff --git a/src/H5FDpkg.h b/src/H5FDpkg.h index e51050e..22b5d17 100644 --- a/src/H5FDpkg.h +++ b/src/H5FDpkg.h @@ -30,7 +30,6 @@ #include "H5FDprivate.h" /* File drivers */ /* Other private headers needed by this file */ -#include "H5FLprivate.h" /* Free lists */ /**************************/ /* Package Private Macros */ @@ -50,10 +49,8 @@ /******************************/ /* Package Private Prototypes */ /******************************/ -H5_DLL haddr_t H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, - haddr_t *align_addr, hsize_t *align_size); -H5_DLL herr_t H5FD_free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, - hsize_t size); +H5_DLL haddr_t H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, haddr_t *align_addr, hsize_t *align_size); +H5_DLL herr_t H5FD__free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size); /* Testing functions */ #ifdef H5FD_TESTING diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 0430064..c79d676 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -130,7 +130,7 @@ H5_DLL H5FD_t *H5FD_open(const char *name, unsigned flags, hid_t fapl_id, H5_DLL herr_t H5FD_close(H5FD_t *file); H5_DLL int H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2); H5_DLL herr_t H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/); -H5_DLL haddr_t H5FD_alloc(H5FD_t *file, H5FD_mem_t type, +H5_DLL haddr_t H5FD_alloc(H5FD_t *file, H5FD_mem_t type, struct H5F_t *f, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size); H5_DLL herr_t H5FD_free(H5FD_t *file, H5FD_mem_t type, struct H5F_t *f, haddr_t addr, hsize_t size); @@ -143,10 +143,8 @@ H5_DLL haddr_t H5FD_get_maxaddr(const H5FD_t *file); H5_DLL herr_t H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags); H5_DLL herr_t H5FD_set_feature_flags(H5FD_t *file, unsigned long feature_flags); H5_DLL herr_t H5FD_get_fs_type_map(const H5FD_t *file, H5FD_mem_t *type_map); -H5_DLL herr_t H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, - size_t size, void *buf/*out*/); -H5_DLL herr_t H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, - size_t size, const void *buf); +H5_DLL herr_t H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/); +H5_DLL herr_t H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf); H5_DLL herr_t H5FD_flush(H5FD_t *file, hbool_t closing); H5_DLL herr_t H5FD_truncate(H5FD_t *file, hbool_t closing); H5_DLL herr_t H5FD_lock(H5FD_t *file, hbool_t rw); diff --git a/src/H5FDspace.c b/src/H5FDspace.c index 69fcb96..e1f0cb2 100644 --- a/src/H5FDspace.c +++ b/src/H5FDspace.c @@ -274,7 +274,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_free_real + * Function: H5FD__free_real * * Purpose: Release space back to the VFD * @@ -287,11 +287,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size) +H5FD__free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check args */ HDassert(file); @@ -349,13 +349,13 @@ HDfprintf(stderr, "%s: LEAKED MEMORY!!! type = %u, addr = %a, size = %Hu\n", FUN done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_free_real() */ +} /* end H5FD__free_real() */ /*------------------------------------------------------------------------- * Function: H5FD_free * - * Purpose: Wrapper for H5FD_free_real, to make certain EOA changes are + * Purpose: Wrapper for H5FD__free_real, to make certain EOA changes are * reflected in superblock. * * Note: When the metadata cache routines are updated to allow @@ -384,7 +384,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t addr, hsize_t size) HDassert(size > 0); /* Call the real 'free' routine */ - if(H5FD_free_real(file, type, addr, size) < 0) + if(H5FD__free_real(file, type, addr, size) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "real 'free' request failed") /* Mark EOA info dirty in cache, so change will get encoded */ @@ -415,8 +415,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t blk_end, - hsize_t extra_requested) +H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t blk_end, hsize_t extra_requested) { haddr_t eoa; /* End of allocated space in file */ htri_t ret_value = FALSE; /* Return value */ diff --git a/src/H5FS.c b/src/H5FS.c index 113c8ae..8fee634 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -58,8 +58,8 @@ /********************/ /* Section info routines */ -static herr_t H5FS_sinfo_free_sect_cb(void *item, void *key, void *op_data); -static herr_t H5FS_sinfo_free_node_cb(void *item, void *key, void *op_data); +static herr_t H5FS__sinfo_free_sect_cb(void *item, void *key, void *op_data); +static herr_t H5FS__sinfo_free_node_cb(void *item, void *key, void *op_data); /*********************/ @@ -221,7 +221,7 @@ HDfprintf(stderr, "%s: fspace->rc = %u\n", FUNC, fspace->rc); /* Increment the reference count on the free space manager header */ HDassert(fspace->rc <= 1); - if(H5FS_incr(fspace) < 0) + if(H5FS__incr(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINC, NULL, "unable to increment ref. count on free space header") fspace->alignment = alignment; @@ -545,7 +545,7 @@ HDfprintf(stderr, "%s: Section info is NOT for file free space\n", FUNC); } /* end if */ /* Destroy section info */ - if(H5FS_sinfo_dest(fspace->sinfo) < 0) + if(H5FS__sinfo_dest(fspace->sinfo) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCLOSEOBJ, FAIL, "unable to destroy free space section info") } /* end else */ @@ -560,7 +560,7 @@ HDfprintf(stderr, "%s: Section info is NOT for file free space\n", FUNC); } /* end else */ /* Decrement the reference count on the free space manager header */ - if(H5FS_decr(fspace) < 0) + if(H5FS__decr(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTDEC, FAIL, "unable to decrement ref. count on free space header") done: @@ -683,7 +683,7 @@ H5FS_size(const H5F_t *f, const H5FS_t *fspace, hsize_t *meta_size) /*------------------------------------------------------------------------- - * Function: H5FS_incr + * Function: H5FS__incr * * Purpose: Increment reference count on free space header * @@ -695,11 +695,11 @@ H5FS_size(const H5F_t *f, const H5FS_t *fspace, hsize_t *meta_size) *------------------------------------------------------------------------- */ herr_t -H5FS_incr(H5FS_t *fspace) +H5FS__incr(H5FS_t *fspace) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: Entering, fpace->addr = %a, fspace->rc = %u\n", FUNC, fspace->addr, fspace->rc); #endif /* H5FS_DEBUG */ @@ -719,11 +719,11 @@ HDfprintf(stderr, "%s: Entering, fpace->addr = %a, fspace->rc = %u\n", FUNC, fsp done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_incr() */ +} /* end H5FS__incr() */ /*------------------------------------------------------------------------- - * Function: H5FS_decr + * Function: H5FS__decr * * Purpose: Decrement reference count on free space header * @@ -735,11 +735,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_decr(H5FS_t *fspace) +H5FS__decr(H5FS_t *fspace) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: Entering, fpace->addr = %a, fspace->rc = %u\n", FUNC, fspace->addr, fspace->rc); #endif /* H5FS_DEBUG */ @@ -766,11 +766,11 @@ HDfprintf(stderr, "%s: Entering, fpace->addr = %a, fspace->rc = %u\n", FUNC, fsp done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_decr() */ +} /* end H5FS__decr() */ /*------------------------------------------------------------------------- - * Function: H5FS_dirty + * Function: H5FS__dirty * * Purpose: Mark free space header as dirty * @@ -782,11 +782,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_dirty(H5FS_t *fspace) +H5FS__dirty(H5FS_t *fspace) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE #ifdef QAK HDfprintf(stderr, "%s: Marking free space header as dirty\n", FUNC); #endif /* QAK */ @@ -802,7 +802,7 @@ HDfprintf(stderr, "%s: Marking free space header as dirty\n", FUNC); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_dirty() */ +} /* end H5FS__dirty() */ /*------------------------------------------------------------------------- @@ -875,7 +875,7 @@ H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace) fspace->alloc_sect_size = fspace->sect_size; /* Mark free-space header as dirty */ - if(H5FS_dirty(fspace) < 0) + if(H5FS__dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") /* Cache the free-space section info */ @@ -959,7 +959,7 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hbool_t free_file_space) } /* end if */ /* Mark free-space manager header as dirty */ - if(H5FS_dirty(fspace) < 0) + if(H5FS__dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") } /* end if */ @@ -1052,7 +1052,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FS_sinfo_free_sect_cb + * Function: H5FS__sinfo_free_sect_cb * * Purpose: Free a size-tracking node for a bin * @@ -1064,12 +1064,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sinfo_free_sect_cb(void *_sect, void H5_ATTR_UNUSED *key, void *op_data) +H5FS__sinfo_free_sect_cb(void *_sect, void H5_ATTR_UNUSED *key, void *op_data) { H5FS_section_info_t *sect = (H5FS_section_info_t *)_sect; /* Section to free */ const H5FS_sinfo_t *sinfo = (const H5FS_sinfo_t *)op_data; /* Free space manager for section */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(sect); HDassert(sinfo); @@ -1078,11 +1078,11 @@ H5FS_sinfo_free_sect_cb(void *_sect, void H5_ATTR_UNUSED *key, void *op_data) (*sinfo->fspace->sect_cls[sect->type].free)(sect); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5FS_sinfo_free_sect_cb() */ +} /* H5FS__sinfo_free_sect_cb() */ /*------------------------------------------------------------------------- - * Function: H5FS_sinfo_free_node_cb + * Function: H5FS__sinfo_free_node_cb * * Purpose: Free a size-tracking node for a bin * @@ -1094,27 +1094,27 @@ H5FS_sinfo_free_sect_cb(void *_sect, void H5_ATTR_UNUSED *key, void *op_data) *------------------------------------------------------------------------- */ static herr_t -H5FS_sinfo_free_node_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data) +H5FS__sinfo_free_node_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data) { H5FS_node_t *fspace_node = (H5FS_node_t *)item; /* Temporary pointer to free space list node */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(fspace_node); HDassert(op_data); /* Release the skip list for sections of this size */ - H5SL_destroy(fspace_node->sect_list, H5FS_sinfo_free_sect_cb, op_data); + H5SL_destroy(fspace_node->sect_list, H5FS__sinfo_free_sect_cb, op_data); /* Release free space list node */ fspace_node = H5FL_FREE(H5FS_node_t, fspace_node); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5FS_sinfo_free_node_cb() */ +} /* H5FS__sinfo_free_node_cb() */ /*------------------------------------------------------------------------- - * Function: H5FS_sinfo_dest + * Function: H5FS__sinfo_dest * * Purpose: Destroys a free space section info in memory. * @@ -1126,12 +1126,12 @@ H5FS_sinfo_free_node_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data) *------------------------------------------------------------------------- */ herr_t -H5FS_sinfo_dest(H5FS_sinfo_t *sinfo) +H5FS__sinfo_dest(H5FS_sinfo_t *sinfo) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1143,7 +1143,7 @@ H5FS_sinfo_dest(H5FS_sinfo_t *sinfo) /* Clear out lists of nodes */ for(u = 0; u < sinfo->nbins; u++) if(sinfo->bins[u].bin_list) { - H5SL_destroy(sinfo->bins[u].bin_list, H5FS_sinfo_free_node_cb, sinfo); + H5SL_destroy(sinfo->bins[u].bin_list, H5FS__sinfo_free_node_cb, sinfo); sinfo->bins[u].bin_list = NULL; } /* end if */ @@ -1160,7 +1160,7 @@ H5FS_sinfo_dest(H5FS_sinfo_t *sinfo) * disappearing immediately) */ sinfo->fspace->sinfo = NULL; - if(H5FS_decr(sinfo->fspace) < 0) + if(H5FS__decr(sinfo->fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTDEC, FAIL, "unable to decrement ref. count on free space header") sinfo->fspace = NULL; @@ -1169,7 +1169,7 @@ H5FS_sinfo_dest(H5FS_sinfo_t *sinfo) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_sinfo_dest() */ +} /* end H5FS__sinfo_dest() */ herr_t H5FS_get_sect_count(const H5FS_t *frsp, hsize_t *tot_sect_count) diff --git a/src/H5FScache.c b/src/H5FScache.c index fa04ba1..ac0874e 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -926,7 +926,7 @@ H5FS__cache_sinfo_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU uint32_t computed_chksum; /* Computed metadata checksum value */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ HDassert(image); @@ -981,7 +981,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata, HDassert(dirty); /* Allocate a new free space section info */ - if(NULL == (sinfo = H5FS_sinfo_new(udata->f, fspace))) + if(NULL == (sinfo = H5FS__sinfo_new(udata->f, fspace))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* initialize old_sect_size */ @@ -1087,7 +1087,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata, done: if(!ret_value && sinfo) - if(H5FS_sinfo_dest(sinfo) < 0) + if(H5FS__sinfo_dest(sinfo) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTFREE, NULL, "unable to destroy free space info") FUNC_LEAVE_NOAPI(ret_value) @@ -1321,7 +1321,7 @@ H5FS__cache_sinfo_notify(H5AC_notify_action_t action, void *_thing) H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(sinfo); @@ -1404,7 +1404,7 @@ H5FS__cache_sinfo_free_icr(void *_thing) HDassert(fspace->cache_info.is_pinned); /* Destroy free space info */ - if(H5FS_sinfo_dest(sinfo) < 0) + if(H5FS__sinfo_dest(sinfo) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space info") done: @@ -1512,3 +1512,4 @@ H5FS__sinfo_serialize_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udat done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FS__sinfo_serialize_node_cb() */ + diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index f160055..2c56ab6 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -215,24 +215,22 @@ H5FL_EXTERN(H5FS_t); /******************************/ /* Generic routines */ -H5_DLL herr_t H5FS__create_flush_depend(H5AC_info_t *parent_entry, - H5AC_info_t *child_entry); -H5_DLL herr_t H5FS__destroy_flush_depend(H5AC_info_t *parent_entry, - H5AC_info_t *child_entry); +H5_DLL herr_t H5FS__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry); +H5_DLL herr_t H5FS__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry); /* Free space manager header routines */ H5_DLL H5FS_t *H5FS__new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata); -H5_DLL herr_t H5FS_incr(H5FS_t *fspace); -H5_DLL herr_t H5FS_decr(H5FS_t *fspace); -H5_DLL herr_t H5FS_dirty(H5FS_t *fspace); +H5_DLL herr_t H5FS__incr(H5FS_t *fspace); +H5_DLL herr_t H5FS__decr(H5FS_t *fspace); +H5_DLL herr_t H5FS__dirty(H5FS_t *fspace); /* Free space section routines */ -H5_DLL H5FS_sinfo_t *H5FS_sinfo_new(H5F_t *f, H5FS_t *fspace); +H5_DLL H5FS_sinfo_t *H5FS__sinfo_new(H5F_t *f, H5FS_t *fspace); /* Routines for destroying structures */ H5_DLL herr_t H5FS__hdr_dest(H5FS_t *hdr); -H5_DLL herr_t H5FS_sinfo_dest(H5FS_sinfo_t *sinfo); +H5_DLL herr_t H5FS__sinfo_dest(H5FS_sinfo_t *sinfo); /* Sanity check routines */ #ifdef H5FS_DEBUG_ASSERT diff --git a/src/H5FSsection.c b/src/H5FSsection.c index a58347f..27486f1 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -64,26 +64,26 @@ typedef struct { /********************/ /* Local Prototypes */ /********************/ -static herr_t H5FS_sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls, +static herr_t H5FS__sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls, unsigned flags); -static herr_t H5FS_sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls); -static herr_t H5FS_size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node, +static herr_t H5FS__sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls); +static herr_t H5FS__size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node, const H5FS_section_class_t *cls); -static herr_t H5FS_sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, +static herr_t H5FS__sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_section_info_t *sect); -static herr_t H5FS_sect_unlink_rest(H5FS_t *fspace, +static herr_t H5FS__sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_section_info_t *sect); -static herr_t H5FS_sect_remove_real(H5FS_t *fspace, H5FS_section_info_t *sect); -static herr_t H5FS_sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, +static herr_t H5FS__sect_remove_real(H5FS_t *fspace, H5FS_section_info_t *sect); +static herr_t H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_section_info_t *sect); -static herr_t H5FS_sect_link_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, +static herr_t H5FS__sect_link_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_section_info_t *sect, unsigned flags); -static herr_t H5FS_sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, +static herr_t H5FS__sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags); -static herr_t H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, +static herr_t H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data); -static htri_t H5FS_sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node); -static herr_t H5FS_sect_serialize_size(H5FS_t *fspace); +static htri_t H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node); +static herr_t H5FS__sect_serialize_size(H5FS_t *fspace); /*********************/ @@ -112,7 +112,7 @@ H5FL_DEFINE(H5FS_sinfo_t); /*------------------------------------------------------------------------- - * Function: H5FS_sinfo_new + * Function: H5FS__sinfo_new * * Purpose: Create new section info structure * @@ -125,12 +125,12 @@ H5FL_DEFINE(H5FS_sinfo_t); *------------------------------------------------------------------------- */ H5FS_sinfo_t * -H5FS_sinfo_new(H5F_t *f, H5FS_t *fspace) +H5FS__sinfo_new(H5F_t *f, H5FS_t *fspace) { H5FS_sinfo_t *sinfo = NULL; /* Section information struct created */ H5FS_sinfo_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(f); @@ -160,7 +160,7 @@ HDfprintf(stderr, "%s: sinfo->sect_off_size = %u, sinfo->sect_len_size = %u\n", HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for free space section bin array") /* Increment the reference count on the free space manager header */ - if(H5FS_incr(fspace) < 0) + if(H5FS__incr(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINC, NULL, "unable to increment ref. count on free space header") sinfo->fspace = fspace; @@ -183,11 +183,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sinfo_new() */ +} /* H5FS__sinfo_new() */ /*------------------------------------------------------------------------- - * Function: H5FS_sinfo_lock + * Function: H5FS__sinfo_lock * * Purpose: Make certain the section info for the free space manager is * in memory. @@ -204,12 +204,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode) +H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode) { H5FS_sinfo_cache_ud_t cache_udata; /* User-data for cache callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: Called, fspace->addr = %a, fspace->sinfo = %p, fspace->sect_addr = %a\n", FUNC, fspace->addr, fspace->sinfo, fspace->sect_addr); @@ -280,7 +280,7 @@ HDfprintf(stderr, "%s: Creating new section info\n", FUNC); HDassert(fspace->ghost_sect_count == 0); /* Allocate and initialize free space section info */ - if(NULL == (fspace->sinfo = H5FS_sinfo_new(f, fspace))) + if(NULL == (fspace->sinfo = H5FS__sinfo_new(f, fspace))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create section info") /* Set initial size of section info to 0 */ @@ -298,11 +298,11 @@ HDfprintf(stderr, "%s: Leaving, fspace->addr = %a, fspace->sinfo = %p, fspace->s HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n", FUNC, fspace->alloc_sect_size, fspace->sect_size); #endif /* H5FS_SINFO_DEBUG */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sinfo_lock() */ +} /* H5FS__sinfo_lock() */ /*------------------------------------------------------------------------- - * Function: H5FS_sinfo_unlock + * Function: H5FS__sinfo_unlock * * Purpose: Release the section info, either giving ownership back to * the cache or letting the free space header keep it. @@ -315,11 +315,11 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" *------------------------------------------------------------------------- */ static herr_t -H5FS_sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) +H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: Called, modified = %t, fspace->addr = %a, fspace->sect_addr = %a\n", FUNC, modified, fspace->addr, fspace->sect_addr); HDfprintf(stderr, "%s: fspace->sinfo_lock_count = %u, fspace->sinfo_modified = %t, fspace->sinfo_protected = %t\n", FUNC, fspace->sinfo_lock_count, fspace->sinfo_modified, fspace->sinfo_protected); @@ -347,7 +347,7 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" /* Assume that the modification will affect the statistics in the header * and mark that dirty also */ - if(H5FS_dirty(fspace) < 0) + if(H5FS__dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") } /* end if */ @@ -442,7 +442,7 @@ HDfprintf(stderr, "%s: Relinquishing section info ownership\n", FUNC); /* If we haven't already marked the header dirty, do so now */ if(!modified) - if(H5FS_dirty(fspace) < 0) + if(H5FS__dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") #ifdef H5FS_SINFO_DEBUG @@ -460,11 +460,11 @@ done: HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); #endif /* H5FS_SINFO_DEBUG */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sinfo_unlock() */ +} /* H5FS__sinfo_unlock() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_serialize_size + * Function: H5FS__sect_serialize_size * * Purpose: Determine serialized size of all sections in free space manager * @@ -476,17 +476,17 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); *------------------------------------------------------------------------- */ static herr_t -H5FS_sect_serialize_size(H5FS_t *fspace) +H5FS__sect_serialize_size(H5FS_t *fspace) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(fspace); #ifdef QAK -HDfprintf(stderr, "%s: Check 1.0 - fspace->sect_size = %Hu\n", "H5FS_sect_serialize_size", fspace->sect_size); -HDfprintf(stderr, "%s: fspace->serial_sect_count = %Zu\n", "H5FS_sect_serialize_size", fspace->serial_sect_count); -HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu\n", "H5FS_sect_serialize_size", fspace->alloc_sect_size); -HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS_sect_serialize_size", fspace->sinfo->serial_size_count); +HDfprintf(stderr, "%s: Check 1.0 - fspace->sect_size = %Hu\n", "H5FS__sect_serialize_size", fspace->sect_size); +HDfprintf(stderr, "%s: fspace->serial_sect_count = %Zu\n", "H5FS__sect_serialize_size", fspace->serial_sect_count); +HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu\n", "H5FS__sect_serialize_size", fspace->alloc_sect_size); +HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS__sect_serialize_size", fspace->sinfo->serial_size_count); #endif /* QAK */ /* Compute the size of the buffer required to serialize all the sections */ @@ -498,8 +498,8 @@ HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS_sect_ser /* Count for each differently sized serializable section */ #ifdef QAK -HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS_sect_serialize_size", fspace->sinfo->serial_size_count); -HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", "H5FS_sect_serialize_size", fspace->serial_sect_count); +HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS__sect_serialize_size", fspace->sinfo->serial_size_count); +HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", "H5FS__sect_serialize_size", fspace->serial_sect_count); #endif /* QAK */ sect_buf_size += fspace->sinfo->serial_size_count * H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); @@ -523,11 +523,11 @@ HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", "H5FS_sect_serialize_ fspace->sect_size = fspace->sinfo->sect_prefix_size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5FS_sect_serialize_size() */ +} /* H5FS__sect_serialize_size() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_increase + * Function: H5FS__sect_increase * * Purpose: Increase the size of the serialized free space section info * on disk @@ -540,12 +540,12 @@ HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", "H5FS_sect_serialize_ *------------------------------------------------------------------------- */ static herr_t -H5FS_sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls, +H5FS__sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls, unsigned flags) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(fspace); @@ -577,18 +577,18 @@ HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size); /* Update the free space sections' serialized size */ /* (if we're not deserializing the sections from disk) */ if(!(flags & H5FS_ADD_DESERIALIZING)) { - if(H5FS_sect_serialize_size(fspace) < 0) + if(H5FS__sect_serialize_size(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCOMPUTE, FAIL, "can't adjust free space section size on disk") } /* end if */ } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sect_increase() */ +} /* H5FS__sect_increase() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_decrease + * Function: H5FS__sect_decrease * * Purpose: Decrease the size of the serialized free space section info * on disk @@ -601,11 +601,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls) +H5FS__sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(fspace); @@ -635,17 +635,17 @@ HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size); fspace->sinfo->serial_size -= cls->serial_size; /* Update the free space sections' serialized size */ - if(H5FS_sect_serialize_size(fspace) < 0) + if(H5FS__sect_serialize_size(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCOMPUTE, FAIL, "can't adjust free space section size on disk") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sect_decrease() */ +} /* H5FS__sect_decrease() */ /*------------------------------------------------------------------------- - * Function: H5FS_size_node_decr + * Function: H5FS__size_node_decr * * Purpose: Decrement the number of sections of a particular size * @@ -657,12 +657,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node, +H5FS__size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node, const H5FS_section_class_t *cls) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sinfo); @@ -728,11 +728,11 @@ HDfprintf(stderr, "%s: sinfo->bins[%u].sect_count = %Zu\n", FUNC, bin, sinfo->bi done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_size_node_decr() */ +} /* H5FS__size_node_decr() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_unlink_size + * Function: H5FS__sect_unlink_size * * Purpose: Remove a section node from size tracking data structures for * a free space manager @@ -745,7 +745,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, +H5FS__sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_section_info_t *sect) { H5FS_node_t *fspace_node; /* Free list size node */ @@ -753,7 +753,7 @@ H5FS_sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, unsigned bin; /* Bin to put the free space section in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sinfo); @@ -777,16 +777,16 @@ H5FS_sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "can't find section node on size list") /* Decrement # of sections in section size node */ - if(H5FS_size_node_decr(sinfo, bin, fspace_node, cls) < 0) + if(H5FS__size_node_decr(sinfo, bin, fspace_node, cls) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTREMOVE, FAIL, "can't remove free space size node from skip list") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sect_unlink_size() */ +} /* H5FS__sect_unlink_size() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_unlink_rest + * Function: H5FS__sect_unlink_rest * * Purpose: Finish unlinking a section from the rest of the free space * manager's data structures, after the section has been removed @@ -800,12 +800,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, +H5FS__sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_section_info_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(fspace); @@ -826,7 +826,7 @@ HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC } /* end if */ /* Update section info & check if we need less room for the serialized free space sections */ - if(H5FS_sect_decrease(fspace, cls) < 0) + if(H5FS__sect_decrease(fspace, cls) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't increase free space section size on disk") /* Decrement amount of free space managed */ @@ -837,11 +837,11 @@ HDfprintf(stderr, "%s: fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sect_unlink_rest() */ +} /* H5FS__sect_unlink_rest() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_remove_real + * Function: H5FS__sect_remove_real * * Purpose: Remove a section from the free space manager * @@ -853,12 +853,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sect_remove_real(H5FS_t *fspace, H5FS_section_info_t *sect) +H5FS__sect_remove_real(H5FS_t *fspace, H5FS_section_info_t *sect) { const H5FS_section_class_t *cls; /* Class of section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(fspace); @@ -869,16 +869,16 @@ H5FS_sect_remove_real(H5FS_t *fspace, H5FS_section_info_t *sect) cls = &fspace->sect_cls[sect->type]; /* Remove node from size tracked data structures */ - if(H5FS_sect_unlink_size(fspace->sinfo, cls, sect) < 0) + if(H5FS__sect_unlink_size(fspace->sinfo, cls, sect) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "can't remove section from size tracking data structures") /* Update rest of free space manager data structures for node removal */ - if(H5FS_sect_unlink_rest(fspace, cls, sect) < 0) + if(H5FS__sect_unlink_rest(fspace, cls, sect) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "can't remove section from non-size tracking data structures") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sect_remove_real() */ +} /* H5FS__sect_remove_real() */ /*------------------------------------------------------------------------- @@ -907,17 +907,17 @@ H5FS_sect_remove(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect) HDassert(sect); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; /* Perform actual section removal */ - if(H5FS_sect_remove_real(fspace, sect) < 0) + if(H5FS__sect_remove_real(fspace, sect) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTREMOVE, FAIL, "can't remove section") done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, TRUE) < 0) + if(sinfo_valid && H5FS__sinfo_unlock(f, fspace, TRUE) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -925,7 +925,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FS_sect_link_size + * Function: H5FS__sect_link_size * * Purpose: Add a section of free space to the free list bins * @@ -937,7 +937,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, +H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_section_info_t *sect) { H5FS_node_t *fspace_node = NULL; /* Pointer to free space node of the correct size */ @@ -945,7 +945,7 @@ H5FS_sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, unsigned bin; /* Bin to put the free space section in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #ifdef QAK HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, sect->addr); #endif /* QAK */ @@ -1028,11 +1028,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sect_link_size() */ +} /* H5FS__sect_link_size() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_link_rest + * Function: H5FS__sect_link_rest * * Purpose: Link a section into the rest of the non-size tracking * free space manager data structures @@ -1045,12 +1045,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sect_link_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, +H5FS__sect_link_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_section_info_t *sect, unsigned flags) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(fspace); @@ -1070,7 +1070,7 @@ HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUN } /* end if */ /* Update section info & check if we need more room for the serialized free space sections */ - if(H5FS_sect_increase(fspace, cls, flags) < 0) + if(H5FS__sect_increase(fspace, cls, flags) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't increase free space section size on disk") /* Increment amount of free space managed */ @@ -1078,11 +1078,11 @@ HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUN done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sect_link_rest() */ +} /* H5FS__sect_link_rest() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_link + * Function: H5FS__sect_link * * Purpose: Link a section into the internal data structures * @@ -1094,12 +1094,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags) +H5FS__sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags) { const H5FS_section_class_t *cls; /* Class of section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(fspace); @@ -1113,14 +1113,14 @@ H5FS_sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags) #ifdef QAK HDfprintf(stderr, "%s: Check 1.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); #endif /* QAK */ - if(H5FS_sect_link_size(fspace->sinfo, cls, sect) < 0) + if(H5FS__sect_link_size(fspace->sinfo, cls, sect) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't add section to size tracking data structures") #ifdef QAK HDfprintf(stderr, "%s: Check 2.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); #endif /* QAK */ /* Update rest of free space manager data structures for section addition */ - if(H5FS_sect_link_rest(fspace, cls, sect, flags) < 0) + if(H5FS__sect_link_rest(fspace, cls, sect, flags) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't add section to non-size tracking data structures") #ifdef QAK HDfprintf(stderr, "%s: Check 3.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); @@ -1128,11 +1128,11 @@ HDfprintf(stderr, "%s: Check 3.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sect_link() */ +} /* H5FS__sect_link() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_merge + * Function: H5FS__sect_merge * * Purpose: Attempt to merge a returned free space section with existing * free space. @@ -1145,7 +1145,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) +H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) { H5FS_section_class_t *sect_cls; /* Section's class */ hbool_t modified; /* Flag to indicate merge or shrink occurred */ @@ -1153,7 +1153,7 @@ H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) htri_t status; /* Status value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(fspace); @@ -1203,7 +1203,7 @@ H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) HDassert(tmp_sect_cls->merge); /* Remove 'less than' node from data structures */ - if(H5FS_sect_remove_real(fspace, tmp_sect) < 0) + if(H5FS__sect_remove_real(fspace, tmp_sect) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't remove section from internal data structures") /* Merge the two sections together */ @@ -1249,7 +1249,7 @@ H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) HDassert(sect_cls->merge); /* Remove 'greater than' node from data structures */ - if(H5FS_sect_remove_real(fspace, tmp_sect) < 0) + if(H5FS__sect_remove_real(fspace, tmp_sect) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't remove section from internal data structures") /* Merge the two sections together */ @@ -1290,7 +1290,7 @@ HDfprintf(stderr, "%s: Can shrink!\n", FUNC); /* Remove SECT from free-space manager */ /* (only possible to happen on second+ pass through loop) */ if(remove_sect) { - if(H5FS_sect_remove_real(fspace, *sect) < 0) + if(H5FS__sect_remove_real(fspace, *sect) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't remove section from internal data structures") remove_sect = FALSE; } /* end if */ @@ -1342,7 +1342,7 @@ done: HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); #endif /* QAK */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sect_merge() */ +} /* H5FS__sect_merge() */ /*------------------------------------------------------------------------- @@ -1379,7 +1379,7 @@ HDfprintf(stderr, "%s: *sect = {%a, %Hu, %u, %s}\n", FUNC, sect->addr, sect->siz HDassert(sect->size); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -1396,7 +1396,7 @@ HDfprintf(stderr, "%s: Returning space\n", FUNC); #endif /* H5FS_SINFO_DEBUG */ /* Attempt to merge returned section with existing sections */ - if(H5FS_sect_merge(fspace, §, op_data) < 0) + if(H5FS__sect_merge(fspace, §, op_data) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMERGE, FAIL, "can't merge sections") } /* end if */ @@ -1405,7 +1405,7 @@ HDfprintf(stderr, "%s: Returning space\n", FUNC); * be NULL at this point - QAK) */ if(sect) - if(H5FS_sect_link(fspace, sect, flags) < 0) + if(H5FS__sect_link(fspace, sect, flags) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't insert free space section into skip list") #ifdef H5FS_SINFO_DEBUG @@ -1418,7 +1418,7 @@ HDfprintf(stderr, "%s: fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, sinfo_modified) < 0) + if(sinfo_valid && H5FS__sinfo_unlock(f, fspace, sinfo_modified) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") #ifdef H5FS_DEBUG_ASSERT @@ -1475,7 +1475,7 @@ HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_se H5FS_section_info_t *sect; /* Temporary free space section */ /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -1511,7 +1511,7 @@ if(_section_) H5FS_section_class_t *cls; /* Section's class */ /* Remove section from data structures */ - if(H5FS_sect_remove_real(fspace, sect) < 0) + if(H5FS__sect_remove_real(fspace, sect) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't remove section from internal data structures") /* Get class for section */ @@ -1537,7 +1537,7 @@ if(_section_) /* Re-adding the section could cause it to disappear (particularly when paging) */ if(sect) { /* Re-add adjusted section to free sections data structures */ - if(H5FS_sect_link(fspace, sect, 0) < 0) + if(H5FS__sect_link(fspace, sect, 0) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't insert free space section into skip list") } /* end if */ } /* end if */ @@ -1561,7 +1561,7 @@ if(_section_) done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, sinfo_modified) < 0) + if(sinfo_valid && H5FS__sinfo_unlock(f, fspace, sinfo_modified) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -1601,13 +1601,13 @@ H5FS_sect_try_merge(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, HDassert(sect->size); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; saved_fs_size = sect->size; /* Attempt to merge/shrink section with existing sections */ - if(H5FS_sect_merge(fspace, §, op_data) < 0) + if(H5FS__sect_merge(fspace, §, op_data) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMERGE, FAIL, "can't merge sections") /* Check if section is shrunk and/or merged away completely */ @@ -1618,7 +1618,7 @@ H5FS_sect_try_merge(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, else { /* Check if section is merged */ if(sect->size > saved_fs_size) { - if(H5FS_sect_link(fspace, sect, flags) < 0) + if(H5FS__sect_link(fspace, sect, flags) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't insert free space section into skip list") sinfo_modified = TRUE; HGOTO_DONE(TRUE) @@ -1627,7 +1627,7 @@ H5FS_sect_try_merge(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, sinfo_modified) < 0) + if(sinfo_valid && H5FS__sinfo_unlock(f, fspace, sinfo_modified) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -1635,7 +1635,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FS_sect_find_node + * Function: H5FS__sect_find_node * * Purpose: Locate a section of free space (in existing free space list * bins) that is large enough to fulfill request. @@ -1648,7 +1648,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5FS_sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node) +H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node) { H5FS_node_t *fspace_node; /* Free list size node */ unsigned bin; /* Bin to put the free space section in */ @@ -1658,7 +1658,7 @@ H5FS_sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node) const H5FS_section_class_t *cls; /* Class of section */ hsize_t alignment; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(fspace); @@ -1696,9 +1696,9 @@ HDfprintf(stderr, "%s: bin = %u\n", FUNC, bin); /* Get section's class */ cls = &fspace->sect_cls[(*node)->type]; /* Decrement # of sections in section size node */ - if(H5FS_size_node_decr(fspace->sinfo, bin, fspace_node, cls) < 0) + if(H5FS__size_node_decr(fspace->sinfo, bin, fspace_node, cls) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTREMOVE, FAIL, "can't remove free space size node from skip list") - if(H5FS_sect_unlink_rest(fspace, cls, *node) < 0) + if(H5FS__sect_unlink_rest(fspace, cls, *node) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "can't remove section from non-size tracking data structures") /* Indicate that we found a node for the request */ HGOTO_DONE(TRUE) @@ -1741,10 +1741,10 @@ HDfprintf(stderr, "%s: bin = %u\n", FUNC, bin); if(NULL == (*node = (H5FS_section_info_t *)H5SL_remove(curr_fspace_node->sect_list, &curr_sect->addr))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTREMOVE, FAIL, "can't remove free space node from skip list") /* Decrement # of sections in section size node */ - if(H5FS_size_node_decr(fspace->sinfo, bin, curr_fspace_node, cls) < 0) + if(H5FS__size_node_decr(fspace->sinfo, bin, curr_fspace_node, cls) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTREMOVE, FAIL, "can't remove free space size node from skip list") - if(H5FS_sect_unlink_rest(fspace, cls, *node) < 0) + if(H5FS__sect_unlink_rest(fspace, cls, *node) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "can't remove section from non-size tracking data structures") /* @@ -1755,7 +1755,7 @@ HDfprintf(stderr, "%s: bin = %u\n", FUNC, bin); */ if(mis_align) { split_sect = cls->split(*node, frag_size); - if((H5FS_sect_link(fspace, split_sect, 0) < 0)) + if((H5FS__sect_link(fspace, split_sect, 0) < 0)) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't insert free space section into skip list") /* sanity check */ HDassert(split_sect->addr < (*node)->addr); @@ -1780,7 +1780,7 @@ HDfprintf(stderr, "%s: bin = %u\n", FUNC, bin); done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sect_find_node() */ +} /* H5FS__sect_find_node() */ /*------------------------------------------------------------------------- @@ -1823,12 +1823,12 @@ HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_se #endif /* QAK */ if(fspace->tot_sect_count > 0) { /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; /* Look for node in bins */ - if((ret_value = H5FS_sect_find_node(fspace, request, node)) < 0) + if((ret_value = H5FS__sect_find_node(fspace, request, node)) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "can't remove section from bins") /* Decrement # of sections on free list, if we found an object */ @@ -1843,7 +1843,7 @@ HDfprintf(stderr, "%s: (*node)->size = %Hu, (*node)->addr = %a, (*node)->type = done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, sinfo_modified) < 0) + if(sinfo_valid && H5FS__sinfo_unlock(f, fspace, sinfo_modified) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") #ifdef H5FS_DEBUG_ASSERT @@ -1965,7 +1965,7 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_c unsigned bin; /* Current bin we are on */ /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, fspace, H5AC__READ_ONLY_FLAG) < 0) + if(H5FS__sinfo_lock(f, fspace, H5AC__READ_ONLY_FLAG) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -1985,7 +1985,7 @@ HDfprintf(stderr, "%s: Iterate over section bins\n", FUNC); done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, FALSE) < 0) + if(sinfo_valid && H5FS__sinfo_unlock(f, fspace, FALSE) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -2054,7 +2054,7 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, HDassert(new_class < fspace->nclasses); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -2179,12 +2179,12 @@ HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC fspace->sinfo->serial_size += fspace->sect_cls[new_class].serial_size; /* Update current space used for free space sections */ - if(H5FS_sect_serialize_size(fspace) < 0) + if(H5FS__sect_serialize_size(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCOMPUTE, FAIL, "can't adjust free space section size on disk") done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, TRUE) < 0) + if(sinfo_valid && H5FS__sinfo_unlock(f, fspace, TRUE) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -2343,13 +2343,12 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H /*------------------------------------------------------------------------- - * Function: H5FS_sect_try_shrink_eoa + * Function: H5FS_sect_try_shrink_eoa * - * Purpose: To shrink the last section on the merge list if the section - * is at EOF. + * Purpose: To shrink the last section on the merge list if the section + * is at EOF. * - * Return: Success: non-negative (TRUE/FALSE) - * Failure: negative + * Return: TRUE/FALSE/FAIL * * Programmer: Vailin Choi * @@ -2367,7 +2366,7 @@ H5FS_sect_try_shrink_eoa(H5F_t *f, H5FS_t *fspace, void *op_data) /* Check arguments. */ HDassert(fspace); - if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -2382,30 +2381,30 @@ H5FS_sect_try_shrink_eoa(H5F_t *f, H5FS_t *fspace, void *op_data) /* Get the pointer to the last section, from the last node */ tmp_sect = (H5FS_section_info_t *)H5SL_item(last_node); HDassert(tmp_sect); - tmp_sect_cls = &fspace->sect_cls[tmp_sect->type]; - if(tmp_sect_cls->can_shrink) { + tmp_sect_cls = &fspace->sect_cls[tmp_sect->type]; + if(tmp_sect_cls->can_shrink) { /* Check if the section can be shrunk away */ - if((ret_value = (*tmp_sect_cls->can_shrink)(tmp_sect, op_data)) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking container") - if(ret_value > 0) { - HDassert(tmp_sect_cls->shrink); + if((ret_value = (*tmp_sect_cls->can_shrink)(tmp_sect, op_data)) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking container") + if(ret_value > 0) { + HDassert(tmp_sect_cls->shrink); /* Remove section from free space manager */ - if(H5FS_sect_remove_real(fspace, tmp_sect) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't remove section from internal data structures") + if(H5FS__sect_remove_real(fspace, tmp_sect) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't remove section from internal data structures") section_removed = TRUE; /* Shrink away section */ - if((*tmp_sect_cls->shrink)(&tmp_sect, op_data) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't shrink free space container") - } /* end if */ - } /* end if */ - } /* end if */ + if((*tmp_sect_cls->shrink)(&tmp_sect, op_data) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't shrink free space container") + } /* end if */ + } /* end if */ + } /* end if */ } /* end if */ done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, section_removed) < 0) + if(sinfo_valid && H5FS__sinfo_unlock(f, fspace, section_removed) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -2557,15 +2556,15 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, if(H5F_IS_TMP_ADDR(f, (eoa + fspace->sect_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, FAIL, "hdr file space alloc will overlap into 'temporary' file space") - hdr_alloc_size = H5FS_HEADER_SIZE(f); + hdr_alloc_size = H5FS_HEADER_SIZE(f); - /* if page allocation is enabled, extend the hdr_alloc_size to the - * next page boundary. + /* if page allocation is enabled, extend the hdr_alloc_size to the + * next page boundary. */ if(H5F_PAGED_AGGR(f)) { HDassert(0 == (eoa % f->shared->fs_page_size)); - hdr_alloc_size = ((hdr_alloc_size / f->shared->fs_page_size) + 1) * f->shared->fs_page_size; + hdr_alloc_size = ((hdr_alloc_size / f->shared->fs_page_size) + 1) * f->shared->fs_page_size; HDassert(hdr_alloc_size >= H5FS_HEADER_SIZE(f)); HDassert((hdr_alloc_size % f->shared->fs_page_size) == 0); @@ -2599,13 +2598,13 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, sinfo_alloc_size = fspace->sect_size; - /* if paged allocation is enabled, extend the sinfo_alloc_size to the - * next page boundary. + /* if paged allocation is enabled, extend the sinfo_alloc_size to the + * next page boundary. */ if(H5F_PAGED_AGGR(f)) { HDassert(0 == (eoa % f->shared->fs_page_size)); - sinfo_alloc_size = ((sinfo_alloc_size / f->shared->fs_page_size) + 1) * f->shared->fs_page_size; + sinfo_alloc_size = ((sinfo_alloc_size / f->shared->fs_page_size) + 1) * f->shared->fs_page_size; HDassert(sinfo_alloc_size >= fspace->sect_size); HDassert((sinfo_alloc_size % f->shared->fs_page_size) == 0); diff --git a/src/H5G.c b/src/H5G.c index cbf3a8e..e54e5cd 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -14,14 +14,12 @@ /*------------------------------------------------------------------------- * * Created: H5G.c - * Jul 18 1997 - * Robb Matzke * * Purpose: Symbol table functions. The functions that begin with - * `H5G_stab_' don't understand the naming system; they operate + * 'H5G_stab_' don't understand the naming system; they operate * on a single symbol table at a time. * - * The functions that begin with `H5G_node_' operate on the leaf + * The functions that begin with 'H5G_node_' operate on the leaf * nodes of a symbol table B-tree. They should be defined in * the H5Gnode.c file. * @@ -42,11 +40,11 @@ * +--------------+----------- +--------------------------------+ * | Location ID | Name | Meaning | * +--------------+------------+--------------------------------+ - * | File ID | "/foo/bar" | Find `foo' within `bar' within | + * | File ID | "/foo/bar" | Find 'foo' within 'bar' within | * | | | the root group of the specified| * | | | file. | * +--------------+------------+--------------------------------+ - * | File ID | "foo/bar" | Find `foo' within `bar' within | + * | File ID | "foo/bar" | Find 'foo' within 'bar' within | * | | | the root group of the specified| * | | | file. | * +--------------+------------+--------------------------------+ @@ -56,11 +54,11 @@ * | File ID | "." | The root group of the specified| * | | | the specified file. | * +--------------+------------+--------------------------------+ - * | Group ID | "/foo/bar" | Find `foo' within `bar' within | + * | Group ID | "/foo/bar" | Find 'foo' within 'bar' within | * | | | the root group of the file | * | | | containing the specified group.| * +--------------+------------+--------------------------------+ - * | Group ID | "foo/bar" | File `foo' within `bar' within | + * | Group ID | "foo/bar" | File 'foo' within 'bar' within | * | | | the specified group. | * +--------------+------------+--------------------------------+ * | Group ID | "/" | The root group of the file | @@ -83,13 +81,12 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5CXprivate.h" /* API Contexts */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Gpkg.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Pprivate.h" /* Property lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Gpkg.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Pprivate.h" /* Property lists */ /****************/ diff --git a/src/H5Gint.c b/src/H5Gint.c index 8fd7514..51d3b91 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -32,13 +32,13 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FOprivate.h" /* File objects */ -#include "H5Gpkg.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Lprivate.h" /* Links */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FOprivate.h" /* File objects */ +#include "H5Gpkg.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Lprivate.h" /* Links */ +#include "H5MMprivate.h" /* Memory management */ /****************/ @@ -805,12 +805,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_iterate + * Function: H5G_iterate * * Purpose: Private function for iterating over links in a group * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Oct 3, 2005 @@ -860,7 +859,7 @@ done: if(gid > 0) { if(H5I_dec_app_ref(gid) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") - } /* end if */ + } else if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") @@ -1054,9 +1053,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_visit + * Function: H5G_visit * - * Purpose: Recursively visit all the links in a group and all + * Purpose: Recursively visit all the links in a group and all * the groups that are linked to from that group. Links within * each group are visited according to the order within the * specified index (unless the specified index does not exist for @@ -1068,18 +1067,13 @@ done: * callback with more than one link that points to a particular * _object_. * - * Return: Success: The return value of the first operator that - * returns non-zero, or zero if all members were - * processed with no operator returning non-zero. - * - * Failure: Negative if something goes wrong within the - * library, or the negative value returned by one - * of the operators. + * Return: Success: The return value of the first operator that + * returns non-zero, or zero if all members were + * processed with no operator returning non-zero. * - * - * - * Programmer: Quincey Koziol - * November 4 2007 + * Failure: Negative if something goes wrong within the + * library, or the negative value returned by one + * of the operators. * *------------------------------------------------------------------------- */ @@ -1193,7 +1187,7 @@ done: if(gid > 0) { if(H5I_dec_app_ref(gid) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") - } /* end if */ + } else if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") diff --git a/src/H5Glink.c b/src/H5Glink.c index 509e511..82a2dcf 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -568,7 +568,7 @@ H5G__link_name_replace(H5F_t *file, H5RS_str_t *grp_full_path_r, const H5O_link_ obj_path_r = H5G_build_fullpath_refstr_str(grp_full_path_r, lnk->name); if(H5G_name_replace(lnk, H5G_NAME_DELETE, file, obj_path_r, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to replace name") - } /* end if */ + } done: if(obj_path_r) diff --git a/src/H5Gloc.c b/src/H5Gloc.c index f5a14a1..2f935e8 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -137,15 +137,11 @@ static herr_t H5G__loc_get_comment_cb(H5G_loc_t *grp_loc, const char *name, /*------------------------------------------------------------------------- - * Function: H5G_loc + * Function: H5G_loc * - * Purpose: Given an object ID return a location for the object. + * Purpose: Given an object ID return a location for the object. * - * Return: Success: Group pointer. - * Failure: NULL - * - * Programmer: Quincey Koziol - * Tuesday, September 13, 2005 + * Returns: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -158,92 +154,94 @@ H5G_loc(hid_t loc_id, H5G_loc_t *loc) switch(H5I_get_type(loc_id)) { case H5I_FILE: - { - H5F_t *f; + { + H5F_t *f = NULL; - /* Get the file struct */ - if(NULL == (f = (H5F_t *)H5I_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file ID") + /* Get the file struct */ + if(NULL == (f = (H5F_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file ID") - /* Construct a group location for root group of the file */ - if(H5G_root_loc(f, loc) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "unable to create location for file") - } /* end case */ + /* Construct a group location for root group of the file */ + if(H5G_root_loc(f, loc) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "unable to create location for file") break; - - case H5I_GENPROP_CLS: - case H5I_GENPROP_LST: - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of property list") - - case H5I_ERROR_CLASS: - case H5I_ERROR_MSG: - case H5I_ERROR_STACK: - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of error class, message or stack") + } case H5I_GROUP: - { - H5G_t *group; - - if(NULL == (group = (H5G_t *)H5I_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid group ID") - if(NULL == (loc->oloc = H5G_oloc(group))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location of group") - if(NULL == (loc->path = H5G_nameof(group))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get path of group") - } /* end case */ + { + H5G_t *group = NULL; + + if(NULL == (group = (H5G_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid group ID") + if(NULL == (loc->oloc = H5G_oloc(group))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location of group") + if(NULL == (loc->path = H5G_nameof(group))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get path of group") break; + } case H5I_DATATYPE: - { - H5T_t *dt; - - if(NULL == (dt = (H5T_t *)H5I_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid type ID") - if(NULL == (loc->oloc = H5T_oloc(dt))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location of datatype") - if(NULL == (loc->path = H5T_nameof(dt))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get path of datatype") - } /* end case */ + { + H5T_t *dt = NULL; + + if(NULL == (dt = (H5T_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid type ID") + if(NULL == (loc->oloc = H5T_oloc(dt))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location of datatype") + if(NULL == (loc->path = H5T_nameof(dt))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get path of datatype") break; - - case H5I_DATASPACE: - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of dataspace") + } case H5I_DATASET: - { - H5D_t *dset; - - if(NULL == (dset = (H5D_t *)H5I_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid data ID") - if(NULL == (loc->oloc = H5D_oloc(dset))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location of dataset") - if(NULL == (loc->path = H5D_nameof(dset))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get path of dataset") - } /* end case */ + { + H5D_t *dset = NULL; + + if(NULL == (dset = (H5D_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid data ID") + if(NULL == (loc->oloc = H5D_oloc(dset))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location of dataset") + if(NULL == (loc->path = H5D_nameof(dset))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get path of dataset") break; + } case H5I_ATTR: - { - H5A_t *attr; - - if(NULL == (attr = (H5A_t *)H5I_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid attribute ID") - if(NULL == (loc->oloc = H5A_oloc(attr))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location of attribute") - if(NULL == (loc->path = H5A_nameof(attr))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get path of attribute") - } /* end case */ + { + H5A_t *attr = NULL; + + if(NULL == (attr = (H5A_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid attribute ID") + if(NULL == (loc->oloc = H5A_oloc(attr))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location of attribute") + if(NULL == (loc->path = H5A_nameof(attr))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get path of attribute") break; + } case H5I_REFERENCE: HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of reference") + case H5I_DATASPACE: + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of dataspace") + + case H5I_GENPROP_CLS: + case H5I_GENPROP_LST: + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of property list") + + case H5I_ERROR_CLASS: + case H5I_ERROR_MSG: + case H5I_ERROR_STACK: + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of error class, message or stack") + + case H5I_VFL: + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of a virtual file driver (VFD)") + case H5I_UNINIT: case H5I_BADID: - case H5I_VFL: case H5I_NTYPES: default: - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid object ID") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid location ID") } /* end switch */ done: @@ -764,7 +762,7 @@ H5G__loc_set_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_A /* Check for existing comment message */ if((exists = H5O_msg_exists(obj_loc->oloc, H5O_NAME_ID)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read object header") + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read object header") /* Remove the previous comment message if any */ if(exists) @@ -774,9 +772,9 @@ H5G__loc_set_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_A /* Add the new message */ if(udata->comment && *udata->comment) { /* Casting away const OK -QAK */ - comment.s = (char *)udata->comment; - if(H5O_msg_create(obj_loc->oloc, H5O_NAME_ID, 0, H5O_UPDATE_TIME, &comment) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to set comment object header message") + comment.s = (char *)udata->comment; + if(H5O_msg_create(obj_loc->oloc, H5O_NAME_ID, 0, H5O_UPDATE_TIME, &comment) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to set comment object header message") } /* end if */ done: @@ -854,20 +852,21 @@ H5G__loc_get_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_A /* Query object comment */ comment.s = NULL; if(NULL == H5O_msg_read(obj_loc->oloc, H5O_NAME_ID, &comment)) { - if(udata->comment && udata->bufsize > 0) + if(udata->comment && udata->bufsize > 0) udata->comment[0] = '\0'; - udata->comment_size = 0; - } /* end if */ + udata->comment_size = 0; + } else { if(udata->comment && udata->bufsize) - HDstrncpy(udata->comment, comment.s, udata->bufsize); - udata->comment_size = (ssize_t)HDstrlen(comment.s); - H5O_msg_reset(H5O_NAME_ID, &comment); - } /* end else */ + HDstrncpy(udata->comment, comment.s, udata->bufsize); + udata->comment_size = (ssize_t)HDstrlen(comment.s); + H5O_msg_reset(H5O_NAME_ID, &comment); + } done: /* Indicate that this callback didn't take ownership of the group * - * location for the object */ + * location for the object. + */ *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Gname.c b/src/H5Gname.c index c1156ca..8aa0b45 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -1155,7 +1155,7 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, else { /* We pass NULL as link pointer when we need to search all IDs */ search_group = search_dataset = search_datatype = TRUE; - } /* end else */ + } /* Check if we need to operate on the objects affected */ if(search_group || search_dataset || search_datatype) { @@ -1166,26 +1166,26 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, src_file = H5F_PARENT(src_file); /* Set up common information for callback */ - names.src_file = src_file; - names.src_full_path_r = src_full_path_r; - names.dst_file = dst_file; - names.dst_full_path_r = dst_full_path_r; - names.op = op; + names.src_file = src_file; + names.src_full_path_r = src_full_path_r; + names.dst_file = dst_file; + names.dst_full_path_r = dst_full_path_r; + names.op = op; /* Search through group IDs */ if(search_group) if(H5I_iterate(H5I_GROUP, H5G_name_replace_cb, &names, FALSE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over groups") + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over groups") /* Search through dataset IDs */ if(search_dataset) if(H5I_iterate(H5I_DATASET, H5G_name_replace_cb, &names, FALSE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over datasets") + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over datasets") /* Search through datatype IDs */ if(search_datatype) if(H5I_iterate(H5I_DATATYPE, H5G_name_replace_cb, &names, FALSE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over datatypes") + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over datatypes") } /* end if */ } /* end if */ @@ -1269,10 +1269,11 @@ done: * * Purpose: Tries to figure out the path to an object from it's address * - * Return: returns size of path name, and copies it into buffer - * pointed to by name if that buffer is big enough. - * 0 if it cannot find the path - * negative on failure. + * Return: Success: Returns size of path name, and copies it into buffer + * pointed to by name if that buffer is big enough. + * 0 if it cannot find the path + * + * Failure: -1 * * Programmer: Quincey Koziol * November 4 2007 @@ -1283,25 +1284,25 @@ ssize_t H5G_get_name_by_addr(hid_t file, const H5O_loc_t *loc, char *name, size_t size) { - H5G_gnba_iter_t udata; /* User data for iteration */ - H5G_loc_t root_loc; /* Root group's location */ - hbool_t found_obj = FALSE; /* If we found the object */ - herr_t status; /* Status from iteration */ - ssize_t ret_value = -1; /* Return value */ + H5G_gnba_iter_t udata; /* User data for iteration */ + H5G_loc_t root_loc; /* Root group's location */ + hbool_t found_obj = FALSE; /* If we found the object */ + herr_t status; /* Status from iteration */ + ssize_t ret_value = -1; /* Return value */ /* Portably clear udata struct (before FUNC_ENTER) */ HDmemset(&udata, 0, sizeof(udata)); - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI((-1)) /* Construct the link info for the file's root group */ if(H5G_loc(file, &root_loc) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get root group's location") + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, (-1), "can't get root group's location") /* Check for root group being the object looked for */ if(root_loc.oloc->addr == loc->addr && root_loc.oloc->file == loc->file) { if(NULL == (udata.path = H5MM_strdup(""))) - HGOTO_ERROR(H5E_SYM, H5E_CANTALLOC, FAIL, "can't duplicate path string") + HGOTO_ERROR(H5E_SYM, H5E_CANTALLOC, (-1), "can't duplicate path string") found_obj = TRUE; } /* end if */ else { @@ -1311,7 +1312,7 @@ H5G_get_name_by_addr(hid_t file, const H5O_loc_t *loc, /* Visit all the links in the file */ if((status = H5G_visit(file, "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5G_get_name_by_addr_cb, &udata)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group traversal failed while looking for object name") + HGOTO_ERROR(H5E_SYM, H5E_BADITER, (-1), "group traversal failed while looking for object name") else if(status > 0) found_obj = TRUE; } /* end else */ @@ -1342,3 +1343,4 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_get_name_by_addr() */ + diff --git a/src/H5Gobj.c b/src/H5Gobj.c index e93896c..15dbd79 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -36,7 +36,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5Gpkg.h" /* Groups */ -#include "H5HLprivate.h" /* Local Heaps */ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ @@ -257,7 +256,7 @@ H5G__obj_create_real(H5F_t *f, const H5O_ginfo_t *ginfo, * incremented if the object is added to the group directed graph. */ if(H5O_create(f, hdr_size, (size_t)1, gcpl_id, oloc/*out*/) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header") + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header") /* Check for format of group to create */ if(use_at_least_v18) { diff --git a/src/H5Goh.c b/src/H5Goh.c index 38570f9..ec3d30d 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -193,9 +193,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5O__group_open + * Function: H5O__group_open * - * Purpose: Open a group at a particular location + * Purpose: Open a group at a particular location * * Return: Success: Open object identifier * Failure: Negative diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 64c4054..9072b97 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -225,14 +225,14 @@ H5G__stab_create(H5O_loc_t *grp_oloc, const H5O_ginfo_t *ginfo, H5O_stab_t *stab /* Go create the B-tree & local heap */ if(H5G__stab_create_components(grp_oloc->file, stab, size_hint) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create symbol table components") + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create symbol table components") /* * Insert the symbol table message into the object header and the symbol * table entry. */ if(H5O_msg_create(grp_oloc, H5O_STAB_ID, 0, H5O_UPDATE_TIME, stab) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") done: FUNC_LEAVE_NOAPI_TAG(ret_value) @@ -534,7 +534,7 @@ H5G__stab_iterate(const H5O_loc_t *oloc, H5_iter_order_t order, /* Get the B-tree info */ if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab)) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Pin the heap down in memory */ if(NULL == (heap = H5HL_protect(oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) @@ -626,7 +626,7 @@ H5G__stab_count(const H5O_loc_t *oloc, hsize_t *num_objs) /* Get the B-tree info */ if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab)) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Iterate over the group members */ if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_sumup, num_objs) < 0) @@ -757,7 +757,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t /* Get the B-tree & local heap info */ if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab)) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Pin the heap down in memory */ if(NULL == (heap = H5HL_protect(oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) @@ -785,11 +785,11 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t /* Iterate over the group members */ if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed") /* If we don't know the name now, we almost certainly went out of bounds */ if(udata.name == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "index out of bound") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "index out of bound") /* Get the length of the name */ ret_value = (ssize_t)HDstrlen(udata.name); @@ -979,7 +979,7 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_ /* Get the B-tree & local heap info */ if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Pin the heap down in memory */ if(NULL == (heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) @@ -1007,11 +1007,11 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_ /* Iterate over the group members */ if(H5B_iterate(grp_oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed") /* If we didn't find the link, we almost certainly went out of bounds */ if(!udata.found) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "index out of bound") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "index out of bound") done: /* Release resources */ @@ -1193,7 +1193,7 @@ H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx) /* Get the B-tree & local heap info */ if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab)) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "unable to determine local heap address") + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "unable to determine local heap address") /* Set iteration information */ udata.common.idx = idx; @@ -1204,7 +1204,7 @@ H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx) /* Iterate over the group members */ if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "iteration operator failed") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "iteration operator failed") /* If we don't know the type now, we almost certainly went out of bounds */ if(udata.type == H5G_UNKNOWN) diff --git a/src/H5I.c b/src/H5I.c index 6cb1947..293a0ea 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -128,6 +128,7 @@ static int H5I__inc_type_ref(H5I_type_t type); static int H5I__get_type_ref(H5I_type_t type); static int H5I__search_cb(void *obj, hid_t id, void *_udata); static H5I_id_info_t *H5I__find_id(hid_t id); +static hid_t H5I__get_file_id(hid_t obj_id, H5I_type_t id_type); #ifdef H5I_DEBUG_OUTPUT static int H5I__debug_cb(void *_item, void *_key, void *_udata); static herr_t H5I__debug(H5I_type_t type); @@ -2055,7 +2056,7 @@ H5Iget_file_id(hid_t obj_id) /* Call internal function */ if (H5I_FILE == type || H5I_DATATYPE == type || H5I_GROUP == type || H5I_DATASET == type || H5I_ATTR == type) { - if ((ret_value = H5I_get_file_id(obj_id, type)) < 0) + if ((ret_value = H5I__get_file_id(obj_id, type)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, H5I_INVALID_HID, "can't retrieve file ID") } else @@ -2067,7 +2068,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_get_file_id + * Function: H5I__get_file_id * * Purpose: The private version of H5Iget_file_id(), obtains the file * ID given an object ID. @@ -2077,12 +2078,12 @@ done: * *------------------------------------------------------------------------- */ -hid_t -H5I_get_file_id(hid_t obj_id, H5I_type_t type) +static hid_t +H5I__get_file_id(hid_t obj_id, H5I_type_t type) { hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Process based on object type */ if (type == H5I_FILE) { @@ -2107,7 +2108,7 @@ H5I_get_file_id(hid_t obj_id, H5I_type_t type) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_get_file_id() */ +} /* end H5I__get_file_id() */ #ifdef H5I_DEBUG_OUTPUT diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index 3bfde93..a10147d 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -72,7 +72,6 @@ H5_DLL void *H5I_subst(hid_t id, const void *new_object); H5_DLL void *H5I_object(hid_t id); H5_DLL void *H5I_object_verify(hid_t id, H5I_type_t id_type); H5_DLL H5I_type_t H5I_get_type(hid_t id); -H5_DLL hid_t H5I_get_file_id(hid_t obj_id, H5I_type_t id_type); H5_DLL void *H5I_remove(hid_t id); H5_DLL herr_t H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref); H5_DLL int H5I_get_ref(hid_t id, hbool_t app_ref); diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 7c32309..1cab17d 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -102,7 +102,7 @@ static const H5L_class_t H5L_EXTERN_LINK_CLASS[1] = {{ * link access property list, appends that prefix to the * filename being opened. * - * Return: ID of the opened object on success/Negative on failure + * Return: ID of the opened object on success/H5I_INVALID_HID on failure * * Programmer: James Laird * Monday, July 10, 2006 @@ -129,8 +129,8 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, char *parent_group_name = NULL;/* Temporary pointer to group name */ char local_group_name[H5L_EXT_TRAVERSE_BUF_SIZE]; /* Local buffer to hold group name */ H5P_genplist_t *fa_plist; /* File access property list pointer */ - H5F_close_degree_t fc_degree = H5F_CLOSE_WEAK; /* File close degree for target file */ - char *elink_prefix; /* Pointer to elink prefix */ + H5F_close_degree_t fc_degree = H5F_CLOSE_WEAK; /* File close degree for target file */ + char *elink_prefix = NULL; /* Pointer to elink prefix */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_STATIC @@ -140,9 +140,9 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, /* Check external link version & flags */ if(((*p >> 4) & 0x0F) > H5L_EXT_VERSION) - HGOTO_ERROR(H5E_LINK, H5E_CANTDECODE, FAIL, "bad version number for external link") + HGOTO_ERROR(H5E_LINK, H5E_CANTDECODE, H5I_INVALID_HID, "bad version number for external link") if((*p & 0x0F) & ~H5L_EXT_FLAGS_ALL) - HGOTO_ERROR(H5E_LINK, H5E_CANTDECODE, FAIL, "bad flags for external link") + HGOTO_ERROR(H5E_LINK, H5E_CANTDECODE, H5I_INVALID_HID, "bad flags for external link") p++; /* Gather some information from the external link's user data */ @@ -152,19 +152,19 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5I_INVALID_HID, "can't find object for ID") /* Get the fapl_id set for lapl_id if any */ if(H5P_get(plist, H5L_ACS_ELINK_FAPL_NAME, &fapl_id) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fapl for links") + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5I_INVALID_HID, "can't get fapl for links") /* Get the location for the group holding the external link */ if(H5G_loc(cur_group, &loc) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get object location") + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, H5I_INVALID_HID, "can't get object location") /* get the access flags set for lapl_id if any */ if(H5P_get(plist, H5L_ACS_ELINK_FLAGS_NAME, &intent) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get elink file access flags") + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5I_INVALID_HID, "can't get elink file access flags") /* get the file access mode flags for the parent file, if they were not set * on lapl_id */ @@ -172,15 +172,15 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, intent = H5F_INTENT(loc.oloc->file); if((fapl_id == H5P_DEFAULT) && ((fapl_id = H5F_get_access_plist(loc.oloc->file, FALSE)) < 0)) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get parent's file access property list") + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, H5I_INVALID_HID, "can't get parent's file access property list") /* Get callback_info */ if(H5P_get(plist, H5L_ACS_ELINK_CB_NAME, &cb_info) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get elink callback info") + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5I_INVALID_HID, "can't get elink callback info") /* Get file access property list */ if(NULL == (fa_plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5I_INVALID_HID, "can't find object for ID") /* Make callback if it exists */ if(cb_info.func) { @@ -192,7 +192,7 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, /* Query length of parent group name */ if((group_name_len = H5G_get_name(&loc, NULL, (size_t) 0, NULL)) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve length of group name") + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, H5I_INVALID_HID, "unable to retrieve length of group name") /* Account for null terminator */ group_name_len++; @@ -200,43 +200,43 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, /* Check if we need to allocate larger buffer */ if((size_t)group_name_len > sizeof(local_group_name)) { if(NULL == (parent_group_name = (char *)H5MM_malloc((size_t)group_name_len))) - HGOTO_ERROR(H5E_LINK, H5E_CANTALLOC, FAIL, "can't allocate buffer to hold group name, group_name_len = %zd", group_name_len) + HGOTO_ERROR(H5E_LINK, H5E_CANTALLOC, H5I_INVALID_HID, "can't allocate buffer to hold group name, group_name_len = %zd", group_name_len) } /* end if */ else parent_group_name = local_group_name; /* Get parent group name */ if(H5G_get_name(&loc, parent_group_name, (size_t) group_name_len, NULL) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve group name") + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, H5I_INVALID_HID, "unable to retrieve group name") /* Make callback */ if((cb_info.func)(parent_file_name, parent_group_name, file_name, obj_name, &intent, fapl_id, cb_info.user_data) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "traversal operator failed") + HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, H5I_INVALID_HID, "traversal operator failed") /* Check access flags */ if((intent & H5F_ACC_TRUNC) || (intent & H5F_ACC_EXCL)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file open flags") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid file open flags") } /* end if */ /* Set file close degree for new file to "weak" */ if(H5P_set(fa_plist, H5F_ACS_CLOSE_DEGREE_NAME, &fc_degree) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree") + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, H5I_INVALID_HID, "can't set file close degree") /* Get the current elink prefix */ if(H5P_peek(plist, H5L_ACS_ELINK_PREFIX_NAME, &elink_prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external link prefix") + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5I_INVALID_HID, "can't get external link prefix") /* Search for the target file */ if(NULL == (ext_file = H5F_prefix_open_file(loc.oloc->file, H5F_PREFIX_ELINK, elink_prefix, file_name, intent, fapl_id))) - HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file, external link file name = '%s'", file_name) + HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to open external file, external link file name = '%s'", file_name) /* Retrieve the "group location" for the file's root group */ if(H5G_root_loc(ext_file, &root_loc) < 0) - HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "unable to create location for file") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, H5I_INVALID_HID, "unable to create location for file") /* Open the object referenced in the external file */ if((ext_obj = H5O_open_name(&root_loc, obj_name, FALSE)) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open object") + HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object") /* Set return value */ ret_value = ext_obj; @@ -244,15 +244,15 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, done: /* Release resources */ if(fapl_id > 0 && H5I_dec_ref(fapl_id) < 0) - HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close atom for file access property list") + HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, H5I_INVALID_HID, "unable to close atom for file access property list") if(ext_file && H5F_efc_close(loc.oloc->file, ext_file) < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTCLOSEFILE, FAIL, "problem closing external file") + HDONE_ERROR(H5E_LINK, H5E_CANTCLOSEFILE, H5I_INVALID_HID, "problem closing external file") if(parent_group_name && parent_group_name != local_group_name) parent_group_name = (char *)H5MM_xfree(parent_group_name); if(ret_value < 0) { /* Close object if it's open and something failed */ if(ext_obj >= 0 && H5I_dec_ref(ext_obj) < 0) - HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close atom for external object") + HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, H5I_INVALID_HID, "unable to close atom for external object") } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -312,7 +312,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Lcreate_external * - * Purpose: Creates an external link from LINK_NAME to OBJ_NAME. + * Purpose: Creates an external link from LINK_NAME to OBJ_NAME. * * External links are links to objects in other HDF5 files. They * are allowed to "dangle" like soft links internal to a file. @@ -322,9 +322,9 @@ done: * LINK_NAME is interpreted relative to LINK_LOC_ID, which is * either a file ID or a group ID. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, May 18, 2005 * *------------------------------------------------------------------------- @@ -380,7 +380,7 @@ H5Lcreate_external(const char *file_name, const char *obj_name, /* Create an external link */ if(H5L__create_ud(&link_loc, link_name, ext_link_buf, buf_size, H5L_TYPE_EXTERNAL, lcpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") + HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create external link") done: H5MM_xfree(ext_link_buf); diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index fa57862..8a44902 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -195,10 +195,7 @@ H5FL_DEFINE(haddr_t); * hid_t lcpl_id IN: Properties which apply to the new hard link * * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Peter Cao - * June 4, 2005 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -216,19 +213,33 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, /* Check arguments */ if(H5G_loc(src_loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if(H5G_loc(dst_loc_id, &dst_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if(!src_name || !*src_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no source name specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no source name specified") if(!dst_name || !*dst_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination name specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination name specified") + + /* Get correct property lists */ + if(H5P_DEFAULT == lcpl_id) + lcpl_id = H5P_LINK_CREATE_DEFAULT; + else + if(TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link creation property list") + + /* Get object copy property list */ + if (H5P_DEFAULT == ocpypl_id) + ocpypl_id = H5P_OBJECT_COPY_DEFAULT; + else + if(TRUE != H5P_isa_class(ocpypl_id, H5P_OBJECT_COPY)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not object copy property list") /* Set up collective metadata if appropriate */ if(H5CX_set_loc(src_loc_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") - /* Call internal routine to copy object */ + /* Copy the object */ if(H5O__copy(&loc, src_name, &dst_loc, dst_name, ocpypl_id, lcpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") @@ -240,10 +251,9 @@ done: /*------------------------------------------------------------------------- * Function: H5O__copy * - * Purpose: Internal routine to copy an object + * Purpose: Private version of H5Ocopy * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * December 29, 2017 @@ -260,7 +270,7 @@ H5O__copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, htri_t dst_exists; /* Does destination name exist already? */ hbool_t loc_found = FALSE; /* Location at 'name' found */ hbool_t obj_open = FALSE; /* Entry at 'name' found */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -272,7 +282,7 @@ H5O__copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, /* Check if destination name already exists */ if((dst_exists = H5L_exists_tolerant(dst_loc, dst_name)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check if destination name exists") + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check if destination name exists") if(TRUE == dst_exists) HGOTO_ERROR(H5E_OHDR, H5E_EXISTS, FAIL, "destination object already exists") @@ -291,24 +301,6 @@ H5O__copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") obj_open = TRUE; - /* Get correct property lists */ - if(H5P_DEFAULT == lcpl_id) { - if((lcpl_id = H5P_get_default(H5P_CLS_LCRT)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to get default lcpl") - } /* end if */ - else - if(TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link creation property list") - - /* Get object copy property list */ - if(H5P_DEFAULT == ocpypl_id) { - if((ocpypl_id = H5P_get_default(H5P_CLS_OCPY)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to get default ocpypl") - } /* end if */ - else - if(TRUE != H5P_isa_class(ocpypl_id, H5P_OBJECT_COPY)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not object copy property list") - /* Do the actual copying of the object */ if(H5O__copy_obj(&src_loc, dst_loc, dst_name, ocpypl_id, lcpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") diff --git a/src/H5P.c b/src/H5P.c index 733af42..72d7ae8 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -82,7 +82,7 @@ hbool_t H5_PKG_INIT_VAR = FALSE; hid_t id; IN: Property list or class ID to copy RETURNS Success: valid property list ID on success (non-negative) - Failure: negative + Failure: H5I_INVALID_HID (negative) DESCRIPTION Copy a property list or class and return the ID. This routine calls the class 'copy' callback after any property 'copy' callbacks are called @@ -97,37 +97,37 @@ hid_t H5Pcopy(hid_t id) { void *obj; /* Property object to copy */ - hid_t ret_value=FALSE; /* return value */ + hid_t ret_value = H5I_INVALID_HID; /* return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", id); - if(H5P_DEFAULT==id) + if(H5P_DEFAULT == id) HGOTO_DONE(H5P_DEFAULT); /* Check arguments. */ if(H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property object"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not property object"); if(NULL == (obj = H5I_object(id))) - HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "property object doesn't exist"); + HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, H5I_INVALID_HID, "property object doesn't exist"); /* Compare property lists */ if(H5I_GENPROP_LST == H5I_get_type(id)) { if((ret_value = H5P_copy_plist((H5P_genplist_t *)obj, TRUE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy property list"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5I_INVALID_HID, "can't copy property list"); } /* end if */ /* Must be property classes */ else { H5P_genclass_t *copy_class; /* Copy of class */ /* Copy the class */ - if((copy_class = H5P_copy_pclass((H5P_genclass_t *)obj)) == NULL) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy property class"); + if((copy_class = H5P__copy_pclass((H5P_genclass_t *)obj)) == NULL) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5I_INVALID_HID, "can't copy property class"); /* Get an atom for the copied class */ if((ret_value = H5I_register(H5I_GENPROP_CLS, copy_class, TRUE)) < 0) { - H5P_close_class(copy_class); - HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class"); + H5P__close_class(copy_class); + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list class"); } /* end if */ } /* end else */ @@ -162,7 +162,7 @@ done: void *close_data; IN: Pointer to user data to pass along to class close callback. RETURNS - Returns a valid property list class ID on success, NULL on failure. + Returns a valid property list class ID on success, H5I_INVALID_HID on failure. DESCRIPTION Allocates memory and attaches a class to the property list class hierarchy. GLOBAL VARIABLES @@ -179,39 +179,39 @@ H5Pcreate_class(hid_t parent, const char *name, { H5P_genclass_t *par_class = NULL; /* Pointer to the parent class */ H5P_genclass_t *pclass = NULL; /* Property list class created */ - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE8("i", "i*sx*xx*xx*x", parent, name, cls_create, create_data, cls_copy, copy_data, cls_close, close_data); /* Check arguments. */ if(H5P_DEFAULT!=parent && (H5I_GENPROP_CLS!=H5I_get_type(parent))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property list class") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid class name") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid class name") if((create_data != NULL && cls_create == NULL) || (copy_data != NULL && cls_copy == NULL) || (close_data != NULL && cls_close == NULL)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "data specified, but no callback provided") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "data specified, but no callback provided") /* Get the pointer to the parent class */ if(parent == H5P_DEFAULT) par_class = NULL; else if(NULL == (par_class = (H5P_genclass_t *)H5I_object(parent))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't retrieve parent class") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "can't retrieve parent class") /* Create the new property list class */ - if(NULL == (pclass = H5P_create_class(par_class, name, H5P_TYPE_USER, cls_create, create_data, cls_copy, copy_data, cls_close, close_data))) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create property list class") + if(NULL == (pclass = H5P__create_class(par_class, name, H5P_TYPE_USER, cls_create, create_data, cls_copy, copy_data, cls_close, close_data))) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create property list class") /* Get an atom for the class */ if((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class") + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list class") done: - if(ret_value < 0 && pclass) - H5P_close_class(pclass); + if(H5I_INVALID_HID == ret_value && pclass) + H5P__close_class(pclass); FUNC_LEAVE_API(ret_value) } /* H5Pcreate_class() */ @@ -226,7 +226,7 @@ done: hid_t H5Pcreate(cls_id) hid_t cls_id; IN: Property list class create list from RETURNS - Returns a valid property list ID on success, FAIL on failure. + Returns a valid property list ID on success, H5I_INVALID_HID on failure. DESCRIPTION Creates a property list of a given class. If a 'create' callback exists for the property list class, it is called before the @@ -243,18 +243,18 @@ hid_t H5Pcreate(hid_t cls_id) { H5P_genclass_t *pclass; /* Property list class to modify */ - hid_t ret_value; /* return value */ + hid_t ret_value = H5I_INVALID_HID; /* return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", cls_id); /* Check arguments. */ if(NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(cls_id, H5I_GENPROP_CLS))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property list class"); /* Create the new property list */ if((ret_value = H5P_create_id(pclass, TRUE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create property list"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create property list"); done: FUNC_LEAVE_API(ret_value) @@ -440,7 +440,7 @@ H5Pregister2(hid_t cls_id, const char *name, size_t size, void *def_value, /* Create the new property list class */ orig_pclass = pclass; - if((ret_value = H5P_register(&pclass, name, size, def_value, prp_create, prp_set, prp_get, NULL, NULL, prp_delete, prp_copy, prp_cmp, prp_close)) < 0) + if((ret_value = H5P__register(&pclass, name, size, def_value, prp_create, prp_set, prp_get, NULL, NULL, prp_delete, prp_copy, prp_cmp, prp_close)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to register property in class") /* Check if the property class changed and needs to be substituted in the ID */ @@ -453,7 +453,7 @@ H5Pregister2(hid_t cls_id, const char *name, size_t size, void *def_value, HDassert(old_pclass == orig_pclass); /* Close the previous class */ - if(H5P_close_class(old_pclass) < 0) + if(H5P__close_class(old_pclass) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "unable to close original property class after substitution") } /* end if */ @@ -738,7 +738,7 @@ H5Pexist(hid_t id, const char *name) if(H5I_GENPROP_CLS == H5I_get_type(id)) { if(NULL == (pclass = (H5P_genclass_t *)H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class"); - if((ret_value = H5P_exist_pclass(pclass, name)) < 0) + if((ret_value = H5P__exist_pclass(pclass, name)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property does not exist in class"); } /* end if */ else @@ -795,7 +795,7 @@ H5Pget_size(hid_t id, const char *name, size_t *size) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); /* Check the property size */ - if((ret_value = H5P_get_size_plist(plist, name, size)) < 0) + if((ret_value = H5P__get_size_plist(plist, name, size)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query size in plist"); } /* end if */ else @@ -804,7 +804,7 @@ H5Pget_size(hid_t id, const char *name, size_t *size) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); /* Check the property size */ - if((ret_value = H5P_get_size_pclass(pclass, name, size)) < 0) + if((ret_value = H5P__get_size_pclass(pclass, name, size)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query size in plist"); } /* end if */ else @@ -867,8 +867,8 @@ done: hid_t H5Pdecode(buf) void *buf; IN: buffer that holds the encoded plist RETURNS - Returns non-negative ID of new property list object on success, negative - on failure. + Success: ID of new property list object + Failure: H5I_INVALID_HID (negative) DESCRIPTION Decodes a property list from a binary buffer. The contents of the buffer contain the values for the correponding properties of the plist. The decode @@ -884,14 +884,14 @@ done: hid_t H5Pdecode(const void *buf) { - hid_t ret_value = SUCCEED; /* return value */ + hid_t ret_value = H5I_INVALID_HID; /* return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "*x", buf); /* Call the internal decode routine */ if((ret_value = H5P__decode(buf)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTDECODE, FAIL, "unable to decode property list"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTDECODE, H5I_INVALID_HID, "unable to decode property list"); done: FUNC_LEAVE_API(ret_value) @@ -908,7 +908,7 @@ done: hid_t plist_id; IN: Property list to query RETURNS Success: ID of class object - Failure: negative + Failure: H5I_INVALID_HID (negative) DESCRIPTION This routine retrieves the class of a property list. @@ -923,30 +923,30 @@ H5Pget_class(hid_t plist_id) { H5P_genplist_t *plist; /* Property list to query */ H5P_genclass_t *pclass=NULL; /* Property list class */ - hid_t ret_value=FAIL; /* return value */ + hid_t ret_value = H5I_INVALID_HID; /* return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", plist_id); /* Check arguments. */ if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property list"); /* Retrieve the property list class */ if((pclass = H5P_get_class(plist)) == NULL) - HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "unable to query class of property list"); + HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, H5I_INVALID_HID, "unable to query class of property list"); /* Increment the outstanding references to the class object */ - if(H5P_access_class(pclass, H5P_MOD_INC_REF) < 0) - HGOTO_ERROR (H5E_PLIST, H5E_CANTINIT, FAIL,"Can't increment class ID ref count"); + if(H5P__access_class(pclass, H5P_MOD_INC_REF) < 0) + HGOTO_ERROR (H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID,"Can't increment class ID ref count"); /* Get an atom for the class */ if((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list class"); done: - if(ret_value<0 && pclass) - H5P_close_class(pclass); + if(H5I_INVALID_HID == ret_value && pclass) + H5P__close_class(pclass); FUNC_LEAVE_API(ret_value) } /* H5Pget_class() */ @@ -994,7 +994,7 @@ H5Pget_nprops(hid_t id, size_t *nprops) if(H5I_GENPROP_LST == H5I_get_type(id)) { if(NULL == (plist = (H5P_genplist_t *)H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - if(H5P_get_nprops_plist(plist, nprops) < 0) + if(H5P__get_nprops_plist(plist, nprops) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query # of properties in plist"); } /* end if */ else @@ -1054,7 +1054,7 @@ H5Pequal(hid_t id1, hid_t id2) if(H5I_GENPROP_LST == H5I_get_type(id1)) { int cmp_ret = 0; - if(H5P_cmp_plist((const H5P_genplist_t *)obj1, (const H5P_genplist_t *)obj2, &cmp_ret) < 0) + if(H5P__cmp_plist((const H5P_genplist_t *)obj1, (const H5P_genplist_t *)obj2, &cmp_ret) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOMPARE, FAIL, "can't compare property lists") /* Set return value */ @@ -1062,7 +1062,7 @@ H5Pequal(hid_t id1, hid_t id2) } /* end if */ /* Must be property classes */ else { - if(H5P_cmp_class((const H5P_genclass_t *)obj1, (const H5P_genclass_t *)obj2) == 0) + if(H5P__cmp_class((const H5P_genclass_t *)obj1, (const H5P_genclass_t *)obj2) == 0) ret_value = TRUE; } /* end else */ @@ -1236,13 +1236,13 @@ H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func, void *iter_data) if(H5I_GENPROP_LST == H5I_get_type(id)) { /* Iterate over a property list */ - if((ret_value = H5P_iterate_plist((H5P_genplist_t *)obj, TRUE, (idx ? idx : &fake_idx), H5P__iterate_cb, &udata)) < 0) + if((ret_value = H5P__iterate_plist((H5P_genplist_t *)obj, TRUE, (idx ? idx : &fake_idx), H5P__iterate_cb, &udata)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over list"); } /* end if */ else if(H5I_GENPROP_CLS == H5I_get_type(id)) { /* Iterate over a property class */ - if((ret_value = H5P_iterate_pclass((H5P_genclass_t *)obj, (idx ? idx : &fake_idx), H5P__iterate_cb, &udata)) < 0) + if((ret_value = H5P__iterate_pclass((H5P_genclass_t *)obj, (idx ? idx : &fake_idx), H5P__iterate_cb, &udata)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over class"); } /* end if */ else @@ -1419,12 +1419,12 @@ H5Pcopy_prop(hid_t dst_id, hid_t src_id, const char *name) /* Compare property lists */ if(H5I_GENPROP_LST == src_id_type) { - if(H5P_copy_prop_plist(dst_id, src_id, name) < 0) + if(H5P__copy_prop_plist(dst_id, src_id, name) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy property between lists") } /* end if */ /* Must be property classes */ else { - if(H5P_copy_prop_pclass(dst_id, src_id, name) < 0) + if(H5P__copy_prop_pclass(dst_id, src_id, name) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy property between classes") } /* end else */ @@ -1470,7 +1470,7 @@ H5Punregister(hid_t pclass_id, const char *name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid property name"); /* Remove the property list from class */ - if((ret_value = H5P_unregister(pclass, name)) < 0) + if((ret_value = H5P__unregister(pclass, name)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to remove property from class"); done: @@ -1575,7 +1575,7 @@ done: hid_t pclass_id; IN: Property class to query RETURNS Success: ID of parent class object - Failure: NULL + Failure: H5I_INVALID_HID (negative) DESCRIPTION This routine retrieves an ID for the parent class of a property class. @@ -1589,30 +1589,30 @@ H5Pget_class_parent(hid_t pclass_id) { H5P_genclass_t *pclass; /* Property class to query */ H5P_genclass_t *parent = NULL; /* Parent's property class */ - hid_t ret_value; /* return value */ + hid_t ret_value = H5I_INVALID_HID; /* return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", pclass_id); /* Check arguments. */ if(NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(pclass_id, H5I_GENPROP_CLS))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property class") /* Retrieve the property class's parent */ - if(NULL == (parent = H5P_get_class_parent(pclass))) - HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "unable to query class of property list") + if(NULL == (parent = H5P__get_class_parent(pclass))) + HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, H5I_INVALID_HID, "unable to query class of property list") /* Increment the outstanding references to the class object */ - if(H5P_access_class(parent, H5P_MOD_INC_REF) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL,"Can't increment class ID ref count") + if(H5P__access_class(parent, H5P_MOD_INC_REF) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID,"Can't increment class ID ref count") /* Get an atom for the class */ if((ret_value = H5I_register(H5I_GENPROP_CLS, parent, TRUE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class") + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list class") done: - if(ret_value < 0 && parent) - H5P_close_class(parent); + if(H5I_INVALID_HID == ret_value && parent) + H5P__close_class(parent); FUNC_LEAVE_API(ret_value) } /* H5Pget_class_parent() */ diff --git a/src/H5Pacpl.c b/src/H5Pacpl.c index 4368dd6..530ede3 100644 --- a/src/H5Pacpl.c +++ b/src/H5Pacpl.c @@ -13,11 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5Pacpl.c - * January 2 2006 - * James Laird + * Created: H5Pacpl.c * - * Purpose: Attribute creation property list class routines + * Purpose: Attribute creation property list class routines * *------------------------------------------------------------------------- */ @@ -32,9 +30,9 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Ppkg.h" /* Property lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Ppkg.h" /* Property lists */ /****************/ @@ -63,21 +61,21 @@ /* Attribute creation property list class library initialization object */ const H5P_libclass_t H5P_CLS_ACRT[1] = {{ - "attribute create", /* Class name for debugging */ - H5P_TYPE_ATTRIBUTE_CREATE, /* Class type */ - - &H5P_CLS_STRING_CREATE_g, /* Parent class */ - &H5P_CLS_ATTRIBUTE_CREATE_g, /* Pointer to class */ - &H5P_CLS_ATTRIBUTE_CREATE_ID_g, /* Pointer to class ID */ - &H5P_LST_ATTRIBUTE_CREATE_ID_g, /* Pointer to default property list ID */ - NULL, /* Default property registration routine */ - - NULL, /* Class creation callback */ - NULL, /* Class creation callback info */ - NULL, /* Class copy callback */ - NULL, /* Class copy callback info */ - NULL, /* Class close callback */ - NULL /* Class close callback info */ + "attribute create", /* Class name for debugging */ + H5P_TYPE_ATTRIBUTE_CREATE, /* Class type */ + + &H5P_CLS_STRING_CREATE_g, /* Parent class */ + &H5P_CLS_ATTRIBUTE_CREATE_g, /* Pointer to class */ + &H5P_CLS_ATTRIBUTE_CREATE_ID_g, /* Pointer to class ID */ + &H5P_LST_ATTRIBUTE_CREATE_ID_g, /* Pointer to default property list ID */ + NULL, /* Default property registration routine */ + + NULL, /* Class creation callback */ + NULL, /* Class creation callback info */ + NULL, /* Class copy callback */ + NULL, /* Class copy callback info */ + NULL, /* Class close callback */ + NULL /* Class close callback info */ }}; diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index da06297..00e598f 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -204,46 +204,46 @@ H5P__dacc_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register the size of raw data chunk cache (elements) */ - if(H5P_register_real(pclass, H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5D_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &rdcc_nslots, + if(H5P__register_real(pclass, H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5D_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &rdcc_nslots, NULL, NULL, NULL, H5D_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5D_ACS_DATA_CACHE_NUM_SLOTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache(bytes) */ - if(H5P_register_real(pclass, H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5D_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &rdcc_nbytes, + if(H5P__register_real(pclass, H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5D_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &rdcc_nbytes, NULL, NULL, NULL, H5D_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5D_ACS_DATA_CACHE_BYTE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the preemption for reading chunks */ - if(H5P_register_real(pclass, H5D_ACS_PREEMPT_READ_CHUNKS_NAME, H5D_ACS_PREEMPT_READ_CHUNKS_SIZE, &rdcc_w0, + if(H5P__register_real(pclass, H5D_ACS_PREEMPT_READ_CHUNKS_NAME, H5D_ACS_PREEMPT_READ_CHUNKS_SIZE, &rdcc_w0, NULL, NULL, NULL, H5D_ACS_PREEMPT_READ_CHUNKS_ENC, H5D_ACS_PREEMPT_READ_CHUNKS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the VDS view option */ - if(H5P_register_real(pclass, H5D_ACS_VDS_VIEW_NAME, H5D_ACS_VDS_VIEW_SIZE, &virtual_view, + if(H5P__register_real(pclass, H5D_ACS_VDS_VIEW_NAME, H5D_ACS_VDS_VIEW_SIZE, &virtual_view, NULL, NULL, NULL, H5D_ACS_VDS_VIEW_ENC, H5D_ACS_VDS_VIEW_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the VDS printf gap */ - if(H5P_register_real(pclass, H5D_ACS_VDS_PRINTF_GAP_NAME, H5D_ACS_VDS_PRINTF_GAP_SIZE, &printf_gap, + if(H5P__register_real(pclass, H5D_ACS_VDS_PRINTF_GAP_NAME, H5D_ACS_VDS_PRINTF_GAP_SIZE, &printf_gap, NULL, NULL, NULL, H5D_ACS_VDS_PRINTF_GAP_ENC, H5D_ACS_VDS_PRINTF_GAP_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for vds prefix */ - if(H5P_register_real(pclass, H5D_ACS_VDS_PREFIX_NAME, H5D_ACS_VDS_PREFIX_SIZE, &H5D_def_vds_prefix_g, + if(H5P__register_real(pclass, H5D_ACS_VDS_PREFIX_NAME, H5D_ACS_VDS_PREFIX_SIZE, &H5D_def_vds_prefix_g, NULL, H5D_ACS_VDS_PREFIX_SET, H5D_ACS_VDS_PREFIX_GET, H5D_ACS_VDS_PREFIX_ENC, H5D_ACS_VDS_PREFIX_DEC, H5D_ACS_VDS_PREFIX_DEL, H5D_ACS_VDS_PREFIX_COPY, H5D_ACS_VDS_PREFIX_CMP, H5D_ACS_VDS_PREFIX_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register info for append flush */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5D_ACS_APPEND_FLUSH_NAME, H5D_ACS_APPEND_FLUSH_SIZE, &H5D_def_append_flush_g, + if(H5P__register_real(pclass, H5D_ACS_APPEND_FLUSH_NAME, H5D_ACS_APPEND_FLUSH_SIZE, &H5D_def_append_flush_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for external file prefix */ - if(H5P_register_real(pclass, H5D_ACS_EFILE_PREFIX_NAME, H5D_ACS_EFILE_PREFIX_SIZE, &H5D_def_efile_prefix_g, + if(H5P__register_real(pclass, H5D_ACS_EFILE_PREFIX_NAME, H5D_ACS_EFILE_PREFIX_SIZE, &H5D_def_efile_prefix_g, NULL, H5D_ACS_EFILE_PREFIX_SET, H5D_ACS_EFILE_PREFIX_GET, H5D_ACS_EFILE_PREFIX_ENC, H5D_ACS_EFILE_PREFIX_DEC, H5D_ACS_EFILE_PREFIX_DEL, H5D_ACS_EFILE_PREFIX_COPY, H5D_ACS_EFILE_PREFIX_CMP, H5D_ACS_EFILE_PREFIX_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index cb13ff3..7e9fc52 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -13,11 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5Pdcpl.c - * February 26 1998 - * Robb Matzke + * Created: H5Pdcpl.c * - * Purpose: Dataset creation property list class routines + * Purpose: Dataset creation property list class routines * *------------------------------------------------------------------------- */ @@ -33,19 +31,19 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5CXprivate.h" /* API Contexts */ -#include "H5Dpkg.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Oprivate.h" /* Object headers */ -#include "H5Ppkg.h" /* Property lists */ -#include "H5Sprivate.h" /* Dataspaces */ -#include "H5Tprivate.h" /* Datatypes */ -#include "H5VMprivate.h" /* Vectors and arrays */ -#include "H5Zprivate.h" /* Data filters */ +#include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Dpkg.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5Ppkg.h" /* Property lists */ +#include "H5Sprivate.h" /* Dataspaces */ +#include "H5Tprivate.h" /* Datatypes */ +#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5Zprivate.h" /* Data filters */ /****************/ @@ -242,30 +240,30 @@ static hbool_t H5P_dcrt_def_layout_init_g = FALSE; static herr_t H5P__dcrt_reg_prop(H5P_genclass_t *pclass) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC /* Register the storage layout property */ - if(H5P_register_real(pclass, H5D_CRT_LAYOUT_NAME, H5D_CRT_LAYOUT_SIZE, &H5D_def_layout_g, + if(H5P__register_real(pclass, H5D_CRT_LAYOUT_NAME, H5D_CRT_LAYOUT_SIZE, &H5D_def_layout_g, NULL, H5D_CRT_LAYOUT_SET, H5D_CRT_LAYOUT_GET, H5D_CRT_LAYOUT_ENC, H5D_CRT_LAYOUT_DEC, H5D_CRT_LAYOUT_DEL, H5D_CRT_LAYOUT_COPY, H5D_CRT_LAYOUT_CMP, H5D_CRT_LAYOUT_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the fill value property */ - if(H5P_register_real(pclass, H5D_CRT_FILL_VALUE_NAME, H5D_CRT_FILL_VALUE_SIZE, &H5D_def_fill_g, + if(H5P__register_real(pclass, H5D_CRT_FILL_VALUE_NAME, H5D_CRT_FILL_VALUE_SIZE, &H5D_def_fill_g, NULL, H5D_CRT_FILL_VALUE_SET, H5D_CRT_FILL_VALUE_GET, H5D_CRT_FILL_VALUE_ENC, H5D_CRT_FILL_VALUE_DEC, H5D_CRT_FILL_VALUE_DEL, H5D_CRT_FILL_VALUE_COPY, H5D_CRT_FILL_VALUE_CMP, H5D_CRT_FILL_VALUE_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the space allocation time state property */ - if(H5P_register_real(pclass, H5D_CRT_ALLOC_TIME_STATE_NAME, H5D_CRT_ALLOC_TIME_STATE_SIZE, &H5D_def_alloc_time_state_g, + if(H5P__register_real(pclass, H5D_CRT_ALLOC_TIME_STATE_NAME, H5D_CRT_ALLOC_TIME_STATE_SIZE, &H5D_def_alloc_time_state_g, NULL, NULL, NULL, H5D_CRT_ALLOC_TIME_STATE_ENC, H5D_CRT_ALLOC_TIME_STATE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the external file list property */ - if(H5P_register_real(pclass, H5D_CRT_EXT_FILE_LIST_NAME, H5D_CRT_EXT_FILE_LIST_SIZE, &H5D_def_efl_g, + if(H5P__register_real(pclass, H5D_CRT_EXT_FILE_LIST_NAME, H5D_CRT_EXT_FILE_LIST_SIZE, &H5D_def_efl_g, NULL, H5D_CRT_EXT_FILE_LIST_SET, H5D_CRT_EXT_FILE_LIST_GET, H5D_CRT_EXT_FILE_LIST_ENC, H5D_CRT_EXT_FILE_LIST_DEC, H5D_CRT_EXT_FILE_LIST_DEL, H5D_CRT_EXT_FILE_LIST_COPY, H5D_CRT_EXT_FILE_LIST_CMP, H5D_CRT_EXT_FILE_LIST_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -3206,10 +3204,10 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) H5T_path_t *tpath; /* Conversion information */ /* Retrieve pointer to datatype */ - if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - /* Set the fill value */ + /* Set the fill value */ if(NULL == (fill.type = H5T_copy(type, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy datatype") fill.size = (ssize_t)H5T_get_size(type); diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c index 226d206..4a63b36 100644 --- a/src/H5Pdeprec.c +++ b/src/H5Pdeprec.c @@ -242,7 +242,7 @@ H5Pregister1(hid_t cls_id, const char *name, size_t size, void *def_value, /* Create the new property list class */ orig_pclass = pclass; - if((ret_value = H5P_register(&pclass, name, size, def_value, prp_create, prp_set, prp_get, NULL, NULL, prp_delete, prp_copy, NULL, prp_close)) < 0) + if((ret_value = H5P__register(&pclass, name, size, def_value, prp_create, prp_set, prp_get, NULL, NULL, prp_delete, prp_copy, NULL, prp_close)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to register property in class"); /* Check if the property class changed and needs to be substituted in the ID */ @@ -255,7 +255,7 @@ H5Pregister1(hid_t cls_id, const char *name, size_t size, void *def_value, HDassert(old_pclass == orig_pclass); /* Close the previous class */ - if(H5P_close_class(orig_pclass) < 0) + if(H5P__close_class(orig_pclass) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "unable to close original property class after substitution") } /* end if */ diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index e6eed32..bfc1d93 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -271,131 +271,131 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register the max. temp buffer size property */ - if(H5P_register_real(pclass, H5D_XFER_MAX_TEMP_BUF_NAME, H5D_XFER_MAX_TEMP_BUF_SIZE, &H5D_def_max_temp_buf_g, + if(H5P__register_real(pclass, H5D_XFER_MAX_TEMP_BUF_NAME, H5D_XFER_MAX_TEMP_BUF_SIZE, &H5D_def_max_temp_buf_g, NULL, NULL, NULL, H5D_XFER_MAX_TEMP_BUF_ENC, H5D_XFER_MAX_TEMP_BUF_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the type conversion buffer property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5D_XFER_TCONV_BUF_NAME, H5D_XFER_TCONV_BUF_SIZE, &H5D_def_tconv_buf_g, + if(H5P__register_real(pclass, H5D_XFER_TCONV_BUF_NAME, H5D_XFER_TCONV_BUF_SIZE, &H5D_def_tconv_buf_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the background buffer property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5D_XFER_BKGR_BUF_NAME, H5D_XFER_BKGR_BUF_SIZE, &H5D_def_bkgr_buf_g, + if(H5P__register_real(pclass, H5D_XFER_BKGR_BUF_NAME, H5D_XFER_BKGR_BUF_SIZE, &H5D_def_bkgr_buf_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the background buffer type property */ - if(H5P_register_real(pclass, H5D_XFER_BKGR_BUF_TYPE_NAME, H5D_XFER_BKGR_BUF_TYPE_SIZE, &H5D_def_bkgr_buf_type_g, + if(H5P__register_real(pclass, H5D_XFER_BKGR_BUF_TYPE_NAME, H5D_XFER_BKGR_BUF_TYPE_SIZE, &H5D_def_bkgr_buf_type_g, NULL, NULL, NULL, H5D_XFER_BKGR_BUF_TYPE_ENC, H5D_XFER_BKGR_BUF_TYPE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the B-Tree node splitting ratios property */ - if(H5P_register_real(pclass, H5D_XFER_BTREE_SPLIT_RATIO_NAME, H5D_XFER_BTREE_SPLIT_RATIO_SIZE, H5D_def_btree_split_ratio_g, + if(H5P__register_real(pclass, H5D_XFER_BTREE_SPLIT_RATIO_NAME, H5D_XFER_BTREE_SPLIT_RATIO_SIZE, H5D_def_btree_split_ratio_g, NULL, NULL, NULL, H5D_XFER_BTREE_SPLIT_RATIO_ENC, H5D_XFER_BTREE_SPLIT_RATIO_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vlen allocation function property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5D_XFER_VLEN_ALLOC_NAME, H5D_XFER_VLEN_ALLOC_SIZE, &H5D_def_vlen_alloc_g, + if(H5P__register_real(pclass, H5D_XFER_VLEN_ALLOC_NAME, H5D_XFER_VLEN_ALLOC_SIZE, &H5D_def_vlen_alloc_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vlen allocation information property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5D_XFER_VLEN_ALLOC_INFO_NAME, H5D_XFER_VLEN_ALLOC_INFO_SIZE, &H5D_def_vlen_alloc_info_g, + if(H5P__register_real(pclass, H5D_XFER_VLEN_ALLOC_INFO_NAME, H5D_XFER_VLEN_ALLOC_INFO_SIZE, &H5D_def_vlen_alloc_info_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vlen free function property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5D_XFER_VLEN_FREE_NAME, H5D_XFER_VLEN_FREE_SIZE, &H5D_def_vlen_free_g, + if(H5P__register_real(pclass, H5D_XFER_VLEN_FREE_NAME, H5D_XFER_VLEN_FREE_SIZE, &H5D_def_vlen_free_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vlen free information property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5D_XFER_VLEN_FREE_INFO_NAME, H5D_XFER_VLEN_FREE_INFO_SIZE, &H5D_def_vlen_free_info_g, + if(H5P__register_real(pclass, H5D_XFER_VLEN_FREE_INFO_NAME, H5D_XFER_VLEN_FREE_INFO_SIZE, &H5D_def_vlen_free_info_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vector size property */ - if(H5P_register_real(pclass, H5D_XFER_HYPER_VECTOR_SIZE_NAME, H5D_XFER_HYPER_VECTOR_SIZE_SIZE, &H5D_def_hyp_vec_size_g, + if(H5P__register_real(pclass, H5D_XFER_HYPER_VECTOR_SIZE_NAME, H5D_XFER_HYPER_VECTOR_SIZE_SIZE, &H5D_def_hyp_vec_size_g, NULL, NULL, NULL, H5D_XFER_HYPER_VECTOR_SIZE_ENC, H5D_XFER_HYPER_VECTOR_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the I/O transfer mode properties */ - if(H5P_register_real(pclass, H5D_XFER_IO_XFER_MODE_NAME, H5D_XFER_IO_XFER_MODE_SIZE, &H5D_def_io_xfer_mode_g, + if(H5P__register_real(pclass, H5D_XFER_IO_XFER_MODE_NAME, H5D_XFER_IO_XFER_MODE_SIZE, &H5D_def_io_xfer_mode_g, NULL, NULL, NULL, H5D_XFER_IO_XFER_MODE_ENC, H5D_XFER_IO_XFER_MODE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P_register_real(pclass, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, H5D_XFER_MPIO_COLLECTIVE_OPT_SIZE, &H5D_def_mpio_collective_opt_mode_g, + if(H5P__register_real(pclass, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, H5D_XFER_MPIO_COLLECTIVE_OPT_SIZE, &H5D_def_mpio_collective_opt_mode_g, NULL, NULL, NULL, H5D_XFER_MPIO_COLLECTIVE_OPT_ENC, H5D_XFER_MPIO_COLLECTIVE_OPT_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P_register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, H5D_XFER_MPIO_CHUNK_OPT_HARD_SIZE, &H5D_def_mpio_chunk_opt_mode_g, + if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, H5D_XFER_MPIO_CHUNK_OPT_HARD_SIZE, &H5D_def_mpio_chunk_opt_mode_g, NULL, NULL, NULL, H5D_XFER_MPIO_CHUNK_OPT_HARD_ENC, H5D_XFER_MPIO_CHUNK_OPT_HARD_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P_register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, H5D_XFER_MPIO_CHUNK_OPT_NUM_SIZE, &H5D_def_mpio_chunk_opt_num_g, + if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, H5D_XFER_MPIO_CHUNK_OPT_NUM_SIZE, &H5D_def_mpio_chunk_opt_num_g, NULL, NULL, NULL, H5D_XFER_MPIO_CHUNK_OPT_NUM_ENC, H5D_XFER_MPIO_CHUNK_OPT_NUM_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P_register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, H5D_XFER_MPIO_CHUNK_OPT_RATIO_SIZE, &H5D_def_mpio_chunk_opt_ratio_g, + if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, H5D_XFER_MPIO_CHUNK_OPT_RATIO_SIZE, &H5D_def_mpio_chunk_opt_ratio_g, NULL, NULL, NULL, H5D_XFER_MPIO_CHUNK_OPT_RATIO_ENC, H5D_XFER_MPIO_CHUNK_OPT_RATIO_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the chunk optimization mode property. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_SIZE, &H5D_def_mpio_actual_chunk_opt_mode_g, + if(H5P__register_real(pclass, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_SIZE, &H5D_def_mpio_actual_chunk_opt_mode_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the actual I/O mode property. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5D_MPIO_ACTUAL_IO_MODE_NAME, H5D_MPIO_ACTUAL_IO_MODE_SIZE, &H5D_def_mpio_actual_io_mode_g, + if(H5P__register_real(pclass, H5D_MPIO_ACTUAL_IO_MODE_NAME, H5D_MPIO_ACTUAL_IO_MODE_SIZE, &H5D_def_mpio_actual_io_mode_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the local cause of broken collective I/O */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, H5D_MPIO_NO_COLLECTIVE_CAUSE_SIZE, &H5D_def_mpio_no_collective_cause_g, + if(H5P__register_real(pclass, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, H5D_MPIO_NO_COLLECTIVE_CAUSE_SIZE, &H5D_def_mpio_no_collective_cause_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the global cause of broken collective I/O */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, H5D_MPIO_NO_COLLECTIVE_CAUSE_SIZE, &H5D_def_mpio_no_collective_cause_g, + if(H5P__register_real(pclass, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, H5D_MPIO_NO_COLLECTIVE_CAUSE_SIZE, &H5D_def_mpio_no_collective_cause_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the EDC property */ - if(H5P_register_real(pclass, H5D_XFER_EDC_NAME, H5D_XFER_EDC_SIZE, &H5D_def_enable_edc_g, + if(H5P__register_real(pclass, H5D_XFER_EDC_NAME, H5D_XFER_EDC_SIZE, &H5D_def_enable_edc_g, NULL, NULL, NULL, H5D_XFER_EDC_ENC, H5D_XFER_EDC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the filter callback property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5D_XFER_FILTER_CB_NAME, H5D_XFER_FILTER_CB_SIZE, &H5D_def_filter_cb_g, + if(H5P__register_real(pclass, H5D_XFER_FILTER_CB_NAME, H5D_XFER_FILTER_CB_SIZE, &H5D_def_filter_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the type conversion callback property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5D_XFER_CONV_CB_NAME, H5D_XFER_CONV_CB_SIZE, &H5D_def_conv_cb_g, + if(H5P__register_real(pclass, H5D_XFER_CONV_CB_NAME, H5D_XFER_CONV_CB_SIZE, &H5D_def_conv_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the data transform property */ - if(H5P_register_real(pclass, H5D_XFER_XFORM_NAME, H5D_XFER_XFORM_SIZE, &H5D_def_xfer_xform_g, + if(H5P__register_real(pclass, H5D_XFER_XFORM_NAME, H5D_XFER_XFORM_SIZE, &H5D_def_xfer_xform_g, NULL, H5D_XFER_XFORM_SET, H5D_XFER_XFORM_GET, H5D_XFER_XFORM_ENC, H5D_XFER_XFORM_DEC, H5D_XFER_XFORM_DEL, H5D_XFER_XFORM_COPY, H5D_XFER_XFORM_CMP, H5D_XFER_XFORM_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index 73c48d7..8b9962f 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -428,7 +428,7 @@ H5P__encode(const H5P_genplist_t *plist, hbool_t enc_all_prop, void *buf, /* Iterate over all properties in property list, encoding them */ idx = 0; - if(H5P_iterate_plist(plist, enc_all_prop, &idx, H5P__encode_cb, &udata) < 0) + if(H5P__iterate_plist(plist, enc_all_prop, &idx, H5P__encode_cb, &udata) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADITER, FAIL, "can't iterate over properties") /* Encode a terminator for list of properties */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 7ba9c11..5320da1 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -398,7 +398,7 @@ static const size_t H5F_def_page_buf_size_g = H5F_ACS_PAGE_BUFFER_SIZE_DEF; static const unsigned H5F_def_page_buf_min_meta_perc_g = H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEF; /* Default page buffer minimum metadata size */ static const unsigned H5F_def_page_buf_min_raw_perc_g = H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEF; /* Default page buffer mininum raw data size */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_reg_prop * @@ -419,110 +419,110 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register the initial metadata cache resize configuration */ - if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g, + if(H5P__register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g, NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache (elements) */ - if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g, + if(H5P__register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g, NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache(bytes) */ - if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g, + if(H5P__register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g, NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the preemption for reading chunks */ - if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g, + if(H5P__register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g, NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the threshold for alignment */ - if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g, + if(H5P__register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g, NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the alignment */ - if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g, + if(H5P__register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g, NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum metadata allocation block size */ - if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g, + if(H5P__register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g, NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the maximum sieve buffer size */ - if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g, + if(H5P__register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g, NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum "small data" allocation block size */ - if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g, + if(H5P__register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g, NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the garbage collection reference */ - if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g, + if(H5P__register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g, NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file driver ID & info */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop, + if(H5P__register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop, H5F_ACS_FILE_DRV_CRT, H5F_ACS_FILE_DRV_SET, H5F_ACS_FILE_DRV_GET, NULL, NULL, H5F_ACS_FILE_DRV_DEL, H5F_ACS_FILE_DRV_COPY, H5F_ACS_FILE_DRV_CMP, H5F_ACS_FILE_DRV_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file close degree */ - if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g, + if(H5P__register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g, NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the offset of family driver info */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g, + if(H5P__register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g, NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of new family file size. It's used by h5repart only. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g, + if(H5P__register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of whether convert family to sec2 driver. It's used by h5repart only. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g, + if(H5P__register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the data type of multi driver info */ - if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g, + if(H5P__register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g, NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 'low' bound of library format versions */ - if(H5P_register_real(pclass, H5F_ACS_LIBVER_LOW_BOUND_NAME, H5F_ACS_LIBVER_LOW_BOUND_SIZE, &H5F_def_libver_low_bound_g, + if(H5P__register_real(pclass, H5F_ACS_LIBVER_LOW_BOUND_NAME, H5F_ACS_LIBVER_LOW_BOUND_SIZE, &H5F_def_libver_low_bound_g, NULL, NULL, NULL, H5F_ACS_LIBVER_LOW_BOUND_ENC, H5F_ACS_LIBVER_LOW_BOUND_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 'high' bound of library format versions */ - if(H5P_register_real(pclass, H5F_ACS_LIBVER_HIGH_BOUND_NAME, H5F_ACS_LIBVER_HIGH_BOUND_SIZE, &H5F_def_libver_high_bound_g, + if(H5P__register_real(pclass, H5F_ACS_LIBVER_HIGH_BOUND_NAME, H5F_ACS_LIBVER_HIGH_BOUND_SIZE, &H5F_def_libver_high_bound_g, NULL, NULL, NULL, H5F_ACS_LIBVER_HIGH_BOUND_ENC, H5F_ACS_LIBVER_HIGH_BOUND_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -530,116 +530,116 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) /* Register the private property of whether to retrieve the file descriptor from the core VFD */ /* (used internally to the library only) */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g, + if(H5P__register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the external file cache size */ - if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g, + if(H5P__register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g, NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the initial file image info */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, + if(H5P__register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, NULL, H5F_ACS_FILE_IMAGE_INFO_SET, H5F_ACS_FILE_IMAGE_INFO_GET, NULL, NULL, H5F_ACS_FILE_IMAGE_INFO_DEL, H5F_ACS_FILE_IMAGE_INFO_COPY, H5F_ACS_FILE_IMAGE_INFO_CMP, H5F_ACS_FILE_IMAGE_INFO_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the core VFD backing store write tracking flag */ - if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g, + if(H5P__register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g, NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the core VFD backing store page size */ - if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g, + if(H5P__register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g, NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the # of read attempts */ - if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, + if(H5P__register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register object flush callback */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g, + if(H5P__register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of whether to clear the superblock status_flags. It's used by h5clear only. */ - if(H5P_register_real(pclass, H5F_ACS_CLEAR_STATUS_FLAGS_NAME, H5F_ACS_CLEAR_STATUS_FLAGS_SIZE, &H5F_def_clear_status_flags_g, + if(H5P__register_real(pclass, H5F_ACS_CLEAR_STATUS_FLAGS_NAME, H5F_ACS_CLEAR_STATUS_FLAGS_SIZE, &H5F_def_clear_status_flags_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of whether to skip EOF check. It's used by h5clear only. */ - if(H5P_register_real(pclass, H5F_ACS_SKIP_EOF_CHECK_NAME, H5F_ACS_SKIP_EOF_CHECK_SIZE, &H5F_def_skip_eof_check_g, + if(H5P__register_real(pclass, H5F_ACS_SKIP_EOF_CHECK_NAME, H5F_ACS_SKIP_EOF_CHECK_SIZE, &H5F_def_skip_eof_check_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of whether to drop free-space to the floor. It's used by h5clear only. */ - if(H5P_register_real(pclass, H5F_ACS_NULL_FSM_ADDR_NAME, H5F_ACS_NULL_FSM_ADDR_SIZE, &H5F_def_null_fsm_addr_g, + if(H5P__register_real(pclass, H5F_ACS_NULL_FSM_ADDR_NAME, H5F_ACS_NULL_FSM_ADDR_SIZE, &H5F_def_null_fsm_addr_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the metadata cache logging flag. */ - if(H5P_register_real(pclass, H5F_ACS_USE_MDC_LOGGING_NAME, H5F_ACS_USE_MDC_LOGGING_SIZE, &H5F_def_use_mdc_logging_g, + if(H5P__register_real(pclass, H5F_ACS_USE_MDC_LOGGING_NAME, H5F_ACS_USE_MDC_LOGGING_SIZE, &H5F_def_use_mdc_logging_g, NULL, NULL, NULL, H5F_ACS_USE_MDC_LOGGING_ENC, H5F_ACS_USE_MDC_LOGGING_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the metadata cache log location. */ - if(H5P_register_real(pclass, H5F_ACS_MDC_LOG_LOCATION_NAME, H5F_ACS_MDC_LOG_LOCATION_SIZE, &H5F_def_mdc_log_location_g, + if(H5P__register_real(pclass, H5F_ACS_MDC_LOG_LOCATION_NAME, H5F_ACS_MDC_LOG_LOCATION_SIZE, &H5F_def_mdc_log_location_g, NULL, NULL, NULL, H5F_ACS_MDC_LOG_LOCATION_ENC, H5F_ACS_MDC_LOG_LOCATION_DEC, H5F_ACS_MDC_LOG_LOCATION_DEL, H5F_ACS_MDC_LOG_LOCATION_COPY, H5F_ACS_MDC_LOG_LOCATION_CMP, H5F_ACS_MDC_LOG_LOCATION_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the flag that indicates whether mdc logging starts on file access. */ - if(H5P_register_real(pclass, H5F_ACS_START_MDC_LOG_ON_ACCESS_NAME, H5F_ACS_START_MDC_LOG_ON_ACCESS_SIZE, &H5F_def_start_mdc_log_on_access_g, + if(H5P__register_real(pclass, H5F_ACS_START_MDC_LOG_ON_ACCESS_NAME, H5F_ACS_START_MDC_LOG_ON_ACCESS_SIZE, &H5F_def_start_mdc_log_on_access_g, NULL, NULL, NULL, H5F_ACS_START_MDC_LOG_ON_ACCESS_ENC, H5F_ACS_START_MDC_LOG_ON_ACCESS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the evict on close flag */ - if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g, + if(H5P__register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g, NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #ifdef H5_HAVE_PARALLEL /* Register the metadata collective read flag */ - if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g, + if(H5P__register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g, NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the metadata collective write flag */ - if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g, + if(H5P__register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g, NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #endif /* H5_HAVE_PARALLEL */ /* Register the initial metadata cache image configuration */ - if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE, &H5F_def_mdc_initCacheImageCfg_g, + if(H5P__register_real(pclass, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE, &H5F_def_mdc_initCacheImageCfg_g, NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEC, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g, + if(H5P__register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g, NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer minimum metadata size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g, + if(H5P__register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g, NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer minimum raw data size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g, + if(H5P__register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g, NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -648,7 +648,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_reg_prop() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_alignment * @@ -706,7 +706,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_alignment * @@ -747,7 +747,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_alignment() */ - + /*------------------------------------------------------------------------- * Function: H5P_set_driver * @@ -795,7 +795,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_set_driver() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_driver * @@ -838,7 +838,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_driver() */ - + /*------------------------------------------------------------------------- * Function: H5P_peek_driver * @@ -882,7 +882,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_peek_driver() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_driver * @@ -923,7 +923,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_driver() */ - + /*------------------------------------------------------------------------- * Function: H5P_peek_driver_info * @@ -965,7 +965,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_peek_driver_info() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_driver_info * @@ -1005,7 +1005,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_driver_info() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_driver_copy * @@ -1071,7 +1071,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_driver_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_driver_free * @@ -1123,7 +1123,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_driver_free() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_create * @@ -1152,7 +1152,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_create() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_set * @@ -1185,7 +1185,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_set() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_get * @@ -1218,7 +1218,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_get() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_del * @@ -1247,7 +1247,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_del() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_copy * @@ -1276,7 +1276,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_cmp * @@ -1335,7 +1335,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_close * @@ -1364,7 +1364,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_family_offset * @@ -1403,7 +1403,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_family_offset() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_family_offset * @@ -1444,7 +1444,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_family_offset() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_multi_type * @@ -1483,7 +1483,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_multi_type() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_multi_type * @@ -1524,7 +1524,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_multi_type() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_cache * @@ -1578,7 +1578,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_cache() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_cache * @@ -1630,7 +1630,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_cache() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_image_config * @@ -1674,7 +1674,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_image_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_image_config * @@ -1725,7 +1725,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_mdc_image_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_config * @@ -1769,7 +1769,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_config * @@ -1820,7 +1820,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_mdc_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_gc_references * @@ -1873,7 +1873,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_gc_references * @@ -1916,7 +1916,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pset_fclose_degree * @@ -1952,7 +1952,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_fclose_degree() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_fclose_degree * @@ -1987,7 +1987,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_fclose_degree() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_meta_block_size * @@ -2038,7 +2038,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_meta_block_size * @@ -2082,7 +2082,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pset_sieve_buf_size * @@ -2133,7 +2133,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_sieve_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_sieve_buf_size * @@ -2176,7 +2176,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_sieve_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_small_data_block_size * @@ -2222,7 +2222,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_small_data_block_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_small_data_block_size * @@ -2261,7 +2261,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_small_data_block_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_libver_bounds * @@ -2403,14 +2403,14 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_libver_bounds() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_libver_bounds * - * Purpose: Returns the current settings for the library version format bounds - * from a file access property list. + * Purpose: Returns the current settings for the library version format bounds + * from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Thursday, January 3, 2008 @@ -2446,7 +2446,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_libver_bounds() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_elink_file_cache_size * @@ -2484,7 +2484,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_elink_file_cache_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_elink_file_cache_size * @@ -2523,7 +2523,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_elink_file_cache_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_file_image * @@ -2604,7 +2604,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_file_image() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_file_image * @@ -2693,7 +2693,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_file_image */ - + /*------------------------------------------------------------------------- * Function: H5Pset_file_image_callbacks * @@ -2770,7 +2770,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_file_image_callbacks() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_file_image_callbacks * @@ -2826,7 +2826,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_file_image_callbacks() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_image_info_copy * @@ -2904,7 +2904,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_image_info_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_image_info_free * @@ -2959,7 +2959,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_image_info_free() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_cmp * @@ -3002,7 +3002,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_image_config_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_enc * @@ -3048,7 +3048,7 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_cache_image_config_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_dec * @@ -3100,7 +3100,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_image_config_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_set * @@ -3133,7 +3133,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_set() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_get * @@ -3166,7 +3166,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_get() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_del * @@ -3197,7 +3197,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_del() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_copy * @@ -3227,7 +3227,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_cmp * @@ -3286,7 +3286,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_close * @@ -3316,7 +3316,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_close() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_cmp * @@ -3428,7 +3428,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_config_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_enc * @@ -3573,7 +3573,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_cache_config_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_dec * @@ -3708,7 +3708,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_config_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_fclose_degree_enc * @@ -3746,7 +3746,7 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_fclose_degree_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_fclose_degree_dec * @@ -3781,7 +3781,7 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_fclose_degree_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_multi_type_enc * @@ -3819,7 +3819,7 @@ H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_multi_type_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_multi_type_dec * @@ -3854,7 +3854,7 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_multi_type_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_libver_type_enc * @@ -3966,7 +3966,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_core_write_tracking() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_core_write_tracking * @@ -4008,7 +4008,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_core_write_tracking() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_metadata_read_attempts * @@ -4051,7 +4051,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_metadata_read_attempts() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_metadata_read_attempts * @@ -4092,7 +4092,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_metadata_read_attempts() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_obj_flush_cb * @@ -4136,7 +4136,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_obj_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_obj_flush_cb * @@ -4177,7 +4177,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_obj_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_log_options * @@ -4229,7 +4229,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_mdc_log_options() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_log_options * @@ -4284,7 +4284,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_mdc_log_options() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_enc * @@ -4337,7 +4337,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_dec * @@ -4391,7 +4391,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_mdc_log_location_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_del * @@ -4414,7 +4414,7 @@ H5P_facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_U FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_del() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_copy * @@ -4436,7 +4436,7 @@ H5P_facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_U FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_cmp * @@ -4468,7 +4468,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_mdc_log_location_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_close * @@ -4491,7 +4491,7 @@ H5P_facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_ FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_evict_on_close * @@ -4539,7 +4539,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_evict_on_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_evict_on_close * @@ -4583,7 +4583,7 @@ done: } /* end H5Pget_evict_on_close() */ #ifdef H5_HAVE_PARALLEL - + /*------------------------------------------------------------------------- * Function: H5P__encode_coll_md_read_flag_t * @@ -4621,7 +4621,7 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__encode_coll_md_read_flag_t() */ - + /*------------------------------------------------------------------------- * Function: H5P__decode_coll_md_read_flag_t * @@ -4655,7 +4655,7 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__decode_coll_md_read_flag_t() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_all_coll_metadata_ops * @@ -4714,7 +4714,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_all_coll_metadata_ops() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_all_coll_metadata_ops * @@ -4772,7 +4772,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_all_coll_metadata_ops */ - + /*------------------------------------------------------------------------- * Function: H5Pset_coll_metadata_write * @@ -4811,7 +4811,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_coll_metadata_write() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_coll_metadata_write * @@ -4849,7 +4849,7 @@ done: } /* end H5Pget_coll_metadata_write() */ #endif /* H5_HAVE_PARALLEL */ - + /*------------------------------------------------------------------------- * Function: H5Pset_page_buffer_size * @@ -4897,7 +4897,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_page_buffer_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_page_buffer_size * diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index f90dae5..56af8b1 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -36,7 +36,6 @@ #include "H5Bprivate.h" /* B-tree subclass names */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ -#include "H5SMprivate.h" /* Shared object header messages */ #include "H5Ppkg.h" /* Property lists */ @@ -213,85 +212,85 @@ H5P_fcrt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_NOAPI_NOINIT /* Register the user block size */ - if(H5P_register_real(pclass, H5F_CRT_USER_BLOCK_NAME, H5F_CRT_USER_BLOCK_SIZE, &H5F_def_userblock_size_g, + if(H5P__register_real(pclass, H5F_CRT_USER_BLOCK_NAME, H5F_CRT_USER_BLOCK_SIZE, &H5F_def_userblock_size_g, NULL, NULL, NULL, H5F_CRT_USER_BLOCK_ENC, H5F_CRT_USER_BLOCK_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 1/2 rank for symbol table leaf nodes */ - if(H5P_register_real(pclass, H5F_CRT_SYM_LEAF_NAME, H5F_CRT_SYM_LEAF_SIZE, &H5F_def_sym_leaf_k_g, + if(H5P__register_real(pclass, H5F_CRT_SYM_LEAF_NAME, H5F_CRT_SYM_LEAF_SIZE, &H5F_def_sym_leaf_k_g, NULL, NULL, NULL, H5F_CRT_SYM_LEAF_ENC, H5F_CRT_SYM_LEAF_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 1/2 rank for btree internal nodes */ - if(H5P_register_real(pclass, H5F_CRT_BTREE_RANK_NAME, H5F_CRT_BTREE_RANK_SIZE, H5F_def_btree_k_g, + if(H5P__register_real(pclass, H5F_CRT_BTREE_RANK_NAME, H5F_CRT_BTREE_RANK_SIZE, H5F_def_btree_k_g, NULL, NULL, NULL, H5F_CRT_BTREE_RANK_ENC, H5F_CRT_BTREE_RANK_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the byte number for an address */ - if(H5P_register_real(pclass, H5F_CRT_ADDR_BYTE_NUM_NAME, H5F_CRT_ADDR_BYTE_NUM_SIZE, &H5F_def_sizeof_addr_g, + if(H5P__register_real(pclass, H5F_CRT_ADDR_BYTE_NUM_NAME, H5F_CRT_ADDR_BYTE_NUM_SIZE, &H5F_def_sizeof_addr_g, NULL, NULL, NULL, H5F_CRT_ADDR_BYTE_NUM_ENC, H5F_CRT_ADDR_BYTE_NUM_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the byte number for object size */ - if(H5P_register_real(pclass, H5F_CRT_OBJ_BYTE_NUM_NAME, H5F_CRT_OBJ_BYTE_NUM_SIZE, &H5F_def_sizeof_size_g, + if(H5P__register_real(pclass, H5F_CRT_OBJ_BYTE_NUM_NAME, H5F_CRT_OBJ_BYTE_NUM_SIZE, &H5F_def_sizeof_size_g, NULL, NULL, NULL, H5F_CRT_OBJ_BYTE_NUM_ENC, H5F_CRT_OBJ_BYTE_NUM_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the superblock version number */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_CRT_SUPER_VERS_NAME, H5F_CRT_SUPER_VERS_SIZE, &H5F_def_superblock_ver_g, + if(H5P__register_real(pclass, H5F_CRT_SUPER_VERS_NAME, H5F_CRT_SUPER_VERS_SIZE, &H5F_def_superblock_ver_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the shared OH message information */ - if(H5P_register_real(pclass, H5F_CRT_SHMSG_NINDEXES_NAME, H5F_CRT_SHMSG_NINDEXES_SIZE, &H5F_def_num_sohm_indexes_g, + if(H5P__register_real(pclass, H5F_CRT_SHMSG_NINDEXES_NAME, H5F_CRT_SHMSG_NINDEXES_SIZE, &H5F_def_num_sohm_indexes_g, NULL, NULL, NULL, H5F_CRT_SHMSG_NINDEXES_ENC, H5F_CRT_SHMSG_NINDEXES_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P_register_real(pclass, H5F_CRT_SHMSG_INDEX_TYPES_NAME, H5F_CRT_SHMSG_INDEX_TYPES_SIZE, &H5F_def_sohm_index_flags_g, + if(H5P__register_real(pclass, H5F_CRT_SHMSG_INDEX_TYPES_NAME, H5F_CRT_SHMSG_INDEX_TYPES_SIZE, &H5F_def_sohm_index_flags_g, NULL, NULL, NULL, H5F_CRT_SHMSG_INDEX_TYPES_ENC, H5F_CRT_SHMSG_INDEX_TYPES_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P_register_real(pclass, H5F_CRT_SHMSG_INDEX_MINSIZE_NAME, H5F_CRT_SHMSG_INDEX_MINSIZE_SIZE, &H5F_def_sohm_index_minsizes_g, + if(H5P__register_real(pclass, H5F_CRT_SHMSG_INDEX_MINSIZE_NAME, H5F_CRT_SHMSG_INDEX_MINSIZE_SIZE, &H5F_def_sohm_index_minsizes_g, NULL, NULL, NULL, H5F_CRT_SHMSG_INDEX_MINSIZE_ENC, H5F_CRT_SHMSG_INDEX_MINSIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the shared OH cutoff size information */ - if(H5P_register_real(pclass, H5F_CRT_SHMSG_LIST_MAX_NAME, H5F_CRT_SHMSG_LIST_MAX_SIZE, &H5F_def_sohm_list_max_g, + if(H5P__register_real(pclass, H5F_CRT_SHMSG_LIST_MAX_NAME, H5F_CRT_SHMSG_LIST_MAX_SIZE, &H5F_def_sohm_list_max_g, NULL, NULL, NULL, H5F_CRT_SHMSG_LIST_MAX_ENC, H5F_CRT_SHMSG_LIST_MAX_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P_register_real(pclass, H5F_CRT_SHMSG_BTREE_MIN_NAME, H5F_CRT_SHMSG_BTREE_MIN_SIZE, &H5F_def_sohm_btree_min_g, + if(H5P__register_real(pclass, H5F_CRT_SHMSG_BTREE_MIN_NAME, H5F_CRT_SHMSG_BTREE_MIN_SIZE, &H5F_def_sohm_btree_min_g, NULL, NULL, NULL, H5F_CRT_SHMSG_BTREE_MIN_ENC, H5F_CRT_SHMSG_BTREE_MIN_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file space handling strategy */ - if(H5P_register_real(pclass, H5F_CRT_FILE_SPACE_STRATEGY_NAME, H5F_CRT_FILE_SPACE_STRATEGY_SIZE, &H5F_def_file_space_strategy_g, + if(H5P__register_real(pclass, H5F_CRT_FILE_SPACE_STRATEGY_NAME, H5F_CRT_FILE_SPACE_STRATEGY_SIZE, &H5F_def_file_space_strategy_g, NULL, NULL, NULL, H5F_CRT_FILE_SPACE_STRATEGY_ENC, H5F_CRT_FILE_SPACE_STRATEGY_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the free-space persist flag */ - if(H5P_register_real(pclass, H5F_CRT_FREE_SPACE_PERSIST_NAME, H5F_CRT_FREE_SPACE_PERSIST_SIZE, &H5F_def_free_space_persist_g, + if(H5P__register_real(pclass, H5F_CRT_FREE_SPACE_PERSIST_NAME, H5F_CRT_FREE_SPACE_PERSIST_SIZE, &H5F_def_free_space_persist_g, NULL, NULL, NULL, H5F_CRT_FREE_SPACE_PERSIST_ENC, H5F_CRT_FREE_SPACE_PERSIST_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the free space section threshold */ - if(H5P_register_real(pclass, H5F_CRT_FREE_SPACE_THRESHOLD_NAME, H5F_CRT_FREE_SPACE_THRESHOLD_SIZE, &H5F_def_free_space_threshold_g, + if(H5P__register_real(pclass, H5F_CRT_FREE_SPACE_THRESHOLD_NAME, H5F_CRT_FREE_SPACE_THRESHOLD_SIZE, &H5F_def_free_space_threshold_g, NULL, NULL, NULL, H5F_CRT_FREE_SPACE_THRESHOLD_ENC, H5F_CRT_FREE_SPACE_THRESHOLD_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file space page size */ - if(H5P_register_real(pclass, H5F_CRT_FILE_SPACE_PAGE_SIZE_NAME, H5F_CRT_FILE_SPACE_PAGE_SIZE_SIZE, &H5F_def_file_space_page_size_g, + if(H5P__register_real(pclass, H5F_CRT_FILE_SPACE_PAGE_SIZE_NAME, H5F_CRT_FILE_SPACE_PAGE_SIZE_SIZE, &H5F_def_file_space_page_size_g, NULL, NULL, NULL, H5F_CRT_FILE_SPACE_PAGE_SIZE_ENC, H5F_CRT_FILE_SPACE_PAGE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") diff --git a/src/H5Pfmpl.c b/src/H5Pfmpl.c index e858a79..1e39749 100644 --- a/src/H5Pfmpl.c +++ b/src/H5Pfmpl.c @@ -124,7 +124,7 @@ H5P_fmnt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_NOAPI_NOINIT /* Register property of whether symlinks is local to file */ - if(H5P_register_real(pclass, H5F_MNT_SYM_LOCAL_NAME, H5F_MNT_SYM_LOCAL_SIZE, &H5F_def_local_g, + if(H5P__register_real(pclass, H5F_MNT_SYM_LOCAL_NAME, H5F_MNT_SYM_LOCAL_SIZE, &H5F_def_local_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index 6f1fab1..e2fdcea 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -32,12 +32,12 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Oprivate.h" /* Object headers */ -#include "H5Ppkg.h" /* Property lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5Ppkg.h" /* Property lists */ /****************/ @@ -133,13 +133,13 @@ H5P__gcrt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register group info property */ - if(H5P_register_real(pclass, H5G_CRT_GROUP_INFO_NAME, H5G_CRT_GROUP_INFO_SIZE, &H5G_def_ginfo_g, + if(H5P__register_real(pclass, H5G_CRT_GROUP_INFO_NAME, H5G_CRT_GROUP_INFO_SIZE, &H5G_def_ginfo_g, NULL, NULL, NULL, H5G_CRT_GROUP_INFO_ENC, H5G_CRT_GROUP_INFO_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register link info property */ - if(H5P_register_real(pclass, H5G_CRT_LINK_INFO_NAME, H5G_CRT_LINK_INFO_SIZE, &H5G_def_linfo_g, + if(H5P__register_real(pclass, H5G_CRT_LINK_INFO_NAME, H5G_CRT_LINK_INFO_SIZE, &H5G_def_linfo_g, NULL, NULL, NULL, H5G_CRT_LINK_INFO_ENC, H5G_CRT_LINK_INFO_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") diff --git a/src/H5Pint.c b/src/H5Pint.c index 6a0cc14..179f883 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -100,11 +100,23 @@ typedef herr_t (*H5P_do_pclass_op_t)(H5P_genplist_t *plist, const char *name, H5 /********************/ /* General helper routines */ -static H5P_genprop_t *H5P_dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type); -static herr_t H5P_free_prop(H5P_genprop_t *prop); -static int H5P_cmp_prop(const H5P_genprop_t *prop1, const H5P_genprop_t *prop2); +static H5P_genplist_t *H5P__create(H5P_genclass_t *pclass); +static H5P_genprop_t *H5P__create_prop(const char *name, size_t size, H5P_prop_within_t type, + const void *value, H5P_prp_create_func_t prp_create, + H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, + H5P_prp_encode_func_t prp_encode, H5P_prp_decode_func_t prp_decode, + H5P_prp_delete_func_t prp_delete, + H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, + H5P_prp_close_func_t prp_close); +static H5P_genprop_t *H5P__dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type); +static herr_t H5P__free_prop(H5P_genprop_t *prop); +static int H5P__cmp_prop(const H5P_genprop_t *prop1, const H5P_genprop_t *prop2); static herr_t H5P__do_prop(H5P_genplist_t *plist, const char *name, H5P_do_plist_op_t plist_op, H5P_do_pclass_op_t pclass_op, void *udata); +static int H5P__open_class_path_cb(void *_obj, hid_t H5_ATTR_UNUSED id, void *_key); +static H5P_genprop_t *H5P__find_prop_pclass(H5P_genclass_t *pclass, const char *name); +static herr_t H5P__free_prop_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data); +static herr_t H5P__free_del_name_cb(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data); /*********************/ @@ -336,7 +348,7 @@ static const H5I_class_t H5I_GENPROPCLS_CLS[1] = {{ H5I_GENPROP_CLS, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - (H5I_free_t)H5P_close_class /* Callback routine for closing objects of this class */ + (H5I_free_t)H5P__close_class /* Callback routine for closing objects of this class */ }}; /* Generic Property List ID class */ @@ -425,7 +437,7 @@ H5P__init_package(void) HDassert(lib_class->par_pclass || lib_class == H5P_CLS_ROOT); /* Allocate the new class */ - if(NULL == (*lib_class->pclass = H5P_create_class(lib_class->par_pclass ? *lib_class->par_pclass : NULL, lib_class->name, lib_class->type, lib_class->create_func, lib_class->create_data, lib_class->copy_func, lib_class->copy_data, lib_class->close_func, lib_class->close_data))) + if(NULL == (*lib_class->pclass = H5P__create_class(lib_class->par_pclass ? *lib_class->par_pclass : NULL, lib_class->name, lib_class->type, lib_class->create_func, lib_class->create_data, lib_class->copy_func, lib_class->copy_data, lib_class->close_func, lib_class->close_data))) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "class initialization failed") /* Call routine to register properties for class */ @@ -626,14 +638,14 @@ H5P__do_prop_cb1(H5SL_t *slist, H5P_genprop_t *prop, H5P_prp_cb1_t cb) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL,"Property callback failed") /* Make a copy of the class's property */ - if(NULL == (pcopy = H5P_dup_prop(prop, H5P_PROP_WITHIN_LIST))) + if(NULL == (pcopy = H5P__dup_prop(prop, H5P_PROP_WITHIN_LIST))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "Can't copy property") /* Copy the changed value into the new property */ HDmemcpy(pcopy->value, tmp_value, prop->size); /* Insert the changed property into the property list */ - if(H5P_add_prop(slist, pcopy) < 0) + if(H5P__add_prop(slist, pcopy) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "Can't insert property into skip list") done: @@ -644,7 +656,7 @@ done: /* Cleanup on failure */ if(ret_value < 0) if(pcopy) - H5P_free_prop(pcopy); + H5P__free_prop(pcopy); FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__do_prop_cb1() */ @@ -652,11 +664,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5P_copy_pclass + H5P__copy_pclass PURPOSE Internal routine to copy a generic property class USAGE - hid_t H5P_copy_pclass(pclass) + hid_t H5P__copy_pclass(pclass) H5P_genclass_t *pclass; IN: Property class to copy RETURNS Success: valid property class ID on success (non-negative) @@ -671,13 +683,13 @@ done: REVISION LOG --------------------------------------------------------------------------*/ H5P_genclass_t * -H5P_copy_pclass(H5P_genclass_t *pclass) +H5P__copy_pclass(H5P_genclass_t *pclass) { H5P_genclass_t *new_pclass = NULL; /* Property list class copied */ H5P_genprop_t *pcopy; /* Copy of property to insert into class */ H5P_genclass_t *ret_value=NULL; /* return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(pclass); @@ -686,7 +698,7 @@ H5P_copy_pclass(H5P_genclass_t *pclass) */ /* Create the new property list class */ - if(NULL == (new_pclass = H5P_create_class(pclass->parent, pclass->name, pclass->type, pclass->create_func, pclass->create_data, pclass->copy_func, pclass->copy_data, pclass->close_func, pclass->close_data))) + if(NULL == (new_pclass = H5P__create_class(pclass->parent, pclass->name, pclass->type, pclass->create_func, pclass->create_data, pclass->copy_func, pclass->copy_data, pclass->close_func, pclass->close_data))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, NULL, "unable to create property list class") /* Copy the properties registered for this class */ @@ -697,11 +709,11 @@ H5P_copy_pclass(H5P_genclass_t *pclass) curr_node=H5SL_first(pclass->props); while(curr_node!=NULL) { /* Make a copy of the class's property */ - if(NULL == (pcopy = H5P_dup_prop((H5P_genprop_t *)H5SL_item(curr_node), H5P_PROP_WITHIN_CLASS))) + if(NULL == (pcopy = H5P__dup_prop((H5P_genprop_t *)H5SL_item(curr_node), H5P_PROP_WITHIN_CLASS))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, NULL,"Can't copy property") /* Insert the initialized property into the property list */ - if(H5P_add_prop(new_pclass->props,pcopy) < 0) + if(H5P__add_prop(new_pclass->props,pcopy) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, NULL,"Can't insert property into class") /* Increment property count for class */ @@ -716,11 +728,11 @@ H5P_copy_pclass(H5P_genclass_t *pclass) ret_value=new_pclass; done: - if(ret_value==NULL && new_pclass) - H5P_close_class(new_pclass); + if(NULL == ret_value && new_pclass) + H5P__close_class(new_pclass); FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_copy_pclass() */ +} /* H5P__copy_pclass() */ /*-------------------------------------------------------------------------- @@ -733,7 +745,7 @@ done: hid_t old_plist_id; IN: Property list ID to copy RETURNS Success: valid property list ID on success (non-negative) - Failure: negative + Failure: H5I_INVALID_HID DESCRIPTION Copy a property list and return the ID. This routine calls the class 'copy' callback after any property 'copy' callbacks are called @@ -756,9 +768,9 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) H5SL_t *seen=NULL; /* Skip list containing properties already seen */ size_t nseen; /* Number of items 'seen' */ hbool_t has_parent_class; /* Flag to indicate that this property list's class has a parent */ - hid_t ret_value=FAIL; /* return value */ + hid_t ret_value = H5I_INVALID_HID; /* return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI(H5I_INVALID_HID) HDassert(old_plist); @@ -768,7 +780,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) /* Allocate room for the property list */ if(NULL==(new_plist = H5FL_CALLOC(H5P_genplist_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,"memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5I_INVALID_HID, "memory allocation failed") /* Set class state */ new_plist->pclass = old_plist->pclass; @@ -777,80 +789,80 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) /* Initialize the skip list to hold the changed properties */ if((new_plist->props = H5SL_create(H5SL_TYPE_STR, NULL)) == NULL) - HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for changed properties") + HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "can't create skip list for changed properties") /* Create the skip list for deleted properties */ if((new_plist->del = H5SL_create(H5SL_TYPE_STR, NULL)) == NULL) - HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for deleted properties") + HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "can't create skip list for deleted properties") /* Create the skip list to hold names of properties already seen * (This prevents a property in the class hierarchy from having it's * 'create' callback called, if a property in the class hierarchy has * already been seen) */ - if((seen = H5SL_create(H5SL_TYPE_STR, NULL))== NULL) - HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for seen properties") + if((seen = H5SL_create(H5SL_TYPE_STR, NULL)) == NULL) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "can't create skip list for seen properties") nseen = 0; /* Cycle through the deleted properties & copy them into the new list's deleted section */ - if(H5SL_count(old_plist->del)>0) { - curr_node=H5SL_first(old_plist->del); + if(H5SL_count(old_plist->del) > 0) { + curr_node = H5SL_first(old_plist->del); while(curr_node) { char *new_name; /* Pointer to new name */ /* Duplicate string for insertion into new deleted property skip list */ - if((new_name=H5MM_xstrdup((char *)H5SL_item(curr_node))) == NULL) - HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,FAIL,"memory allocation failed") + if((new_name = H5MM_xstrdup((char *)H5SL_item(curr_node))) == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5I_INVALID_HID, "memory allocation failed") /* Insert property name into deleted list */ if(H5SL_insert(new_plist->del,new_name,new_name) < 0) - HGOTO_ERROR(H5E_PLIST,H5E_CANTINSERT,FAIL,"can't insert property into deleted skip list") + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert property into deleted skip list") /* Add property name to "seen" list */ if(H5SL_insert(seen,new_name,new_name) < 0) - HGOTO_ERROR(H5E_PLIST,H5E_CANTINSERT,FAIL,"can't insert property into seen skip list") + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert property into seen skip list") nseen++; /* Get the next property node in the skip list */ - curr_node=H5SL_next(curr_node); + curr_node = H5SL_next(curr_node); } /* end while */ } /* end if */ /* Cycle through the properties and copy them also */ - if(H5SL_count(old_plist->props)>0) { - curr_node=H5SL_first(old_plist->props); + if(H5SL_count(old_plist->props) > 0) { + curr_node = H5SL_first(old_plist->props); while(curr_node) { /* Get a pointer to the node's property */ tmp = (H5P_genprop_t *)H5SL_item(curr_node); /* Make a copy of the list's property */ - if(NULL == (new_prop = H5P_dup_prop(tmp, H5P_PROP_WITHIN_LIST))) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL,"Can't copy property") + if(NULL == (new_prop = H5P__dup_prop(tmp, H5P_PROP_WITHIN_LIST))) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5I_INVALID_HID, "Can't copy property") /* Call property copy callback, if it exists */ if(new_prop->copy) { if((new_prop->copy)(new_prop->name,new_prop->size,new_prop->value) < 0) { - H5P_free_prop(new_prop); - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL,"Can't copy property") + H5P__free_prop(new_prop); + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5I_INVALID_HID, "Can't copy property") } /* end if */ } /* end if */ /* Insert the initialized property into the property list */ - if(H5P_add_prop(new_plist->props,new_prop) < 0) { - H5P_free_prop(new_prop); - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL,"Can't insert property into list") + if(H5P__add_prop(new_plist->props,new_prop) < 0) { + H5P__free_prop(new_prop); + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, H5I_INVALID_HID, "Can't insert property into list") } /* end if */ /* Add property name to "seen" list */ if(H5SL_insert(seen,new_prop->name,new_prop->name) < 0) - HGOTO_ERROR(H5E_PLIST,H5E_CANTINSERT,FAIL,"can't insert property into seen skip list") + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert property into seen skip list") nseen++; /* Increment the number of properties in list */ new_plist->nprops++; /* Get the next property node in the skip list */ - curr_node=H5SL_next(curr_node); + curr_node = H5SL_next(curr_node); } /* end while */ } /* end if */ @@ -860,27 +872,27 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) */ tclass=old_plist->pclass; has_parent_class = (hbool_t)(tclass != NULL && tclass->parent != NULL && tclass->parent->nprops > 0); - while(tclass!=NULL) { + while(tclass != NULL) { if(tclass->nprops>0) { /* Walk through the properties in the old class */ - curr_node=H5SL_first(tclass->props); + curr_node = H5SL_first(tclass->props); while(curr_node!=NULL) { /* Get pointer to property from node */ tmp = (H5P_genprop_t *)H5SL_item(curr_node); /* Only "copy" properties we haven't seen before */ - if(nseen==0 || H5SL_search(seen,tmp->name) == NULL) { + if(nseen == 0 || H5SL_search(seen,tmp->name) == NULL) { /* Call property copy callback, if it exists */ if(tmp->copy) { /* Call the callback & insert changed value into skip list (if necessary) */ if(H5P__do_prop_cb1(new_plist->props, tmp, tmp->copy) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL,"Can't create property") + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5I_INVALID_HID, "Can't create property") } /* end if */ /* Add property name to "seen" list, if we have other classes to work on */ if(has_parent_class) { if(H5SL_insert(seen,tmp->name,tmp->name) < 0) - HGOTO_ERROR(H5E_PLIST,H5E_CANTINSERT,FAIL,"can't insert property into seen skip list") + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert property into seen skip list") nseen++; } /* end if */ @@ -889,24 +901,24 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) } /* end if */ /* Get the next property node in the skip list */ - curr_node=H5SL_next(curr_node); + curr_node = H5SL_next(curr_node); } /* end while */ } /* end if */ /* Go up to parent class */ - tclass=tclass->parent; + tclass = tclass->parent; } /* end while */ /* Increment the number of property lists derived from class */ - if(H5P_access_class(new_plist->pclass, H5P_MOD_INC_LST) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "Can't increment class ref count") + if(H5P__access_class(new_plist->pclass, H5P_MOD_INC_LST) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID, "Can't increment class ref count") /* Get an atom for the property list */ if((new_plist_id = H5I_register(H5I_GENPROP_LST, new_plist, app_ref)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list") + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list") /* Save the property list ID in the property list struct, for use in the property class's 'close' callback */ - new_plist->plist_id=new_plist_id; + new_plist->plist_id = new_plist_id; /* Call the class callback (if it exists) now that we have the property list ID * (up through chain of parent classes also) @@ -917,7 +929,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) if((tclass->copy_func)(new_plist_id, old_plist->plist_id, old_plist->pclass->copy_data) < 0) { /* Delete ID, ignore return value */ H5I_remove(new_plist_id); - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL,"Can't initialize property") + HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID, "Can't initialize property") } /* end if */ } /* end if */ @@ -933,10 +945,10 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) done: /* Release the list of 'seen' properties */ - if(seen!=NULL) + if(seen != NULL) H5SL_close(seen); - if(ret_value<0 && new_plist) + if(H5I_INVALID_HID == ret_value && new_plist) H5P_close(new_plist); FUNC_LEAVE_NOAPI(ret_value) @@ -945,11 +957,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5P_dup_prop + H5P__dup_prop PURPOSE Internal routine to duplicate a property USAGE - H5P_genprop_t *H5P_dup_prop(oprop) + H5P_genprop_t *H5P__dup_prop(oprop) H5P_genprop_t *oprop; IN: Pointer to property to copy H5P_prop_within_t type; IN: Type of object the property will be inserted into RETURNS @@ -963,12 +975,12 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5P_genprop_t * -H5P_dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type) +H5P__dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type) { H5P_genprop_t *prop = NULL; /* Pointer to new property copied */ H5P_genprop_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(oprop); HDassert(type != H5P_PROP_WITHIN_UNKNOWN); @@ -1037,16 +1049,16 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_dup_prop() */ +} /* H5P__dup_prop() */ /*-------------------------------------------------------------------------- NAME - H5P_create_prop + H5P__create_prop PURPOSE Internal routine to create a new property USAGE - H5P_genprop_t *H5P_create_prop(name,size,type,value,prp_create,prp_set, + H5P_genprop_t *H5P__create_prop(name,size,type,value,prp_create,prp_set, prp_get,prp_delete,prp_close, prp_encode, prp_decode) const char *name; IN: Name of property to register size_t size; IN: Size of property in bytes @@ -1074,7 +1086,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5P_genprop_t * -H5P_create_prop(const char *name, size_t size, H5P_prop_within_t type, +H5P__create_prop(const char *name, size_t size, H5P_prop_within_t type, const void *value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_encode_func_t prp_encode, H5P_prp_decode_func_t prp_decode, @@ -1085,7 +1097,7 @@ H5P_create_prop(const char *name, size_t size, H5P_prop_within_t type, H5P_genprop_t *prop = NULL; /* Pointer to new property copied */ H5P_genprop_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(name); HDassert((size > 0 && value != NULL) || (size == 0)); @@ -1141,16 +1153,16 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_create_prop() */ +} /* H5P__create_prop() */ /*-------------------------------------------------------------------------- NAME - H5P_add_prop + H5P__add_prop PURPOSE Internal routine to insert a property into a property skip list USAGE - herr_t H5P_add_prop(slist, prop) + herr_t H5P__add_prop(slist, prop) H5SL_t *slist; IN/OUT: Pointer to skip list of properties H5P_genprop_t *prop; IN: Pointer to property to insert RETURNS @@ -1163,11 +1175,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P_add_prop(H5SL_t *slist, H5P_genprop_t *prop) +H5P__add_prop(H5SL_t *slist, H5P_genprop_t *prop) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(slist); HDassert(prop); @@ -1179,7 +1191,7 @@ H5P_add_prop(H5SL_t *slist, H5P_genprop_t *prop) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_add_prop() */ +} /* H5P__add_prop() */ /*-------------------------------------------------------------------------- @@ -1244,11 +1256,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5P_find_prop_pclass + H5P__find_prop_pclass PURPOSE Internal routine to check for a property in a class skip list USAGE - H5P_genprop_t *H5P_find_prop_class(pclass, name) + H5P_genprop_t *H5P__find_prop_class(pclass, name) H5P_genclass *pclass; IN: Pointer generic property class to check const char *name; IN: Name of property to check for RETURNS @@ -1261,11 +1273,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5P_genprop_t * -H5P_find_prop_pclass(H5P_genclass_t *pclass, const char *name) +H5P__find_prop_pclass(H5P_genclass_t *pclass, const char *name) { H5P_genprop_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(pclass); HDassert(name); @@ -1276,16 +1288,16 @@ H5P_find_prop_pclass(H5P_genclass_t *pclass, const char *name) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_find_prop_pclass() */ +} /* H5P__find_prop_pclass() */ /*-------------------------------------------------------------------------- NAME - H5P_free_prop + H5P__free_prop PURPOSE Internal routine to destroy a property node USAGE - herr_t H5P_free_prop(prop) + herr_t H5P__free_prop(prop) H5P_genprop_t *prop; IN: Pointer to property to destroy RETURNS Returns non-negative on success, negative on failure. @@ -1298,9 +1310,9 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P_free_prop(H5P_genprop_t *prop) +H5P__free_prop(H5P_genprop_t *prop) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(prop); @@ -1315,16 +1327,16 @@ H5P_free_prop(H5P_genprop_t *prop) prop = H5FL_FREE(H5P_genprop_t, prop); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5P_free_prop() */ +} /* H5P__free_prop() */ /*-------------------------------------------------------------------------- NAME - H5P_free_prop_cb + H5P__free_prop_cb PURPOSE Internal routine to properties from a property skip list USAGE - herr_t H5P_free_prop_cb(item, key, op_data) + herr_t H5P__free_prop_cb(item, key, op_data) void *item; IN/OUT: Pointer to property void *key; IN/OUT: Pointer to property key void *_make_cb; IN: Whether to make property callbacks or not @@ -1339,12 +1351,12 @@ H5P_free_prop(H5P_genprop_t *prop) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P_free_prop_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data) +H5P__free_prop_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data) { H5P_genprop_t *tprop=(H5P_genprop_t *)item; /* Temporary pointer to property */ hbool_t make_cb = *(hbool_t *)op_data; /* Whether to make property 'close' callback */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(tprop); @@ -1353,19 +1365,19 @@ H5P_free_prop_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data) (tprop->close)(tprop->name, tprop->size, tprop->value); /* Free the property, ignoring return value, nothing we can do */ - H5P_free_prop(tprop); + H5P__free_prop(tprop); FUNC_LEAVE_NOAPI(0) -} /* H5P_free_prop_cb() */ +} /* H5P__free_prop_cb() */ /*-------------------------------------------------------------------------- NAME - H5P_free_del_name_cb + H5P__free_del_name_cb PURPOSE Internal routine to free 'deleted' property name USAGE - herr_t H5P_free_del_name_cb(item, key, op_data) + herr_t H5P__free_del_name_cb(item, key, op_data) void *item; IN/OUT: Pointer to deleted name void *key; IN/OUT: Pointer to key void *op_data; IN: Operator callback data (unused) @@ -1379,11 +1391,11 @@ H5P_free_prop_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P_free_del_name_cb(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data) +H5P__free_del_name_cb(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data) { char *del_name=(char *)item; /* Temporary pointer to deleted name */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(del_name); @@ -1391,17 +1403,17 @@ H5P_free_del_name_cb(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED * H5MM_xfree(del_name); FUNC_LEAVE_NOAPI(0) -} /* H5P_free_del_name_cb() */ +} /* H5P__free_del_name_cb() */ /*-------------------------------------------------------------------------- NAME - H5P_access_class + H5P__access_class PURPOSE - Internal routine to increment or decrement list & class dependencies on a + Internal routine to increment or decrement list & class dependancies on a property list class USAGE - herr_t H5P_access_class(pclass,mod) + herr_t H5P__access_class(pclass,mod) H5P_genclass_t *pclass; IN: Pointer to class to modify H5P_class_mod_t mod; IN: Type of modification to class RETURNS @@ -1417,9 +1429,9 @@ H5P_free_del_name_cb(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED * REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P_access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) +H5P__access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(pclass); HDassert(mod > H5P_MOD_ERR && mod < H5P_MOD_MAX); @@ -1473,27 +1485,27 @@ H5P_access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) if(pclass->props) { hbool_t make_cb = FALSE; - H5SL_destroy(pclass->props, H5P_free_prop_cb, &make_cb); + H5SL_destroy(pclass->props, H5P__free_prop_cb, &make_cb); } /* end if */ pclass = H5FL_FREE(H5P_genclass_t, pclass); /* Reduce the number of dependent classes on parent class also */ if(par_class != NULL) - H5P_access_class(par_class, H5P_MOD_DEC_CLS); + H5P__access_class(par_class, H5P_MOD_DEC_CLS); } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5P_access_class() */ +} /* H5P__access_class() */ /*-------------------------------------------------------------------------- NAME - H5P_open_class_path_cb + H5P__open_class_path_cb PURPOSE Internal callback routine to check for duplicated names in parent class. USAGE - int H5P_open_class_path_cb(obj, id, key) + int H5P__open_class_path_cb(obj, id, key) H5P_genclass_t *obj; IN: Pointer to class hid_t id; IN: ID of object being looked at const void *key; IN: Pointer to information used to compare @@ -1509,13 +1521,13 @@ H5P_access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) REVISION LOG --------------------------------------------------------------------------*/ static int -H5P_open_class_path_cb(void *_obj, hid_t H5_ATTR_UNUSED id, void *_key) +H5P__open_class_path_cb(void *_obj, hid_t H5_ATTR_UNUSED id, void *_key) { H5P_genclass_t *obj = (H5P_genclass_t *)_obj; /* Pointer to the class for this ID */ H5P_check_class_t *key = (H5P_check_class_t *)_key; /* Pointer to key information for comparison */ int ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(obj); HDassert(H5I_GENPROP_CLS == H5I_get_type(id)); @@ -1531,16 +1543,16 @@ H5P_open_class_path_cb(void *_obj, hid_t H5_ATTR_UNUSED id, void *_key) } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_open_class_path_cb() */ +} /* end H5P__open_class_path_cb() */ /*-------------------------------------------------------------------------- NAME - H5P_create_class + H5P__create_class PURPOSE Internal routine to create a new property list class. USAGE - H5P_genclass_t H5P_create_class(par_class, name, type, + H5P_genclass_t H5P__create_class(par_class, name, type, cls_create, create_data, cls_close, close_data) H5P_genclass_t *par_class; IN: Pointer to parent class const char *name; IN: Name of class we are creating @@ -1568,7 +1580,7 @@ H5P_open_class_path_cb(void *_obj, hid_t H5_ATTR_UNUSED id, void *_key) REVISION LOG --------------------------------------------------------------------------*/ H5P_genclass_t * -H5P_create_class(H5P_genclass_t *par_class, const char *name, H5P_plist_type_t type, +H5P__create_class(H5P_genclass_t *par_class, const char *name, H5P_plist_type_t type, H5P_cls_create_func_t cls_create, void *create_data, H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data) @@ -1576,7 +1588,7 @@ H5P_create_class(H5P_genclass_t *par_class, const char *name, H5P_plist_type_t t H5P_genclass_t *pclass = NULL; /* Property list class created */ H5P_genclass_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE HDassert(name); /* Allow internal classes to break some rules */ @@ -1614,7 +1626,7 @@ H5P_create_class(H5P_genclass_t *par_class, const char *name, H5P_plist_type_t t /* Increment parent class's derived class value */ if(par_class != NULL) { - if(H5P_access_class(par_class, H5P_MOD_INC_CLS) < 0) + if(H5P__access_class(par_class, H5P_MOD_INC_CLS) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, NULL, "Can't increment parent class ref count") } /* end if */ @@ -1630,22 +1642,22 @@ done: if(pclass->props) { hbool_t make_cb = FALSE; - H5SL_destroy(pclass->props, H5P_free_prop_cb, &make_cb); + H5SL_destroy(pclass->props, H5P__free_prop_cb, &make_cb); } /* end if */ pclass = H5FL_FREE(H5P_genclass_t, pclass); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_create_class() */ +} /* H5P__create_class() */ /*-------------------------------------------------------------------------- NAME - H5P_create + H5P__create PURPOSE Internal routine to create a new property list of a property list class. USAGE - H5P_genplist_t *H5P_create(class) + H5P_genplist_t *H5P__create(class) H5P_genclass_t *class; IN: Property list class create list from RETURNS Returns a pointer to the newly created property list on success, @@ -1665,7 +1677,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5P_genplist_t * -H5P_create(H5P_genclass_t *pclass) +H5P__create(H5P_genclass_t *pclass) { H5P_genclass_t *tclass; /* Temporary class pointer */ H5P_genplist_t *plist = NULL; /* New property list created */ @@ -1673,7 +1685,7 @@ H5P_create(H5P_genclass_t *pclass) H5SL_t *seen = NULL; /* Skip list to hold names of properties already seen */ H5P_genplist_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(pclass); @@ -1748,7 +1760,7 @@ H5P_create(H5P_genclass_t *pclass) } /* end while */ /* Increment the number of property lists derived from class */ - if(H5P_access_class(plist->pclass,H5P_MOD_INC_LST) < 0) + if(H5P__access_class(plist->pclass,H5P_MOD_INC_LST) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, NULL,"Can't increment class ref count") /* Set return value */ @@ -1766,7 +1778,7 @@ done: if(plist->props) { unsigned make_cb=1; - H5SL_destroy(plist->props,H5P_free_prop_cb,&make_cb); + H5SL_destroy(plist->props, H5P__free_prop_cb, &make_cb); } /* end if */ /* Close the deleted property skip list */ @@ -1779,7 +1791,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_create() */ +} /* H5P__create() */ /*-------------------------------------------------------------------------- @@ -1791,7 +1803,7 @@ done: hid_t H5P_create_id(pclass) H5P_genclass_t *pclass; IN: Property list class create list from RETURNS - Returns a valid property list ID on success, FAIL on failure. + Returns a valid property list ID on success, H5I_INVALID_HID on failure. DESCRIPTION Creates a property list of a given class. If a 'create' callback exists for the property list class, it is called before the @@ -1812,20 +1824,20 @@ H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref) hid_t plist_id = FAIL; /* Property list ID */ hid_t ret_value = H5I_INVALID_HID; /* return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI(H5I_INVALID_HID) HDassert(pclass); /* Create the new property list */ - if((plist=H5P_create(pclass)) == NULL) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create property list") + if((plist = H5P__create(pclass)) == NULL) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create property list") /* Get an atom for the property list */ if((plist_id = H5I_register(H5I_GENPROP_LST, plist, app_ref)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list") + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list") /* Save the property list ID in the property list struct, for use in the property class's 'close' callback */ - plist->plist_id=plist_id; + plist->plist_id = plist_id; /* Call the class callback (if it exists) now that we have the property list ID * (up through chain of parent classes also) @@ -1836,7 +1848,7 @@ H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref) if((tclass->create_func)(plist_id, tclass->create_data) < 0) { /* Delete ID, ignore return value */ H5I_remove(plist_id); - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL,"Can't initialize property") + HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID, "Can't initialize property") } /* end if */ } /* end if */ @@ -1848,10 +1860,10 @@ H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref) plist->class_init = TRUE; /* Set the return value */ - ret_value=plist_id; + ret_value = plist_id; done: - if(ret_value<0 && plist) + if(H5I_INVALID_HID == ret_value && plist) H5P_close(plist); FUNC_LEAVE_NOAPI(ret_value) @@ -1860,11 +1872,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5P_register_real + H5P__register_real PURPOSE Internal routine to register a new property in a property list class. USAGE - herr_t H5P_register_real(class, name, size, default, prp_create, prp_set, + herr_t H5P__register_real(class, name, size, default, prp_create, prp_set, prp_get, prp_close, prp_encode, prp_decode) H5P_genclass_t *class; IN: Property list class to modify const char *name; IN: Name of property to register @@ -2043,7 +2055,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P_register_real(H5P_genclass_t *pclass, const char *name, size_t size, +H5P__register_real(H5P_genclass_t *pclass, const char *name, size_t size, const void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_encode_func_t prp_encode, H5P_prp_decode_func_t prp_decode, @@ -2054,7 +2066,7 @@ H5P_register_real(H5P_genclass_t *pclass, const char *name, size_t size, H5P_genprop_t *new_prop = NULL; /* Temporary property pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(pclass); HDassert(0 == pclass->plists); @@ -2067,13 +2079,13 @@ H5P_register_real(H5P_genclass_t *pclass, const char *name, size_t size, HGOTO_ERROR(H5E_PLIST, H5E_EXISTS, FAIL, "property already exists") /* Create property object from parameters */ - if(NULL == (new_prop = H5P_create_prop(name, size, H5P_PROP_WITHIN_CLASS, + if(NULL == (new_prop = H5P__create_prop(name, size, H5P_PROP_WITHIN_CLASS, def_value, prp_create, prp_set, prp_get, prp_encode, prp_decode, prp_delete, prp_copy, prp_cmp, prp_close))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL,"Can't create property") /* Insert property into property list class */ - if(H5P_add_prop(pclass->props, new_prop) < 0) + if(H5P__add_prop(pclass->props, new_prop) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL,"Can't insert property into class") /* Increment property count for class */ @@ -2084,20 +2096,20 @@ H5P_register_real(H5P_genclass_t *pclass, const char *name, size_t size, done: if(ret_value < 0) - if(new_prop && H5P_free_prop(new_prop) < 0) + if(new_prop && H5P__free_prop(new_prop) < 0) HDONE_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "unable to close property") FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_register_real() */ +} /* H5P__register_real() */ /*-------------------------------------------------------------------------- NAME - H5P_register + H5P__register PURPOSE Internal routine to register a new property in a property list class. USAGE - herr_t H5P_register(class, name, size, default, prp_create, prp_set, prp_get, prp_close) + herr_t H5P__register(class, name, size, default, prp_create, prp_set, prp_get, prp_close) H5P_genclass_t **class; IN: Property list class to modify const char *name; IN: Name of property to register size_t size; IN: Size of property in bytes @@ -2275,7 +2287,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P_register(H5P_genclass_t **ppclass, const char *name, size_t size, +H5P__register(H5P_genclass_t **ppclass, const char *name, size_t size, const void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_encode_func_t prp_encode, H5P_prp_decode_func_t prp_decode, @@ -2287,7 +2299,7 @@ H5P_register(H5P_genclass_t **ppclass, const char *name, size_t size, H5P_genclass_t *new_class = NULL; /* New class pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(ppclass); @@ -2297,7 +2309,7 @@ H5P_register(H5P_genclass_t **ppclass, const char *name, size_t size, * been created since the last modification was made to the class. */ if(pclass->plists > 0 || pclass->classes > 0) { - if(NULL == (new_class = H5P_create_class(pclass->parent, pclass->name, + if(NULL == (new_class = H5P__create_class(pclass->parent, pclass->name, pclass->type, pclass->create_func, pclass->create_data, pclass->copy_func, pclass->copy_data, pclass->close_func, pclass->close_data))) @@ -2313,11 +2325,11 @@ H5P_register(H5P_genclass_t **ppclass, const char *name, size_t size, H5P_genprop_t *pcopy; /* Property copy */ /* Make a copy of the class's property */ - if(NULL == (pcopy = H5P_dup_prop((H5P_genprop_t *)H5SL_item(curr_node), H5P_PROP_WITHIN_CLASS))) + if(NULL == (pcopy = H5P__dup_prop((H5P_genprop_t *)H5SL_item(curr_node), H5P_PROP_WITHIN_CLASS))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "Can't copy property") /* Insert the initialized property into the property class */ - if(H5P_add_prop(new_class->props, pcopy) < 0) + if(H5P__add_prop(new_class->props, pcopy) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL,"Can't insert property into class") /* Increment property count for class */ @@ -2333,7 +2345,7 @@ H5P_register(H5P_genclass_t **ppclass, const char *name, size_t size, } /* end if */ /* Really register the property in the class */ - if(H5P_register_real(pclass, name, size, def_value, prp_create, prp_set, prp_get, + if(H5P__register_real(pclass, name, size, def_value, prp_create, prp_set, prp_get, prp_encode, prp_decode, prp_delete, prp_copy, prp_cmp, prp_close) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "can't register property") @@ -2343,11 +2355,11 @@ H5P_register(H5P_genclass_t **ppclass, const char *name, size_t size, done: if(ret_value < 0) - if(new_class && H5P_close_class(new_class) < 0) + if(new_class && H5P__close_class(new_class) < 0) HDONE_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "unable to close new property class") FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_register() */ +} /* H5P__register() */ /*-------------------------------------------------------------------------- @@ -2570,13 +2582,13 @@ H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, /* Ok to add to property list */ /* Create property object from parameters */ - if(NULL == (new_prop = H5P_create_prop(name, size, H5P_PROP_WITHIN_LIST, value, NULL, + if(NULL == (new_prop = H5P__create_prop(name, size, H5P_PROP_WITHIN_LIST, value, NULL, prp_set, prp_get, prp_encode, prp_decode, prp_delete, prp_copy, prp_cmp, prp_close))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "Can't create property") /* Insert property into property list class */ - if(H5P_add_prop(plist->props, new_prop) < 0) + if(H5P__add_prop(plist->props, new_prop) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "Can't insert property into class") /* Increment property count for class */ @@ -2584,7 +2596,7 @@ H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, done: if(ret_value < 0) - if(new_prop && H5P_free_prop(new_prop) < 0) + if(new_prop && H5P__free_prop(new_prop) < 0) HDONE_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "unable to close property") FUNC_LEAVE_NOAPI(ret_value) @@ -2764,20 +2776,20 @@ H5P__poke_pclass_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "property has zero size") /* Make a copy of the class's property */ - if(NULL == (pcopy = H5P_dup_prop(prop, H5P_PROP_WITHIN_LIST))) + if(NULL == (pcopy = H5P__dup_prop(prop, H5P_PROP_WITHIN_LIST))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "Can't copy property") HDmemcpy(pcopy->value, udata->value, pcopy->size); /* Insert the changed property into the property list */ - if(H5P_add_prop(plist->props, pcopy) < 0) + if(H5P__add_prop(plist->props, pcopy) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL,"Can't insert changed property into skip list") done: /* Cleanup on failure */ if(ret_value < 0) if(pcopy) - H5P_free_prop(pcopy); + H5P__free_prop(pcopy); FUNC_LEAVE_NOAPI(ret_value) } /* H5P__poke_pclass_cb() */ @@ -2970,13 +2982,13 @@ H5P__set_pclass_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, prp_value = udata->value; /* Make a copy of the class's property */ - if(NULL == (pcopy = H5P_dup_prop(prop, H5P_PROP_WITHIN_LIST))) + if(NULL == (pcopy = H5P__dup_prop(prop, H5P_PROP_WITHIN_LIST))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "Can't copy property") HDmemcpy(pcopy->value, prp_value, pcopy->size); /* Insert the changed property into the property list */ - if(H5P_add_prop(plist->props, pcopy) < 0) + if(H5P__add_prop(plist->props, pcopy) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL,"Can't insert changed property into skip list") done: @@ -2987,7 +2999,7 @@ done: /* Cleanup on failure */ if(ret_value < 0) if(pcopy) - H5P_free_prop(pcopy); + H5P__free_prop(pcopy); FUNC_LEAVE_NOAPI(ret_value) } /* H5P__set_pclass_cb() */ @@ -3109,11 +3121,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5P_exist_pclass + H5P__exist_pclass PURPOSE Internal routine to query the existance of a property in a property class. USAGE - herr_t H5P_exist_pclass(pclass, name) + herr_t H5P__exist_pclass(pclass, name) H5P_genclass_t *pclass; IN: Property class to check const char *name; IN: Name of property to check for RETURNS @@ -3129,11 +3141,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ htri_t -H5P_exist_pclass(H5P_genclass_t *pclass, const char *name) +H5P__exist_pclass(H5P_genclass_t *pclass, const char *name) { htri_t ret_value = FAIL; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(pclass); HDassert(name); @@ -3159,16 +3171,16 @@ H5P_exist_pclass(H5P_genclass_t *pclass, const char *name) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_exist_pclass() */ +} /* H5P__exist_pclass() */ /*-------------------------------------------------------------------------- NAME - H5P_get_size_plist + H5P__get_size_plist PURPOSE Internal routine to query the size of a property in a property list. USAGE - herr_t H5P_get_size_plist(plist, name) + herr_t H5P__get_size_plist(plist, name) const H5P_genplist_t *plist; IN: Property list to check const char *name; IN: Name of property to query size_t *size; OUT: Size of property @@ -3185,12 +3197,12 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P_get_size_plist(const H5P_genplist_t *plist, const char *name, size_t *size) +H5P__get_size_plist(const H5P_genplist_t *plist, const char *name, size_t *size) { H5P_genprop_t *prop; /* Temporary property pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(plist); HDassert(name); @@ -3205,16 +3217,16 @@ H5P_get_size_plist(const H5P_genplist_t *plist, const char *name, size_t *size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_get_size_plist() */ +} /* H5P__get_size_plist() */ /*-------------------------------------------------------------------------- NAME - H5P_get_size_pclass + H5P__get_size_pclass PURPOSE Internal routine to query the size of a property in a property class. USAGE - herr_t H5P_get_size_pclass(pclass, name) + herr_t H5P__get_size_pclass(pclass, name) H5P_genclass_t *pclass; IN: Property class to check const char *name; IN: Name of property to query size_t *size; OUT: Size of property @@ -3231,36 +3243,36 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P_get_size_pclass(H5P_genclass_t *pclass, const char *name, size_t *size) +H5P__get_size_pclass(H5P_genclass_t *pclass, const char *name, size_t *size) { H5P_genprop_t *prop; /* Temporary property pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(pclass); HDassert(name); HDassert(size); /* Find property */ - if((prop=H5P_find_prop_pclass(pclass,name)) == NULL) + if((prop = H5P__find_prop_pclass(pclass,name)) == NULL) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "property doesn't exist") /* Get property size */ - *size=prop->size; + *size = prop->size; done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_get_size_pclass() */ +} /* H5P__get_size_pclass() */ /*-------------------------------------------------------------------------- NAME - H5P_get_nprops_plist + H5P__get_nprops_plist PURPOSE Internal routine to query the number of properties in a property list USAGE - herr_t H5P_get_nprops_plist(plist, nprops) + herr_t H5P__get_nprops_plist(plist, nprops) H5P_genplist_t *plist; IN: Property list to check size_t *nprops; OUT: Number of properties in the property list RETURNS @@ -3275,9 +3287,9 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P_get_nprops_plist(const H5P_genplist_t *plist, size_t *nprops) +H5P__get_nprops_plist(const H5P_genplist_t *plist, size_t *nprops) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(plist); HDassert(nprops); @@ -3286,7 +3298,7 @@ H5P_get_nprops_plist(const H5P_genplist_t *plist, size_t *nprops) *nprops = plist->nprops; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5P_get_nprops_plist() */ +} /* H5P__get_nprops_plist() */ /*-------------------------------------------------------------------------- @@ -3337,11 +3349,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5P_cmp_prop + H5P__cmp_prop PURPOSE Internal routine to compare two generic properties USAGE - int H5P_cmp_prop(prop1, prop2) + int H5P__cmp_prop(prop1, prop2) H5P_genprop_t *prop1; IN: 1st property to compare H5P_genprop_t *prop1; IN: 2nd property to compare RETURNS @@ -3358,12 +3370,12 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static int -H5P_cmp_prop(const H5P_genprop_t *prop1, const H5P_genprop_t *prop2) +H5P__cmp_prop(const H5P_genprop_t *prop1, const H5P_genprop_t *prop2) { int cmp_value; /* Value from comparison */ int ret_value = 0; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(prop1); HDassert(prop2); @@ -3432,16 +3444,16 @@ H5P_cmp_prop(const H5P_genprop_t *prop1, const H5P_genprop_t *prop2) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_cmp_prop() */ +} /* H5P__cmp_prop() */ /*-------------------------------------------------------------------------- NAME - H5P_cmp_class + H5P__cmp_class PURPOSE Internal routine to compare two generic property classes USAGE - int H5P_cmp_class(pclass1, pclass2) + int H5P__cmp_class(pclass1, pclass2) H5P_genclass_t *pclass1; IN: 1st property class to compare H5P_genclass_t *pclass2; IN: 2nd property class to compare RETURNS @@ -3458,13 +3470,13 @@ done: REVISION LOG --------------------------------------------------------------------------*/ int -H5P_cmp_class(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2) +H5P__cmp_class(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2) { H5SL_node_t *tnode1, *tnode2; /* Temporary pointer to property nodes */ int cmp_value; /* Value from comparison */ int ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(pclass1); HDassert(pclass2); @@ -3528,7 +3540,7 @@ H5P_cmp_class(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2) /* Compare the two properties */ prop1 = (H5P_genprop_t *)H5SL_item(tnode1); prop2 = (H5P_genprop_t *)H5SL_item(tnode2); - if((cmp_value = H5P_cmp_prop(prop1, prop2)) != 0) + if((cmp_value = H5P__cmp_prop(prop1, prop2)) != 0) HGOTO_DONE(cmp_value); /* Advance the pointers */ @@ -3538,7 +3550,7 @@ H5P_cmp_class(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_cmp_class() */ +} /* H5P__cmp_class() */ /*-------------------------------------------------------------------------- @@ -3588,7 +3600,7 @@ H5P__cmp_plist_cb(H5P_genprop_t *prop, void *_udata) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, H5_ITER_ERROR, "property doesn't exist") /* Compare the two properties */ - if((udata->cmp_value = H5P_cmp_prop(prop, prop2)) != 0) + if((udata->cmp_value = H5P__cmp_prop(prop, prop2)) != 0) HGOTO_DONE(H5_ITER_STOP); } /* end if */ else { @@ -3604,11 +3616,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5P_cmp_plist + H5P__cmp_plist PURPOSE Internal routine to compare two generic property lists USAGE - herr_t H5P_cmp_plist(plist1, plist2, cmp_ret) + herr_t H5P__cmp_plist(plist1, plist2, cmp_ret) H5P_genplist_t *plist1; IN: 1st property list to compare H5P_genplist_t *plist2; IN: 2nd property list to compare int *cmp_ret; OUT: Comparison value for two property lists @@ -3627,14 +3639,14 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P_cmp_plist(const H5P_genplist_t *plist1, const H5P_genplist_t *plist2, +H5P__cmp_plist(const H5P_genplist_t *plist1, const H5P_genplist_t *plist2, int *cmp_ret) { H5P_plist_cmp_ud_t udata; /* User data for callback */ int idx = 0; /* Index of property to begin with */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(plist1); HDassert(plist2); @@ -3665,7 +3677,7 @@ H5P_cmp_plist(const H5P_genplist_t *plist1, const H5P_genplist_t *plist2, udata.plist2 = plist2; /* Iterate over properties in first property list */ - if((ret_value = H5P_iterate_plist(plist1, TRUE, &idx, H5P__cmp_plist_cb, &udata)) < 0) + if((ret_value = H5P__iterate_plist(plist1, TRUE, &idx, H5P__cmp_plist_cb, &udata)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over list") if(ret_value != 0) { *cmp_ret = udata.cmp_value; @@ -3673,7 +3685,7 @@ H5P_cmp_plist(const H5P_genplist_t *plist1, const H5P_genplist_t *plist2, } /* end if */ /* Check the parent classes */ - if((*cmp_ret = H5P_cmp_class(plist1->pclass, plist2->pclass)) != 0) + if((*cmp_ret = H5P__cmp_class(plist1->pclass, plist2->pclass)) != 0) HGOTO_DONE(SUCCEED); /* Property lists must be equal, set comparison value to 0 */ @@ -3681,7 +3693,7 @@ H5P_cmp_plist(const H5P_genplist_t *plist1, const H5P_genplist_t *plist2, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_cmp_plist() */ +} /* H5P__cmp_plist() */ /*-------------------------------------------------------------------------- @@ -3718,7 +3730,7 @@ H5P_class_isa(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2) HDassert(pclass2); /* Compare property classes */ - if(H5P_cmp_class(pclass1, pclass2) == 0) { + if(H5P__cmp_class(pclass1, pclass2) == 0) { HGOTO_DONE(TRUE); } else { /* Check if the class is derived, and walk up the chain, if so */ @@ -3931,11 +3943,11 @@ H5P__iterate_plist_pclass_cb(void *_item, void *_key, void *_udata) /*-------------------------------------------------------------------------- NAME - H5P_iterate_plist + H5P__iterate_plist PURPOSE Internal routine to iterate over the properties in a property list USAGE - int H5P_iterate_plist(plist, iter_all_prop, idx, cb_func, iter_data) + int H5P__iterate_plist(plist, iter_all_prop, idx, cb_func, iter_data) const H5P_genplist_t *plist; IN: Property list to iterate over hbool_t iter_all_prop; IN: Whether to iterate over all properties (TRUE), or just non-default (i.e. changed) @@ -3984,7 +3996,7 @@ iteration, the function's behavior is undefined. REVISION LOG --------------------------------------------------------------------------*/ int -H5P_iterate_plist(const H5P_genplist_t *plist, hbool_t iter_all_prop, int *idx, +H5P__iterate_plist(const H5P_genplist_t *plist, hbool_t iter_all_prop, int *idx, H5P_iterate_int_t cb_func, void *udata) { H5P_genclass_t *tclass; /* Temporary class pointer */ @@ -3993,7 +4005,7 @@ H5P_iterate_plist(const H5P_genplist_t *plist, hbool_t iter_all_prop, int *idx, int curr_idx = 0; /* Current iteration index */ int ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(plist); @@ -4042,7 +4054,7 @@ done: H5SL_close(seen); FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_iterate_plist() */ +} /* H5P__iterate_plist() */ /*-------------------------------------------------------------------------- @@ -4098,11 +4110,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5P_iterate_pclass + H5P__iterate_pclass PURPOSE Internal routine to iterate over the properties in a property class USAGE - herr_t H5P_iterate_pclass(pclass, idx, cb_func, iter_data) + herr_t H5P__iterate_pclass(pclass, idx, cb_func, iter_data) const H5P_genpclass_t *pclass; IN: Property list class to iterate over int *idx; IN/OUT: Index of the property to begin with H5P_iterate_t cb_func; IN: Function pointer to function to be @@ -4148,14 +4160,14 @@ iteration, the function's behavior is undefined. REVISION LOG --------------------------------------------------------------------------*/ int -H5P_iterate_pclass(const H5P_genclass_t *pclass, int *idx, +H5P__iterate_pclass(const H5P_genclass_t *pclass, int *idx, H5P_iterate_int_t cb_func, void *udata) { H5P_iter_pclass_ud_t udata_int; /* User data for skip list iterator */ int curr_idx = 0; /* Current iteration index */ int ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(pclass); @@ -4178,7 +4190,7 @@ done: *idx = curr_idx; FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_iterate_pclass() */ +} /* H5P__iterate_pclass() */ /*-------------------------------------------------------------------------- @@ -4450,7 +4462,7 @@ H5P__del_plist_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove property from skip list") /* Free the property, ignoring return value, nothing we can do */ - H5P_free_prop(prop); + H5P__free_prop(prop); /* Decrement the number of properties in list */ plist->nprops--; @@ -4586,11 +4598,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5P_copy_prop_plist + H5P__copy_prop_plist PURPOSE Internal routine to copy a property from one list to another USAGE - herr_t H5P_copy_prop_plist(dst_plist, src_plist, name) + herr_t H5P__copy_prop_plist(dst_plist, src_plist, name) hid_t dst_id; IN: ID of destination property list or class hid_t src_id; IN: ID of source property list or class const char *name; IN: Name of property to copy @@ -4616,7 +4628,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P_copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name) +H5P__copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name) { H5P_genplist_t *dst_plist; /* Pointer to destination property list */ H5P_genplist_t *src_plist; /* Pointer to source property list */ @@ -4624,7 +4636,7 @@ H5P_copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name) H5P_genprop_t *new_prop=NULL; /* Pointer to new property */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(name); @@ -4642,7 +4654,7 @@ H5P_copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name) prop = H5P__find_prop_plist(src_plist, name); /* Make a copy of the source property */ - if((new_prop=H5P_dup_prop(prop,H5P_PROP_WITHIN_LIST)) == NULL) + if((new_prop = H5P__dup_prop(prop,H5P_PROP_WITHIN_LIST)) == NULL) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL,"Can't copy property") /* Call property copy callback, if it exists */ @@ -4652,7 +4664,7 @@ H5P_copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name) } /* end if */ /* Insert the initialized property into the property list */ - if(H5P_add_prop(dst_plist->props,new_prop) < 0) + if(H5P__add_prop(dst_plist->props,new_prop) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL,"Can't insert property into list") /* Increment the number of properties in list */ @@ -4664,7 +4676,7 @@ H5P_copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name) prop = H5P__find_prop_plist(src_plist, name); /* Create property object from parameters */ - if(NULL == (new_prop = H5P_create_prop(prop->name, prop->size, H5P_PROP_WITHIN_LIST, prop->value, + if(NULL == (new_prop = H5P__create_prop(prop->name, prop->size, H5P_PROP_WITHIN_LIST, prop->value, prop->create, prop->set, prop->get, prop->encode, prop->decode, prop->del, prop->copy, prop->cmp, prop->close))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL,"Can't create property") @@ -4676,7 +4688,7 @@ H5P_copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name) } /* end if */ /* Insert property into property list class */ - if(H5P_add_prop(dst_plist->props, new_prop) < 0) + if(H5P__add_prop(dst_plist->props, new_prop) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL,"Can't insert property into class") /* Increment property count for class */ @@ -4685,22 +4697,22 @@ H5P_copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name) done: /* Cleanup, if necessary */ - if(ret_value<0) { - if(new_prop!=NULL) - H5P_free_prop(new_prop); + if(ret_value < 0) { + if(new_prop != NULL) + H5P__free_prop(new_prop); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_copy_prop_plist() */ +} /* H5P__copy_prop_plist() */ /*-------------------------------------------------------------------------- NAME - H5P_copy_prop_pclass + H5P__copy_prop_pclass PURPOSE Internal routine to copy a property from one class to another USAGE - herr_t H5P_copy_prop_pclass(dst_pclass, src_pclass, name) + herr_t H5P__copy_prop_pclass(dst_pclass, src_pclass, name) H5P_genclass_t *dst_pclass; IN: Pointer to destination class H5P_genclass_t *src_pclass; IN: Pointer to source class const char *name; IN: Name of property to copy @@ -4724,7 +4736,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P_copy_prop_pclass(hid_t dst_id, hid_t src_id, const char *name) +H5P__copy_prop_pclass(hid_t dst_id, hid_t src_id, const char *name) { H5P_genclass_t *src_pclass; /* Source property class, containing property to copy */ H5P_genclass_t *dst_pclass; /* Destination property class */ @@ -4732,7 +4744,7 @@ H5P_copy_prop_pclass(hid_t dst_id, hid_t src_id, const char *name) H5P_genprop_t *prop; /* Temporary property pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(name); @@ -4744,19 +4756,19 @@ H5P_copy_prop_pclass(hid_t dst_id, hid_t src_id, const char *name) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "destination property class object doesn't exist") /* Get the property from the source */ - if(NULL == (prop = H5P_find_prop_pclass(src_pclass, name))) + if(NULL == (prop = H5P__find_prop_pclass(src_pclass, name))) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "unable to locate property") /* If the property exists in the destination already */ - if(H5P_exist_pclass(dst_pclass, name)) { + if(H5P__exist_pclass(dst_pclass, name)) { /* Delete the old property from the destination class */ - if(H5P_unregister(dst_pclass, name) < 0) + if(H5P__unregister(dst_pclass, name) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "unable to remove property") } /* end if */ /* Register the property into the destination */ orig_dst_pclass = dst_pclass; - if(H5P_register(&dst_pclass, name, prop->size, prop->value, prop->create, prop->set, prop->get, + if(H5P__register(&dst_pclass, name, prop->size, prop->value, prop->create, prop->set, prop->get, prop->encode, prop->decode, prop->del, prop->copy, prop->cmp, prop->close) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "unable to remove property") @@ -4770,7 +4782,7 @@ H5P_copy_prop_pclass(hid_t dst_id, hid_t src_id, const char *name) HDassert(old_dst_pclass == orig_dst_pclass); /* Close the previous class */ - if(H5P_close_class(old_dst_pclass) < 0) + if(H5P__close_class(old_dst_pclass) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "unable to close original property class after substitution") } /* end if */ @@ -4778,16 +4790,16 @@ done: /* Cleanup, if necessary */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_copy_prop_pclass() */ +} /* H5P__copy_prop_pclass() */ /*-------------------------------------------------------------------------- NAME - H5P_unregister + H5P__unregister PURPOSE Internal routine to remove a property from a property list class. USAGE - herr_t H5P_unregister(pclass, name) + herr_t H5P__unregister(pclass, name) H5P_genclass_t *pclass; IN: Property list class to modify const char *name; IN: Name of property to remove RETURNS @@ -4803,12 +4815,12 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P_unregister(H5P_genclass_t *pclass, const char *name) +H5P__unregister(H5P_genclass_t *pclass, const char *name) { H5P_genprop_t *prop; /* Temporary property pointer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(pclass); HDassert(name); @@ -4822,7 +4834,7 @@ H5P_unregister(H5P_genclass_t *pclass, const char *name) HGOTO_ERROR(H5E_PLIST,H5E_CANTDELETE,FAIL,"can't remove property from skip list") /* Free the property, ignoring return value, nothing we can do */ - H5P_free_prop(prop); + H5P__free_prop(prop); /* Decrement the number of registered properties in class */ pclass->nprops--; @@ -4832,7 +4844,7 @@ H5P_unregister(H5P_genclass_t *pclass, const char *name) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_unregister() */ +} /* H5P__unregister() */ /*-------------------------------------------------------------------------- @@ -4982,18 +4994,18 @@ H5P_close(void *_plist) } /* end while */ /* Decrement class's dependent property list value! */ - if(H5P_access_class(plist->pclass,H5P_MOD_DEC_LST) < 0) + if(H5P__access_class(plist->pclass,H5P_MOD_DEC_LST) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "Can't decrement class ref count") /* Free the list of 'seen' properties */ H5SL_close(seen); - seen=NULL; + seen = NULL; /* Free the list of deleted property names */ - H5SL_destroy(plist->del,H5P_free_del_name_cb,NULL); + H5SL_destroy(plist->del, H5P__free_del_name_cb, NULL); /* Free the properties */ - H5SL_destroy(plist->props,H5P_free_prop_cb,&make_cb); + H5SL_destroy(plist->props, H5P__free_prop_cb, &make_cb); /* Destroy property list object */ plist = H5FL_FREE(H5P_genplist_t, plist); @@ -5046,11 +5058,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5P_get_class_path + H5P__get_class_path PURPOSE Internal routine to query the full path of a generic property list class USAGE - char *H5P_get_class_name(pclass) + char *H5P__get_class_name(pclass) H5P_genclass_t *pclass; IN: Property list class to check RETURNS Success: Pointer to a malloc'ed string containing the full path of class @@ -5066,11 +5078,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ char * -H5P_get_class_path(H5P_genclass_t *pclass) +H5P__get_class_path(H5P_genclass_t *pclass) { char *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(pclass); @@ -5079,7 +5091,7 @@ H5P_get_class_path(H5P_genclass_t *pclass) char *par_path; /* Parent class's full path */ /* Get the parent class's path */ - par_path = H5P_get_class_path(pclass->parent); + par_path = H5P__get_class_path(pclass->parent); if(par_path != NULL) { size_t ret_str_len; @@ -5104,16 +5116,16 @@ H5P_get_class_path(H5P_genclass_t *pclass) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_get_class_path() */ +} /* H5P__get_class_path() */ /*-------------------------------------------------------------------------- NAME - H5P_open_class_path + H5P__open_class_path PURPOSE Internal routine to open [a copy of] a class with its full path name USAGE - H5P_genclass_t *H5P_open_class_path(path) + H5P_genclass_t *H5P__open_class_path(path) const char *path; IN: Full path name of class to open [copy of] RETURNS Success: Pointer to a generic property class object @@ -5127,7 +5139,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ H5P_genclass_t * -H5P_open_class_path(const char *path) +H5P__open_class_path(const char *path) { char *tmp_path = NULL; /* Temporary copy of the path */ char *curr_name; /* Pointer to current component of path name */ @@ -5136,7 +5148,7 @@ H5P_open_class_path(const char *path) H5P_check_class_t check_info; /* Structure to hold the information for checking duplicate names */ H5P_genclass_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(path); @@ -5157,8 +5169,8 @@ H5P_open_class_path(const char *path) check_info.new_class = NULL; /* Find the class with this name & parent by iterating over the open classes */ - if(H5I_iterate(H5I_GENPROP_CLS, H5P_open_class_path_cb, &check_info, FALSE) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_BADITER, NULL, "can't iterate over classes") + if(H5I_iterate(H5I_GENPROP_CLS, H5P__open_class_path_cb, &check_info, FALSE) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_BADITER, NULL, "can't iterate over classes") else if(NULL == check_info.new_class) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, NULL, "can't locate class") @@ -5175,13 +5187,13 @@ H5P_open_class_path(const char *path) check_info.new_class = NULL; /* Find the class with this name & parent by iterating over the open classes */ - if(H5I_iterate(H5I_GENPROP_CLS, H5P_open_class_path_cb, &check_info, FALSE) < 0) + if(H5I_iterate(H5I_GENPROP_CLS, H5P__open_class_path_cb, &check_info, FALSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADITER, NULL, "can't iterate over classes") else if(NULL == check_info.new_class) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, NULL, "can't locate class") /* Copy it */ - if(NULL == (ret_value = H5P_copy_pclass(check_info.new_class))) + if(NULL == (ret_value = H5P__copy_pclass(check_info.new_class))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, NULL, "can't copy property class") done: @@ -5189,16 +5201,16 @@ done: H5MM_xfree(tmp_path); FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_open_class_path() */ +} /* H5P__open_class_path() */ /*-------------------------------------------------------------------------- NAME - H5P_get_class_parent + H5P__get_class_parent PURPOSE Internal routine to query the parent class of a generic property class USAGE - H5P_genclass_t *H5P_get_class_parent(pclass) + H5P_genclass_t *H5P__get_class_parent(pclass) H5P_genclass_t *pclass; IN: Property class to check RETURNS Success: Pointer to the parent class of a property class @@ -5212,11 +5224,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ H5P_genclass_t * -H5P_get_class_parent(const H5P_genclass_t *pclass) +H5P__get_class_parent(const H5P_genclass_t *pclass) { H5P_genclass_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(pclass); @@ -5224,16 +5236,16 @@ H5P_get_class_parent(const H5P_genclass_t *pclass) ret_value = pclass->parent; FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_get_class_parent() */ +} /* H5P__get_class_parent() */ /*-------------------------------------------------------------------------- NAME - H5P_close_class + H5P__close_class PURPOSE Internal routine to close a property list class. USAGE - herr_t H5P_close_class(class) + herr_t H5P__close_class(class) H5P_genclass_t *class; IN: Property list class to close RETURNS Returns non-negative on success, negative on failure. @@ -5245,7 +5257,7 @@ H5P_get_class_parent(const H5P_genclass_t *pclass) REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P_close_class(void *_pclass) +H5P__close_class(void *_pclass) { H5P_genclass_t *pclass = (H5P_genclass_t *)_pclass; herr_t ret_value = SUCCEED; /* Return value */ @@ -5255,12 +5267,12 @@ H5P_close_class(void *_pclass) HDassert(pclass); /* Decrement the reference count & check if the object should go away */ - if(H5P_access_class(pclass, H5P_MOD_DEC_REF) < 0) + if(H5P__access_class(pclass, H5P_MOD_DEC_REF) < 0) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "can't decrement ID ref count") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_close_class() */ +} /* H5P__close_class() */ /*------------------------------------------------------------------------- @@ -5269,7 +5281,7 @@ done: * Purpose: Create a new property list, of a given type * * Return: Success: ID of new property list - * Failure: Negative + * Failure: H5I_INVALID_HID * * Programmer: Quincey Koziol * Thursday, August 2, 2012 @@ -5291,9 +5303,9 @@ H5P__new_plist_of_type(H5P_plist_type_t type) /* Check arguments */ if(type == H5P_TYPE_USER) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't create user property list"); + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, H5I_INVALID_HID, "can't create user property list"); if(type == H5P_TYPE_ROOT) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "shouldn't be creating root class property list"); + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, H5I_INVALID_HID, "shouldn't be creating root class property list"); /* Instantiate a property list of the proper type */ switch(type) { @@ -5374,11 +5386,11 @@ H5P__new_plist_of_type(H5P_plist_type_t type) /* Get the class object */ if(NULL == (pclass = (H5P_genclass_t *)H5I_object(class_id))) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a property class") + HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, H5I_INVALID_HID, "not a property class") /* Create the new property list */ if((ret_value = H5P_create_id(pclass, TRUE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create property list") + HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create property list") done: FUNC_LEAVE_NOAPI(ret_value) @@ -5394,7 +5406,7 @@ done: * H5P_genplist_t data structure) * * Return: Success: Non-negative ID of property list. - * Failure: negative. + * Failure: H5I_INVALID_HID * * Programmer: Quincey Koziol * April 22, 2014 @@ -5440,32 +5452,3 @@ H5P_get_class(const H5P_genplist_t *plist) FUNC_LEAVE_NOAPI(plist->pclass) } /* end H5P_get_class() */ - -/*------------------------------------------------------------------------- - * Function: H5P_get_default - * - * Purpose: Get the default property list ID, for a property class. - * - * Return: Success: Non-negative ID of property list. - * Failure: negative. - * - * Programmer: Quincey Koziol - * December 29, 2017 - * - *------------------------------------------------------------------------- - */ -hid_t -H5P_get_default(const H5P_libclass_t *libclass) -{ - hid_t ret_value = H5I_INVALID_HID; /* Return value */ - - FUNC_ENTER_NOAPI(H5I_INVALID_HID) - - HDassert(libclass); - - ret_value = *libclass->def_plist_id; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_get_default() */ - diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 18b81ac..bedeed9 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -194,38 +194,38 @@ H5P__lacc_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register property for number of links traversed */ - if(H5P_register_real(pclass, H5L_ACS_NLINKS_NAME, H5L_ACS_NLINKS_SIZE, &H5L_def_nlinks_g, + if(H5P__register_real(pclass, H5L_ACS_NLINKS_NAME, H5L_ACS_NLINKS_SIZE, &H5L_def_nlinks_g, NULL, NULL, NULL, H5L_ACS_NLINKS_ENC, H5L_ACS_NLINKS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for external link prefix */ - if(H5P_register_real(pclass, H5L_ACS_ELINK_PREFIX_NAME, H5L_ACS_ELINK_PREFIX_SIZE, &H5L_def_elink_prefix_g, + if(H5P__register_real(pclass, H5L_ACS_ELINK_PREFIX_NAME, H5L_ACS_ELINK_PREFIX_SIZE, &H5L_def_elink_prefix_g, NULL, H5L_ACS_ELINK_PREFIX_SET, H5L_ACS_ELINK_PREFIX_GET, H5L_ACS_ELINK_PREFIX_ENC, H5L_ACS_ELINK_PREFIX_DEC, H5L_ACS_ELINK_PREFIX_DEL, H5L_ACS_ELINK_PREFIX_COPY, H5L_ACS_ELINK_PREFIX_CMP, H5L_ACS_ELINK_PREFIX_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register fapl for link access */ - if(H5P_register_real(pclass, H5L_ACS_ELINK_FAPL_NAME, H5L_ACS_ELINK_FAPL_SIZE, &H5L_def_fapl_id_g, + if(H5P__register_real(pclass, H5L_ACS_ELINK_FAPL_NAME, H5L_ACS_ELINK_FAPL_SIZE, &H5L_def_fapl_id_g, NULL, H5L_ACS_ELINK_FAPL_SET, H5L_ACS_ELINK_FAPL_GET, H5L_ACS_ELINK_FAPL_ENC, H5L_ACS_ELINK_FAPL_DEC, H5L_ACS_ELINK_FAPL_DEL, H5L_ACS_ELINK_FAPL_COPY, H5L_ACS_ELINK_FAPL_CMP, H5L_ACS_ELINK_FAPL_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for external link file access flags */ - if(H5P_register_real(pclass, H5L_ACS_ELINK_FLAGS_NAME, H5L_ACS_ELINK_FLAGS_SIZE, &H5L_def_elink_flags_g, + if(H5P__register_real(pclass, H5L_ACS_ELINK_FLAGS_NAME, H5L_ACS_ELINK_FLAGS_SIZE, &H5L_def_elink_flags_g, NULL, NULL, NULL, H5L_ACS_ELINK_FLAGS_ENC, H5L_ACS_ELINK_FLAGS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for external link file traversal callback */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5L_ACS_ELINK_CB_NAME, H5L_ACS_ELINK_CB_SIZE, &H5L_def_elink_cb_g, + if(H5P__register_real(pclass, H5L_ACS_ELINK_CB_NAME, H5L_ACS_ELINK_CB_SIZE, &H5L_def_elink_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #ifdef H5_HAVE_PARALLEL /* Register the metadata collective read flag */ - if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5L_ACS_COLL_MD_READ_SIZE, &H5L_def_coll_md_read_g, + if(H5P__register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5L_ACS_COLL_MD_READ_SIZE, &H5L_def_coll_md_read_g, NULL, NULL, NULL, H5L_ACS_COLL_MD_READ_ENC, H5L_ACS_COLL_MD_READ_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -569,7 +569,7 @@ H5P__lacc_elink_fapl_cmp(const void *value1, const void *value2, size_t H5_ATTR_ if(obj1 && obj2) { herr_t status; - status = H5P_cmp_plist(obj1, obj2, &ret_value); + status = H5P__cmp_plist(obj1, obj2, &ret_value); HDassert(status >= 0); } /* end if */ diff --git a/src/H5Plcpl.c b/src/H5Plcpl.c index 6508a82..1d45bed 100644 --- a/src/H5Plcpl.c +++ b/src/H5Plcpl.c @@ -13,11 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5Plcpl.c - * May 8 2006 - * Peter Cao + * Created: H5Plcpl.c * - * Purpose: Link creation property list class routines + * Purpose: Link creation property list class routines * *------------------------------------------------------------------------- */ @@ -32,11 +30,11 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Lprivate.h" /* Links */ -#include "H5Ppkg.h" /* Property lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Lprivate.h" /* Links */ +#include "H5Ppkg.h" /* Property lists */ /****************/ @@ -120,12 +118,12 @@ static const unsigned H5L_def_intmd_group_g = H5L_CRT_INTERMEDIATE_GROUP_DEF; herr_t H5P_lcrt_reg_prop(H5P_genclass_t *pclass) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Register create intermediate groups property */ - if(H5P_register_real(pclass, H5L_CRT_INTERMEDIATE_GROUP_NAME, H5L_CRT_INTERMEDIATE_GROUP_SIZE, &H5L_def_intmd_group_g, + if(H5P__register_real(pclass, H5L_CRT_INTERMEDIATE_GROUP_NAME, H5L_CRT_INTERMEDIATE_GROUP_SIZE, &H5L_def_intmd_group_g, NULL, NULL, NULL, H5L_CRT_INTERMEDIATE_GROUP_ENC, H5L_CRT_INTERMEDIATE_GROUP_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index be41e32..c2bf6cb 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -165,25 +165,25 @@ H5P__ocrt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register max. compact attribute storage property */ - if(H5P_register_real(pclass, H5O_CRT_ATTR_MAX_COMPACT_NAME, H5O_CRT_ATTR_MAX_COMPACT_SIZE, &H5O_def_attr_max_compact_g, + if(H5P__register_real(pclass, H5O_CRT_ATTR_MAX_COMPACT_NAME, H5O_CRT_ATTR_MAX_COMPACT_SIZE, &H5O_def_attr_max_compact_g, NULL, NULL, NULL, H5O_CRT_ATTR_MAX_COMPACT_ENC, H5O_CRT_ATTR_MAX_COMPACT_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register min. dense attribute storage property */ - if(H5P_register_real(pclass, H5O_CRT_ATTR_MIN_DENSE_NAME, H5O_CRT_ATTR_MIN_DENSE_SIZE, &H5O_def_attr_min_dense_g, + if(H5P__register_real(pclass, H5O_CRT_ATTR_MIN_DENSE_NAME, H5O_CRT_ATTR_MIN_DENSE_SIZE, &H5O_def_attr_min_dense_g, NULL, NULL, NULL, H5O_CRT_ATTR_MIN_DENSE_ENC, H5O_CRT_ATTR_MIN_DENSE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register object header flags property */ - if(H5P_register_real(pclass, H5O_CRT_OHDR_FLAGS_NAME, H5O_CRT_OHDR_FLAGS_SIZE, &H5O_def_ohdr_flags_g, + if(H5P__register_real(pclass, H5O_CRT_OHDR_FLAGS_NAME, H5O_CRT_OHDR_FLAGS_SIZE, &H5O_def_ohdr_flags_g, NULL, NULL, NULL, H5O_CRT_OHDR_FLAGS_ENC, H5O_CRT_OHDR_FLAGS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the pipeline property */ - if(H5P_register_real(pclass, H5O_CRT_PIPELINE_NAME, H5O_CRT_PIPELINE_SIZE, &H5O_def_pline_g, + if(H5P__register_real(pclass, H5O_CRT_PIPELINE_NAME, H5O_CRT_PIPELINE_SIZE, &H5O_def_pline_g, NULL, H5O_CRT_PIPELINE_SET, H5O_CRT_PIPELINE_GET, H5O_CRT_PIPELINE_ENC, H5O_CRT_PIPELINE_DEC, H5O_CRT_PIPELINE_DEL, H5O_CRT_PIPELINE_COPY, H5O_CRT_PIPELINE_CMP, H5O_CRT_PIPELINE_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -899,7 +899,7 @@ H5Pget_filter2(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/, filter = &pline.filter[idx]; /* Get filter information */ - if(H5P_get_filter(filter, flags, cd_nelmts, cd_values, namelen, name, filter_config) < 0) + if(H5P__get_filter(filter, flags, cd_nelmts, cd_values, namelen, name, filter_config) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5Z_FILTER_ERROR, "can't get filter info") /* Set return value */ @@ -952,7 +952,7 @@ H5P_get_filter_by_id(H5P_genplist_t *plist, H5Z_filter_t id, unsigned int *flags HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "filter ID is invalid") /* Get filter information */ - if(H5P_get_filter(filter, flags, cd_nelmts, cd_values, namelen, name, filter_config) < 0) + if(H5P__get_filter(filter, flags, cd_nelmts, cd_values, namelen, name, filter_config) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get filter info") done: @@ -1118,7 +1118,7 @@ H5P_filter_in_pline(H5P_genplist_t *plist, H5Z_filter_t id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_get_filter_by_id() */ +} /* end H5P_filter_in_pline() */ /*------------------------------------------------------------------------- @@ -1292,7 +1292,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_get_filter + * Function: H5P__get_filter * * Purpose: Internal component of H5Pget_filter & H5Pget_filter_id * @@ -1304,12 +1304,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5P_get_filter(const H5Z_filter_info_t *filter, unsigned int *flags/*out*/, +H5P__get_filter(const H5Z_filter_info_t *filter, unsigned int *flags/*out*/, size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/, size_t namelen, char name[]/*out*/, unsigned *filter_config /*out*/) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ HDassert(filter); @@ -1364,7 +1364,7 @@ H5P_get_filter(const H5Z_filter_info_t *filter, unsigned int *flags/*out*/, H5Z_get_filter_info(filter->id, filter_config); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P_get_filter() */ +} /* end H5P__get_filter() */ /*------------------------------------------------------------------------- @@ -1893,7 +1893,7 @@ H5Pget_filter1(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/, filter = &pline.filter[idx]; /* Get filter information */ - if(H5P_get_filter(filter, flags, cd_nelmts, cd_values, namelen, name, NULL) < 0) + if(H5P__get_filter(filter, flags, cd_nelmts, cd_values, namelen, name, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5Z_FILTER_ERROR, "can't get filter info") /* Set return value */ diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index 47bba05..666a945 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -161,20 +161,20 @@ H5P__ocpy_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register copy options property */ - if(H5P_register_real(pclass, H5O_CPY_OPTION_NAME, H5O_CPY_OPTION_SIZE, &H5O_def_ocpy_option_g, + if(H5P__register_real(pclass, H5O_CPY_OPTION_NAME, H5O_CPY_OPTION_SIZE, &H5O_def_ocpy_option_g, NULL, NULL, NULL, H5O_CPY_OPTION_ENC, H5O_CPY_OPTION_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register merge named dtype list property */ - if(H5P_register_real(pclass, H5O_CPY_MERGE_COMM_DT_LIST_NAME, H5O_CPY_MERGE_COMM_DT_LIST_SIZE, &H5O_def_merge_comm_dtype_list_g, + if(H5P__register_real(pclass, H5O_CPY_MERGE_COMM_DT_LIST_NAME, H5O_CPY_MERGE_COMM_DT_LIST_SIZE, &H5O_def_merge_comm_dtype_list_g, NULL, H5O_CPY_MERGE_COMM_DT_LIST_SET, H5O_CPY_MERGE_COMM_DT_LIST_GET, H5O_CPY_MERGE_COMM_DT_LIST_ENC, H5O_CPY_MERGE_COMM_DT_LIST_DEC, H5O_CPY_MERGE_COMM_DT_LIST_DEL, H5O_CPY_MERGE_COMM_DT_LIST_COPY, H5O_CPY_MERGE_COMM_DT_LIST_CMP, H5O_CPY_MERGE_COMM_DT_LIST_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for callback when completing the search for a matching named datatype from the named dtype list */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5O_CPY_MCDT_SEARCH_CB_NAME, H5O_CPY_MCDT_SEARCH_CB_SIZE, &H5O_def_mcdt_cb_g, + if(H5P__register_real(pclass, H5O_CPY_MCDT_SEARCH_CB_NAME, H5O_CPY_MCDT_SEARCH_CB_SIZE, &H5O_def_mcdt_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") diff --git a/src/H5Ppkg.h b/src/H5Ppkg.h index 19ff7f9..13f3b13 100644 --- a/src/H5Ppkg.h +++ b/src/H5Ppkg.h @@ -129,48 +129,48 @@ struct H5Z_filter_info_t; /******************************/ /* Private functions, not part of the publicly documented API */ -H5_DLL H5P_genclass_t *H5P_create_class(H5P_genclass_t *par_class, +H5_DLL H5P_genclass_t *H5P__create_class(H5P_genclass_t *par_class, const char *name, H5P_plist_type_t type, H5P_cls_create_func_t cls_create, void *create_data, H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data); -H5_DLL H5P_genclass_t *H5P_copy_pclass(H5P_genclass_t *pclass); -H5_DLL herr_t H5P_register_real(H5P_genclass_t *pclass, const char *name, size_t size, +H5_DLL H5P_genclass_t *H5P__copy_pclass(H5P_genclass_t *pclass); +H5_DLL herr_t H5P__register_real(H5P_genclass_t *pclass, const char *name, size_t size, const void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_encode_func_t prp_encode, H5P_prp_decode_func_t prp_decode, H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close); -H5_DLL herr_t H5P_register(H5P_genclass_t **pclass, const char *name, size_t size, +H5_DLL herr_t H5P__register(H5P_genclass_t **pclass, const char *name, size_t size, const void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_encode_func_t prp_encode, H5P_prp_decode_func_t prp_decode, H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close); -H5_DLL herr_t H5P_add_prop(H5SL_t *props, H5P_genprop_t *prop); -H5_DLL herr_t H5P_access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod); -H5_DLL htri_t H5P_exist_pclass(H5P_genclass_t *pclass, const char *name); -H5_DLL herr_t H5P_get_size_plist(const H5P_genplist_t *plist, const char *name, +H5_DLL herr_t H5P__add_prop(H5SL_t *props, H5P_genprop_t *prop); +H5_DLL herr_t H5P__access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod); +H5_DLL htri_t H5P__exist_pclass(H5P_genclass_t *pclass, const char *name); +H5_DLL herr_t H5P__get_size_plist(const H5P_genplist_t *plist, const char *name, size_t *size); -H5_DLL herr_t H5P_get_size_pclass(H5P_genclass_t *pclass, const char *name, +H5_DLL herr_t H5P__get_size_pclass(H5P_genclass_t *pclass, const char *name, size_t *size); -H5_DLL herr_t H5P_get_nprops_plist(const H5P_genplist_t *plist, size_t *nprops); -H5_DLL int H5P_cmp_class(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2); -H5_DLL herr_t H5P_cmp_plist(const H5P_genplist_t *plist1, const H5P_genplist_t *plist2, +H5_DLL herr_t H5P__get_nprops_plist(const H5P_genplist_t *plist, size_t *nprops); +H5_DLL int H5P__cmp_class(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2); +H5_DLL herr_t H5P__cmp_plist(const H5P_genplist_t *plist1, const H5P_genplist_t *plist2, int *cmp_ret); -H5_DLL int H5P_iterate_plist(const H5P_genplist_t *plist, hbool_t iter_all_prop, +H5_DLL int H5P__iterate_plist(const H5P_genplist_t *plist, hbool_t iter_all_prop, int *idx, H5P_iterate_int_t iter_func, void *iter_data); -H5_DLL int H5P_iterate_pclass(const H5P_genclass_t *pclass, int *idx, +H5_DLL int H5P__iterate_pclass(const H5P_genclass_t *pclass, int *idx, H5P_iterate_int_t iter_func, void *iter_data); -H5_DLL herr_t H5P_copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name); -H5_DLL herr_t H5P_copy_prop_pclass(hid_t dst_id, hid_t src_id, const char *name); -H5_DLL herr_t H5P_unregister(H5P_genclass_t *pclass, const char *name); -H5_DLL char *H5P_get_class_path(H5P_genclass_t *pclass); -H5_DLL H5P_genclass_t *H5P_open_class_path(const char *path); -H5_DLL H5P_genclass_t *H5P_get_class_parent(const H5P_genclass_t *pclass); -H5_DLL herr_t H5P_close_class(void *_pclass); +H5_DLL herr_t H5P__copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name); +H5_DLL herr_t H5P__copy_prop_pclass(hid_t dst_id, hid_t src_id, const char *name); +H5_DLL herr_t H5P__unregister(H5P_genclass_t *pclass, const char *name); +H5_DLL char *H5P__get_class_path(H5P_genclass_t *pclass); +H5_DLL H5P_genclass_t *H5P__open_class_path(const char *path); +H5_DLL H5P_genclass_t *H5P__get_class_parent(const H5P_genclass_t *pclass); +H5_DLL herr_t H5P__close_class(void *_pclass); H5_DLL H5P_genprop_t *H5P__find_prop_plist(const H5P_genplist_t *plist, const char *name); H5_DLL hid_t H5P__new_plist_of_type(H5P_plist_type_t type); @@ -194,7 +194,7 @@ H5_DLL herr_t H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, siz H5_DLL herr_t H5P__decode_coll_md_read_flag_t(const void **_pp, void *value); /* Private OCPL routines */ -H5_DLL herr_t H5P_get_filter(const struct H5Z_filter_info_t *filter, +H5_DLL herr_t H5P__get_filter(const struct H5Z_filter_info_t *filter, unsigned int *flags, size_t *cd_nelmts, unsigned cd_values[], size_t namelen, char name[], unsigned *filter_config); diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index 1a2bb95..7792671 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -190,7 +190,6 @@ H5_DLL herr_t H5P_get_filter_by_id(H5P_genplist_t *plist, H5Z_filter_t id, unsigned int *flags, size_t *cd_nelmts, unsigned cd_values[], size_t namelen, char name[], unsigned *filter_config); H5_DLL htri_t H5P_filter_in_pline(H5P_genplist_t *plist, H5Z_filter_t id); -H5_DLL hid_t H5P_get_default(const H5P_libclass_t *pclass); /* Query internal fields of the property list struct */ H5_DLL hid_t H5P_get_plist_id(const H5P_genplist_t *plist); diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c index fb91356..45343c6 100644 --- a/src/H5Pstrcpl.c +++ b/src/H5Pstrcpl.c @@ -130,7 +130,7 @@ H5P__strcrt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register character encoding */ - if(H5P_register_real(pclass, H5P_STRCRT_CHAR_ENCODING_NAME, H5P_STRCRT_CHAR_ENCODING_SIZE, &H5P_def_char_encoding_g, + if(H5P__register_real(pclass, H5P_STRCRT_CHAR_ENCODING_NAME, H5P_STRCRT_CHAR_ENCODING_SIZE, &H5P_def_char_encoding_g, NULL, NULL, NULL, H5P_STRCRT_CHAR_ENCODING_ENC, H5P_STRCRT_CHAR_ENCODING_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") diff --git a/src/H5Ptest.c b/src/H5Ptest.c index 075040d..114b37b 100644 --- a/src/H5Ptest.c +++ b/src/H5Ptest.c @@ -68,7 +68,7 @@ H5P__get_class_path_test(hid_t pclass_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property class"); /* Get the property list class path */ - if(NULL == (ret_value = H5P_get_class_path(pclass))) + if(NULL == (ret_value = H5P__get_class_path(pclass))) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, NULL, "unable to query full path of class") done: @@ -109,7 +109,7 @@ H5P__open_class_path_test(const char *path) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid class path"); /* Open the property list class */ - if(NULL == (pclass = H5P_open_class_path(path))) + if(NULL == (pclass = H5P__open_class_path(path))) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, H5I_INVALID_HID, "unable to find class with full path"); /* Get an atom for the class */ @@ -118,7 +118,7 @@ H5P__open_class_path_test(const char *path) done: if(H5I_INVALID_HID == ret_value && pclass) - H5P_close_class(pclass); + H5P__close_class(pclass); FUNC_LEAVE_NOAPI(ret_value) } /* H5P__open_class_path_test() */ diff --git a/test/testfiles/err_compat_1 b/test/testfiles/err_compat_1 index e8ea044..d81dba1 100644 --- a/test/testfiles/err_compat_1 +++ b/test/testfiles/err_compat_1 @@ -15,7 +15,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Dcreate2(): not a location ID major: Invalid arguments to routine minor: Inappropriate type - #001: (file name) line (number) in H5G_loc(): invalid object ID + #001: (file name) line (number) in H5G_loc(): invalid location ID major: Invalid arguments to routine minor: Bad value @@ -43,7 +43,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Dcreate2(): not a location ID major: Invalid arguments to routine minor: Inappropriate type - #001: (file name) line (number) in H5G_loc(): invalid object ID + #001: (file name) line (number) in H5G_loc(): invalid location ID major: Invalid arguments to routine minor: Bad value -- cgit v0.12