28 unsigned char G = 0x47;
29 unsigned char R = 0x52;
30 unsigned char I = 0x49;
31 unsigned char B = 0x42;
32 unsigned char seven = 0x37;
34 assert(cgrib && lencurr);
37 if (cgrib[0] != G || cgrib[1] != R || cgrib[2] != I || cgrib[3] != B)
40 printf(
"GRIB not found in given message. A call to routine g2_create() "
41 "is required to to initialize GRIB messge.\n");
46 gbit(cgrib, lencurr, 96, 32);
49 if (cgrib[*lencurr - 4] == seven && cgrib[*lencurr - 3] == seven &&
50 cgrib[*lencurr - 2] == seven && cgrib[*lencurr - 1] == seven)
53 printf(
"GRIB message already complete. Cannot add new section.\n");
64 int g2_log_level = -1;
81 g2_log(
int severity,
const char *fmt, ...)
89 if (severity > g2_log_level)
95 fprintf(f,
"ERROR: ");
96 for (t = 0; t < severity; t++)
101 vfprintf(f, fmt, argp);
128 g2_log_level = new_level;
130 LOG((1,
"log_level changed to %d", g2_log_level));