Last change
on this file since 2759 was
2759,
checked in by aslmd, 2 years ago
|
adding unmodified code from WRFV3.0.1.1, expurged from useless data +1M size
|
File size:
567 bytes
|
Line | |
---|
1 | /* |
---|
2 | * read_grib.c |
---|
3 | * |
---|
4 | * reads grib message |
---|
5 | * |
---|
6 | * input: pos, byte position of grib message |
---|
7 | * len_grib, length of grib message |
---|
8 | * output: *buffer, grib message |
---|
9 | * |
---|
10 | * note: call seek_grib first |
---|
11 | * |
---|
12 | * v1.0 9/94 Wesley Ebisuzaki |
---|
13 | * |
---|
14 | */ |
---|
15 | #include <stdio.h> |
---|
16 | #include <stdlib.h> |
---|
17 | #include <stddef.h> |
---|
18 | #include "grib.h" |
---|
19 | |
---|
20 | int read_grib(FILE *file, long pos, long len_grib, unsigned char *buffer) { |
---|
21 | |
---|
22 | int i; |
---|
23 | |
---|
24 | |
---|
25 | if (fseek(file, pos, SEEK_SET) == -1) { |
---|
26 | return 0; |
---|
27 | } |
---|
28 | |
---|
29 | i = fread(buffer, sizeof (unsigned char), len_grib, file); |
---|
30 | return (i == len_grib); |
---|
31 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.