Go to the documentation of this file.
23 int main(
int argc,
char *argv[]) {
24 char *sstfile = argv[1];
30 if ((fp = fopen(sstfile,
"r")) ==
NULL) {
31 printf(
"Error opening SST reference file %s for reading.\n", sstfile);
35 if (fseek(fp, 4, SEEK_SET) < 0) {
36 printf(
"Error reading SST reference file %s.\n", sstfile);
39 if (fread(&
syear,
sizeof (int32_t), 1, fp) != 1) {
40 printf(
"Error reading SST reference file %s.\n", sstfile);
43 fread(&smon,
sizeof (int32_t), 1, fp);
44 fread(&
sday,
sizeof (int32_t), 1, fp);
45 fread(&
eyear,
sizeof (int32_t), 1, fp);
46 fread(&emon,
sizeof (int32_t), 1, fp);
47 fread(&
eday,
sizeof (int32_t), 1, fp);
48 fread(&ndays,
sizeof (int32_t), 1, fp);
49 fread(&
version,
sizeof (int32_t), 1, fp);
50 fseek(fp, 4, SEEK_CUR);
63 printf(
"OI Reynolds SST file %s\n", sstfile);
64 printf(
"start_date=%.4d-%.2d-%.2d 00:00:00\n",
syear, smon,
sday);
65 printf(
"end_date=%.4d-%.2d-%.2d 23:59:59\n",
eyear, emon,
eday);
int main(int argc, char *argv[])
int endianess(void)
determine endianess
int swapc_bytes(char *in, int nbyte, int ntime)