diff options
Diffstat (limited to 'hl/src')
-rw-r--r-- | hl/src/H5DS.c | 514 | ||||
-rw-r--r-- | hl/src/H5DS.h | 20 | ||||
-rw-r--r-- | hl/src/H5HL_private.c | 18 | ||||
-rw-r--r-- | hl/src/H5HL_private.h | 2 | ||||
-rw-r--r-- | hl/src/H5IM.c | 286 | ||||
-rw-r--r-- | hl/src/H5IM.h | 42 | ||||
-rw-r--r-- | hl/src/H5LT.c | 596 | ||||
-rw-r--r-- | hl/src/H5LT.h | 210 | ||||
-rw-r--r-- | hl/src/H5PT.c | 72 | ||||
-rw-r--r-- | hl/src/H5PT.h | 8 | ||||
-rw-r--r-- | hl/src/H5TB.c | 648 | ||||
-rw-r--r-- | hl/src/H5TB.h | 48 |
12 files changed, 1232 insertions, 1232 deletions
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index fbf7f19..b77b97f 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -22,7 +22,7 @@ /*------------------------------------------------------------------------- * Function: H5DSset_scale * - * Purpose: Convert dataset DSID to a dimension scale, by writing the standard + * Purpose: Convert dataset DSID to a dimension scale, by writing the standard * attributes for a Dimension Scale dataset; optionally set its name * * Return: Success: SUCCESS, Failure: FAIL @@ -38,9 +38,9 @@ *------------------------------------------------------------------------- */ -herr_t H5DSset_scale(hid_t dsid, - char *dimname) -{ +herr_t H5DSset_scale(hid_t dsid, + char *dimname) +{ int has_dimlist; H5I_type_t it; @@ -66,12 +66,12 @@ herr_t H5DSset_scale(hid_t dsid, if (has_dimlist == 1) return FAIL; - + /*------------------------------------------------------------------------- * write the standard attributes for a Dimension Scale dataset *------------------------------------------------------------------------- */ - + if (H5LT_set_attribute_string(dsid,"CLASS",DIMENSION_SCALE_CLASS)<0) return FAIL; @@ -89,10 +89,10 @@ herr_t H5DSset_scale(hid_t dsid, /*------------------------------------------------------------------------- * Function: H5DSattach_scale * - * Purpose: attach a DS with DSID to the IDX dimension of the existing + * Purpose: attach a DS with DSID to the IDX dimension of the existing * dataset DID * - * Return: + * Return: * Success: SUCCESS * Failure: FAIL * @@ -109,8 +109,8 @@ herr_t H5DSset_scale(hid_t dsid, herr_t H5DSattach_scale(hid_t did, hid_t dsid, - unsigned int idx) -{ + unsigned int idx) +{ int has_dimlist; int has_reflist; int is_ds; @@ -130,15 +130,15 @@ herr_t H5DSattach_scale(hid_t did, H5I_type_t it1, it2; int i, len; int found_ds=0; - + /*------------------------------------------------------------------------- * parameter checking *------------------------------------------------------------------------- */ /* the dataset cannot be a DS dataset */ - if ((H5DSis_scale(did))==1) + if ((H5DSis_scale(did))==1) return FAIL; - + /* get info for the dataset in the parameter list */ if (H5Gget_objinfo(did,".",TRUE,&sb1)<0) return FAIL; @@ -148,7 +148,7 @@ herr_t H5DSattach_scale(hid_t did, return FAIL; /* same object, not valid */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) return FAIL; /* get ID type */ @@ -172,7 +172,7 @@ herr_t H5DSattach_scale(hid_t did, /*------------------------------------------------------------------------- * The dataset may or may not have the associated DS attribute * First we try to open to see if it is already there; if not, it is created. - * If it exists, the array of references is extended to hold the reference + * If it exists, the array of references is extended to hold the reference * to the new DS *------------------------------------------------------------------------- */ @@ -180,7 +180,7 @@ herr_t H5DSattach_scale(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -205,15 +205,15 @@ herr_t H5DSattach_scale(hid_t did, /* create a reference for the >>DS<< dataset */ if (H5Rcreate(&ref_to_ds,dsid,".",H5R_OBJECT,-1)<0) return FAIL; - + /* create a reference for the >>data<< dataset */ if (H5Rcreate(&dsl.ref,did,".",H5R_OBJECT,-1)<0) return FAIL; - + /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */ if ((has_dimlist = H5LT_find_attribute(did,DIMENSION_LIST))<0) return FAIL; - + /*------------------------------------------------------------------------- * it does not exist. we create the attribute and its reference data *------------------------------------------------------------------------- @@ -231,7 +231,7 @@ herr_t H5DSattach_scale(hid_t did, /* space for the attribute */ if ((sid = H5Screate_simple(1,dims,NULL))<0) return FAIL; - + /* create the type for the attribute "DIMENSION_LIST" */ if ((tid = H5Tvlen_create(H5T_STD_REF_OBJ))<0) goto out; @@ -239,7 +239,7 @@ herr_t H5DSattach_scale(hid_t did, /* create the attribute */ if ((aid = H5Acreate(did,DIMENSION_LIST,tid,sid,H5P_DEFAULT))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); @@ -251,7 +251,7 @@ herr_t H5DSattach_scale(hid_t did, buf[i].len = 0; buf[i].p = NULL; } - + /* store the REF information in the index of the dataset that has the DS */ buf[idx].len = 1; buf[idx].p = malloc( 1 * sizeof(hobj_ref_t)); @@ -260,7 +260,7 @@ herr_t H5DSattach_scale(hid_t did, /* write the attribute with the reference */ if (H5Awrite(aid,tid,buf)<0) goto out; - + /* close */ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf)<0) goto out; @@ -275,32 +275,32 @@ herr_t H5DSattach_scale(hid_t did, free(dims); if (buf) free(buf); - + } - + /*------------------------------------------------------------------------- * the attribute already exists, open it, extend the buffer, * and insert the new reference *------------------------------------------------------------------------- */ - + else if ( has_dimlist == 1 ) { if ((aid = H5Aopen_name(did,DIMENSION_LIST))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; @@ -315,21 +315,21 @@ herr_t H5DSattach_scale(hid_t did, /* get the scale id for this REF */ if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref_j))<0) goto out; - + /* get info for DS in the parameter list */ if (H5Gget_objinfo(dsid,".",TRUE,&sb1)<0) goto out; - + /* get info for this DS */ if (H5Gget_objinfo(dsid_j,".",TRUE,&sb2)<0) goto out; - + /* same object, so this DS scale is already in this DIM IDX */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) { found_ds = 1; } - + /* close the dereferenced dataset */ if (H5Dclose(dsid_j)<0) goto out; @@ -353,30 +353,30 @@ herr_t H5DSattach_scale(hid_t did, ((hobj_ref_t *)buf[idx].p)[0] = ref_to_ds; } } - + /* write the attribute with the new references */ if (H5Awrite(aid,tid,buf)<0) goto out; - + /* close */ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf)<0) goto out; if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; if (buf) free(buf); - - } /* has_dimlist */ - + + } /* has_dimlist */ + /*------------------------------------------------------------------------- * save DS info on the >>DS<< dataset *------------------------------------------------------------------------- */ - + /* try to find the attribute "REFERENCE_LIST" on the >>DS<< dataset */ if ((has_reflist = H5LT_find_attribute(dsid,REFERENCE_LIST))<0) goto out; @@ -398,30 +398,30 @@ herr_t H5DSattach_scale(hid_t did, /* space for the attribute */ if ((sid = H5Screate_simple(1,dims,NULL))<0) goto out; - + /* create the compound datatype for the attribute "REFERENCE_LIST" */ if ((tid = H5Tcreate(H5T_COMPOUND,sizeof(ds_list_t)))<0) goto out; - + /* insert reference field */ if (H5Tinsert(tid,"dataset",HOFFSET(ds_list_t,ref),H5T_STD_REF_OBJ)<0) goto out; - + /* insert dimension idx of the dataset field */ if (H5Tinsert(tid,"dimension",HOFFSET(ds_list_t,dim_idx),H5T_NATIVE_INT)<0) goto out; - + /* create the attribute */ if ((aid = H5Acreate(dsid,REFERENCE_LIST,tid,sid,H5P_DEFAULT))<0) goto out; - + /* store the IDX information */ dsl.dim_idx = idx; - + /* write the attribute with the reference */ if (H5Awrite(aid,tid,&dsl)<0) goto out; - + /* close */ if (H5Sclose(sid)<0) goto out; @@ -438,32 +438,32 @@ herr_t H5DSattach_scale(hid_t did, * the "REFERENCE_LIST" array already exists, open it and extend it *------------------------------------------------------------------------- */ - + else if ( has_reflist == 1 ) { if ((aid = H5Aopen_name(dsid,REFERENCE_LIST))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; - + /* get and save the old reference(s) */ if ((sid = H5Aget_space(aid))<0) goto out; - + if ((nelmts = H5Sget_simple_extent_npoints(sid))<0) goto out; - + nelmts++; - + dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbuf == NULL) goto out; - + if (H5Aread(aid,tid,dsbuf)<0) goto out; - + /* close */ if (H5Sclose(sid)<0) goto out; @@ -474,7 +474,7 @@ herr_t H5DSattach_scale(hid_t did, * create a new attribute *------------------------------------------------------------------------- */ - + /* the attribute must be deleted, in order to the new one can reflect the changes*/ if (H5Adelete(dsid,REFERENCE_LIST)<0) goto out; @@ -488,34 +488,34 @@ herr_t H5DSattach_scale(hid_t did, if (dims == NULL) goto out; dims[0] = nelmts; - + if ((sid = H5Screate_simple(1,dims,NULL))<0) goto out; if (dims) free(dims); - + /* create the attribute again with the changes of space */ if ((aid = H5Acreate(dsid,REFERENCE_LIST,tid,sid,H5P_DEFAULT))<0) goto out; - + /* write the attribute with the new references */ if (H5Awrite(aid,tid,dsbuf)<0) goto out; - + /* close */ if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; - + if (dsbuf) free(dsbuf); - - } /* has_reflist */ - + + } /* has_reflist */ + /*------------------------------------------------------------------------- * write the standard attributes for a Dimension Scale dataset *------------------------------------------------------------------------- @@ -523,7 +523,7 @@ herr_t H5DSattach_scale(hid_t did, if ((is_ds=H5DSis_scale(dsid))<0) return FAIL; - + if (is_ds == 0 ) { if (H5LT_set_attribute_string(dsid,"CLASS",DIMENSION_SCALE_CLASS)<0) @@ -531,7 +531,7 @@ herr_t H5DSattach_scale(hid_t did, } return SUCCESS; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -545,10 +545,10 @@ out: /*------------------------------------------------------------------------- * Function: H5DSdetach_scale * - * Purpose: detach a DS with DSID to the IDX dimension of the existing + * Purpose: detach a DS with DSID to the IDX dimension of the existing * dataset DID * - * Return: + * Return: * Success: SUCCESS * Failure: FAIL * @@ -565,8 +565,8 @@ out: herr_t H5DSdetach_scale(hid_t did, hid_t dsid, - unsigned int idx) -{ + unsigned int idx) +{ int has_dimlist; int has_reflist; hssize_t nelmts; @@ -584,15 +584,15 @@ herr_t H5DSdetach_scale(hid_t did, H5G_stat_t sb1, sb2, sb3, sb4; int found_dset=0, found_ds=0; H5I_type_t it1, it2; - + /*------------------------------------------------------------------------- * parameter checking *------------------------------------------------------------------------- */ /* the dataset cannot be a DS dataset */ - if ((H5DSis_scale(did))==1) + if ((H5DSis_scale(did))==1) return FAIL; - + /* get info for the dataset in the parameter list */ if (H5Gget_objinfo(did,".",TRUE,&sb1)<0) return FAIL; @@ -602,7 +602,7 @@ herr_t H5DSdetach_scale(hid_t did, return FAIL; /* same object, not valid */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) return FAIL; /* get ID type */ @@ -629,7 +629,7 @@ herr_t H5DSdetach_scale(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -650,31 +650,31 @@ herr_t H5DSdetach_scale(hid_t did, if (has_reflist == 0) return FAIL; - + /*------------------------------------------------------------------------- * open "DIMENSION_LIST", and delete the reference *------------------------------------------------------------------------- */ - + if ((aid = H5Aopen_name(did,DIMENSION_LIST))<0) return FAIL; - + if ((tid = H5Aget_type(aid))<0) goto out; - + if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); - + if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; - + /* reset */ if ( buf[idx].len > 0 ) { @@ -682,28 +682,28 @@ herr_t H5DSdetach_scale(hid_t did, { /* get the reference */ ref = ((hobj_ref_t *)buf[idx].p)[j]; - + /* get the DS id */ if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref))<0) goto out; - + /* get info for DS in the parameter list */ if (H5Gget_objinfo(dsid,".",TRUE,&sb1)<0) goto out; - + /* get info for this DS */ if (H5Gget_objinfo(dsid_j,".",TRUE,&sb2)<0) goto out; - + /* same object, reset */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) { for(jj=j; jj<buf[idx].len-1; jj++) { ((hobj_ref_t *)buf[idx].p)[jj] = ((hobj_ref_t *)buf[idx].p)[jj+1]; } buf[idx].len--; - + found_ds = 1; /* close the dereferenced dataset and break */ @@ -711,23 +711,23 @@ herr_t H5DSdetach_scale(hid_t did, goto out; break; } - + /* close the dereferenced dataset */ if (H5Dclose(dsid_j)<0) goto out; } /* j */ } /* if */ - + /* write the attribute */ if (H5Awrite(aid,tid,buf)<0) goto out; - + /* close */ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf)<0) goto out; if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; @@ -742,46 +742,46 @@ herr_t H5DSdetach_scale(hid_t did, * the "REFERENCE_LIST" array exists, update *------------------------------------------------------------------------- */ - + if ((aid = H5Aopen_name(dsid,REFERENCE_LIST))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; - + /* get and save the old reference(s) */ if ((sid = H5Aget_space(aid))<0) goto out; - + if ((nelmts = H5Sget_simple_extent_npoints(sid))<0) goto out; - + dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbuf == NULL) goto out; - + if (H5Aread(aid,tid,dsbuf)<0) goto out; - + for(i=0; i<nelmts; i++) { /* get the reference */ ref = dsbuf[i].ref; - + /* get the DS id */ if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref))<0) goto out; - + /* get info for dataset in the parameter list */ if (H5Gget_objinfo(did,".",TRUE,&sb3)<0) goto out; - + /* get info for this DS */ if (H5Gget_objinfo(dsid_j,".",TRUE,&sb4)<0) goto out; - + /* same object, reset. we want to detach only for this DIM */ - if (sb3.fileno==sb4.fileno && sb3.objno==sb4.objno && (int)idx==dsbuf[i].dim_idx) + if (sb3.fileno==sb4.fileno && sb3.objno==sb4.objno && (int)idx==dsbuf[i].dim_idx) { for(jj=i; jj<nelmts-1; jj++) { @@ -789,17 +789,17 @@ herr_t H5DSdetach_scale(hid_t did, } nelmts--; found_dset=1; - + /* close the dereferenced dataset and break */ if (H5Dclose(dsid_j)<0) goto out; break; } /* if */ - + /* close the dereferenced dataset */ if (H5Dclose(dsid_j)<0) goto out; - + } /* i */ /* close space and attribute */ @@ -807,12 +807,12 @@ herr_t H5DSdetach_scale(hid_t did, goto out; if (H5Aclose(aid)<0) goto out; - + /*------------------------------------------------------------------------- * check if we found the pointed dataset *------------------------------------------------------------------------- */ - + /* the pointed dataset must exist */ if (found_dset == 0) goto out; @@ -821,7 +821,7 @@ herr_t H5DSdetach_scale(hid_t did, * create a new attribute *------------------------------------------------------------------------- */ - + /* the attribute must be deleted, in order to the new one can reflect the changes*/ if (H5Adelete(dsid,REFERENCE_LIST)<0) goto out; @@ -834,28 +834,28 @@ herr_t H5DSdetach_scale(hid_t did, if (dims == NULL) goto out; dims[0] = nelmts; - + dsbufn = malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbufn == NULL) goto out; - + /* store the new information */ for(i=0; i<nelmts; i++) { dsbufn[i] = dsbuf[i]; } - + if ((sid = H5Screate_simple(1,dims,NULL))<0) goto out; - + /* create the attribute again with the changes of space */ if ((aid = H5Acreate(dsid,REFERENCE_LIST,tid,sid,H5P_DEFAULT))<0) goto out; - + /* write the new attribute with the new references */ if (H5Awrite(aid,tid,dsbufn)<0) goto out; - + /* close space and attribute */ if (H5Sclose(sid)<0) goto out; @@ -863,9 +863,9 @@ herr_t H5DSdetach_scale(hid_t did, goto out; } /* nelmts */ - + /* close type */ - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (dsbuf) { @@ -881,33 +881,33 @@ herr_t H5DSdetach_scale(hid_t did, dims=NULL; } - + return SUCCESS; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { H5Sclose(sid); H5Aclose(aid); H5Tclose(tid); - if (dsbuf) + if (dsbuf) free(dsbuf); - if (dsbufn) + if (dsbufn) free(dsbufn); - if (dims) + if (dims) free(dims); } H5E_END_TRY; return FAIL; - + } /*------------------------------------------------------------------------- * Function: H5DSget_num_scales * - * Purpose: get the number of scales linked to the IDX dimension of dataset DID + * Purpose: get the number of scales linked to the IDX dimension of dataset DID * - * Return: - * Success: number of scales + * Return: + * Success: number of scales * Failure: FAIL * * Programmer: pvn@ncsa.uiuc.edu @@ -923,7 +923,7 @@ out: int H5DSget_num_scales(hid_t did, unsigned int idx) -{ +{ int has_dimlist; hid_t sid; /* space ID */ hid_t tid; /* attribute type ID */ @@ -943,15 +943,15 @@ int H5DSget_num_scales(hid_t did, if (H5I_DATASET!=it) return FAIL; - + /*------------------------------------------------------------------------- - * the attribute "DIMENSION_LIST" on the >>data<< dataset must exist + * the attribute "DIMENSION_LIST" on the >>data<< dataset must exist *------------------------------------------------------------------------- */ /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -973,10 +973,10 @@ int H5DSget_num_scales(hid_t did, return 0; /*------------------------------------------------------------------------- - * the attribute exists, open it + * the attribute exists, open it *------------------------------------------------------------------------- */ - + else if ( has_dimlist == 1 ) { if ((aid = H5Aopen_name(did,DIMENSION_LIST))<0) @@ -985,13 +985,13 @@ int H5DSget_num_scales(hid_t did, goto out; if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; @@ -1003,17 +1003,17 @@ int H5DSget_num_scales(hid_t did, goto out; if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; if (buf) free(buf); - - } /* has_dimlist */ + + } /* has_dimlist */ return nscales; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -1043,10 +1043,10 @@ out: *------------------------------------------------------------------------- */ -herr_t H5DSset_label(hid_t did, +herr_t H5DSset_label(hid_t did, unsigned int idx, char *label) -{ +{ int has_labels; hid_t sid; /* space ID */ hid_t tid; /* attribute type ID */ @@ -1080,7 +1080,7 @@ herr_t H5DSset_label(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -1101,17 +1101,17 @@ herr_t H5DSset_label(hid_t did, /* space for the attribute */ if ((sid = H5Screate_simple(1,dims,NULL))<0) goto out; - + /* create the datatype */ if ((tid = H5Tcopy(H5T_C_S1))<0) goto out; if (H5Tset_size(tid,H5T_VARIABLE)<0) goto out; - + /* create the attribute */ if ((aid = H5Acreate(did,DIMENSION_LABELS,tid,sid,H5P_DEFAULT))<0) goto out; - + /* allocate and initialize */ buf = (char **)malloc((size_t)rank * sizeof(char *)); @@ -1120,14 +1120,14 @@ herr_t H5DSset_label(hid_t did, for(i=0; i<(unsigned int)rank; i++) buf[i] = NULL; - + /* store the label information in the required index */ buf[idx] = label; - + /* write the attribute with the label */ if (H5Awrite(aid,tid,buf)<0) goto out; - + /* close */ if (H5Sclose(sid)<0) goto out; @@ -1138,7 +1138,7 @@ herr_t H5DSset_label(hid_t did, if (buf) free(buf); } - + /*------------------------------------------------------------------------- * just insert label *------------------------------------------------------------------------- @@ -1148,29 +1148,29 @@ herr_t H5DSset_label(hid_t did, { if ((aid = H5Aopen_name(did,DIMENSION_LABELS))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; - + /* allocate and initialize */ buf = (char **)malloc((size_t)rank * sizeof(char *)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; /* store the label information in the required index */ buf[idx] = label; - + /* write the attribute with the new references */ if (H5Awrite(aid,tid,buf)<0) goto out; - + /* close */ - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; @@ -1193,7 +1193,7 @@ out: /*------------------------------------------------------------------------- * Function: H5DSget_label * - * Purpose: Read the label LABEL for dimension IDX of datsset DID + * Purpose: Read the label LABEL for dimension IDX of datsset DID * Up to 'size' characters are stored in 'label' followed by a '\0' string * terminator. If the label is longer than 'size'-1, * the string terminator is stored in the last position of the buffer to @@ -1211,11 +1211,11 @@ out: * *------------------------------------------------------------------------- */ -ssize_t H5DSget_label(hid_t did, +ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) -{ +{ int has_labels; hid_t sid; /* space ID */ hid_t tid; /* attribute type ID */ @@ -1257,7 +1257,7 @@ ssize_t H5DSget_label(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -1275,36 +1275,36 @@ ssize_t H5DSget_label(hid_t did, { if ((aid = H5Aopen_name(did,DIMENSION_LABELS))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; - + /* allocate and initialize */ buf = (char **)malloc((size_t)rank * sizeof(char *)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; - + /* get the real string length */ nbytes = HDstrlen(buf[idx]); - + /* compute the string length which will fit into the user's buffer */ copy_len = MIN(size-1, nbytes); - + /* copy all/some of the name */ if( label ) { HDmemcpy(label, buf[idx], copy_len); - + /* terminate the string */ label[copy_len]='\0'; } - + /* close */ - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; @@ -1348,10 +1348,10 @@ out: *------------------------------------------------------------------------- */ -ssize_t H5DSget_scale_name(hid_t did, +ssize_t H5DSget_scale_name(hid_t did, char *name, - size_t size) -{ + size_t size) +{ hid_t aid; /* attribute ID */ hid_t tid; /* attribute type ID */ hid_t sid; /* space ID */ @@ -1372,9 +1372,9 @@ ssize_t H5DSget_scale_name(hid_t did, if (H5I_DATASET!=it) return FAIL; - if ((H5DSis_scale(did))<=0) + if ((H5DSis_scale(did))<=0) return FAIL; - + /*------------------------------------------------------------------------- * check if the DS has a name *------------------------------------------------------------------------- @@ -1391,7 +1391,7 @@ ssize_t H5DSget_scale_name(hid_t did, * open the attribute *------------------------------------------------------------------------- */ - + if ((aid = H5Aopen_name(did,"NAME"))<0) return FAIL; @@ -1411,22 +1411,22 @@ ssize_t H5DSget_scale_name(hid_t did, buf = (char*)malloc(nbytes * sizeof(char)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; /* compute the string length which will fit into the user's buffer */ copy_len = MIN(size-1, nbytes); - + /* copy all/some of the name */ if (name) { HDmemcpy(name, buf, copy_len); - + /* terminate the string */ name[copy_len]='\0'; } - + /* close */ if (H5Tclose(tid)<0) goto out; @@ -1475,8 +1475,8 @@ out: *------------------------------------------------------------------------- */ -htri_t H5DSis_scale(hid_t did) -{ +htri_t H5DSis_scale(hid_t did) +{ hid_t tid; /* attribute type ID */ hid_t aid; /* attribute ID */ herr_t has_class; /* has the "CLASS" attribute */ @@ -1506,19 +1506,19 @@ htri_t H5DSis_scale(hid_t did) { if ((aid = H5Aopen_name(did,"CLASS"))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; if (H5Aread(aid,tid,buf)<0) goto out; - if( strcmp(buf,DIMENSION_SCALE_CLASS)==0) + if( strcmp(buf,DIMENSION_SCALE_CLASS)==0) is_ds = 1; else is_ds = 0; - - if (H5Tclose(tid)<0) + + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) @@ -1526,7 +1526,7 @@ htri_t H5DSis_scale(hid_t did) } return is_ds; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -1541,16 +1541,16 @@ out: /*------------------------------------------------------------------------- * Function: H5DSiterate_scales * - * Purpose: H5DSiterate_scales iterates over the scales attached to dimension dim - * of dataset dset. For each scale in the list, the visitor_data and some - * additional information, specified below, are passed to the visitor function. - * The iteration begins with the idx object in the group and the next element - * to be processed by the operator is returned in idx. If idx is NULL, then the + * Purpose: H5DSiterate_scales iterates over the scales attached to dimension dim + * of dataset dset. For each scale in the list, the visitor_data and some + * additional information, specified below, are passed to the visitor function. + * The iteration begins with the idx object in the group and the next element + * to be processed by the operator is returned in idx. If idx is NULL, then the * iterator starts at zero. * * Parameters: * - * hid_t DID; IN: the dataset + * hid_t DID; IN: the dataset * unsigned int dim; IN: the dimension of the dataset * int *idx; IN/OUT: input the index to start iterating, output the next index * to visit. If NULL, start at the first position. @@ -1560,10 +1560,10 @@ out: * Iterate over all scales of DIM, calling an application callback * with the item, key and any operator data. * - * The operator callback receives a pointer to the item , + * The operator callback receives a pointer to the item , * and the pointer to the operator data passed * in to H5SL_iterate ('op_data'). The return values from an operator are: - * A. Zero causes the iterator to continue, returning zero when all + * A. Zero causes the iterator to continue, returning zero when all * nodes of that type have been processed. * B. Positive causes the iterator to immediately return that positive * value, indicating short-circuit success. @@ -1581,10 +1581,10 @@ out: *------------------------------------------------------------------------- */ -herr_t H5DSiterate_scales(hid_t did, - unsigned int dim, - int *idx, - H5DS_iterate_t visitor, +herr_t H5DSiterate_scales(hid_t did, + unsigned int dim, + int *idx, + H5DS_iterate_t visitor, void *visitor_data ) { hid_t scale_id; @@ -1619,7 +1619,7 @@ herr_t H5DSiterate_scales(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -1643,22 +1643,22 @@ herr_t H5DSiterate_scales(hid_t did, goto out; if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; - + if ( buf[dim].len > 0 ) { if (idx!=NULL) j_idx = *idx; - else + else j_idx=0; /* iterate */ @@ -1673,15 +1673,15 @@ herr_t H5DSiterate_scales(hid_t did, if ((scale_id = H5Rdereference(did,H5R_OBJECT,&ref))<0) goto out; } H5E_END_TRY; - + if((ret_value=(visitor)(did,dim,scale_id,visitor_data))!=0) { /* set the return IDX OUT value at current scale index and break */ - if (idx!=NULL) + if (idx!=NULL) { *idx = i; } - + /* close the DS id */ if (H5Dclose(scale_id)<0) goto out; @@ -1695,23 +1695,23 @@ herr_t H5DSiterate_scales(hid_t did, } /* i */ } /* if */ - + /* close */ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf)<0) goto out; if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; if (buf) free(buf); - + } /* if has_dimlist */ return ret_value; - + out: H5E_BEGIN_TRY { if (buf) @@ -1724,17 +1724,17 @@ out: H5Tclose(tid); } H5E_END_TRY; return FAIL; -} +} /*------------------------------------------------------------------------- * Function: H5DSis_attached * - * Purpose: Report if dimension scale DSID is currently attached to + * Purpose: Report if dimension scale DSID is currently attached to * dimension IDX of dataset DID by checking if DID has a pointer in the REFERENCE_LIST - * attribute and DSID (scale ) has a pointer in the DIMENSION_LIST attribute + * attribute and DSID (scale ) has a pointer in the DIMENSION_LIST attribute * - * Return: + * Return: * 1: both the DS and the dataset pointers match * 0: one of them or both do not match * FAIL (-1): error @@ -1752,8 +1752,8 @@ out: htri_t H5DSis_attached(hid_t did, hid_t dsid, - unsigned int idx) -{ + unsigned int idx) +{ int has_dimlist; int has_reflist; hssize_t nelmts; @@ -1775,9 +1775,9 @@ htri_t H5DSis_attached(hid_t did, *------------------------------------------------------------------------- */ /* the dataset cannot be a DS dataset */ - if ((H5DSis_scale(did))==1) + if ((H5DSis_scale(did))==1) return FAIL; - + /* get info for the dataset in the parameter list */ if (H5Gget_objinfo(did,".",TRUE,&sb1)<0) return FAIL; @@ -1787,7 +1787,7 @@ htri_t H5DSis_attached(hid_t did, return FAIL; /* same object, not valid */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) return FAIL; /* get ID type */ @@ -1807,7 +1807,7 @@ htri_t H5DSis_attached(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -1828,24 +1828,24 @@ htri_t H5DSis_attached(hid_t did, * open "DIMENSION_LIST" *------------------------------------------------------------------------- */ - + if ( has_dimlist == 1 ) { if ((aid = H5Aopen_name(did,DIMENSION_LIST))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; @@ -1859,83 +1859,83 @@ htri_t H5DSis_attached(hid_t did, /* get the scale id for this REF */ if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref))<0) goto out; - + /* get info for DS in the parameter list */ if (H5Gget_objinfo(dsid,".",TRUE,&sb1)<0) goto out; - + /* get info for this DS */ if (H5Gget_objinfo(dsid_j,".",TRUE,&sb2)<0) goto out; - + /* same object */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) { found_ds = 1; } - + /* close the dereferenced dataset */ if (H5Dclose(dsid_j)<0) goto out; } - + /* close */ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf)<0) goto out; if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; if (buf) free(buf); - } /* has_dimlist */ - + } /* has_dimlist */ + /*------------------------------------------------------------------------- * info on the >>DS<< dataset *------------------------------------------------------------------------- */ - + /* try to find the attribute "REFERENCE_LIST" on the >>DS<< dataset */ if ((has_reflist = H5LT_find_attribute(dsid,REFERENCE_LIST))<0) goto out; /*------------------------------------------------------------------------- - * open "REFERENCE_LIST" + * open "REFERENCE_LIST" *------------------------------------------------------------------------- */ - + if ( has_reflist == 1 ) { if ((aid = H5Aopen_name(dsid,REFERENCE_LIST))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; - + /* get and save the old reference(s) */ if ((sid = H5Aget_space(aid))<0) goto out; - + if ((nelmts = H5Sget_simple_extent_npoints(sid))<0) goto out; - + dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbuf == NULL) goto out; - + if (H5Aread(aid,tid,dsbuf)<0) goto out; - + /*------------------------------------------------------------------------- * iterate *------------------------------------------------------------------------- */ - + for(i=0; i<nelmts; i++) { /* get the reference */ @@ -1947,43 +1947,43 @@ htri_t H5DSis_attached(hid_t did, /* get the DS id */ if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref))<0) goto out; - + /* get info for dataset in the parameter list */ if (H5Gget_objinfo(did,".",TRUE,&sb3)<0) goto out; - + /* get info for this DS */ if (H5Gget_objinfo(dsid_j,".",TRUE,&sb4)<0) goto out; - + /* same object */ if (sb3.fileno==sb4.fileno && sb3.objno==sb4.objno && (int)idx==dsbuf[i].dim_idx) { found_dset=1; } /* if */ - + /* close the dereferenced dataset */ if (H5Dclose(dsid_j)<0) goto out; } /* if */ } /* i */ - - + + /* close */ if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; if (dsbuf) free(dsbuf); - } /* has_reflist */ + } /* has_reflist */ if (found_ds && found_dset) return 1; else return 0; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -2033,7 +2033,7 @@ herr_t H5DS_is_reserved(hid_t did) { if ((aid = H5Aopen_name(did,"CLASS"))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; @@ -2046,8 +2046,8 @@ herr_t H5DS_is_reserved(hid_t did) ret = 1; else ret = 0; - - if (H5Tclose(tid)<0) + + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) diff --git a/hl/src/H5DS.h b/hl/src/H5DS.h index 8733997..6ad7b09 100644 --- a/hl/src/H5DS.h +++ b/hl/src/H5DS.h @@ -26,7 +26,7 @@ #define REFERENCE_LIST "REFERENCE_LIST" #define DIMENSION_LABELS "DIMENSION_LABELS" -typedef herr_t (*H5DS_iterate_t)(hid_t dset, unsigned dim, hid_t scale, void *visitor_data); +typedef herr_t (*H5DS_iterate_t)(hid_t dset, unsigned dim, hid_t scale, void *visitor_data); /* attribute type of a DS dataset */ @@ -48,31 +48,31 @@ H5_HLDLL herr_t H5DSdetach_scale( hid_t did, hid_t dsid, unsigned int idx); -H5_HLDLL herr_t H5DSset_scale( hid_t dsid, +H5_HLDLL herr_t H5DSset_scale( hid_t dsid, char *dimname); H5_HLDLL int H5DSget_num_scales( hid_t did, unsigned int dim); -H5_HLDLL herr_t H5DSset_label( hid_t did, +H5_HLDLL herr_t H5DSset_label( hid_t did, unsigned int idx, char *label); -H5_HLDLL ssize_t H5DSget_label( hid_t did, +H5_HLDLL ssize_t H5DSget_label( hid_t did, unsigned int idx, char *label, size_t size); -H5_HLDLL ssize_t H5DSget_scale_name( hid_t did, +H5_HLDLL ssize_t H5DSget_scale_name( hid_t did, char *name, size_t size); H5_HLDLL htri_t H5DSis_scale( hid_t did); -H5_HLDLL herr_t H5DSiterate_scales( hid_t did, - unsigned int dim, - int *idx, - H5DS_iterate_t visitor, +H5_HLDLL herr_t H5DSiterate_scales( hid_t did, + unsigned int dim, + int *idx, + H5DS_iterate_t visitor, void *visitor_data); H5_HLDLL htri_t H5DSis_attached( hid_t did, @@ -84,7 +84,7 @@ H5_HLDLL htri_t H5DSis_attached( hid_t did, /*------------------------------------------------------------------------- * private functions *------------------------------------------------------------------------- - */ + */ H5_HLDLL herr_t H5DS_is_reserved( hid_t did); diff --git a/hl/src/H5HL_private.c b/hl/src/H5HL_private.c index 723e9ea..0d7e3b4 100644 --- a/hl/src/H5HL_private.c +++ b/hl/src/H5HL_private.c @@ -37,9 +37,9 @@ * *------------------------------------------------------------------------- */ -herr_t H5TBcommon_append_records( hid_t dataset_id, - hid_t mem_type_id, - hsize_t nrecords, +herr_t H5TBcommon_append_records( hid_t dataset_id, + hid_t mem_type_id, + hsize_t nrecords, hsize_t orig_table_size, const void * data) { @@ -71,7 +71,7 @@ herr_t H5TBcommon_append_records( hid_t dataset_id, goto out; /* Write the records */ - if ( H5Dwrite( dataset_id, mem_type_id, mem_space_id, space_id, H5P_DEFAULT, data ) < + if ( H5Dwrite( dataset_id, mem_type_id, mem_space_id, space_id, H5P_DEFAULT, data ) < 0 ) goto out; @@ -94,7 +94,7 @@ out: /*------------------------------------------------------------------------- - * Function: H5TBcommon_read_records + * Function: H5TBcommon_read_records * * Purpose: Common code for reading records shared between H5PT and H5TB * @@ -107,7 +107,7 @@ out: * * Comments: Called by H5TBread_records and H5PTread_records * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -118,8 +118,8 @@ herr_t H5TBcommon_read_records( hid_t dataset_id, hsize_t nrecords, hsize_t table_size, void *data) -{ - hsize_t count[1]; +{ + hsize_t count[1]; hsize_t offset[1]; hid_t space_id = H5I_BADID; hid_t mem_space_id = H5I_BADID; @@ -129,7 +129,7 @@ herr_t H5TBcommon_read_records( hid_t dataset_id, if ( start + nrecords > table_size ) goto out; - /* Get the dataspace handle */ + /* Get the dataspace handle */ if ( (space_id = H5Dget_space( dataset_id )) < 0 ) goto out; diff --git a/hl/src/H5HL_private.h b/hl/src/H5HL_private.h index d6f2157..c431e7d 100644 --- a/hl/src/H5HL_private.h +++ b/hl/src/H5HL_private.h @@ -28,7 +28,7 @@ extern "C" { */ herr_t H5TBcommon_append_records( hid_t dataset_id, - hid_t mem_type_id, + hid_t mem_type_id, hsize_t nrecords, hsize_t orig_table_size, const void * data); diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 9e8982d..0db602c 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -27,7 +27,7 @@ * Date: June 13, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -35,17 +35,17 @@ *------------------------------------------------------------------------- */ -herr_t H5IMmake_image_8bit( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_8bit( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const unsigned char *buffer ) { hsize_t dims[IMAGE8_RANK]; - + /* Initialize the image dimensions */ - dims[0] = height; - dims[1] = width; + dims[0] = height; + dims[1] = width; dims[2] = 1; /* Make the dataset */ @@ -79,12 +79,12 @@ herr_t H5IMmake_image_8bit( hid_t loc_id, * Date: June 13, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * - * Interlace Mode Dimensions in the Dataspace - * INTERLACE_PIXEL [height][width][pixel components] - * INTERLACE_PLANE [pixel components][height][width] + * Interlace Mode Dimensions in the Dataspace + * INTERLACE_PIXEL [height][width][pixel components] + * INTERLACE_PLANE [pixel components][height][width] * * * Modifications: @@ -92,34 +92,34 @@ herr_t H5IMmake_image_8bit( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5IMmake_image_24bit( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_24bit( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const char *interlace, const unsigned char *buffer ) { hsize_t dims[IMAGE24_RANK]; - + /* Initialize the image dimensions */ - if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) + if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) { /* Number of color planes is defined as the third dimension */ - dims[0] = height; - dims[1] = width; - dims[2] = IMAGE24_RANK; + dims[0] = height; + dims[1] = width; + dims[2] = IMAGE24_RANK; } else - if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) + if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) { /* Number of color planes is defined as the first dimension */ - dims[0] = IMAGE24_RANK; - dims[1] = height; - dims[2] = width; + dims[0] = IMAGE24_RANK; + dims[1] = height; + dims[2] = width; } else return -1; - + /* Make the dataset */ if ( H5LTmake_dataset( loc_id, dset_name, IMAGE24_RANK, dims, H5T_NATIVE_UCHAR, buffer ) < 0 ) return -1; @@ -151,7 +151,7 @@ herr_t H5IMmake_image_24bit( hid_t loc_id, * * Purpose: operator function used by H5LT_find_palette * - * Return: + * Return: * * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu * @@ -167,33 +167,33 @@ herr_t H5IMmake_image_24bit( hid_t loc_id, static herr_t find_palette( hid_t loc_id, const char *name, void *op_data ) { - /* Define a default zero value for return. This will cause the iterator to continue if + /* Define a default zero value for return. This will cause the iterator to continue if * the palette attribute is not found yet. */ - int ret = 0; + int ret = 0; /* Shut compiler */ loc_id=loc_id; op_data=op_data; - - /* Define a positive value for return value if the attribute was found. This will - * cause the iterator to immediately return that positive value, - * indicating short-circuit success + + /* Define a positive value for return value if the attribute was found. This will + * cause the iterator to immediately return that positive value, + * indicating short-circuit success */ - - if( strcmp( name, "PALETTE" ) == 0 ) + + if( strcmp( name, "PALETTE" ) == 0 ) ret = 1; return ret; -} +} /*------------------------------------------------------------------------- * Function: H5IM_find_palette * - * Purpose: Private function. Find the attribute "PALETTE" in the image dataset + * Purpose: Private function. Find the attribute "PALETTE" in the image dataset * * Return: Success: 1, Failure: 0 * @@ -209,7 +209,7 @@ static herr_t find_palette( hid_t loc_id, const char *name, void *op_data ) *------------------------------------------------------------------------- */ -herr_t H5IM_find_palette( hid_t loc_id ) +herr_t H5IM_find_palette( hid_t loc_id ) { unsigned int attr_num; /* Starting attribute to look up */ @@ -225,7 +225,7 @@ herr_t H5IM_find_palette( hid_t loc_id ) /*------------------------------------------------------------------------- * Function: H5IMget_image_info * - * Purpose: Gets information about an image dataset (dimensions, interlace mode + * Purpose: Gets information about an image dataset (dimensions, interlace mode * and number of associated palettes). * * Return: Success: 0, Failure: -1 @@ -235,7 +235,7 @@ herr_t H5IM_find_palette( hid_t loc_id ) * Date: July 25, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -243,18 +243,18 @@ herr_t H5IM_find_palette( hid_t loc_id ) *------------------------------------------------------------------------- */ -herr_t H5IMget_image_info( hid_t loc_id, - const char *dset_name, +herr_t H5IMget_image_info( hid_t loc_id, + const char *dset_name, hsize_t *width, hsize_t *height, hsize_t *planes, char *interlace, hssize_t *npals ) { - hid_t did, sid; + hid_t did, sid; hsize_t dims[IMAGE24_RANK]; hid_t attr_id; - hid_t attr_type; + hid_t attr_type; int has_attr; hid_t attr_space_id; hid_t attr_class; @@ -289,7 +289,7 @@ herr_t H5IMget_image_info( hid_t loc_id, if ( H5Aclose( attr_id ) < 0 ) goto out; } - + /* Get the dataspace handle */ if ( (sid = H5Dget_space( did )) < 0 ) goto out; @@ -304,18 +304,18 @@ herr_t H5IMget_image_info( hid_t loc_id, /* This is a 24 bit image */ { - if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) + if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) { /* Number of color planes is defined as the third dimension */ - *height = dims[0]; + *height = dims[0]; *width = dims[1]; *planes = dims[2]; } else - if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) + if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) { /* Number of color planes is defined as the first dimension */ - *planes = dims[0]; + *planes = dims[0]; *height = dims[1]; *width = dims[2]; } @@ -324,7 +324,7 @@ herr_t H5IMget_image_info( hid_t loc_id, else /* This is a 8 bit image */ { - *height = dims[0]; + *height = dims[0]; *width = dims[1]; *planes = 1; } @@ -345,7 +345,7 @@ herr_t H5IMget_image_info( hid_t loc_id, if ( (attr_id = H5Aopen_name( did, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -366,13 +366,13 @@ herr_t H5IMget_image_info( hid_t loc_id, if ( H5Sclose( attr_space_id ) < 0 ) goto out; - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; @@ -403,7 +403,7 @@ out: * Date: June 13, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -411,11 +411,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMread_image( hid_t loc_id, - const char *dset_name, +herr_t H5IMread_image( hid_t loc_id, + const char *dset_name, unsigned char *buffer ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -450,7 +450,7 @@ out: * Date: May 01, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -458,18 +458,18 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMmake_palette( hid_t loc_id, +herr_t H5IMmake_palette( hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, - const unsigned char *pal_data ) + const unsigned char *pal_data ) + +{ -{ - int has_pal; - + /* Check if the dataset already exists */ has_pal = H5LTfind_dataset( loc_id, pal_name ); - + /* It exists. Return */ if ( has_pal == 1 ) return 0; @@ -485,7 +485,7 @@ herr_t H5IMmake_palette( hid_t loc_id, /* Attach the attribute "PAL_VERSION" to the >>palette<< dataset*/ if ( H5LTset_attribute_string( loc_id, pal_name, "PAL_VERSION", "1.2" ) < 0 ) return -1; - + return 0; } @@ -503,23 +503,23 @@ herr_t H5IMmake_palette( hid_t loc_id, * Date: May 01, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html - * - * An image (dataset) within an HDF5 file may optionally specify an array of - * palettes to be viewed with. The dataset will have an attribute - * which contains an array of object reference pointers which refer to palettes in the file. + * + * An image (dataset) within an HDF5 file may optionally specify an array of + * palettes to be viewed with. The dataset will have an attribute + * which contains an array of object reference pointers which refer to palettes in the file. * * Modifications: * *------------------------------------------------------------------------- */ -herr_t H5IMlink_palette( hid_t loc_id, - const char *image_name, - const char *pal_name ) +herr_t H5IMlink_palette( hid_t loc_id, + const char *image_name, + const char *pal_name ) -{ +{ hid_t image_id; hid_t attr_type; @@ -532,12 +532,12 @@ herr_t H5IMlink_palette( hid_t loc_id, hsize_t dim_ref; int ok_pal; - /* The image dataset may or may not have the attribute "PALETTE" + /* The image dataset may or may not have the attribute "PALETTE" * First we try to open to see if it is already there; if not, it is created. - * If it exists, the array of references is extended to hold the reference + * If it exists, the array of references is extended to hold the reference * to the new palette */ - + /* First we get the image id */ if ( (image_id = H5Dopen( loc_id, image_name )) < 0 ) return -1; @@ -551,11 +551,11 @@ herr_t H5IMlink_palette( hid_t loc_id, if ( (attr_space_id = H5Screate( H5S_SCALAR )) < 0 ) goto out; - + /* Create the attribute type for the reference */ if ( (attr_type = H5Tcopy( H5T_STD_REF_OBJ )) < 0 ) goto out; - + /* Create the attribute "PALETTE" to be attached to the image*/ if ( (attr_id = H5Acreate( image_id, "PALETTE", attr_type, attr_space_id, H5P_DEFAULT )) < 0 ) goto out; @@ -581,7 +581,7 @@ herr_t H5IMlink_palette( hid_t loc_id, if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -615,7 +615,7 @@ herr_t H5IMlink_palette( hid_t loc_id, goto out; /* Create a new reference for this palette. */ - if ( H5Rcreate( &ref, loc_id, pal_name, H5R_OBJECT, -1 ) < 0 ) + if ( H5Rcreate( &ref, loc_id, pal_name, H5R_OBJECT, -1 ) < 0 ) goto out; refbuf[n_refs] = ref; @@ -636,22 +636,22 @@ herr_t H5IMlink_palette( hid_t loc_id, goto out; free( refbuf ); - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; } - + /* Close the image dataset. */ if ( H5Dclose( image_id ) < 0 ) return -1; - + return 0; out: @@ -673,7 +673,7 @@ out: * Date: September 10, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -681,10 +681,10 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMunlink_palette( hid_t loc_id, - const char *image_name, - const char *pal_name ) -{ +herr_t H5IMunlink_palette( hid_t loc_id, + const char *image_name, + const char *pal_name ) +{ hid_t image_id; hid_t attr_type; hid_t attr_id; @@ -693,17 +693,17 @@ herr_t H5IMunlink_palette( hid_t loc_id, /* Try to find the palette dataset */ has_pal = H5LTfind_dataset( loc_id, pal_name ); - + /* It does not exist. Return */ if ( has_pal == 0 ) return -1; - /* The image dataset may or not have the attribute "PALETTE" + /* The image dataset may or not have the attribute "PALETTE" * First we try to open to see if it is already there; if not, it is created. - * If it exists, the array of references is extended to hold the reference + * If it exists, the array of references is extended to hold the reference * to the new palette */ - + /* First we get the image id */ if ( (image_id = H5Dopen( loc_id, image_name )) < 0 ) return -1; @@ -720,7 +720,7 @@ herr_t H5IMunlink_palette( hid_t loc_id, { if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -735,21 +735,21 @@ herr_t H5IMunlink_palette( hid_t loc_id, if ( H5Adelete( image_id, "PALETTE" ) < 0 ) goto out; - } /* H5T_REFERENCE */ + } /* H5T_REFERENCE */ - if ( H5Tclose( attr_type ) < 0 ) + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; } /* ok_pal */ - + /* Close the image dataset. */ if ( H5Dclose( image_id ) < 0 ) return -1; - + return 0; out: @@ -776,8 +776,8 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMget_npalettes( hid_t loc_id, - const char *image_name, +herr_t H5IMget_npalettes( hid_t loc_id, + const char *image_name, hssize_t *npals ) { hid_t image_id; @@ -802,7 +802,7 @@ herr_t H5IMget_npalettes( hid_t loc_id, if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -820,13 +820,13 @@ herr_t H5IMget_npalettes( hid_t loc_id, if ( H5Sclose( attr_space_id ) < 0 ) goto out; - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; @@ -843,7 +843,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5IMget_palette_info @@ -857,7 +857,7 @@ out: * Date: July 22, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -865,7 +865,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMget_palette_info( hid_t loc_id, +herr_t H5IMget_palette_info( hid_t loc_id, const char *image_name, int pal_number, hsize_t *pal_dims ) @@ -895,7 +895,7 @@ herr_t H5IMget_palette_info( hid_t loc_id, if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -931,7 +931,7 @@ herr_t H5IMget_palette_info( hid_t loc_id, if ( H5Sget_simple_extent_ndims( pal_space_id ) < 0 ) goto out; - + if ( H5Sget_simple_extent_dims( pal_space_id, pal_dims, pal_maxdims ) < 0 ) goto out; @@ -946,18 +946,18 @@ herr_t H5IMget_palette_info( hid_t loc_id, goto out; free( refbuf ); - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; } - + /* Close the image dataset. */ if ( H5Dclose( image_id ) < 0 ) return -1; @@ -969,7 +969,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5IMget_palette @@ -983,7 +983,7 @@ out: * Date: August 30, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -991,7 +991,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMget_palette( hid_t loc_id, +herr_t H5IMget_palette( hid_t loc_id, const char *image_name, int pal_number, unsigned char *pal_data ) @@ -1019,7 +1019,7 @@ herr_t H5IMget_palette( hid_t loc_id, if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -1059,13 +1059,13 @@ herr_t H5IMget_palette( hid_t loc_id, goto out; free( refbuf ); - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; } @@ -1081,7 +1081,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5IMis_image * @@ -1094,7 +1094,7 @@ out: * Date: August 30, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -1102,7 +1102,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMis_image( hid_t loc_id, +herr_t H5IMis_image( hid_t loc_id, const char *dset_name ) { hid_t did; @@ -1133,7 +1133,7 @@ herr_t H5IMis_image( hid_t loc_id, if ( (attr_id = H5Aopen_name( did, "CLASS" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -1143,12 +1143,12 @@ herr_t H5IMis_image( hid_t loc_id, if ( H5Aread( attr_id, attr_type, attr_data ) < 0 ) goto out; - if( strcmp( attr_data, IMAGE_CLASS ) == 0 ) + if( strcmp( attr_data, IMAGE_CLASS ) == 0 ) ret = 1; else ret = 0; - - if ( H5Tclose( attr_type ) < 0 ) + + if ( H5Tclose( attr_type ) < 0 ) goto out; if ( H5Aclose( attr_id ) < 0 ) @@ -1180,7 +1180,7 @@ out: * Date: August 30, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -1188,7 +1188,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMis_palette( hid_t loc_id, +herr_t H5IMis_palette( hid_t loc_id, const char *dset_name ) { hid_t did; @@ -1219,7 +1219,7 @@ herr_t H5IMis_palette( hid_t loc_id, if ( (attr_id = H5Aopen_name( did, "CLASS" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -1229,12 +1229,12 @@ herr_t H5IMis_palette( hid_t loc_id, if ( H5Aread( attr_id, attr_type, attr_data ) < 0 ) goto out; - if( strcmp( attr_data, PALETTE_CLASS ) == 0 ) + if( strcmp( attr_data, PALETTE_CLASS ) == 0 ) ret = 1; else ret = 0; - - if ( H5Tclose( attr_type ) < 0 ) + + if ( H5Tclose( attr_type ) < 0 ) goto out; if ( H5Aclose( attr_id ) < 0 ) diff --git a/hl/src/H5IM.h b/hl/src/H5IM.h index b2d96ad..a18434f 100644 --- a/hl/src/H5IM.h +++ b/hl/src/H5IM.h @@ -28,69 +28,69 @@ extern "C" { #define IMAGE24_RANK 3 -H5_HLDLL herr_t H5IMmake_image_8bit( hid_t loc_id, - const char *dset_name, +H5_HLDLL herr_t H5IMmake_image_8bit( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const unsigned char *buffer ); -H5_HLDLL herr_t H5IMmake_image_24bit( hid_t loc_id, - const char *dset_name, +H5_HLDLL herr_t H5IMmake_image_24bit( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const char *interlace, const unsigned char *buffer ); -H5_HLDLL herr_t H5IMget_image_info( hid_t loc_id, - const char *dset_name, +H5_HLDLL herr_t H5IMget_image_info( hid_t loc_id, + const char *dset_name, hsize_t *width, hsize_t *height, hsize_t *planes, char *interlace, hssize_t *npals ); -H5_HLDLL herr_t H5IMread_image( hid_t loc_id, - const char *dset_name, +H5_HLDLL herr_t H5IMread_image( hid_t loc_id, + const char *dset_name, unsigned char *buffer ); -H5_HLDLL herr_t H5IMmake_palette( hid_t loc_id, +H5_HLDLL herr_t H5IMmake_palette( hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, const unsigned char *pal_data ); -H5_HLDLL herr_t H5IMlink_palette( hid_t loc_id, - const char *image_name, +H5_HLDLL herr_t H5IMlink_palette( hid_t loc_id, + const char *image_name, const char *pal_name ); -H5_HLDLL herr_t H5IMunlink_palette( hid_t loc_id, - const char *image_name, +H5_HLDLL herr_t H5IMunlink_palette( hid_t loc_id, + const char *image_name, const char *pal_name ); -H5_HLDLL herr_t H5IMget_npalettes( hid_t loc_id, - const char *image_name, +H5_HLDLL herr_t H5IMget_npalettes( hid_t loc_id, + const char *image_name, hssize_t *npals ); -H5_HLDLL herr_t H5IMget_palette_info( hid_t loc_id, - const char *image_name, +H5_HLDLL herr_t H5IMget_palette_info( hid_t loc_id, + const char *image_name, int pal_number, hsize_t *pal_dims ); -H5_HLDLL herr_t H5IMget_palette( hid_t loc_id, +H5_HLDLL herr_t H5IMget_palette( hid_t loc_id, const char *image_name, int pal_number, unsigned char *pal_data ); -H5_HLDLL herr_t H5IMis_image( hid_t loc_id, +H5_HLDLL herr_t H5IMis_image( hid_t loc_id, const char *dset_name ); -H5_HLDLL herr_t H5IMis_palette( hid_t loc_id, +H5_HLDLL herr_t H5IMis_palette( hid_t loc_id, const char *dset_name ); H5_HLDLL herr_t H5IM_find_palette(hid_t loc_id ); - + #ifdef __cplusplus diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index bdd76ef..aab6a37 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -15,23 +15,23 @@ #include <stdlib.h> /*------------------------------------------------------------------------- - * + * * internal functions - * + * *------------------------------------------------------------------------- */ -herr_t H5LT_open_id( hid_t loc_id, - const char *obj_name, +herr_t H5LT_open_id( hid_t loc_id, + const char *obj_name, int obj_type ); herr_t H5LT_close_id( hid_t obj_id, int obj_type ); /*------------------------------------------------------------------------- - * + * * Public functions - * + * *------------------------------------------------------------------------- */ @@ -54,16 +54,16 @@ herr_t H5LT_close_id( hid_t obj_id, *------------------------------------------------------------------------- */ -herr_t H5LTmake_dataset( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, hid_t tid, - const void *data ) + const void *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -74,7 +74,7 @@ herr_t H5LTmake_dataset( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -84,7 +84,7 @@ herr_t H5LTmake_dataset( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -115,15 +115,15 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTmake_dataset_char( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_char( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const char *data ) + const char *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -134,7 +134,7 @@ herr_t H5LTmake_dataset_char( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -144,7 +144,7 @@ herr_t H5LTmake_dataset_char( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -177,15 +177,15 @@ out: */ -herr_t H5LTmake_dataset_short( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_short( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const short *data ) + const short *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -196,7 +196,7 @@ herr_t H5LTmake_dataset_short( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -206,7 +206,7 @@ herr_t H5LTmake_dataset_short( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -238,15 +238,15 @@ out: */ -herr_t H5LTmake_dataset_int( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_int( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const int *data ) + const int *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -257,7 +257,7 @@ herr_t H5LTmake_dataset_int( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -267,7 +267,7 @@ herr_t H5LTmake_dataset_int( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -301,15 +301,15 @@ out: */ -herr_t H5LTmake_dataset_long( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_long( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const long *data ) + const long *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -320,7 +320,7 @@ herr_t H5LTmake_dataset_long( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -330,7 +330,7 @@ herr_t H5LTmake_dataset_long( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -362,15 +362,15 @@ out: */ -herr_t H5LTmake_dataset_float( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_float( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const float *data ) + const float *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -381,7 +381,7 @@ herr_t H5LTmake_dataset_float( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -391,7 +391,7 @@ herr_t H5LTmake_dataset_float( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -425,15 +425,15 @@ out: */ -herr_t H5LTmake_dataset_double( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_double( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const double *data ) + const double *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -444,7 +444,7 @@ herr_t H5LTmake_dataset_double( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -454,7 +454,7 @@ herr_t H5LTmake_dataset_double( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -487,12 +487,12 @@ out: */ -herr_t H5LTmake_dataset_string(hid_t loc_id, - const char *dset_name, - const char *buf ) +herr_t H5LTmake_dataset_string(hid_t loc_id, + const char *dset_name, + const char *buf ) { - hid_t did=-1; + hid_t did=-1; hid_t sid=-1; hid_t tid; size_t size; @@ -508,7 +508,7 @@ herr_t H5LTmake_dataset_string(hid_t loc_id, if ( H5Tset_strpad(tid,H5T_STR_NULLTERM ) < 0 ) goto out; - + /* Create the data space for the dataset. */ if ( (sid = H5Screate( H5S_SCALAR )) < 0 ) goto out; @@ -519,7 +519,7 @@ herr_t H5LTmake_dataset_string(hid_t loc_id, /* Write the dataset only if there is data to write */ - if (buf) + if (buf) { if ( H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0 ) goto out; @@ -557,12 +557,12 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset( hid_t loc_id, +herr_t H5LTread_dataset( hid_t loc_id, const char *dset_name, hid_t tid, void *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -583,7 +583,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5LTread_dataset_char @@ -599,11 +599,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_char( hid_t loc_id, +herr_t H5LTread_dataset_char( hid_t loc_id, const char *dset_name, char *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -639,11 +639,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_short( hid_t loc_id, +herr_t H5LTread_dataset_short( hid_t loc_id, const char *dset_name, short *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -679,11 +679,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_int( hid_t loc_id, +herr_t H5LTread_dataset_int( hid_t loc_id, const char *dset_name, int *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -719,11 +719,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_long( hid_t loc_id, +herr_t H5LTread_dataset_long( hid_t loc_id, const char *dset_name, long *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -759,11 +759,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_float( hid_t loc_id, +herr_t H5LTread_dataset_float( hid_t loc_id, const char *dset_name, float *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -800,11 +800,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_double( hid_t loc_id, +herr_t H5LTread_dataset_double( hid_t loc_id, const char *dset_name, double *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -841,11 +841,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_string( hid_t loc_id, +herr_t H5LTread_dataset_string( hid_t loc_id, const char *dset_name, char *buf ) { - hid_t did; + hid_t did; hid_t tid; /* Open the dataset. */ @@ -889,12 +889,12 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTget_dataset_ndims( hid_t loc_id, +herr_t H5LTget_dataset_ndims( hid_t loc_id, const char *dset_name, int *rank ) { - hid_t did; - hid_t sid; + hid_t did; + hid_t sid; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -940,15 +940,15 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTget_dataset_info( hid_t loc_id, +herr_t H5LTget_dataset_info( hid_t loc_id, const char *dset_name, hsize_t *dims, H5T_class_t *type_class, size_t *type_size ) { - hid_t did; + hid_t did; hid_t tid; - hid_t sid; + hid_t sid; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -1011,42 +1011,42 @@ out: static herr_t find_dataset( hid_t loc_id, const char *name, void *op_data) { - /* Define a default zero value for return. This will cause the iterator to continue if + /* Define a default zero value for return. This will cause the iterator to continue if * the dataset is not found yet. */ - int ret = 0; + int ret = 0; char *dset_name = (char*)op_data; - + /* Shut the compiler up */ loc_id=loc_id; - /* Define a positive value for return value if the dataset was found. This will - * cause the iterator to immediately return that positive value, - * indicating short-circuit success + /* Define a positive value for return value if the dataset was found. This will + * cause the iterator to immediately return that positive value, + * indicating short-circuit success */ - if( strcmp( name, dset_name ) == 0 ) + if( strcmp( name, dset_name ) == 0 ) ret = 1; return ret; -} +} /*------------------------------------------------------------------------- * Function: H5LTfind_dataset * - * Purpose: Inquires if a dataset named dset_name exists attached + * Purpose: Inquires if a dataset named dset_name exists attached * to the object loc_id. * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: July 15, 2001 * - * Return: + * 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. @@ -1058,7 +1058,7 @@ static herr_t find_dataset( hid_t loc_id, const char *name, void *op_data) *------------------------------------------------------------------------- */ -herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) +herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) { herr_t ret; @@ -1070,17 +1070,17 @@ herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) /*------------------------------------------------------------------------- - * + * * Set attribute functions - * + * *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * Function: H5LTset_attribute_string * - * Purpose: Creates and writes a string attribute named attr_name and attaches + * Purpose: Creates and writes a string attribute named attr_name and attaches * it to the object specified by the name obj_name. * * Return: Success: 0, Failure: -1 @@ -1096,20 +1096,20 @@ herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_string( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_string( hid_t loc_id, + const char *obj_name, const char *attr_name, - const char *attr_data ) + const char *attr_data ) { hid_t attr_type; hid_t attr_space_id; hid_t attr_id; - hid_t obj_id; + hid_t obj_id; int has_attr; H5G_stat_t statbuf; size_t attr_size; - + /* Get the type of object */ if (H5Gget_objinfo( loc_id, obj_name, 1, &statbuf )<0) return -1; @@ -1150,10 +1150,10 @@ herr_t H5LTset_attribute_string( hid_t loc_id, if ( H5Awrite( attr_id, attr_type, attr_data ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; - + if ( H5Sclose( attr_space_id ) < 0 ) goto out; @@ -1193,23 +1193,23 @@ out: */ -herr_t H5LT_set_attribute_numerical( hid_t loc_id, - const char *obj_name, +herr_t H5LT_set_attribute_numerical( hid_t loc_id, + const char *obj_name, const char *attr_name, size_t size, hid_t tid, - const void *data ) + const void *data ) { - hid_t obj_id, sid, attr_id; + hid_t obj_id, sid, attr_id; hsize_t dim_size=size; int has_attr; H5G_stat_t statbuf; - + /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -1271,17 +1271,17 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LT_open_id( hid_t loc_id, - const char *obj_name, - int obj_type /*basic object type*/ ) +herr_t H5LT_open_id( hid_t loc_id, + const char *obj_name, + int obj_type /*basic object type*/ ) { - hid_t obj_id = -1; - + hid_t obj_id = -1; + switch ( obj_type ) { case H5G_DATASET: - + /* Open the dataset. */ if ( (obj_id = H5Dopen( loc_id, obj_name )) < 0 ) return -1; @@ -1295,10 +1295,10 @@ herr_t H5LT_open_id( hid_t loc_id, break; default: - return -1; + return -1; } - return obj_id; + return obj_id; } @@ -1320,27 +1320,27 @@ herr_t H5LT_open_id( hid_t loc_id, */ herr_t H5LT_close_id( hid_t obj_id, - int obj_type /*basic object type*/ ) + int obj_type /*basic object type*/ ) { switch ( obj_type ) { case H5G_DATASET: /* Close the dataset. */ if ( H5Dclose( obj_id ) < 0 ) - return -1; + return -1; break; case H5G_GROUP: /* Close the group. */ if ( H5Gclose( obj_id ) < 0 ) - return -1; + return -1; break; default: - return -1; + return -1; } - return 0; + return 0; } @@ -1360,14 +1360,14 @@ herr_t H5LT_close_id( hid_t obj_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_char( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_char( hid_t loc_id, + const char *obj_name, const char *attr_name, const char *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_CHAR, data ) < 0 ) return -1; @@ -1390,14 +1390,14 @@ herr_t H5LTset_attribute_char( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_uchar( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_uchar( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned char *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_UCHAR, data ) < 0 ) return -1; @@ -1421,14 +1421,14 @@ herr_t H5LTset_attribute_uchar( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_short( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_short( hid_t loc_id, + const char *obj_name, const char *attr_name, const short *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_SHORT, data ) < 0 ) return -1; @@ -1452,14 +1452,14 @@ herr_t H5LTset_attribute_short( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_ushort( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_ushort( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned short *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_USHORT, data ) < 0 ) return -1; @@ -1483,14 +1483,14 @@ herr_t H5LTset_attribute_ushort( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_int( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_int( hid_t loc_id, + const char *obj_name, const char *attr_name, const int *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_INT, data ) < 0 ) return -1; @@ -1514,14 +1514,14 @@ herr_t H5LTset_attribute_int( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_uint( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_uint( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned int *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_UINT, data ) < 0 ) return -1; @@ -1546,14 +1546,14 @@ herr_t H5LTset_attribute_uint( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_long( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_long( hid_t loc_id, + const char *obj_name, const char *attr_name, const long *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_LONG, data ) < 0 ) return -1; @@ -1576,14 +1576,14 @@ herr_t H5LTset_attribute_long( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_long_long( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_long_long( hid_t loc_id, + const char *obj_name, const char *attr_name, const long_long *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_LLONG, data ) < 0 ) return -1; @@ -1608,14 +1608,14 @@ herr_t H5LTset_attribute_long_long( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_ulong( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_ulong( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned long *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_ULONG, data ) < 0 ) return -1; @@ -1641,14 +1641,14 @@ herr_t H5LTset_attribute_ulong( hid_t loc_id, */ -herr_t H5LTset_attribute_float( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_float( hid_t loc_id, + const char *obj_name, const char *attr_name, const float *data, size_t size ) { - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_FLOAT, data ) < 0 ) return -1; @@ -1673,14 +1673,14 @@ herr_t H5LTset_attribute_float( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_double( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_double( hid_t loc_id, + const char *obj_name, const char *attr_name, const double *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_DOUBLE, data ) < 0 ) return -1; @@ -1709,28 +1709,28 @@ herr_t H5LTset_attribute_double( hid_t loc_id, static herr_t find_attr( hid_t loc_id, const char *name, void *op_data) { - /* Define a default zero value for return. This will cause the iterator to continue if + /* Define a default zero value for return. This will cause the iterator to continue if * the palette attribute is not found yet. */ - int ret = 0; + int ret = 0; char *attr_name = (char*)op_data; - + /* Shut the compiler up */ loc_id=loc_id; - /* Define a positive value for return value if the attribute was found. This will - * cause the iterator to immediately return that positive value, - * indicating short-circuit success + /* Define a positive value for return value if the attribute was found. This will + * cause the iterator to immediately return that positive value, + * indicating short-circuit success */ - if( strcmp( name, attr_name ) == 0 ) + if( strcmp( name, attr_name ) == 0 ) ret = 1; return ret; -} +} /*------------------------------------------------------------------------- @@ -1745,7 +1745,7 @@ static herr_t find_attr( hid_t loc_id, const char *name, void *op_data) * Comments: * The function uses H5Aiterate with the operator function find_attr * - * Return: + * 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. @@ -1757,10 +1757,10 @@ static herr_t find_attr( hid_t loc_id, const char *name, void *op_data) *------------------------------------------------------------------------- */ -herr_t H5LT_find_attribute( hid_t loc_id, const char* attr_name ) +herr_t H5LT_find_attribute( hid_t loc_id, const char* attr_name ) { - unsigned int attr_num; + unsigned int attr_num; herr_t ret; attr_num = 0; @@ -1785,16 +1785,16 @@ herr_t H5LT_find_attribute( hid_t loc_id, const char* attr_name ) *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_ndims( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_ndims( hid_t loc_id, + const char *obj_name, const char *attr_name, int *rank ) { - hid_t attr_id; - hid_t sid; + hid_t attr_id; + hid_t sid; H5G_stat_t statbuf; - hid_t obj_id; - + hid_t obj_id; + /* Get the type of object */ if (H5Gget_objinfo( loc_id, obj_name, 1, &statbuf )<0) return -1; @@ -1854,19 +1854,19 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_info( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_info( hid_t loc_id, + const char *obj_name, const char *attr_name, hsize_t *dims, H5T_class_t *type_class, size_t *type_size ) { - hid_t attr_id; + hid_t attr_id; hid_t tid; - hid_t sid; + hid_t sid; H5G_stat_t statbuf; - hid_t obj_id; - + hid_t obj_id; + /* Get the type of object */ if (H5Gget_objinfo( loc_id, obj_name, 1, &statbuf )<0) return -1; @@ -1936,7 +1936,7 @@ out: /*------------------------------------------------------------------------- * Function: H5LTcreate_compound_type * - * Purpose: + * Purpose: * * Return: Success: 0, Failure: -1 * @@ -1952,19 +1952,19 @@ out: *------------------------------------------------------------------------- */ -hid_t H5LTcreate_compound_type( hsize_t nfields, size_t size, const char *field_names[], - const size_t *field_offset, const hid_t *field_types ) +hid_t H5LTcreate_compound_type( hsize_t nfields, size_t size, const char *field_names[], + const size_t *field_offset, const hid_t *field_types ) { - hid_t tid; + hid_t tid; hsize_t i; - + /* Create the memory data type. */ if ((tid = H5Tcreate (H5T_COMPOUND, size )) < 0 ) goto out; /* Insert fields. */ - for ( i = 0; i < nfields; i++) + for ( i = 0; i < nfields; i++) { if ( H5Tinsert(tid, field_names[i], field_offset[i], field_types[i] ) < 0 ) goto out; @@ -1984,7 +1984,7 @@ out: * Function: H5LTrepack * * Purpose: Packs/Unpacks data from buffers. This function transfers data from a packed - * data, src_buf, to a "natural byte aligned" (an n-byte item at an n-byte boundary) + * data, src_buf, to a "natural byte aligned" (an n-byte item at an n-byte boundary) * data, dst_buf, and vice-versa. * * Return: Success: 0, Failure: -1 @@ -1993,7 +1993,7 @@ out: * * Date: January 17, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -2001,16 +2001,16 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTrepack( hsize_t nfields, - hsize_t nrecords, - size_t src_size, - const size_t *src_offset, - const size_t *src_sizes, - size_t dst_size, - const size_t *dst_offset, +herr_t H5LTrepack( hsize_t nfields, + hsize_t nrecords, + size_t src_size, + const size_t *src_offset, + const size_t *src_sizes, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, - unsigned char *src_buf, - unsigned char *dst_buf ) + unsigned char *src_buf, + unsigned char *dst_buf ) { hsize_t i, j; /* size of each field of destination data counting with padding */ @@ -2042,12 +2042,12 @@ herr_t H5LTrepack( hsize_t nfields, src_buf += src_sizes[j]; } - + } - + if ( size_pad != NULL ) free( size_pad ); - + return 0; out: @@ -2057,9 +2057,9 @@ out: /*------------------------------------------------------------------------- - * + * * Get attribute functions - * + * *------------------------------------------------------------------------- */ @@ -2083,10 +2083,10 @@ out: */ -herr_t H5LTget_attribute_string( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_string( hid_t loc_id, + const char *obj_name, const char *attr_name, - char *data ) + char *data ) { /* identifiers */ @@ -2096,7 +2096,7 @@ herr_t H5LTget_attribute_string( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2130,10 +2130,10 @@ herr_t H5LTget_attribute_string( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_char( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_char( hid_t loc_id, + const char *obj_name, const char *attr_name, - char *data ) + char *data ) { /* identifiers */ @@ -2143,7 +2143,7 @@ herr_t H5LTget_attribute_char( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2177,10 +2177,10 @@ herr_t H5LTget_attribute_char( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_uchar( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_uchar( hid_t loc_id, + const char *obj_name, const char *attr_name, - unsigned char *data ) + unsigned char *data ) { /* identifiers */ @@ -2190,7 +2190,7 @@ herr_t H5LTget_attribute_uchar( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2226,10 +2226,10 @@ herr_t H5LTget_attribute_uchar( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_short( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_short( hid_t loc_id, + const char *obj_name, const char *attr_name, - short *data ) + short *data ) { /* identifiers */ @@ -2239,7 +2239,7 @@ herr_t H5LTget_attribute_short( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2273,10 +2273,10 @@ herr_t H5LTget_attribute_short( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_ushort( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_ushort( hid_t loc_id, + const char *obj_name, const char *attr_name, - unsigned short *data ) + unsigned short *data ) { /* identifiers */ @@ -2286,7 +2286,7 @@ herr_t H5LTget_attribute_ushort( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2322,10 +2322,10 @@ herr_t H5LTget_attribute_ushort( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_int( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_int( hid_t loc_id, + const char *obj_name, const char *attr_name, - int *data ) + int *data ) { /* identifiers */ @@ -2335,7 +2335,7 @@ herr_t H5LTget_attribute_int( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2369,10 +2369,10 @@ herr_t H5LTget_attribute_int( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_uint( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_uint( hid_t loc_id, + const char *obj_name, const char *attr_name, - unsigned int *data ) + unsigned int *data ) { /* identifiers */ @@ -2382,7 +2382,7 @@ herr_t H5LTget_attribute_uint( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2418,10 +2418,10 @@ herr_t H5LTget_attribute_uint( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_long( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_long( hid_t loc_id, + const char *obj_name, const char *attr_name, - long *data ) + long *data ) { /* identifiers */ @@ -2431,7 +2431,7 @@ herr_t H5LTget_attribute_long( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2464,10 +2464,10 @@ herr_t H5LTget_attribute_long( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_long_long( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_long_long( hid_t loc_id, + const char *obj_name, const char *attr_name, - long_long *data ) + long_long *data ) { /* identifiers */ @@ -2477,7 +2477,7 @@ herr_t H5LTget_attribute_long_long( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2512,10 +2512,10 @@ herr_t H5LTget_attribute_long_long( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_ulong( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_ulong( hid_t loc_id, + const char *obj_name, const char *attr_name, - unsigned long *data ) + unsigned long *data ) { /* identifiers */ @@ -2525,7 +2525,7 @@ herr_t H5LTget_attribute_ulong( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2562,10 +2562,10 @@ herr_t H5LTget_attribute_ulong( hid_t loc_id, */ -herr_t H5LTget_attribute_float( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_float( hid_t loc_id, + const char *obj_name, const char *attr_name, - float *data ) + float *data ) { /* identifiers */ @@ -2575,7 +2575,7 @@ herr_t H5LTget_attribute_float( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2612,10 +2612,10 @@ herr_t H5LTget_attribute_float( hid_t loc_id, */ -herr_t H5LTget_attribute_double( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_double( hid_t loc_id, + const char *obj_name, const char *attr_name, - double *data ) + double *data ) { /* identifiers */ @@ -2625,7 +2625,7 @@ herr_t H5LTget_attribute_double( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2662,11 +2662,11 @@ herr_t H5LTget_attribute_double( hid_t loc_id, */ -herr_t H5LTget_attribute( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute( hid_t loc_id, + const char *obj_name, const char *attr_name, hid_t mem_type_id, - void *data ) + void *data ) { /* identifiers */ @@ -2676,7 +2676,7 @@ herr_t H5LTget_attribute( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2695,7 +2695,7 @@ herr_t H5LTget_attribute( hid_t loc_id, return 0; } - + /*------------------------------------------------------------------------- * private functions *------------------------------------------------------------------------- @@ -2721,10 +2721,10 @@ herr_t H5LTget_attribute( hid_t loc_id, */ -herr_t H5LT_get_attribute_mem( hid_t obj_id, +herr_t H5LT_get_attribute_mem( hid_t obj_id, const char *attr_name, hid_t mem_type_id, - void *data ) + void *data ) { /* identifiers */ @@ -2764,9 +2764,9 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LT_get_attribute_disk( hid_t loc_id, +herr_t H5LT_get_attribute_disk( hid_t loc_id, const char *attr_name, - void *attr_out ) + void *attr_out ) { /* identifiers */ hid_t attr_id; @@ -2780,7 +2780,7 @@ herr_t H5LT_get_attribute_disk( hid_t loc_id, if ( H5Aread( attr_id, attr_type, attr_out ) < 0 ) goto out; - + if ( H5Tclose( attr_type ) < 0 ) goto out; @@ -2818,26 +2818,26 @@ out: */ -herr_t H5LT_set_attribute_string(hid_t dset_id, +herr_t H5LT_set_attribute_string(hid_t dset_id, char *name, - char *buf ) + char *buf ) { hid_t tid; hid_t sid; hid_t aid; int has_attr; size_t size; - + /* verify if the attribute already exists */ has_attr = H5LT_find_attribute(dset_id,name); - + /* the attribute already exists, delete it */ if ( has_attr == 1 ) { if ( H5Adelete(dset_id,name)<0) return FAIL; } - + /*------------------------------------------------------------------------- * create the attribute type *------------------------------------------------------------------------- @@ -2856,7 +2856,7 @@ herr_t H5LT_set_attribute_string(hid_t dset_id, if ((sid = H5Screate(H5S_SCALAR))<0) goto out; - + /*------------------------------------------------------------------------- * create and write the attribute *------------------------------------------------------------------------- @@ -2866,10 +2866,10 @@ herr_t H5LT_set_attribute_string(hid_t dset_id, if (H5Awrite(aid,tid,buf)<0) goto out; - + if (H5Aclose(aid)<0) goto out; - + if (H5Sclose(sid)<0) goto out; @@ -2877,7 +2877,7 @@ herr_t H5LT_set_attribute_string(hid_t dset_id, goto out; return SUCCESS; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -2886,6 +2886,6 @@ out: H5Sclose(sid); } H5E_END_TRY; return FAIL; - + } diff --git a/hl/src/H5LT.h b/hl/src/H5LT.h index 53b97ba..c9d6269 100644 --- a/hl/src/H5LT.h +++ b/hl/src/H5LT.h @@ -46,51 +46,51 @@ extern "C" { *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5LTmake_dataset( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, hid_t type_id, const void *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_char( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_char( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const char *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_short( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_short( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const short *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_int( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_int( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const int *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_long( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_long( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const long *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_float( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_float( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const float *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_double( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_double( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const double *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_string( hid_t loc_id, - const char *dset_name, +H5_HLDLL herr_t H5LTmake_dataset_string( hid_t loc_id, + const char *dset_name, const char *buf ); @@ -101,36 +101,36 @@ H5_HLDLL herr_t H5LTmake_dataset_string( hid_t loc_id, *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5LTread_dataset( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset( hid_t loc_id, const char *dset_name, hid_t type_id, void *buffer ); -H5_HLDLL herr_t H5LTread_dataset_char( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_char( hid_t loc_id, const char *dset_name, char *buffer ); -H5_HLDLL herr_t H5LTread_dataset_short( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_short( hid_t loc_id, const char *dset_name, short *buffer ); -H5_HLDLL herr_t H5LTread_dataset_int( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_int( hid_t loc_id, const char *dset_name, int *buffer ); -H5_HLDLL herr_t H5LTread_dataset_long( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_long( hid_t loc_id, const char *dset_name, long *buffer ); -H5_HLDLL herr_t H5LTread_dataset_float( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_float( hid_t loc_id, const char *dset_name, float *buffer ); -H5_HLDLL herr_t H5LTread_dataset_double( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_double( hid_t loc_id, const char *dset_name, double *buffer ); -H5_HLDLL herr_t H5LTread_dataset_string( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_string( hid_t loc_id, const char *dset_name, char *buf ); @@ -142,17 +142,17 @@ H5_HLDLL herr_t H5LTread_dataset_string( hid_t loc_id, */ -H5_HLDLL herr_t H5LTget_dataset_ndims( hid_t loc_id, +H5_HLDLL herr_t H5LTget_dataset_ndims( hid_t loc_id, const char *dset_name, int *rank ); -H5_HLDLL herr_t H5LTget_dataset_info( hid_t loc_id, +H5_HLDLL herr_t H5LTget_dataset_info( hid_t loc_id, const char *dset_name, hsize_t *dims, H5T_class_t *type_class, size_t *type_size ); -H5_HLDLL herr_t H5LTfind_dataset( hid_t loc_id, const char *name ); +H5_HLDLL herr_t H5LTfind_dataset( hid_t loc_id, const char *name ); @@ -164,73 +164,73 @@ H5_HLDLL herr_t H5LTfind_dataset( hid_t loc_id, const char *name ); */ -H5_HLDLL herr_t H5LTset_attribute_string( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_string( hid_t loc_id, + const char *obj_name, const char *attr_name, const char *attr_data ); -H5_HLDLL herr_t H5LTset_attribute_char( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_char( hid_t loc_id, + const char *obj_name, const char *attr_name, const char *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_uchar( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_uchar( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned char *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_short( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_short( hid_t loc_id, + const char *obj_name, const char *attr_name, const short *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_ushort( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_ushort( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned short *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_int( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_int( hid_t loc_id, + const char *obj_name, const char *attr_name, const int *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_uint( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_uint( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned int *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_long( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_long( hid_t loc_id, + const char *obj_name, const char *attr_name, const long *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_long_long( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_long_long( hid_t loc_id, + const char *obj_name, const char *attr_name, const long_long *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_ulong( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_ulong( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned long *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_float( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_float( hid_t loc_id, + const char *obj_name, const char *attr_name, const float *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_double( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_double( hid_t loc_id, + const char *obj_name, const char *attr_name, const double *buffer, size_t size ); @@ -242,69 +242,69 @@ H5_HLDLL herr_t H5LTset_attribute_double( hid_t loc_id, *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5LTget_attribute( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute( hid_t loc_id, + const char *obj_name, const char *attr_name, hid_t mem_type_id, void *data ); -H5_HLDLL herr_t H5LTget_attribute_string( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_string( hid_t loc_id, + const char *obj_name, const char *attr_name, char *data ); -H5_HLDLL herr_t H5LTget_attribute_char( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_char( hid_t loc_id, + const char *obj_name, const char *attr_name, char *data ); -H5_HLDLL herr_t H5LTget_attribute_uchar( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_uchar( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned char *data ); -H5_HLDLL herr_t H5LTget_attribute_short( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_short( hid_t loc_id, + const char *obj_name, const char *attr_name, short *data ); -H5_HLDLL herr_t H5LTget_attribute_ushort( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_ushort( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned short *data ); -H5_HLDLL herr_t H5LTget_attribute_int( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_int( hid_t loc_id, + const char *obj_name, const char *attr_name, int *data ); -H5_HLDLL herr_t H5LTget_attribute_uint( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_uint( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned int *data ); -H5_HLDLL herr_t H5LTget_attribute_long( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_long( hid_t loc_id, + const char *obj_name, const char *attr_name, long *data ); -H5_HLDLL herr_t H5LTget_attribute_long_long( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_long_long( hid_t loc_id, + const char *obj_name, const char *attr_name, long_long *data ); -H5_HLDLL herr_t H5LTget_attribute_ulong( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_ulong( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned long *data ); -H5_HLDLL herr_t H5LTget_attribute_float( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_float( hid_t loc_id, + const char *obj_name, const char *attr_name, float *data ); -H5_HLDLL herr_t H5LTget_attribute_double( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_double( hid_t loc_id, + const char *obj_name, const char *attr_name, double *data ); @@ -317,13 +317,13 @@ H5_HLDLL herr_t H5LTget_attribute_double( hid_t loc_id, */ -H5_HLDLL herr_t H5LTget_attribute_ndims( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_ndims( hid_t loc_id, + const char *obj_name, const char *attr_name, int *rank ); -H5_HLDLL herr_t H5LTget_attribute_info( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_info( hid_t loc_id, + const char *obj_name, const char *attr_name, hsize_t *dims, H5T_class_t *type_class, @@ -341,51 +341,51 @@ H5_HLDLL herr_t H5LTget_attribute_info( hid_t loc_id, */ -H5_HLDLL hid_t H5LTcreate_compound_type( hsize_t nfields, size_t size, const char *field_names[], +H5_HLDLL hid_t H5LTcreate_compound_type( hsize_t nfields, size_t size, const char *field_names[], const size_t *field_offset, const hid_t *field_types ); -H5_HLDLL herr_t H5LTrepack( hsize_t nfields, - hsize_t nrecords, - size_t src_size, - const size_t *src_offset, - const size_t *src_sizes, - size_t dst_size, - const size_t *dst_offset, +H5_HLDLL herr_t H5LTrepack( hsize_t nfields, + hsize_t nrecords, + size_t src_size, + const size_t *src_offset, + const size_t *src_sizes, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, - unsigned char *src_buf, + unsigned char *src_buf, unsigned char *dst_buf ); /*------------------------------------------------------------------------- - * + * * Private functions - * + * *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5LT_get_attribute_mem( hid_t obj_id, +H5_HLDLL herr_t H5LT_get_attribute_mem( hid_t obj_id, const char *attr_name, hid_t mem_type_id, void *data ); -H5_HLDLL herr_t H5LT_get_attribute_disk( hid_t obj_id, +H5_HLDLL herr_t H5LT_get_attribute_disk( hid_t obj_id, const char *attr_name, void *data ); -H5_HLDLL herr_t H5LT_find_attribute( hid_t loc_id, const char *name ); +H5_HLDLL herr_t H5LT_find_attribute( hid_t loc_id, const char *name ); -H5_HLDLL herr_t H5LT_set_attribute_numerical( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LT_set_attribute_numerical( hid_t loc_id, + const char *obj_name, const char *attr_name, size_t size, hid_t type_id, const void *data ); -H5_HLDLL herr_t H5LT_set_attribute_string( hid_t dset_id, +H5_HLDLL herr_t H5LT_set_attribute_string( hid_t dset_id, char *name, char *buf ); diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index d59e9ed..083e0e7 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -54,8 +54,8 @@ herr_t H5PT_set_index(htbl_t *table_id, hsize_t pt_index); * * Date: March 12, 2004 * - * Comments: This function does not handle compression or fill data - * currently. Fill data is not necessary because the + * Comments: This function does not handle compression or fill data + * currently. Fill data is not necessary because the * table is initially of size 0. * * Modifications: @@ -112,7 +112,7 @@ hid_t H5PTcreate_fl ( hid_t loc_id, /* Create the table identifier */ table->dset_id = dset_id; - if((table->type_id = H5Tcopy(dtype_id)) <0) + if((table->type_id = H5Tcopy(dtype_id)) <0) goto out; H5PT_create_index(table); @@ -152,8 +152,8 @@ hid_t H5PTcreate_fl ( hid_t loc_id, * * Date: April 12, 2004 * - * Comments: This function does not handle compression or fill data - * currently. Fill data is not necessary because the + * Comments: This function does not handle compression or fill data + * currently. Fill data is not necessary because the * table is initially of size 0. * * Modifications: @@ -200,7 +200,7 @@ out: * * Date: March 10, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -273,7 +273,7 @@ out: /*------------------------------------------------------------------------- * Function: H5PT_close * - * Purpose: Closes a table (i.e. cleans up all open resources used by a + * Purpose: Closes a table (i.e. cleans up all open resources used by a * table). * * Return: Success: 0, Failure: -1 @@ -283,7 +283,7 @@ out: * * Date: March 10, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -321,7 +321,7 @@ out: /*------------------------------------------------------------------------- * Function: H5PTclose * - * Purpose: Closes a table (i.e. cleans up all open resources used by a + * Purpose: Closes a table (i.e. cleans up all open resources used by a * table). * * Return: Success: 0, Failure: -1 @@ -331,7 +331,7 @@ out: * * Date: April 21, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -386,7 +386,7 @@ out: * * Date: March 12, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -406,7 +406,7 @@ herr_t H5PTappend( hid_t table_id, if (nrecords == 0) return 0; - if((H5TBcommon_append_records(table->dset_id, table->type_id, + if((H5TBcommon_append_records(table->dset_id, table->type_id, nrecords, table->size, data)) <0) goto out; @@ -427,9 +427,9 @@ out: /*------------------------------------------------------------------------- - * Function: H5PTget_next + * Function: H5PTget_next * - * Purpose: Reads packets starting at the current index and updates + * Purpose: Reads packets starting at the current index and updates * that index * * Return: Success: 0, Failure: -1 @@ -441,7 +441,7 @@ out: * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -460,7 +460,7 @@ herr_t H5PTget_next( hid_t table_id, if (nrecords == 0) return 0; - if((H5TBcommon_read_records(table->dset_id, table->type_id, + if((H5TBcommon_read_records(table->dset_id, table->type_id, table->current_index, nrecords, table->size, data)) < 0) goto out; @@ -473,7 +473,7 @@ out: } /*------------------------------------------------------------------------- - * Function: H5PTread_packets + * Function: H5PTread_packets * * Purpose: Reads packets from anywhere in a packet table * @@ -484,9 +484,9 @@ out: * * Date: March 12, 2004 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -507,7 +507,7 @@ herr_t H5PTread_packets( hid_t table_id, if (nrecords == 0) return 0; - if( H5TBcommon_read_records(table->dset_id, table->type_id, + if( H5TBcommon_read_records(table->dset_id, table->type_id, start, nrecords, table->size, data) < 0) goto out; @@ -518,9 +518,9 @@ out: } /*------------------------------------------------------------------------- - * + * * Table attribute functions - * + * *------------------------------------------------------------------------- */ @@ -536,9 +536,9 @@ out: * * Date: March 12, 2004 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -578,9 +578,9 @@ herr_t H5PT_set_index(htbl_t *table, hsize_t index) * * Date: April 23, 2004 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -613,7 +613,7 @@ herr_t H5PTset_index(hid_t table_id, hsize_t pt_index) */ /*------------------------------------------------------------------------- - * Function: H5PTget_num_packets + * Function: H5PTget_num_packets * * Purpose: Returns by reference the number of packets in the dataset * @@ -626,7 +626,7 @@ herr_t H5PTset_index(hid_t table_id, hsize_t pt_index) * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -648,7 +648,7 @@ out: /*------------------------------------------------------------------------- - * Function: H5PTis_valid + * Function: H5PTis_valid * * Purpose: Validates a table identifier * @@ -661,7 +661,7 @@ out: * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -676,7 +676,7 @@ herr_t H5PTis_valid(hid_t table_id) } /*------------------------------------------------------------------------- - * Function: H5PTis_varlen + * Function: H5PTis_varlen * * Purpose: Returns 1 if a table_id corresponds to a packet table of variable- * length records or 0 for fixed-length records. @@ -690,7 +690,7 @@ herr_t H5PTis_valid(hid_t table_id) * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -716,16 +716,16 @@ out: } /*------------------------------------------------------------------------- - * + * * Memory Management functions - * + * *------------------------------------------------------------------------- */ /*------------------------------------------------------------------------- * Function: H5PTfree_vlen_readbuff * - * Purpose: Frees memory used when reading from a variable length packet + * Purpose: Frees memory used when reading from a variable length packet * table. * * Return: Success: 0, Failure: -1 @@ -738,7 +738,7 @@ out: * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- diff --git a/hl/src/H5PT.h b/hl/src/H5PT.h index 699419e..9d07131 100644 --- a/hl/src/H5PT.h +++ b/hl/src/H5PT.h @@ -90,9 +90,9 @@ H5_HLDLL herr_t H5PTis_valid( hid_t table_id ); H5_HLDLL herr_t H5PTis_varlen( hid_t table_id ); /*------------------------------------------------------------------------- - * + * * Packet Table "current index" functions - * + * *------------------------------------------------------------------------- */ @@ -102,9 +102,9 @@ H5_HLDLL herr_t H5PTset_index( hid_t table_id, hsize_t pt_index ); /*------------------------------------------------------------------------- - * + * * Memory Management functions - * + * *------------------------------------------------------------------------- */ diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index 59642da..c67747f 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -21,25 +21,25 @@ /*------------------------------------------------------------------------- - * + * * Private functions - * + * *------------------------------------------------------------------------- */ -int H5TB_find_field(const char *field, +int H5TB_find_field(const char *field, const char *field_list); -herr_t H5TB_attach_attributes(const char *table_title, - hid_t loc_id, +herr_t H5TB_attach_attributes(const char *table_title, + hid_t loc_id, const char *dset_name, - hsize_t nfields, + hsize_t nfields, hid_t tid ); -hid_t H5TB_create_type(hid_t loc_id, +hid_t H5TB_create_type(hid_t loc_id, const char *dset_name, - size_t dst_size, - const size_t *dst_offset, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, hid_t ftype_id); @@ -64,14 +64,14 @@ hid_t H5TB_create_type(hid_t loc_id, * * Comments: The data is packed * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ herr_t H5TBmake_table( const char *table_title, - hid_t loc_id, + hid_t loc_id, const char *dset_name, hsize_t nfields, hsize_t nrecords, @@ -82,12 +82,12 @@ herr_t H5TBmake_table( const char *table_title, hsize_t chunk_size, void *fill_data, int compress, - const void *data ) + const void *data ) { hid_t did; - hid_t sid; - hid_t mem_type_id; + hid_t sid; + hid_t mem_type_id; hid_t plist_id; hsize_t dims[1]; hsize_t dims_chunk[1]; @@ -107,7 +107,7 @@ herr_t H5TBmake_table( const char *table_title, return -1; /* Insert fields. */ - for ( i = 0; i < nfields; i++) + for ( i = 0; i < nfields; i++) { if ( H5Tinsert(mem_type_id, field_names[i], field_offset[i], field_types[i] ) < 0 ) return -1; @@ -125,25 +125,25 @@ herr_t H5TBmake_table( const char *table_title, /* Set the fill value using a struct as the data type. */ if ( fill_data ) { - if ( H5Pset_fill_value( plist_id, mem_type_id, fill_data ) < 0 ) + if ( H5Pset_fill_value( plist_id, mem_type_id, fill_data ) < 0 ) return -1; } - /* - Dataset creation property list is modified to use - GZIP compression with the compression effort set to 6. - Note that compression can be used only when dataset is chunked. + /* + Dataset creation property list is modified to use + GZIP compression with the compression effort set to 6. + Note that compression can be used only when dataset is chunked. */ if ( compress ) { - if ( H5Pset_deflate( plist_id, 6) < 0 ) + if ( H5Pset_deflate( plist_id, 6) < 0 ) return -1; } - + /* Create the dataset. */ if ( (did = H5Dcreate( loc_id, dset_name, mem_type_id, sid, plist_id )) < 0 ) goto out; - + /* Only write if there is something to write */ if ( data ) { @@ -151,8 +151,8 @@ herr_t H5TBmake_table( const char *table_title, if ( H5Dwrite( did, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; } - - /* Terminate access to the data space. */ + + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) goto out; @@ -168,7 +168,7 @@ herr_t H5TBmake_table( const char *table_title, * Set the conforming table attributes *------------------------------------------------------------------------- */ - + /* Attach the CLASS attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", TABLE_CLASS ) < 0 ) goto out; @@ -176,7 +176,7 @@ herr_t H5TBmake_table( const char *table_title, /* Attach the VERSION attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "VERSION", "2.0" ) < 0 ) goto out; - + /* Attach the TITLE attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "TITLE", table_title ) < 0 ) goto out; @@ -193,7 +193,7 @@ herr_t H5TBmake_table( const char *table_title, strcat( attr_name, aux ); sprintf( aux, "%s", "_NAME" ); strcat( attr_name, aux ); - + /* Attach the attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0 ) goto out; @@ -211,7 +211,7 @@ herr_t H5TBmake_table( const char *table_title, /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) return -1; - + if (( sid = H5Screate(H5S_SCALAR)) < 0 ) goto out; @@ -229,28 +229,28 @@ herr_t H5TBmake_table( const char *table_title, if ( (attr_id = H5Acreate( did, attr_name, field_types[i], sid, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, field_types[i], tmp_buf+field_offset[i] ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; free( member_name ); } - + /* Close the dataset. */ H5Dclose( did ); - /* Close data space. */ + /* Close data space. */ H5Sclose( sid ); } - + /* Release the datatype. */ if ( H5Tclose( mem_type_id ) < 0 ) return -1; - - + + return 0; /* error zone, gracefully close */ @@ -279,7 +279,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmers: + * Programmers: * Pedro Vicente, pvn@ncsa.uiuc.edu * Quincey Koziol * @@ -287,23 +287,23 @@ out: * * Comments: Uses memory offsets * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBappend_records( hid_t loc_id, +herr_t H5TBappend_records( hid_t loc_id, const char *dset_name, hsize_t nrecords, size_t dst_size, const size_t *dst_offset, const size_t *dst_sizes, - const void *data ) + const void *data ) { hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t mem_type_id=-1; hid_t sid=-1; hid_t mem_space_id=-1; @@ -327,7 +327,7 @@ herr_t H5TBappend_records( hid_t loc_id, /* Append the records */ if ((H5TBcommon_append_records(did, mem_type_id, nrecords, nrecords_orig, data))<0) - goto out; + goto out; /* Release the datatype. */ if ( H5Tclose( tid ) < 0 ) @@ -341,7 +341,7 @@ herr_t H5TBappend_records( hid_t loc_id, if ( H5Dclose( did ) < 0 ) goto out; - + return 0; /* error zone, gracefully close */ @@ -369,27 +369,27 @@ out: * * Comments: Uses memory offsets * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBwrite_records( hid_t loc_id, +herr_t H5TBwrite_records( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, size_t dst_size, const size_t *dst_offset, const size_t *dst_sizes, - const void *data ) + const void *data ) { hid_t did; - hid_t tid; - hsize_t count[1]; + hid_t tid; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hid_t mem_space_id=-1; @@ -418,7 +418,7 @@ herr_t H5TBwrite_records( hid_t loc_id, if ( start + nrecords > dims[0] ) goto out; - + /* Define a hyperslab in the dataset of the size of the records */ offset[0] = start; count[0] = nrecords; @@ -440,7 +440,7 @@ herr_t H5TBwrite_records( hid_t loc_id, /* Terminate access to the dataspace */ if ( H5Sclose( sid ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( tid ) < 0 ) goto out; @@ -453,7 +453,7 @@ herr_t H5TBwrite_records( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -481,13 +481,13 @@ out: * * Comments: * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBwrite_fields_name( hid_t loc_id, +herr_t H5TBwrite_fields_name( hid_t loc_id, const char *dset_name, const char *field_names, hsize_t start, @@ -495,15 +495,15 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, size_t type_size, const size_t *field_offset, const size_t *dst_sizes, - const void *data ) + const void *data ) { hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t write_type_id=-1; hid_t member_type_id; hid_t nmtype_id; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; char *member_name; @@ -513,9 +513,9 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, size_t size_native; /* Create xfer properties to preserve initialized data */ - if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) + if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) return -1; - if (H5Pset_preserve (PRESERVE, 1)<0) + if (H5Pset_preserve (PRESERVE, 1)<0) return -1; /* Open the dataset. */ @@ -525,7 +525,7 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, /* Get the datatype */ if ( (tid = H5Dget_type( did )) < 0 ) goto out; - + /* Get the number of fields */ if ( ( nfields = H5Tget_nmembers( tid )) < 0 ) goto out; @@ -552,9 +552,9 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, /* Convert to native type */ if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT))<0) goto out; - + size_native=H5Tget_size(nmtype_id); - + /* Adjust, if necessary */ if (dst_sizes[j]!=size_native) { @@ -601,7 +601,7 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, /* Write */ if ( H5Dwrite( did, write_type_id, H5S_ALL, sid, PRESERVE, data ) < 0 ) goto out; - + /* End access to the write id */ if ( H5Tclose( write_type_id ) ) goto out; @@ -617,7 +617,7 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, /* End access to the property list */ if ( H5Pclose( PRESERVE ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -648,15 +648,15 @@ out: * * Comments: Uses memory offsets * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBwrite_fields_index( hid_t loc_id, +herr_t H5TBwrite_fields_index( hid_t loc_id, const char *dset_name, hsize_t nfields, const int *field_index, @@ -665,15 +665,15 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, size_t type_size, const size_t *field_offset, const size_t *dst_sizes, - const void *data ) + const void *data ) { hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t write_type_id=-1; hid_t member_type_id; hid_t nmtype_id; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; char *member_name; @@ -682,9 +682,9 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, size_t size_native; /* Create xfer properties to preserve initialized data */ - if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) + if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) return -1; - if (H5Pset_preserve (PRESERVE, 1)<0) + if (H5Pset_preserve (PRESERVE, 1)<0) return -1; /* Open the dataset. */ @@ -694,11 +694,11 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, /* Get the datatype */ if ( (tid = H5Dget_type( did )) < 0 ) goto out; - + /* Get the number of fields */ if ( H5Tget_nmembers( tid ) < 0 ) goto out; - + /* Create a write id */ if ( ( write_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0 ) goto out; @@ -709,7 +709,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, { j = field_index[i]; - + /* Get the member name */ member_name = H5Tget_member_name( tid, (unsigned) j ); @@ -720,9 +720,9 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, /* Convert to native type */ if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT))<0) goto out; - + size_native=H5Tget_size(nmtype_id); - + if (dst_sizes[i]!=size_native) { if (H5Tset_size(nmtype_id, dst_sizes[i])<0) @@ -748,7 +748,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, goto out; free( member_name ); - + } /* Get the dataspace handle */ @@ -764,7 +764,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, /* Write */ if ( H5Dwrite( did, write_type_id, H5S_ALL, sid, PRESERVE, data ) < 0 ) goto out; - + /* End access to the write id */ if ( H5Tclose( write_type_id ) ) goto out; @@ -780,7 +780,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, /* End access to the property list */ if ( H5Pclose( PRESERVE ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -817,25 +817,25 @@ out: * * Comments: * - * Modifications: April 1, 2004 + * Modifications: April 1, 2004 * used a memory type ID returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBread_table( hid_t loc_id, +herr_t H5TBread_table( hid_t loc_id, const char *dset_name, - size_t dst_size, - const size_t *dst_offset, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, - void *dst_buf ) + void *dst_buf ) { hid_t did; - hid_t ftype_id=-1; + hid_t ftype_id=-1; hid_t mem_type_id=-1; hid_t sid; hsize_t dims[1]; - + /* open the dataset. */ if ((did=H5Dopen(loc_id,dset_name))<0) return -1; @@ -843,13 +843,13 @@ herr_t H5TBread_table( hid_t loc_id, /* get the dataspace handle */ if ( (sid = H5Dget_space( did )) < 0 ) goto out; - + /* get dimensions */ if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 ) goto out; /* get the datatypes */ - if ((ftype_id=H5Dget_type (did))<0) + if ((ftype_id=H5Dget_type (did))<0) goto out; if ((mem_type_id=H5TB_create_type(loc_id,dset_name,dst_size,dst_offset,dst_sizes,ftype_id))<0) @@ -893,30 +893,30 @@ out: * * Date: November 19, 2001 * - * Comments: + * Comments: * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBread_records( hid_t loc_id, +herr_t H5TBread_records( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, size_t dst_size, const size_t *dst_offset, const size_t *dst_sizes, - void *data ) + void *data ) { hid_t did; - hid_t ftype_id; + hid_t ftype_id; hid_t mem_type_id=-1; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hsize_t dims[1]; @@ -936,7 +936,7 @@ herr_t H5TBread_records( hid_t loc_id, /* get the datatypes */ if ( (ftype_id = H5Dget_type( did )) < 0 ) goto out; - + if ((mem_type_id=H5TB_create_type(loc_id,dset_name,dst_size,dst_offset,dst_sizes,ftype_id))<0) goto out; @@ -1011,15 +1011,15 @@ out: * * Comments: * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBread_fields_name( hid_t loc_id, +herr_t H5TBread_fields_name( hid_t loc_id, const char *dset_name, const char *field_names, hsize_t start, @@ -1027,24 +1027,24 @@ herr_t H5TBread_fields_name( hid_t loc_id, size_t type_size, const size_t *field_offset, const size_t *dst_sizes, - void *data ) + void *data ) { hid_t did; - hid_t ftype_id=-1; + hid_t ftype_id=-1; hid_t mem_type_id=-1; hid_t mtype_id; hid_t nmtype_id; char *member_name; hssize_t nfields; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hid_t mem_space_id=-1; hsize_t mem_size[1]; size_t size_native; hssize_t i, j; - + /* open the dataset */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) goto out; @@ -1076,9 +1076,9 @@ herr_t H5TBread_fields_name( hid_t loc_id, /* convert to native type */ if ((nmtype_id=H5Tget_native_type(mtype_id,H5T_DIR_DEFAULT))<0) goto out; - + size_native=H5Tget_size(nmtype_id); - + if (dst_sizes[j]!=size_native) { if (H5Tset_size(nmtype_id, dst_sizes[j])<0) @@ -1136,7 +1136,7 @@ herr_t H5TBread_fields_name( hid_t loc_id, goto out; if ( H5Dclose( did ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -1166,15 +1166,15 @@ out: * * Comments: * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBread_fields_index( hid_t loc_id, +herr_t H5TBread_fields_index( hid_t loc_id, const char *dset_name, hsize_t nfields, const int *field_index, @@ -1183,16 +1183,16 @@ herr_t H5TBread_fields_index( hid_t loc_id, size_t type_size, const size_t *field_offset, const size_t *dst_sizes, - void *data ) + void *data ) { hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t read_type_id=-1; hid_t member_type_id; hid_t nmtype_id; char *member_name; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hid_t mem_space_id=-1; @@ -1216,7 +1216,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, for ( i = 0; i < nfields; i++) { j = field_index[i]; - + /* Get the member name */ member_name = H5Tget_member_name( tid, (unsigned) j ); @@ -1227,13 +1227,13 @@ herr_t H5TBread_fields_index( hid_t loc_id, /* Get the member size */ if ( H5Tget_size( member_type_id ) == 0 ) goto out; - + /* Convert to native type */ if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT))<0) goto out; - + size_native=H5Tget_size(nmtype_id); - + if (dst_sizes[i]!=size_native) { if (H5Tset_size(nmtype_id, dst_sizes[i])<0) @@ -1251,7 +1251,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, if ( H5Tinsert( read_type_id, member_name, 0, nmtype_id ) < 0 ) goto out; } - + /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) goto out; @@ -1270,7 +1270,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, count[0] = nrecords; if ( H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 ) goto out; - + /* Create a memory dataspace handle */ mem_size[0] = count[0]; if ( (mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0 ) @@ -1287,7 +1287,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, /* Terminate access to the memory dataspace */ if ( H5Sclose( mem_space_id ) < 0 ) goto out; - + /* End access to the read id */ if ( H5Tclose( read_type_id ) ) goto out; @@ -1299,7 +1299,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, /* End access to the dataset */ if ( H5Dclose( did ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -1340,7 +1340,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5TBdelete_record( hid_t loc_id, +herr_t H5TBdelete_record( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords ) @@ -1351,8 +1351,8 @@ herr_t H5TBdelete_record( hid_t loc_id, hsize_t read_start; hsize_t read_nrecords; hid_t did; - hid_t tid; - hsize_t count[1]; + hid_t tid; + hsize_t count[1]; hsize_t offset[1]; hid_t sid; hid_t mem_space_id; @@ -1366,7 +1366,7 @@ herr_t H5TBdelete_record( hid_t loc_id, hsize_t dims[1]; #endif - + /*------------------------------------------------------------------------- * First we get information about type size and offsets on disk *------------------------------------------------------------------------- @@ -1381,11 +1381,11 @@ herr_t H5TBdelete_record( hid_t loc_id, if ( src_offset == NULL ) return -1; - + /* Get field info */ if ( H5TBget_field_info( loc_id, dset_name, NULL, src_sizes, src_offset, &src_size ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Read the records after the deleted one(s) *------------------------------------------------------------------------- @@ -1399,7 +1399,7 @@ herr_t H5TBdelete_record( hid_t loc_id, return -1; /* Read the records after the deleted one(s) */ - if ( H5TBread_records( loc_id, dset_name, read_start, read_nrecords, src_size, + if ( H5TBread_records( loc_id, dset_name, read_start, read_nrecords, src_size, src_offset, src_sizes, tmp_buf ) < 0 ) return -1; @@ -1412,7 +1412,7 @@ herr_t H5TBdelete_record( hid_t loc_id, /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) return -1; - + /* Get the datatype */ if ( (tid = H5Dget_type( did )) < 0 ) goto out; @@ -1461,11 +1461,11 @@ herr_t H5TBdelete_record( hid_t loc_id, /* End access to the dataset */ if ( H5Dclose( did ) < 0 ) return -1; - + free( tmp_buf ); free( src_offset ); free( src_sizes ); - + /*------------------------------------------------------------------------- * Store the new dimension as an attribute @@ -1474,11 +1474,11 @@ herr_t H5TBdelete_record( hid_t loc_id, nrows = ntotal_records - nrecords; /* Set the attribute */ - if (H5LT_set_attribute_numerical(loc_id,dset_name,"NROWS",1, + if (H5LT_set_attribute_numerical(loc_id,dset_name,"NROWS",1, H5T_NATIVE_LLONG,&nrows)<0) return -1; - + return 0; out: @@ -1499,15 +1499,15 @@ out: * * Comments: Uses memory offsets * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBinsert_record( hid_t loc_id, +herr_t H5TBinsert_record( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, @@ -1521,18 +1521,18 @@ herr_t H5TBinsert_record( hid_t loc_id, hsize_t ntotal_records; hsize_t read_nrecords; hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t mem_type_id=-1; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hid_t mem_space_id=-1; hsize_t dims[1]; hsize_t mem_dims[1]; unsigned char *tmp_buf; - + /*------------------------------------------------------------------------- - * Read the records after the inserted one(s) + * Read the records after the inserted one(s) *------------------------------------------------------------------------- */ @@ -1556,7 +1556,7 @@ herr_t H5TBinsert_record( hid_t loc_id, tmp_buf = (unsigned char *)calloc((size_t) read_nrecords, dst_size ); /* Read the records after the inserted one(s) */ - if ( H5TBread_records( loc_id, dset_name, start, read_nrecords, dst_size, dst_offset, + if ( H5TBread_records( loc_id, dset_name, start, read_nrecords, dst_size, dst_offset, dst_sizes, tmp_buf ) < 0 ) return -1; @@ -1565,7 +1565,7 @@ herr_t H5TBinsert_record( hid_t loc_id, if ( H5Dextend ( did, dims ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Write the inserted records *------------------------------------------------------------------------- @@ -1588,13 +1588,13 @@ herr_t H5TBinsert_record( hid_t loc_id, if ( H5Dwrite( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0 ) goto out; - + /* Terminate access to the dataspace */ if ( H5Sclose( mem_space_id ) < 0 ) goto out; if ( H5Sclose( sid ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Write the "pushed down" records *------------------------------------------------------------------------- @@ -1617,7 +1617,7 @@ herr_t H5TBinsert_record( hid_t loc_id, if ( H5Dwrite( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /* Terminate access to the dataspace */ if ( H5Sclose( mem_space_id ) < 0 ) goto out; @@ -1664,7 +1664,7 @@ out: * * Date: December 5, 2001 * - * Comments: + * Comments: * * Modifications: * @@ -1672,22 +1672,22 @@ out: *------------------------------------------------------------------------- */ -herr_t H5TBadd_records_from( hid_t loc_id, +herr_t H5TBadd_records_from( hid_t loc_id, const char *dset_name1, hsize_t start1, hsize_t nrecords, const char *dset_name2, - hsize_t start2 ) + hsize_t start2 ) { /* Identifiers for the 1st dataset. */ hid_t dataset_id1; - hid_t type_id1; + hid_t type_id1; hid_t space_id1=-1; hid_t mem_space_id1=-1; size_t type_size1; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hsize_t mem_size[1]; hsize_t nfields; @@ -1711,13 +1711,13 @@ herr_t H5TBadd_records_from( hid_t loc_id, if ( src_offset == NULL ) return -1; - + /* Get field info */ if ( H5TBget_field_info( loc_id, dset_name1, NULL, src_sizes, src_offset, &src_size ) < 0 ) return -1; - + /*------------------------------------------------------------------------- - * Get information about the first table and read it + * Get information about the first table and read it *------------------------------------------------------------------------- */ @@ -1754,12 +1754,12 @@ herr_t H5TBadd_records_from( hid_t loc_id, goto out; /*------------------------------------------------------------------------- - * Add to the second table + * Add to the second table *------------------------------------------------------------------------- */ if ( H5TBinsert_record(loc_id,dset_name2,start2,nrecords,src_size,src_offset,src_sizes,tmp_buf ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Close resources for table 1 *------------------------------------------------------------------------- @@ -1772,7 +1772,7 @@ herr_t H5TBadd_records_from( hid_t loc_id, /* Terminate access to the dataspace */ if ( H5Sclose( space_id1 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id1 ) < 0 ) return -1; @@ -1784,7 +1784,7 @@ herr_t H5TBadd_records_from( hid_t loc_id, free( tmp_buf ); free( src_offset ); free( src_sizes ); - + return 0; /* error zone, gracefully close */ @@ -1810,14 +1810,14 @@ out: * * Date: December 10, 2001 * - * Comments: + * Comments: * * Modifications: * * *------------------------------------------------------------------------- */ -herr_t H5TBcombine_tables( hid_t loc_id1, +herr_t H5TBcombine_tables( hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const char *dset_name2, @@ -1826,23 +1826,23 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Identifiers for the 1st dataset. */ hid_t dataset_id1; - hid_t type_id1; + hid_t type_id1; hid_t space_id1; hid_t plist_id1; /* Identifiers for the 2nd dataset. */ hid_t dataset_id2; - hid_t type_id2; + hid_t type_id2; hid_t space_id2; hid_t plist_id2; /* Identifiers for the 3rd dataset. */ hid_t dataset_id3; - hid_t type_id3; + hid_t type_id3; hid_t space_id3; hid_t plist_id3; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t mem_space_id; hsize_t mem_size[1]; @@ -1850,7 +1850,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, hsize_t nrecords; hsize_t dims[1]; hsize_t maxdims[1] = { H5S_UNLIMITED }; - + size_t type_size; hid_t sid; @@ -1882,13 +1882,13 @@ herr_t H5TBcombine_tables( hid_t loc_id1, if ( src_offset == NULL ) return -1; - + /* Get field info */ if ( H5TBget_field_info( loc_id1, dset_name1, NULL, src_sizes, src_offset, &src_size ) < 0 ) return -1; /*------------------------------------------------------------------------- - * Get information about the first table + * Get information about the first table *------------------------------------------------------------------------- */ @@ -1911,7 +1911,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Get the dimensions */ if ( H5TBget_table_info ( loc_id1, dset_name1, &nfields, &nrecords ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Make the merged table with no data originally *------------------------------------------------------------------------- @@ -1966,44 +1966,44 @@ herr_t H5TBcombine_tables( hid_t loc_id1, */ if ( has_fill == 1 ) { - + if (( sid = H5Screate(H5S_SCALAR)) < 0 ) goto out; - + for ( i = 0; i < nfields; i++) { - + /* Get the member type */ if ( ( member_type_id = H5Tget_member_type( type_id3, (unsigned) i )) < 0 ) goto out; - + /* Get the member offset */ member_offset = H5Tget_member_offset( type_id3, (unsigned) i ); - + strcpy( attr_name, "FIELD_" ); sprintf( aux, "%d", (int) i ); strcat( attr_name, aux ); sprintf( aux, "%s", "_FILL" ); strcat( attr_name, aux ); - + if ( (attr_id = H5Acreate( dataset_id3, attr_name, member_type_id, sid, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, member_type_id, tmp_fill_buf+member_offset ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; if ( H5Tclose( member_type_id ) < 0 ) goto out; } - - /* Close data space. */ + + /* Close data space. */ if ( H5Sclose( sid ) < 0 ) goto out; } - + /*------------------------------------------------------------------------- * Read data from 1st table *------------------------------------------------------------------------- @@ -2024,7 +2024,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, if ( H5Dread( dataset_id1, type_id1, mem_space_id, space_id1, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Save data from 1st table into new table *------------------------------------------------------------------------- @@ -2046,7 +2046,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Terminate access to the dataspace */ if ( H5Sclose( space_id1 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id1 ) < 0 ) goto out; @@ -2063,7 +2063,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, free( tmp_buf ); /*------------------------------------------------------------------------- - * Get information about the 2nd table + * Get information about the 2nd table *------------------------------------------------------------------------- */ @@ -2108,7 +2108,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, if ( H5Dread( dataset_id2, type_id2, mem_space_id, space_id2, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Save data from 2nd table into new table *------------------------------------------------------------------------- @@ -2130,7 +2130,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Terminate access to the dataspace */ if ( H5Sclose( space_id2 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id2 ) < 0 ) return -1; @@ -2151,7 +2151,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Terminate access to the dataspace */ if ( H5Sclose( space_id3 ) < 0 ) return -1; - + /* Release the datatype. */ if ( H5Tclose( type_id3 ) < 0 ) return -1; @@ -2191,32 +2191,32 @@ out: * * Date: January 30, 2002 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ -herr_t H5TBinsert_field( hid_t loc_id, +herr_t H5TBinsert_field( hid_t loc_id, const char *dset_name, const char *field_name, hid_t field_type, hsize_t position, const void *fill_data, - const void *data ) + const void *data ) { /* Identifiers for the 1st, original dataset */ hid_t dataset_id1; - hid_t type_id1; + hid_t type_id1; hid_t space_id1; hid_t plist_id1; hid_t mem_space_id1; /* Identifiers for the 2nd, new dataset */ hid_t dataset_id2; - hid_t type_id2; + hid_t type_id2; hid_t space_id2; hid_t plist_id2; hid_t mem_space_id2; @@ -2231,7 +2231,7 @@ herr_t H5TBinsert_field( hid_t loc_id, hsize_t dims_chunk[1]; hsize_t dims[1]; hsize_t maxdims[1] = { H5S_UNLIMITED }; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hsize_t mem_size[1]; hid_t write_type_id; @@ -2251,16 +2251,16 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Get the number of records and fields */ if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Get information about the old data type *------------------------------------------------------------------------- */ - + /* Open the dataset. */ if ( (dataset_id1 = H5Dopen( loc_id, dset_name )) < 0 ) return -1; - + /* Get creation properties list */ if ( (plist_id1 = H5Dget_create_plist( dataset_id1 )) < 0 ) goto out; @@ -2272,7 +2272,7 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Get the size of the datatype */ if ( ( total_size = H5Tget_size( type_id1 )) == 0 ) goto out; - + /* Get the dataspace handle */ if ( (space_id1 = H5Dget_space( dataset_id1 )) < 0 ) goto out; @@ -2313,7 +2313,7 @@ herr_t H5TBinsert_field( hid_t loc_id, inserted = 0; /* Insert the old fields, counting with the new one */ - for ( i = 0; i < nfields + 1; i++) + for ( i = 0; i < nfields + 1; i++) { idx = i; @@ -2337,7 +2337,7 @@ herr_t H5TBinsert_field( hid_t loc_id, continue; } - + /* Get the member name */ member_name = H5Tget_member_name( type_id1, (unsigned)idx ); @@ -2347,7 +2347,7 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Get the member size */ member_size = H5Tget_size( member_type_id ); - + /* Insert it into the new type */ if ( H5Tinsert( type_id2, member_name, curr_offset, member_type_id ) < 0 ) goto out; @@ -2360,9 +2360,9 @@ herr_t H5TBinsert_field( hid_t loc_id, if ( H5Tclose( member_type_id ) < 0 ) goto out; - + } /* i */ - + /*------------------------------------------------------------------------- * Create a new temporary dataset *------------------------------------------------------------------------- @@ -2407,7 +2407,7 @@ herr_t H5TBinsert_field( hid_t loc_id, if ( H5Dread( dataset_id1, type_id1, mem_space_id1, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Save data from 1st table into new table, using the 1st type id *------------------------------------------------------------------------- @@ -2427,15 +2427,15 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Create a write id */ if ( ( write_type_id = H5Tcreate( H5T_COMPOUND, (size_t)new_member_size )) < 0 ) goto out; - + /* The field in the file is found by its name */ if ( H5Tinsert( write_type_id, field_name, 0, field_type ) < 0 ) goto out; /* Create xfer properties to preserve initialized data */ - if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) + if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) goto out; - if (H5Pset_preserve (PRESERVE, 1)<0) + if (H5Pset_preserve (PRESERVE, 1)<0) goto out; /* Only write if there is something to write */ @@ -2468,8 +2468,8 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Terminate access to the memory dataspace */ if ( H5Sclose( mem_space_id1 ) < 0 ) - goto out; - + goto out; + /* Release the datatype. */ if ( H5Tclose( type_id1 ) < 0 ) goto out; @@ -2495,7 +2495,7 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Terminate access to the dataspace */ if ( H5Sclose( space_id2 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id2 ) < 0 ) return -1; @@ -2511,7 +2511,7 @@ herr_t H5TBinsert_field( hid_t loc_id, * Delete 1st table *------------------------------------------------------------------------- */ - if ( H5Gunlink( loc_id, dset_name ) < 0 ) + if ( H5Gunlink( loc_id, dset_name ) < 0 ) return -1; /*------------------------------------------------------------------------- @@ -2519,7 +2519,7 @@ herr_t H5TBinsert_field( hid_t loc_id, *------------------------------------------------------------------------- */ - if ( H5Gmove( loc_id, "new", dset_name ) < 0 ) + if ( H5Gmove( loc_id, "new", dset_name ) < 0 ) return -1; /*------------------------------------------------------------------------- @@ -2567,10 +2567,10 @@ herr_t H5TBinsert_field( hid_t loc_id, if ( (attr_id = H5Acreate( dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, member_type_id, tmp_fill_buf+member_offset ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; @@ -2598,19 +2598,19 @@ herr_t H5TBinsert_field( hid_t loc_id, if ( (attr_id = H5Acreate( dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, member_type_id, fill_data ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; if ( H5Tclose( member_type_id ) < 0 ) goto out; - + } - - /* Close data space. */ + + /* Close data space. */ if ( H5Sclose( space_id1 ) < 0 ) goto out; @@ -2621,12 +2621,12 @@ herr_t H5TBinsert_field( hid_t loc_id, /* End access to the dataset */ if ( H5Dclose( dataset_id1 ) < 0 ) goto out; - + /* Release resources. */ free ( tmp_buf ); free ( tmp_fill_buf ); - + return 0; out: @@ -2645,7 +2645,7 @@ out: * * Date: January 30, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -2653,20 +2653,20 @@ out: *------------------------------------------------------------------------- */ -herr_t H5TBdelete_field( hid_t loc_id, +herr_t H5TBdelete_field( hid_t loc_id, const char *dset_name, - const char *field_name ) + const char *field_name ) { /* Identifiers for the 1st original dataset */ hid_t dataset_id1; - hid_t type_id1; + hid_t type_id1; hid_t space_id1; hid_t plist_id1; /* Identifiers for the 2nd new dataset */ hid_t dataset_id2; - hid_t type_id2; + hid_t type_id2; hid_t space_id2; hid_t plist_id2; @@ -2694,11 +2694,11 @@ herr_t H5TBdelete_field( hid_t loc_id, hid_t attr_id; hsize_t i; int has_fill=0; - + /* Get the number of records and fields */ if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Get information about the old data type *------------------------------------------------------------------------- @@ -2718,7 +2718,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Get the size of the datatype */ type_size1 = H5Tget_size( type_id1 ); - + /* Get the dataspace handle */ if ( (space_id1 = H5Dget_space( dataset_id1 )) < 0 ) goto out; @@ -2733,9 +2733,9 @@ herr_t H5TBdelete_field( hid_t loc_id, */ /* Check out the field */ - for ( i = 0; i < nfields; i++) + for ( i = 0; i < nfields; i++) { - + /* Get the member name */ member_name = H5Tget_member_name( type_id1,(unsigned) i ); @@ -2748,7 +2748,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Get the member size */ delete_member_size = H5Tget_size( member_type_id ); - + /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) goto out; @@ -2760,7 +2760,7 @@ herr_t H5TBdelete_field( hid_t loc_id, } free( member_name ); - + } /* i */ /* No field to delete was found */ @@ -2787,15 +2787,15 @@ herr_t H5TBdelete_field( hid_t loc_id, * Get attributes from previous table in the process *------------------------------------------------------------------------- */ - + /* Get the table title */ if ( (H5TBAget_title( dataset_id1, table_title )) < 0 ) goto out; /* Insert the old fields except the one to delete */ - for ( i = 0; i < nfields; i++) + for ( i = 0; i < nfields; i++) { - + /* Get the member name */ member_name = H5Tget_member_name( type_id1, (unsigned) i ); @@ -2812,11 +2812,11 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Get the member size */ member_size = H5Tget_size( member_type_id ); - + /* Insert it into the new type */ if ( H5Tinsert( type_id2, member_name, curr_offset, member_type_id ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Get the fill value information *------------------------------------------------------------------------- @@ -2845,9 +2845,9 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) goto out; - + } /* i */ - + /*------------------------------------------------------------------------- * Create a new temporary dataset *------------------------------------------------------------------------- @@ -2874,9 +2874,9 @@ herr_t H5TBdelete_field( hid_t loc_id, * We have to read field by field of the old dataset and save it into the new one *------------------------------------------------------------------------- */ - for ( i = 0; i < nfields; i++) + for ( i = 0; i < nfields; i++) { - + /* Get the member name */ member_name = H5Tget_member_name( type_id1,(unsigned) i ); @@ -2903,23 +2903,23 @@ herr_t H5TBdelete_field( hid_t loc_id, goto out; tmp_buf = (unsigned char *)calloc((size_t) nrecords, member_size ); - + /* Read */ if ( H5Dread( dataset_id1, read_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /* Create a write id */ if ( ( write_type_id = H5Tcreate( H5T_COMPOUND, member_size )) < 0 ) goto out; - + /* The field in the file is found by its name */ if ( H5Tinsert( write_type_id, member_name, 0, member_type_id ) < 0 ) goto out; /* Create xfer properties to preserve initialized data */ - if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) + if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) goto out; - if (H5Pset_preserve (PRESERVE, 1)<0) + if (H5Pset_preserve (PRESERVE, 1)<0) goto out; /* Write */ @@ -2932,7 +2932,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) - goto out; + goto out; /* Close the read type */ if ( H5Tclose( read_type_id ) < 0 ) @@ -2941,10 +2941,10 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Close the write type */ if ( H5Tclose( write_type_id ) < 0 ) goto out; - + /* Release resources. */ free( member_name ); - free ( tmp_buf ); + free ( tmp_buf ); } /* i */ @@ -2952,7 +2952,7 @@ herr_t H5TBdelete_field( hid_t loc_id, * Release resources from 1st table *------------------------------------------------------------------------- */ - + /* Release the datatype. */ if ( H5Tclose( type_id1 ) < 0 ) goto out; @@ -2978,7 +2978,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Terminate access to the dataspace */ if ( H5Sclose( space_id2 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id2 ) < 0 ) return -1; @@ -2996,7 +2996,7 @@ herr_t H5TBdelete_field( hid_t loc_id, *------------------------------------------------------------------------- */ - if ( H5Gunlink( loc_id, dset_name ) < 0 ) + if ( H5Gunlink( loc_id, dset_name ) < 0 ) return -1; /*------------------------------------------------------------------------- @@ -3004,9 +3004,9 @@ herr_t H5TBdelete_field( hid_t loc_id, *------------------------------------------------------------------------- */ - if ( H5Gmove( loc_id, "new", dset_name ) < 0 ) + if ( H5Gmove( loc_id, "new", dset_name ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Attach the conforming table attributes *------------------------------------------------------------------------- @@ -3035,45 +3035,45 @@ herr_t H5TBdelete_field( hid_t loc_id, if ( has_fill == 1 ) { - + if (( space_id1 = H5Screate(H5S_SCALAR)) < 0 ) goto out; - + for ( i = 0; i < nfields; i++) { - + /* Get the member type */ if ( ( member_type_id = H5Tget_member_type( type_id1, (unsigned)i )) < 0 ) goto out; - + /* Get the member offset */ member_offset = H5Tget_member_offset( type_id1, (unsigned)i ); - + strcpy( attr_name, "FIELD_" ); sprintf( aux, "%d", (int)i ); strcat( attr_name, aux ); sprintf( aux, "%s", "_FILL" ); strcat( attr_name, aux ); - + if ( (attr_id = H5Acreate( dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, member_type_id, tmp_fill_buf+member_offset ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; - + /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) goto out; - + } - - /* Close data space. */ + + /* Close data space. */ if ( H5Sclose( space_id1 ) < 0 ) goto out; - + } /*has_fill*/ /* Release the datatype. */ @@ -3083,7 +3083,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* End access to the dataset */ if ( H5Dclose( dataset_id1 ) < 0 ) goto out; - + /* Release resources. */ free ( tmp_fill_buf ); @@ -3095,9 +3095,9 @@ out: } /*------------------------------------------------------------------------- - * + * * Table attribute functions - * + * *------------------------------------------------------------------------- */ @@ -3112,22 +3112,22 @@ out: * * Date: January 30, 2001 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ -herr_t H5TBAget_title( hid_t loc_id, - char *table_title ) +herr_t H5TBAget_title( hid_t loc_id, + char *table_title ) { /* Get the TITLE attribute */ if ( H5LT_get_attribute_disk( loc_id, "TITLE", table_title ) < 0 ) return -1; - + return 0; } @@ -3143,18 +3143,18 @@ herr_t H5TBAget_title( hid_t loc_id, * * Date: January 30, 2002 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ -herr_t H5TBAget_fill( hid_t loc_id, +herr_t H5TBAget_fill( hid_t loc_id, const char *dset_name, hid_t dset_id, - unsigned char *dst_buf ) + unsigned char *dst_buf ) { hsize_t nfields; @@ -3168,7 +3168,7 @@ herr_t H5TBAget_fill( hid_t loc_id, /* Get the number of records and fields */ if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0 ) return -1; - + src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t)); if (src_offset == NULL ) @@ -3217,7 +3217,7 @@ out: */ /*------------------------------------------------------------------------- - * Function: H5TBget_table_info + * Function: H5TBget_table_info * * Purpose: Gets the number of records and fields of a table * @@ -3230,26 +3230,26 @@ out: * Comments: * * Modifications: May 08, 2003 - * In version 2.0 of Table, the number of records is stored as an + * In version 2.0 of Table, the number of records is stored as an * attribute "NROWS" * * *------------------------------------------------------------------------- */ -herr_t H5TBget_table_info ( hid_t loc_id, +herr_t H5TBget_table_info ( hid_t loc_id, const char *dset_name, hsize_t *nfields, hsize_t *nrecords ) { - hid_t tid; + hid_t tid; hid_t sid=-1; hid_t did; int num_members; hsize_t dims[1]; int has_attr; hsize_t n[1]; - + /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) return -1; @@ -3270,19 +3270,19 @@ herr_t H5TBget_table_info ( hid_t loc_id, * Get number of records *------------------------------------------------------------------------- */ - + if (nrecords) { /* Try to find the attribute "NROWS" */ has_attr = H5LT_find_attribute( did, "NROWS" ); - + /* It exists, get it */ if ( has_attr == 1 ) { /* Get the attribute */ if ( H5LTget_attribute(loc_id,dset_name,"NROWS",H5T_NATIVE_LLONG,n)<0) return -1; - + *nrecords = *n; } else @@ -3290,15 +3290,15 @@ herr_t H5TBget_table_info ( hid_t loc_id, /* Get the dataspace handle */ if ( (sid = H5Dget_space( did )) < 0 ) goto out; - + /* Get records */ if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 ) goto out; - + /* Terminate access to the dataspace */ if ( H5Sclose( sid ) < 0 ) goto out; - + *nrecords = dims[0]; } }/*nrecords*/ @@ -3340,7 +3340,7 @@ out: * *------------------------------------------------------------------------- */ -herr_t H5TBget_field_info( hid_t loc_id, +herr_t H5TBget_field_info( hid_t loc_id, const char *dset_name, char *field_names[], size_t *field_sizes, @@ -3348,7 +3348,7 @@ herr_t H5TBget_field_info( hid_t loc_id, size_t *type_size ) { hid_t did; - hid_t ftype_id; + hid_t ftype_id; hid_t native_type_id; hssize_t nfields; char *member_name; @@ -3414,7 +3414,7 @@ herr_t H5TBget_field_info( hid_t loc_id, goto out; free( member_name ); - + } /* i */ /* Release the datatype. */ @@ -3459,19 +3459,19 @@ out: int H5TB_find_field( const char *field, const char *field_list ) { - const char *start = field_list; - const char *end; + const char *start = field_list; + const char *end; - while ( (end = strstr( start, "," )) != 0 ) { - if ( strncmp(start,field,(size_t)(end-start)) == 0 ) return 1; - start = end + 1; - } + while ( (end = strstr( start, "," )) != 0 ) { + if ( strncmp(start,field,(size_t)(end-start)) == 0 ) return 1; + start = end + 1; + } - if ( strcmp( start, field ) == 0 ) return 1; + if ( strcmp( start, field ) == 0 ) return 1; - return -1; + return -1; -} +} /*------------------------------------------------------------------------- @@ -3496,17 +3496,17 @@ int H5TB_find_field( const char *field, const char *field_list ) herr_t H5TB_attach_attributes( const char *table_title, - hid_t loc_id, + hid_t loc_id, const char *dset_name, hsize_t nfields, - hid_t tid ) + hid_t tid ) { char attr_name[255]; char *member_name; char aux[255]; hsize_t i; - + /* Attach the CLASS attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", TABLE_CLASS ) < 0 ) goto out; @@ -3514,7 +3514,7 @@ herr_t H5TB_attach_attributes( const char *table_title, /* Attach the VERSION attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "VERSION", "2.0" ) < 0 ) goto out; - + /* Attach the TITLE attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "TITLE", table_title ) < 0 ) goto out; @@ -3531,7 +3531,7 @@ herr_t H5TB_attach_attributes( const char *table_title, strcat( attr_name, aux ); sprintf( aux, "%s", "_NAME" ); strcat( attr_name, aux ); - + /* Attach the attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0 ) goto out; @@ -3565,10 +3565,10 @@ out: *------------------------------------------------------------------------- */ -hid_t H5TB_create_type(hid_t loc_id, +hid_t H5TB_create_type(hid_t loc_id, const char *dset_name, - size_t dst_size, - const size_t *dst_offset, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, hid_t ftype_id) { @@ -3587,7 +3587,7 @@ hid_t H5TB_create_type(hid_t loc_id, if ((fnames=malloc(sizeof(char*)*(size_t)nfields))==NULL) return -1; - for ( i=0; i<nfields; i++) + for ( i=0; i<nfields; i++) { if ((fnames[i]=malloc(sizeof(char)*HLTB_MAX_FIELD_LEN))==NULL) { free(fnames); @@ -3598,13 +3598,13 @@ hid_t H5TB_create_type(hid_t loc_id, /* get field info */ if ( H5TBget_field_info(loc_id,dset_name,fnames,NULL,NULL,NULL)<0) goto out; - + /* create the memory data type */ if ((mem_type_id=H5Tcreate(H5T_COMPOUND,dst_size))<0) goto out; /* get each field ID and adjust its size, if necessary */ - for ( i=0; i<nfields; i++) + for ( i=0; i<nfields; i++) { if ((mtype_id=H5Tget_member_type(ftype_id,i))<0) goto out; @@ -3624,7 +3624,7 @@ hid_t H5TB_create_type(hid_t loc_id, goto out; } - for ( i=0; i<nfields; i++) + for ( i=0; i<nfields; i++) { free (fnames[i]); } @@ -3638,7 +3638,7 @@ out: H5Tclose(mtype_id); H5Tclose(nmtype_id); } H5E_END_TRY; - for ( i=0; i<nfields; i++) + for ( i=0; i<nfields; i++) { if (fnames[i]) free (fnames[i]); diff --git a/hl/src/H5TB.h b/hl/src/H5TB.h index 015c158..ac0d619 100644 --- a/hl/src/H5TB.h +++ b/hl/src/H5TB.h @@ -47,7 +47,7 @@ extern "C" { */ H5_HLDLL herr_t H5TBmake_table( const char *table_title, - hid_t loc_id, + hid_t loc_id, const char *dset_name, hsize_t nfields, hsize_t nrecords, @@ -68,7 +68,7 @@ H5_HLDLL herr_t H5TBmake_table( const char *table_title, *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5TBappend_records( hid_t loc_id, +H5_HLDLL herr_t H5TBappend_records( hid_t loc_id, const char *dset_name, hsize_t nrecords, size_t type_size, @@ -76,7 +76,7 @@ H5_HLDLL herr_t H5TBappend_records( hid_t loc_id, const size_t *dst_sizes, const void *data ); -H5_HLDLL herr_t H5TBwrite_records( hid_t loc_id, +H5_HLDLL herr_t H5TBwrite_records( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, @@ -86,7 +86,7 @@ H5_HLDLL herr_t H5TBwrite_records( hid_t loc_id, const void *data ); -H5_HLDLL herr_t H5TBwrite_fields_name( hid_t loc_id, +H5_HLDLL herr_t H5TBwrite_fields_name( hid_t loc_id, const char *dset_name, const char *field_names, hsize_t start, @@ -96,7 +96,7 @@ H5_HLDLL herr_t H5TBwrite_fields_name( hid_t loc_id, const size_t *dst_sizes, const void *data ); -H5_HLDLL herr_t H5TBwrite_fields_index( hid_t loc_id, +H5_HLDLL herr_t H5TBwrite_fields_index( hid_t loc_id, const char *dset_name, hsize_t nfields, const int *field_index, @@ -117,15 +117,15 @@ H5_HLDLL herr_t H5TBwrite_fields_index( hid_t loc_id, -H5_HLDLL herr_t H5TBread_table( hid_t loc_id, +H5_HLDLL herr_t H5TBread_table( hid_t loc_id, const char *dset_name, - size_t dst_size, - const size_t *dst_offset, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, - void *dst_buf ); + void *dst_buf ); -H5_HLDLL herr_t H5TBread_fields_name( hid_t loc_id, +H5_HLDLL herr_t H5TBread_fields_name( hid_t loc_id, const char *dset_name, const char *field_names, hsize_t start, @@ -135,7 +135,7 @@ H5_HLDLL herr_t H5TBread_fields_name( hid_t loc_id, const size_t *dst_sizes, void *data ); -H5_HLDLL herr_t H5TBread_fields_index( hid_t loc_id, +H5_HLDLL herr_t H5TBread_fields_index( hid_t loc_id, const char *dset_name, hsize_t nfields, const int *field_index, @@ -147,7 +147,7 @@ H5_HLDLL herr_t H5TBread_fields_index( hid_t loc_id, void *data ); -H5_HLDLL herr_t H5TBread_records( hid_t loc_id, +H5_HLDLL herr_t H5TBread_records( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, @@ -164,12 +164,12 @@ H5_HLDLL herr_t H5TBread_records( hid_t loc_id, */ -H5_HLDLL herr_t H5TBget_table_info ( hid_t loc_id, +H5_HLDLL herr_t H5TBget_table_info ( hid_t loc_id, const char *dset_name, hsize_t *nfields, hsize_t *nrecords ); -H5_HLDLL herr_t H5TBget_field_info( hid_t loc_id, +H5_HLDLL herr_t H5TBget_field_info( hid_t loc_id, const char *dset_name, char *field_names[], size_t *field_sizes, @@ -185,13 +185,13 @@ H5_HLDLL herr_t H5TBget_field_info( hid_t loc_id, */ -H5_HLDLL herr_t H5TBdelete_record( hid_t loc_id, +H5_HLDLL herr_t H5TBdelete_record( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords ); -H5_HLDLL herr_t H5TBinsert_record( hid_t loc_id, +H5_HLDLL herr_t H5TBinsert_record( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, @@ -200,20 +200,20 @@ H5_HLDLL herr_t H5TBinsert_record( hid_t loc_id, const size_t *dst_sizes, void *data ); -H5_HLDLL herr_t H5TBadd_records_from( hid_t loc_id, +H5_HLDLL herr_t H5TBadd_records_from( hid_t loc_id, const char *dset_name1, hsize_t start1, hsize_t nrecords, const char *dset_name2, hsize_t start2 ); -H5_HLDLL herr_t H5TBcombine_tables( hid_t loc_id1, +H5_HLDLL herr_t H5TBcombine_tables( hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const char *dset_name2, const char *dset_name3 ); -H5_HLDLL herr_t H5TBinsert_field( hid_t loc_id, +H5_HLDLL herr_t H5TBinsert_field( hid_t loc_id, const char *dset_name, const char *field_name, hid_t field_type, @@ -221,22 +221,22 @@ H5_HLDLL herr_t H5TBinsert_field( hid_t loc_id, const void *fill_data, const void *data ); -H5_HLDLL herr_t H5TBdelete_field( hid_t loc_id, +H5_HLDLL herr_t H5TBdelete_field( hid_t loc_id, const char *dset_name, const char *field_name ); /*------------------------------------------------------------------------- - * + * * Table attribute functions - * + * *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5TBAget_title( hid_t loc_id, +H5_HLDLL herr_t H5TBAget_title( hid_t loc_id, char *table_title ); -H5_HLDLL herr_t H5TBAget_fill( hid_t loc_id, +H5_HLDLL herr_t H5TBAget_fill( hid_t loc_id, const char *dset_name, hid_t dset_id, unsigned char *dst_buf ); |