Re: Strings

NOTE: The netcdf-hdf mailing list is no longer active. The list archives are made available for historical reasons.

Hi Ed,

H5Dvlen_reclaim is used to release memory allocated by library while reading variable-length data. You may use free function to deallocate array of char pointers, i.e.
for (i=0; i<N; i++)  free read_txt[i];

or you may use H5Dvlen_reclaim (type_id, space_id, H5P_DEFAULT, read_txt)
where type_id corresponds to the variable string datatypes and space_id corresponds to 1-DIM array of size N.

The name of the function is misleading. It should be probably H5Tvlen_reclaim

In the example I sent you yesterday, I used free function, since the attribute was just one string (not an array of strings and not a compound datatype that had string member).

At 12:24 PM 9/15/2005, Ed Hartnett wrote:
Elena Pourmal <epourmal@xxxxxxxxxxxxx> writes:

> I believe you just allocate array of char pointers, then library does
> the rest. You only have to use
> H5Dvlen_reclaim function after you are done. See tvlstr.c test in the
> test directory.
> Elena

Does that mean that instead of a pointer to char * I should be
allocated for hvl_t types?


Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx

Elena Pourmal, HDF QA, Maintenance and Support Team Leader
NCSA University of Illinois at Urbana-Champaign
605 E. Springfield Ave.
Champaign, IL 61820

(217)333-0238 (office)
(217)244-1987 (fax)

  • 2005 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-hdf archives: