#include "MisrFileQuery.h"
#include "MisrError.h"
#include <mfhdf.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
|
MTKt_status | MtkFileAttrList (const char *filename, int *num_attrs, char **attrlist[]) |
| Get a list of file attributes. More...
|
|
MTKt_status | MtkFileAttrListNC (const char *filename, int *num_attrs, char **attrlist[]) |
|
MTKt_status | MtkFileAttrListHDF (const char *filename, int *num_attrs, char **attrlist[]) |
|
MTKt_status | MtkFileAttrListFid (int32 sd_id, int *num_attrs, char **attrlist[]) |
| Version of MtkFileAttrList that takes an HDF SD file identifier rather than a filename. More...
|
|
MTKt_status | MtkFileAttrListNcid (int ncid, int *num_attrs, char **attrlist[]) |
|
◆ MtkFileAttrList()
MTKt_status MtkFileAttrList |
( |
const char * |
filename, |
|
|
int * |
num_attrs, |
|
|
char ** |
attrlist[] |
|
) |
| |
Get a list of file attributes.
- Returns
- MTK_SUCCESS if successful.
- Example:
- In this example, we get a list of file attributes from the file
MISR_AM1_GRP_TERRAIN_GM_P161_O012115_DF_F03_0021.hdf
status =
MtkFileAttrList(
"MISR_AM1_GRP_TERRAIN_GM_P161_O012115_DF_F03_0021.hdf", &num_attrs, &attrlist);
- Note
- The caller is responsible for using MtkStringListFree() to free the memory used by attrlist
- Parameters
-
[in] | filename | File name |
[out] | num_attrs | Number of attributes |
[out] | attrlist | List of Attributes |
Definition at line 38 of file MtkFileAttrList.c.
◆ MtkFileAttrListFid()
MTKt_status MtkFileAttrListFid |
( |
int32 |
sd_id, |
|
|
int * |
num_attrs, |
|
|
char ** |
attrlist[] |
|
) |
| |
Version of MtkFileAttrList that takes an HDF SD file identifier rather than a filename.
- Returns
- MTK_SUCCESS if successful.
- Parameters
-
[in] | sd_id | HDF SD file identifier |
[out] | num_attrs | Number of attributes |
[out] | attrlist | List of Attributes |
Definition at line 127 of file MtkFileAttrList.c.
◆ MtkFileAttrListHDF()
MTKt_status MtkFileAttrListHDF |
( |
const char * |
filename, |
|
|
int * |
num_attrs, |
|
|
char ** |
attrlist[] |
|
) |
| |
- Parameters
-
[in] | filename | File name |
[out] | num_attrs | Number of attributes |
[out] | attrlist | List of Attributes |
Definition at line 86 of file MtkFileAttrList.c.
◆ MtkFileAttrListNC()
MTKt_status MtkFileAttrListNC |
( |
const char * |
filename, |
|
|
int * |
num_attrs, |
|
|
char ** |
attrlist[] |
|
) |
| |
- Parameters
-
[in] | filename | File name |
[out] | num_attrs | Number of attributes |
[out] | attrlist | List of Attributes |
Definition at line 51 of file MtkFileAttrList.c.
◆ MtkFileAttrListNcid()
MTKt_status MtkFileAttrListNcid |
( |
int |
ncid, |
|
|
int * |
num_attrs, |
|
|
char ** |
attrlist[] |
|
) |
| |
- Parameters
-
[in] | ncid | netCDF File ID |
[out] | num_attrs | Number of attributes |
[out] | attrlist | List of Attributes |
Definition at line 181 of file MtkFileAttrList.c.