31 int large_file_index = 0;
42 while ((c = getopt(argc, argv,
"vlo:")) != -1)
53 if (!(fileout = malloc(
sizeof(
char) * strlen(optarg) + 1)))
55 strcpy(fileout, optarg);
59 fprintf(stderr,
"Unknown option `-%c'.\n", optopt);
61 fprintf(stderr,
"Unknown option character `\\x%x'.\n", optopt);
69 for (index = optind; index < argc; index++)
71 if (!(filein = malloc(
sizeof(
char) * strlen(argv[index]) + 1)))
73 strcpy(filein, argv[index]);
81 printf(
"g2c_index %s reading index file %s summarizing into %s.\n",
int main(int argc, char **argv)
Write a GRIB2 index file.
int g2c_open(const char *path, int mode, int *g2cid)
Open an existing GRIB2 file.
int g2c_close(int g2cid)
Close a GRIB2 file, freeing resources.
int g2c_write_index(int g2cid, int mode, const char *index_file)
Create an index file from a GRIB2 file, just like those created by the grb2index utility.
Header file for NCEPLIBS-g2c library.
#define G2C_LARGE_FILE_INDEX
Create a large file index.
#define G2C_ENOMEM
Out of memory.
#define G2C_ERROR
General error code, returned for some test errors.
#define G2C_VERSION
Current version of NCEPLIBS-g2c library.
#define G2C_CLOBBER
Destroy existing file.
#define G2C_NOWRITE
Set read-only access for g2c_open().
int g2c_set_log_level(int new_level)
Use this to set the global log level.