[svn-r12764]

put the H5LTcreate_compound_type function inside the 
#ifdef NOT_YET
macro

meaning that the function is not used by us
This commit is contained in:
Pedro Vicente Nunes 2006-10-16 16:20:05 -05:00
parent 3300d035b0
commit c00121ce00
2 changed files with 134 additions and 88 deletions

View File

@ -2672,82 +2672,8 @@ out:
return FAIL; return FAIL;
} }
#ifdef NOT_YET
/*-------------------------------------------------------------------------
* 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, dst_buf, and vice-versa.
*
* Return: Success: 0, Failure: -1
*
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
*
* Date: January 17, 2002
*
* Comments:
*
* Modifications:
*
*
*-------------------------------------------------------------------------
*/
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 )
{
hsize_t i, j;
/* size of each field of destination data counting with padding */
size_t *size_pad = (size_t *)malloc((size_t)nfields * sizeof(size_t));
/* Shut compiler */
src_size=src_size;
src_offset=src_offset;
if ( size_pad == NULL )
goto out;
for ( i= 0; i < nfields; i++)
{
size_pad[i] = ( i == nfields-1 ? dst_size-dst_offset[i] : dst_offset[i+1]-dst_offset[i] );
}
/* Iterate tru the records */
for ( i = 0; i < nrecords; i++)
{
/* Iterate tru the members */
for ( j = 0; j < nfields; j++)
{
memcpy( dst_buf, src_buf, dst_sizes[j] );
dst_buf += size_pad[j];
src_buf += src_sizes[j];
}
}
if ( size_pad != NULL )
free( size_pad );
return 0;
out:
return -1;
}
#endif /* NOT_YET */
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
@ -3578,3 +3504,123 @@ out:
} }
#ifdef NOT_YET
/*-------------------------------------------------------------------------
* Function: H5LTcreate_compound_type
*
* Purpose:
*
* Return: Success: 0, Failure: -1
*
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
*
* Date: September 18, 2001
*
* Comments:
*
* Modifications:
*
*
*-------------------------------------------------------------------------
*/
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;
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++)
{
if ( H5Tinsert(tid, field_names[i], field_offset[i], field_types[i] ) < 0 )
goto out;
}
return tid;
out:
return -1;
}
/*-------------------------------------------------------------------------
* 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, dst_buf, and vice-versa.
*
* Return: Success: 0, Failure: -1
*
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
*
* Date: January 17, 2002
*
* Comments:
*
* Modifications:
*
*
*-------------------------------------------------------------------------
*/
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 )
{
hsize_t i, j;
/* size of each field of destination data counting with padding */
size_t *size_pad = (size_t *)malloc((size_t)nfields * sizeof(size_t));
/* Shut compiler */
src_size=src_size;
src_offset=src_offset;
if ( size_pad == NULL )
goto out;
for ( i= 0; i < nfields; i++)
{
size_pad[i] = ( i == nfields-1 ? dst_size-dst_offset[i] : dst_offset[i+1]-dst_offset[i] );
}
/* Iterate tru the records */
for ( i = 0; i < nrecords; i++)
{
/* Iterate tru the members */
for ( j = 0; j < nfields; j++)
{
memcpy( dst_buf, src_buf, dst_sizes[j] );
dst_buf += size_pad[j];
src_buf += src_sizes[j];
}
}
if ( size_pad != NULL )
free( size_pad );
return 0;
out:
return -1;
}
#endif /* NOT_YET */

View File

@ -331,7 +331,21 @@ H5_HLDLL herr_t H5LTget_attribute_info( hid_t loc_id,
H5_HLDLL hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type); H5_HLDLL hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type);
H5_HLDLL herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len); H5_HLDLL herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len);
/*-------------------------------------------------------------------------
*
* Utility functions
*
*-------------------------------------------------------------------------
*/
H5_HLDLL herr_t H5LTfind_attribute( hid_t loc_id, const char *name );
#ifdef NOT_YET #ifdef NOT_YET
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, H5_HLDLL herr_t H5LTrepack( hsize_t nfields,
hsize_t nrecords, hsize_t nrecords,
size_t src_size, size_t src_size,
@ -345,20 +359,6 @@ H5_HLDLL herr_t H5LTrepack( hsize_t nfields,
#endif /* NOT_YET */ #endif /* NOT_YET */
/*-------------------------------------------------------------------------
*
* Utility functions
*
*-------------------------------------------------------------------------
*/
H5_HLDLL herr_t H5LTfind_attribute( hid_t loc_id, const char *name );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif