Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Content Layer
id1195548671
Content Column
width50.00001%
id1195578110
classrm_pagetree_col mobile-hide
Content Block
id1195578111
 
Content Column
width50.00001%
id1195548673
classhdf-rm-main-column
Content Block
id1195548672

Include Content
render-without-blockstrue
page.rm-navbar
HTML Wrap
classhdf-print-only

Page Title

HTML Wrap
classhdf-rm-summary-block

Hdf rm anchor
AnchorNamesummary

Excerpt

Reads the table attribute fill values

HTML Wrap
classhdf-rm-content-block

Hdf rm anchor
AnchorNameprocedure

Procedure:
HTML Wrap
classhdf-rm-section
HTML Wrap
classhdf_procedure

H5TBA_GET_FILL ( loc_id, dset_name, dset_id, dst_buf )

Hdf rm anchor
AnchorNamesignature

Signature:
HTML Wrap
classhdf-rm-section
HTML Wrap
classhdf-togglebox hdf-c

HTML Add Class
hdf-togglebutton-visible
hdf-togglebutton-visible
selector.hdf-togglebutton.hdf-c

HTML
<pre><code class="language-c">htri_t H5TBAget_fill ( hid_t loc_id, const char *dset_name, hid_t dset_id, unsigned char *dst_buf )</code></pre>
Comment
HTML Wrap
classhdf-togglebox hdf-fortran hdf-togglebox-hidden

HTML Add Class
hdf-togglebutton-visible
hdf-togglebutton-visible
selector.hdf-togglebutton.hdf-fortran

HTML
<pre><code class="language-fortran">Replace this text with the Fortran function signature</code></pre>

Hdf rm anchor
AnchorNameparameters

Parameters:
HTML Wrap
classhdf-rm-section
hid_t loc_idIN: Location identifier of table
const char * dset_nameIN: Name of table
hid_t dset_idIN: Table identifier
unsigned char * dst_bufOUT: Buffer of fill values for table fields

Hdf rm anchor
AnchorNamedescription

Description:
HTML Wrap
classhdf-rm-section

H5TBA_GET_FILL reads the table attribute fill values into the buffer dst_buf for the table specified by dset_id and dset_name located in loc_id.

Hdf rm anchor
AnchorNamereturns

Returns:
HTML Wrap
classhdf-rm-section

A return value of 1 indicates that a fill value is present.

A return value of 0 indicates a fill value is not present.

A return value <0 indicates an error.

Hdf rm anchor
AnchorNameexample

Example:
HTML Wrap
classhdf-rm-section
              unsigned char tmp_fill_buf[40];
              ...
              
              file_id = H5Fopen (FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
              dataset_id = H5Dopen (file_id, TABLE_NAME, H5P_DEFAULT);
              datatype_id = H5Dget_type (dataset_id);
           
              status = H5TBget_table_info (file_id, TABLE_NAME, &nfields, &nrecords);
           
              hasfill = H5TBAget_fill (file_id, TABLE_NAME, dataset_id, tmp_fill_buf);
           
              for(i = 0; i < nfields; i++) {
                member_type_id = H5Tget_member_type (datatype_id, (unsigned)i);
                native_mem_type_id = H5Tget_native_type (member_type_id, H5T_DIR_ASCEND);
                member_offset = H5Tget_member_offset(datatype_id, (unsigned)i);
                printf ("member_offset: %i\n", member_offset);
                memb_class = H5Tget_class (member_type_id);
                switch (memb_class){
                   case H5T_INTEGER:
                      /* convert unsigned char array to integer */
                     break;
                   case H5T_FLOAT:
                     /* convert unsigned char array to double or float */
           
                     if (H5Tequal (native_mem_type_id, H5T_NATIVE_DOUBLE)) {
                     }
                     else if (H5Tequal (native_mem_type_id, H5T_NATIVE_FLOAT)) {
                        f.i =   tmp_fill_buf[member_offset] |
                               (tmp_fill_buf[member_offset+1] << 8)  |
                               (tmp_fill_buf[member_offset+2] << 16) |
                               (tmp_fill_buf[member_offset+3] << 24) ;
                        printf ("Field %i  Fill Value:  %lf\n", i, f.f);
                     }
                     break;
             
                    case H5T_STRING:
                      /* convert unsigned char array to string */
                     strsize= H5Tget_size (member_type_id);
           
                     printf ("Field %i  Fill Value: ", i);
                     for (j = 0;j<strsize;j++)
                       printf ("%c", tmp_fill_buf[member_offset+j]);
                     printf ("\n");
                     break;
                }

 

Comment
HTML Wrap
classhdf-togglebox hdf-c

Bitbucket Server file
repoSlugexamples
branchIdrefs/heads/master
projectKeySUP
filepathC/tableattr.c
showLineNumberstrue
lineStart62
progLangplain
lineEnd100
applicationLink5ac7b370-7412-3c8c-ad20-807a68261336

Comment
HTML Wrap
classhdf-togglebox hdf-fortran hdf-togglebox-hidden

Bitbucket Server file
repoSlughdf5
branchIdrefs/heads/1.10/master
projectKeyHDFFV
filepathfortran/examples/compound.f90
showLineNumberstrue
lineStart25
progLangplain
lineEnd35
applicationLink5ac7b370-7412-3c8c-ad20-807a68261336

Hdf rm anchor
AnchorNamehistory

History:
HTML Wrap
classhdf-rm-section