[svn-r12846] Description:

Further minor tweaking of property list class initialization macros, etc.

Tested on:
    FreeBSD/32 4.11 (sleipnir) w/threadsafe & debugging turned on
    Linux/32 2.4 (heping) w/FORTRAN & C++
    Linux/64 2.4 (mir) w/build-all & 1.6 compat enabled
    AIX/32 5.x (copper) w/FORTRAN & parallel
This commit is contained in:
Quincey Koziol 2006-11-02 13:38:22 -05:00
parent d90d6ffdce
commit 55b31c57b5
6 changed files with 53 additions and 15 deletions

View File

@ -252,14 +252,14 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type,
/* If the creation property list is H5P_DEFAULT, use the default character encoding */
if(acpl_id == H5P_DEFAULT)
attr->encoding = H5P_CHAR_ENCODING_DEF;
attr->encoding = H5F_DEFAULT_CSET;
else
{
/* Get a local copy of the attribute creation property list */
if (NULL == (ac_plist = H5I_object(acpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
if(H5P_get(ac_plist, H5P_CHAR_ENCODING_NAME, &(attr->encoding)) < 0)
if(H5P_get(ac_plist, H5P_STRCRT_CHAR_ENCODING_NAME, &(attr->encoding)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get character encoding flag")
} /* end else */
@ -1037,7 +1037,7 @@ H5Aget_create_plist(hid_t attr_id)
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get property list")
/* Set the character encoding on the new property list */
if(H5P_set(new_plist, H5P_CHAR_ENCODING_NAME, &(attr->encoding)) < 0)
if(H5P_set(new_plist, H5P_STRCRT_CHAR_ENCODING_NAME, &(attr->encoding)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set character encoding")
ret_value = new_plist_id;

View File

@ -1210,7 +1210,7 @@ H5L_create_real(H5G_loc_t *link_loc, const char *link_name, H5G_name_t *obj_path
target_flags |= H5G_CRT_INTMD_GROUP;
/* Get character encoding property */
if(H5P_get(lc_plist, H5P_CHAR_ENCODING_NAME, &char_encoding) < 0)
if(H5P_get(lc_plist, H5P_STRCRT_CHAR_ENCODING_NAME, &char_encoding) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for character encoding")
} /* end if */
@ -1963,7 +1963,7 @@ H5L_move(H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc,
target_flags |= H5G_CRT_INTMD_GROUP;
/* Get character encoding property */
if(H5P_get(lc_plist, H5P_CHAR_ENCODING_NAME, &char_encoding) < 0)
if(H5P_get(lc_plist, H5P_STRCRT_CHAR_ENCODING_NAME, &char_encoding) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for character encoding")
} /* end if */

View File

@ -30,6 +30,24 @@
/* Get package's private header */
#include "H5Lprivate.h"
/* Other private headers needed by this file */
/**************************/
/* Package Private Macros */
/**************************/
/****************************/
/* Package Private Typedefs */
/****************************/
/*****************************/
/* Package Private Variables */
/*****************************/
/******************************/
/* Package Private Prototypes */
/******************************/
@ -38,6 +56,5 @@ H5_DLL herr_t H5L_create_ud(H5G_loc_t *link_loc, const char *link_name,
const void * ud_data, size_t ud_data_size, H5L_type_t type,
hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id);
#endif /* _H5Lpkg_H */

View File

@ -13,7 +13,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This file contains private information about the H5DL module
* This file contains private information about the H5L module
* for dealing with links in an HDF5 file.
*/
#ifndef _H5Lprivate_H
@ -26,6 +26,10 @@
#include "H5Gprivate.h"
#include "H5Oprivate.h"
/**************************/
/* Library Private Macros */
/**************************/
/* Default number of soft links to traverse */
#define H5L_NUM_LINKS 16
@ -36,6 +40,20 @@
#define H5L_ACS_NLINKS_NAME "max soft links" /* Number of soft links to traverse */
#define H5L_ACS_ELINK_PREFIX_NAME "external link prefix" /* External link prefix */
/****************************/
/* Library Private Typedefs */
/****************************/
/*****************************/
/* Library Private Variables */
/*****************************/
/******************************/
/* Library Private Prototypes */
/******************************/
/* General operations on links */
H5_DLL herr_t H5L_link(H5G_loc_t *new_loc, const char *new_name,
H5G_loc_t *obj_loc, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id);

View File

@ -29,10 +29,8 @@
/* Library Private Macros */
/**************************/
/* String creation properties */
#define H5P_CHAR_ENCODING_NAME "character_encoding"
#define H5P_CHAR_ENCODING_SIZE sizeof(H5T_cset_t)
#define H5P_CHAR_ENCODING_DEF H5F_DEFAULT_CSET
/* ======== String creation property names ======== */
#define H5P_STRCRT_CHAR_ENCODING_NAME "character_encoding" /* Character set encoding for string */
/****************************/

View File

@ -41,6 +41,11 @@
/* Local Macros */
/****************/
/* ======== String creation properties ======== */
/* Definitions for character set encoding property */
#define H5P_STRCRT_CHAR_ENCODING_SIZE sizeof(H5T_cset_t)
#define H5P_STRCRT_CHAR_ENCODING_DEF H5F_DEFAULT_CSET
/******************/
/* Local Typedefs */
@ -105,13 +110,13 @@ const H5P_libclass_t H5P_CLS_STRCRT[1] = {{
herr_t
H5P_strcrt_reg_prop(H5P_genclass_t *pclass)
{
H5T_cset_t char_encoding = H5P_CHAR_ENCODING_DEF; /* Default character set encoding */
H5T_cset_t char_encoding = H5P_STRCRT_CHAR_ENCODING_DEF; /* Default character set encoding */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5P_strcrt_reg_prop, FAIL)
/* Register character encoding */
if(H5P_register(pclass, H5P_CHAR_ENCODING_NAME, H5P_CHAR_ENCODING_SIZE,
if(H5P_register(pclass, H5P_STRCRT_CHAR_ENCODING_NAME, H5P_STRCRT_CHAR_ENCODING_SIZE,
&char_encoding, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
@ -152,7 +157,7 @@ H5Pset_char_encoding(hid_t plist_id, H5T_cset_t encoding)
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set the character encoding */
if(H5P_set(plist, H5P_CHAR_ENCODING_NAME, &encoding) < 0)
if(H5P_set(plist, H5P_STRCRT_CHAR_ENCODING_NAME, &encoding) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set character encoding")
done:
@ -186,7 +191,7 @@ H5Pget_char_encoding(hid_t plist_id, H5T_cset_t *encoding /*out*/)
/* Get value */
if(encoding)
if(H5P_get(plist, H5P_CHAR_ENCODING_NAME, encoding) < 0)
if(H5P_get(plist, H5P_STRCRT_CHAR_ENCODING_NAME, encoding) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get character encoding flag")
done: