43 char ***blockmetalist )
64 if (hdf_status ==
FAIL)
85 char ***blockmetalist )
90 int32 vdata_ref =
FAIL;
91 int32 vdata_id =
FAIL;
93 char **temp_list = NULL;
95 int temp_list_max = 5;
97 int vstart_active = 0;
99 if (nblockmeta == NULL || blockmetalist == NULL)
103 hdf_status =
Vstart(file_id);
104 if (hdf_status ==
FAIL)
108 temp_list = (
char**)calloc(temp_list_max,
sizeof(
char*));
109 if (temp_list == NULL)
113 vdata_ref =
VSgetid(file_id, vdata_ref);
114 while (vdata_ref !=
FAIL)
116 vdata_id =
VSattach(file_id, vdata_ref,
"r");
117 if (vdata_id ==
FAIL)
120 hdf_status =
VSgetname(vdata_id, vdata_name);
121 if (hdf_status ==
FAIL)
124 if (strstr(vdata_name,
"Metadata") != NULL && strstr(vdata_name,
"Block") != NULL)
126 if (temp_list_max == temp_count)
129 temp_list = (
char**)realloc(temp_list,temp_list_max);
130 if (temp_list == NULL)
134 temp_list[temp_count] = (
char*)malloc((strlen(vdata_name) + 1) *
136 if (temp_list[temp_count] == NULL)
139 strcpy(temp_list[temp_count],vdata_name);
144 if (hdf_status ==
FAIL)
148 vdata_ref =
VSgetid(file_id, vdata_ref);
152 hdf_status =
Vend(file_id);
153 if (hdf_status ==
FAIL)
158 *nblockmeta = temp_count;
160 *blockmetalist = (
char**)malloc(temp_count *
sizeof(
char*));
161 if (*blockmetalist == NULL)
164 for (i = 0; i < temp_count; ++i)
165 (*blockmetalist)[i] = temp_list[i];
172 if (vdata_id !=
FAIL)
MTKt_status MtkStringListFree(int strcnt, char **strlist[])
Free string list.
HDFLIBAPI int32 VSdetach(int32 vkey)
#define MTK_ERR_CODE_JUMP(code)
HDFLIBAPI int32 VSgetid(HFILEID f, int32 vsref)
HDFLIBAPI int32 VSgetname(int32 vkey, char *vsname)
HDFLIBAPI int32 VSattach(HFILEID f, int32 vsref, const char *accesstype)
#define MTK_ERR_COND_JUMP(code)