source: trunk/WRF.COMMON/WRFV2/external/io_grib1/WGRIB/readgrib.c @ 3567

Last change on this file since 3567 was 11, checked in by aslmd, 14 years ago

spiga@svn-planeto:ajoute le modele meso-echelle martien

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
20int 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.