bufr2synop 0.24.0
bufrnoaa.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2004-2022 by Guillermo Ballester Valor *
3 * gbv@oxixares.com *
4 * *
5 * This file is part of Ogimet *
6 * *
7 * Ogimet is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * Ogimet is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, see <http://www.gnu.org/licenses/>. *
19 * *
20 ***************************************************************************/
21/*!
22 \file bufrnoaa.h
23 \brief inclusion file for binary bufrnoaa
24*/
25#include <stdio.h>
26#include <stdlib.h>
27#include <string.h>
28#include <getopt.h>
29#include <time.h>
30#include <utime.h>
31#include <sys/time.h>
32#include <sys/stat.h>
33
34#define BLEN 1024
35// longitud maxima de un bufr 8 MB
36#define BUFRLEN 8388608
37
39extern int LISTF;
40extern unsigned char BUFR[BUFRLEN];
41extern unsigned char BUF[BLEN];
42extern char ENTRADA[256], PREFIX[64];
43extern struct stat INSTAT;
44extern char SEL[64], SELS[64], SELO[64], SELU[64];
45extern char OWN[];
46extern char HEADER_MARK;
47extern char FINAL_SEP[4];
48extern char SEP[];
49
50// Functions
51int is_bufr ( unsigned char *b );
52int is_endb ( unsigned char *b );
53int is_head ( unsigned char *b );
54int is_head_custom ( unsigned char *b, char mark );
55int timeval_substract ( struct timeval *result, struct timeval *x, struct timeval *y );
56int read_args ( int _argc, char * _argv[] );
57void print_usage ( void );
58void print_version ( void );
59int bufr_is_selected ( char *name );
60int date_mtime_from_stat ( char *date, struct stat *st );
61int mtime_from_stat ( char *filename, struct stat *st );
62
63
64
65
66
int bufr_is_selected(char *name)
returns 1 if selected message 0 otherwise
char SEP[]
Definition: bufrnoaa.c:206
int is_head_custom(unsigned char *b, char mark)
checks if an unsigned char from an array is the first char of repeated mark char four times
struct stat INSTAT
Definition: bufrnoaa.c:204
int SELECT
Definition: bufrnoaa.h:38
char ENTRADA[256]
Definition: bufrdeco_json.c:27
char HEADER_MARK
Definition: bufrnoaa.c:202
char SELU[64]
Definition: bufrnoaa.h:44
int read_args(int _argc, char *_argv[])
read the arguments from stdio
Definition: bufrdeco_json.c:63
char FINAL_SEP[4]
Definition: bufrnoaa.c:207
int is_endb(unsigned char *b)
checks if an unsigned char from an array is the first char of '7777'
int INDIVIDUAL
Definition: bufrnoaa.h:38
int mtime_from_stat(char *filename, struct stat *st)
modifies a file update time from a struct stat
unsigned char BUFR[BUFRLEN]
Definition: bufrdeco_json.c:25
int date_mtime_from_stat(char *date, struct stat *st)
get a string with date and time from a struct stat
char OWN[]
Definition: bufrnoaa.c:205
int is_head(unsigned char *b)
checks if an unsigned char from an array is the first char of '****'
void print_usage(void)
Definition: bufrdeco_json.c:37
unsigned char BUF[BLEN]
Definition: bufrnoaa.c:195
char PREFIX[64]
Definition: bufrnoaa.h:42
int is_bufr(unsigned char *b)
checks if an unsigned char from an array is the first char of 'BUFR'
char SELS[64]
Definition: bufrnoaa.h:44
int STAGE
Definition: bufrnoaa.c:192
int LISTF
Definition: bufrnoaa.c:193
int VERBOSE
Definition: bufrnoaa.h:38
#define BUFRLEN
Definition: bufrnoaa.h:36
char SELO[64]
Definition: bufrnoaa.h:44
void print_version(void)
Definition: bufrnoaa_io.c:114
#define BLEN
Definition: bufrnoaa.h:34
int COLECT
Definition: bufrnoaa.h:38
int timeval_substract(struct timeval *result, struct timeval *x, struct timeval *y)
Subtract the ‘struct timeval’ values X and Y, storing the result in RESULT.