---
name: "g2ccompare.c"
section: "3"
platform: "linux"
package: "libg2c-dev"
version: "2.1.0-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/g2ccompare.c"
---

# g2ccompare.c(3)

Compare the metadata of two open GRIB2 files.

## NAME

g2ccompare.c - Compare the metadata of two open GRIB2 files.

## SYNOPSIS

`#include 'grib2_int.h'`\
 `#include <math.h>`\
 `#include <stdarg.h>`\

### Functions

int **g2c\_compare** (int g2cid1, int g2cid2)\
 Compare the metadata of two open GRIB2 files.

### Variables

**G2C\_FILE\_INFO\_T** **g2c\_file** \[**G2C\_MAX\_FILES**+1\]\
 Global file information.

## Detailed Description

Compare the metadata of two open GRIB2 files.

**Author**

Ed Hartnett

**Date**

Dec 28, 2022

Definition in file **g2ccompare.c**.

## Function Documentation

### int g2c\_compare (int g2cid1, int g2cid2)

Compare the metadata of two open GRIB2 files.

**Parameters**

*g2cid1* Indentifier for one file. \
 *g2cid2* Indentifier for the other file.

**Returns**

- •

  **G2C\_NOERROR** No error.

- •

  **G2C\_EINVAL** Invalid parameters.

- •

  **G2C\_EFILE** File I/O error.

**Author**

Ed Hartnett

**Date**

Dec 28, 2022

Definition at line **28** of file **g2ccompare.c**.

References **g2c\_message\_info::center**, **g2c\_section5\_info::data\_def**, **g2c\_message\_info::day**, **g2c\_message\_info::discipline**, **G2C\_EBADID**, **G2C\_ENOSECTION**, **G2C\_ERROR**, **g2c\_file**, **G2C\_MAX\_FILES**, **G2C\_NOERROR**, **g2c\_section3\_info::grid\_def**, **g2c\_message\_info::hour**, **g2c\_section3\_info::interp\_list**, **g2c\_message\_info::local\_version**, **LOG**, **g2c\_message\_info::master\_version**, **g2c\_message\_info::minute**, **g2c\_message\_info::month**, **g2c\_file\_info::msg**, **g2c\_message\_info::next**, **g2c\_section\_info::next**, **g2c\_section4\_info::num\_coord**, **g2c\_section3\_info::num\_data\_points**, **g2c\_section5\_info::num\_data\_points**, **g2c\_message\_info::num\_fields**, **g2c\_message\_info::num\_local**, **g2c\_file\_info::num\_messages**, **g2c\_section3\_info::num\_opt**, **g2c\_section\_info::prev**, **g2c\_section4\_info::prod\_def**, **g2c\_message\_info::sec**, **g2c\_section\_info::sec\_info**, **g2c\_section\_info::sec\_num**, **g2c\_message\_info::second**, **g2c\_message\_info::sig\_ref\_time**, **g2c\_section3\_info::source\_grid\_def**, **g2c\_message\_info::status**, **g2c\_message\_info::subcenter**, **g2c\_section\_info::template**, **g2c\_section\_info::template\_len**, **g2c\_message\_info::type**, and **g2c\_message\_info::year**.

Referenced by **main()**.

## Variable Documentation

### G2C\_FILE\_INFO\_T g2c\_file` [extern]`

Global file information.

Definition at line **30** of file **g2cfile.c**.

Referenced by **g2c\_compare()**.

## Author

Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.
