41 const char *blockmetaname,
66 if (hdfstatus ==
FAIL)
86 const char *blockmetaname,
92 int32 vdata_ref =
FAIL;
93 int32 vdata_id =
FAIL;
98 int vstart_active = 0;
101 if (blockmetaname == NULL ||
102 nfields == NULL || fieldlist == NULL)
108 hdfstatus =
Vstart(file_id);
109 if (hdfstatus ==
FAIL)
114 vdata_ref =
VSfind(file_id, blockmetaname);
118 vdata_id =
VSattach(file_id, vdata_ref,
"r");
119 if (vdata_id ==
FAIL)
124 if (num_fields ==
FAIL)
127 list = (
char*)malloc((
VSNAMELENMAX + 1) * num_fields *
sizeof(char));
133 if (hdfstatus ==
FAIL)
136 *nfields = num_fields;
137 *fieldlist = (
char**)calloc(num_fields,
sizeof(
char*));
138 if (*fieldlist == NULL)
141 temp = strtok(list,
",");
145 (*fieldlist)[i] = (
char*)malloc((strlen(temp) + 1) *
sizeof(char));
146 if ((*fieldlist)[i] == NULL)
148 strcpy((*fieldlist)[i],temp);
149 temp = strtok(NULL,
",");
158 if (hdfstatus ==
FAIL)
162 hdfstatus =
Vend(file_id);
163 if (hdfstatus ==
FAIL)
170 if (vdata_id !=
FAIL)
178 if (fieldlist != NULL && *fieldlist != NULL)
MTKt_status MtkStringListFree(int strcnt, char **strlist[])
Free string list.
HDFLIBAPI int32 VSdetach(int32 vkey)
#define MTK_ERR_CODE_JUMP(code)
HDFLIBAPI int32 VSfind(HFILEID f, const char *vsname)
HDFLIBAPI int32 VSgetfields(int32 vkey, char *fields)
HDFLIBAPI int32 VSattach(HFILEID f, int32 vsref, const char *accesstype)
#define MTK_ERR_COND_JUMP(code)
HDFLIBAPI int32 VFnfields(int32 vkey)