[svn-r5066]

Purpose:
    Bug fix
Description:
    I borrowed function HDpackFstring from the HDF4 Library and
    left name unchanged. It causes linking problems for Fortran users
    that use both HDF4 and HDF5 Libraries in their applications.
Solution:
    Changed the name to be HD5packFstring
Platforms tested:
    Solaris 2.7
This commit is contained in:
Elena Pourmal 2002-03-14 15:12:12 -05:00
parent 34880b42a0
commit 7b77f97188
7 changed files with 19 additions and 19 deletions

View File

@ -439,7 +439,7 @@ nh5aget_name_c(hid_t_f *attr_id, size_t_f *bufsize, _fcd buf)
/*
* Convert C name to FORTRAN and place it in the given buffer
*/
HDpackFstring(c_buf, _fcdtocp(buf), (int)c_bufsize);
HD5packFstring(c_buf, _fcdtocp(buf), (int)c_bufsize);
HDfree(c_buf);
ret_value = (int_f)c_size;
return ret_value;

View File

@ -115,7 +115,7 @@ nh5eget_major_c(int_f* error_no, _fcd name)
* Call H5Eget_major function.
*/
c_name = H5Eget_major(c_error_no);
HDpackFstring((char*)c_name, _fcdtocp(name), strlen(c_name));
HD5packFstring((char*)c_name, _fcdtocp(name), strlen(c_name));
if(!strcmp(c_name, "Invalid major error number")) return ret_val;
ret_val = 0;
@ -145,7 +145,7 @@ nh5eget_minor_c(int_f* error_no, _fcd name)
* Call H5Eget_minor function.
*/
c_name = H5Eget_minor(c_error_no);
HDpackFstring((char*)c_name, _fcdtocp(name), strlen(c_name));
HD5packFstring((char*)c_name, _fcdtocp(name), strlen(c_name));
if(!strcmp(c_name, "Invalid minor error number")) return ret_val;
ret_val = 0;

View File

@ -165,7 +165,7 @@ nh5gget_obj_info_idx_c
* Convert C name to FORTRAN and place it in the given buffer
*/
c_obj_namelen = *obj_namelen;
HDpackFstring(c_obj_name, _fcdtocp(obj_name), c_obj_namelen);
HD5packFstring(c_obj_name, _fcdtocp(obj_name), c_obj_namelen);
if (c_obj_name) HDfree(c_obj_name);
if (c_name) HDfree(c_name);
@ -419,7 +419,7 @@ nh5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _f
/*
* Convert C name to FORTRAN and place it in the given buffer
*/
HDpackFstring(c_value, _fcdtocp(value), (int)*size);
HD5packFstring(c_value, _fcdtocp(value), (int)*size);
if(c_value) HDfree(c_value);
if(c_name) HDfree(c_name);
@ -529,7 +529,7 @@ nh5gget_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize,
/*
* Convert C name to FORTRAN and place it in the given buffer
*/
HDpackFstring(c_comment, _fcdtocp(comment), (int)*bufsize);
HD5packFstring(c_comment, _fcdtocp(comment), (int)*bufsize);
if(c_name) HDfree(c_name);
if(c_comment) HDfree(c_comment);

View File

@ -1238,8 +1238,8 @@ nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, h
if (ret < 0) return ret_value;
*meta_plist = c_meta_plist;
*raw_plist = c_raw_plist;
HDpackFstring(c_meta_ext, _fcdtocp(meta_ext), strlen(c_meta_ext));
HDpackFstring(c_raw_ext, _fcdtocp(raw_ext), strlen(c_raw_ext));
HD5packFstring(c_meta_ext, _fcdtocp(meta_ext), strlen(c_meta_ext));
HD5packFstring(c_raw_ext, _fcdtocp(raw_ext), strlen(c_raw_ext));
ret_value = 0;
return ret_value;
@ -1493,7 +1493,7 @@ nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f*
*filter_id = c_filter;
*cd_nelmts = c_cd_nelmts;
*flags = c_flags;
HDpackFstring(c_name, _fcdtocp(name), strlen(c_name));
HD5packFstring(c_name, _fcdtocp(name), strlen(c_name));
for (i = 0; i < c_cd_nelmts; i++)
cd_values[i] = (int_f)c_cd_values[i];
@ -1625,7 +1625,7 @@ nh5pget_external_c(hid_t_f *prp_id,int*idx, size_t_f* name_size, _fcd name, int_
*offset = (int_f)c_offset;
*bytes = (hsize_t_f)size;
HDpackFstring(c_name, _fcdtocp(name), strlen(c_name));
HD5packFstring(c_name, _fcdtocp(name), strlen(c_name));
HDfree(c_name);
ret_value = 0;

View File

@ -981,7 +981,7 @@ nh5tget_member_name_c ( hid_t_f *type_id ,int_f* index, _fcd member_name, int_f
c_name = H5Tget_member_name(c_type_id, c_index);
if (c_name == NULL ) return ret_value;
HDpackFstring(c_name, _fcdtocp(member_name), strlen(c_name));
HD5packFstring(c_name, _fcdtocp(member_name), strlen(c_name));
*namelen = (int_f)strlen(c_name);
HDfree(c_name);
ret_value = 0;
@ -1389,7 +1389,7 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen)
c_name = (char *)malloc(sizeof(char)*c_namelen);
c_type_id = *type_id;
error = H5Tenum_nameof(c_type_id, &c_value, c_name, c_namelen);
HDpackFstring(c_name, _fcdtocp(name), strlen(c_name));
HD5packFstring(c_name, _fcdtocp(name), strlen(c_name));
HDfree(c_name);
if(error < 0) return ret_value;
@ -1524,7 +1524,7 @@ nh5tget_tag_c(hid_t_f* type_id, _fcd tag, int_f* taglen)
c_tag = H5Tget_tag(c_type_id);
if (c_tag == NULL ) return ret_value;
HDpackFstring(c_tag, _fcdtocp(tag), strlen(c_tag));
HD5packFstring(c_tag, _fcdtocp(tag), strlen(c_tag));
*taglen = strlen(c_tag);
HDfree(c_tag);
ret_value = 0;

View File

@ -69,12 +69,12 @@ HD5f2cstring(_fcd fdesc, int len)
return cstr;
} /* HD5f2cstring */
/* ---------------------------- HDpackFstring ----------------------------- */
/* ---------------------------- HD5packFstring ----------------------------- */
/*
NAME
HDpackFstring -- convert a C string into a Fortran string
HD5packFstring -- convert a C string into a Fortran string
USAGE
int HDpackFstring(src, dest, len)
int HD5packFstring(src, dest, len)
char * src; IN: source string
char * dest; OUT: destination
int len; IN: length of string
@ -90,7 +90,7 @@ DESCRIPTION
---------------------------------------------------------------------------*/
int
HDpackFstring(char *src, char *dest, int len)
HD5packFstring(char *src, char *dest, int len)
{
int sofar;
@ -101,5 +101,5 @@ HDpackFstring(char *src, char *dest, int len)
*dest++ = ' ';
return 0;
} /* HDpackFstring */
} /* HD5packFstring */

View File

@ -4,7 +4,7 @@
#include "H5Git.h"
__DLL__ int HD5c2fstr(char *str, int len);
__DLL__ char * HD5f2cstring (_fcd fdesc, int len);
__DLL__ int HDpackFstring(char *src, char *dest, int len);
__DLL__ int HD5packFstring(char *src, char *dest, int len);
/*
* Functions from H5Ff.c