mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-18 15:15:56 +08:00
[svn-r7966] Purpose:
h5repack new features Description: added debugging functions and a hard link generated dataset for the test suite Solution: Platforms tested: linux solaris 2.7 IRIX Misc. update:
This commit is contained in:
parent
52a46001cb
commit
cd7b4b8b90
@ -57,6 +57,7 @@ int h5repack(const char* infile,
|
||||
/* copy the file */
|
||||
if (copy_file(infile,outfile,options)<0)
|
||||
return -1;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -19,6 +19,10 @@
|
||||
#include "hdf5.h"
|
||||
#include "h5trav.h"
|
||||
|
||||
#if 0
|
||||
#define H5_REPACK_DEBUG
|
||||
#endif
|
||||
|
||||
|
||||
#define PFORMAT "%-7s %-7s %-7s\n" /*chunk info, compression info, name*/
|
||||
#define PFORMAT1 "%-7s %-7s %-7s" /*chunk info, compression info, name*/
|
||||
@ -26,10 +30,6 @@
|
||||
#define MAX_NC_NAME 256 /* max length of a name */
|
||||
#define MAX_VAR_DIMS 32 /* max per variable dimensions */
|
||||
|
||||
#if 1
|
||||
#define H5_REPACK_DEBUG
|
||||
#endif
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* data structures for command line options
|
||||
|
@ -109,6 +109,11 @@ int copy_file(const char* fnamein,
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if defined (H5_REPACK_DEBUG)
|
||||
h5trav_printinfo(nobjects,travi);
|
||||
#endif
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* free
|
||||
*-------------------------------------------------------------------------
|
||||
|
@ -168,6 +168,10 @@ void write_dset_in(hid_t loc_id,
|
||||
write_dset(loc_id,1,dims,"string",type_id,buf1);
|
||||
status = H5Tclose(type_id);
|
||||
|
||||
|
||||
/* create hard link */
|
||||
status = H5Glink(loc_id, H5G_LINK_HARD, "string", "string_link");
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5T_BITFIELD
|
||||
*-------------------------------------------------------------------------
|
||||
|
@ -536,55 +536,6 @@ int diff( hid_t file1_id,
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: diff_list
|
||||
*
|
||||
* Purpose: print list of objects in file
|
||||
*
|
||||
* Return: void
|
||||
*
|
||||
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
||||
*
|
||||
* Date: May 9, 2003
|
||||
*
|
||||
* Comments:
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifdef NOT_YET
|
||||
void diff_list( const char *filename, int nobjects, trav_info_t *info )
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("File <%s>: # of entries = %d\n", filename, nobjects );
|
||||
for ( i = 0; i < nobjects; i++)
|
||||
{
|
||||
switch ( info[i].type )
|
||||
{
|
||||
case H5G_GROUP:
|
||||
printf(" %-10s %s\n", "group", info[i].name );
|
||||
break;
|
||||
case H5G_DATASET:
|
||||
printf(" %-10s %s\n", "dataset", info[i].name );
|
||||
break;
|
||||
case H5G_TYPE:
|
||||
printf(" %-10s %s\n", "datatype", info[i].name );
|
||||
break;
|
||||
case H5G_LINK:
|
||||
printf(" %-10s %s\n", "link", info[i].name );
|
||||
break;
|
||||
default:
|
||||
printf(" %-10s %s\n", "User defined object", info[i].name );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -467,3 +467,51 @@ int traverse( hid_t loc_id,
|
||||
return inserted_objs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: diff_list
|
||||
*
|
||||
* Purpose: print list of objects in file
|
||||
*
|
||||
* Return: void
|
||||
*
|
||||
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
||||
*
|
||||
* Date: May 9, 2003
|
||||
*
|
||||
* Comments:
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
void h5trav_printinfo(int nobjs, trav_info_t *travi)
|
||||
{
|
||||
int i;
|
||||
for ( i = 0; i < nobjs; i++)
|
||||
{
|
||||
switch ( travi[i].type )
|
||||
{
|
||||
case H5G_GROUP:
|
||||
printf(" %-10s %s\n", "group", travi[i].name );
|
||||
break;
|
||||
case H5G_DATASET:
|
||||
printf(" %-10s %s\n", "dataset", travi[i].name );
|
||||
break;
|
||||
case H5G_TYPE:
|
||||
printf(" %-10s %s\n", "datatype", travi[i].name );
|
||||
break;
|
||||
case H5G_LINK:
|
||||
printf(" %-10s %s\n", "link", travi[i].name );
|
||||
break;
|
||||
default:
|
||||
printf(" %-10s %s\n", "User defined object", travi[i].name );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -17,6 +17,10 @@
|
||||
|
||||
#include "hdf5.h"
|
||||
|
||||
#if 0
|
||||
#define H5_TRAV_DEBUG
|
||||
#endif
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* public struct to store name and type of an object
|
||||
@ -73,6 +77,9 @@ extern "C" {
|
||||
int h5trav_getinfo( hid_t file_id, trav_info_t *info );
|
||||
int h5trav_getindex( const char *obj, int nobjs, trav_info_t *info );
|
||||
void h5trav_freeinfo( trav_info_t *info, int nobjs );
|
||||
void h5trav_printinfo(int nobjs, trav_info_t *info);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user