SD Programming Model - Example


The following fragment of code is an example of what the function calls might look like when reading an HDF file in a program:
C:
	sd_id = SDstart (filename, DFACC_READ);
	sds_index = SDnametoindex (sd_id, "Data_Set_Name")  
	sds_id = SDselect (sd_id, sds_index);
                  .
                  .
                  .
	istat = SDendaccess (sds_id);
	istat = SDend (sd_id);

FORTRAN:
	sd_id = sfstart (filename, DFACC_READ)
	sds_index = sfn2index (sd_id, 'Data_Set_Name') 
	sds_id = sfselect (sd_id, sds_index)
                   .
                   .
                   .
	istat = sfendacc (sds_id)
	istat = sfend (sd_id)>
Following are the steps: