/*
This source file is part of Scol
For the latest info, see http://www.scolring.org

Copyright (c) 2010 Stephane Bisaro, aka Iri <iri@irizone.net>

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
http://www.gnu.org/copyleft/lesser.txt

For others informations, please contact us from http://www.scolring.org/
*/


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

int nisalnum(char *, int);
int nisalpha(char *, int);
int nisdigit(char *, int);
int searchChar (char * word, char c);
char * nsubstr (char * string, int len);
char * nsubstr2 (char * r, char * string, int len);
void copyValue (char * om, char * word, int len);
void copyNegativeValue (char * om, char * word, int len);
void copyPositiveValue (char * om, char * word, int len);
void addWeather (char* om, const char * word);





#define SAFEfree(p)      { if (p) { free (p); (p) = NULL; } }

#define MAXWORD 100
#define DEFAULTINT 0

typedef struct outputMetar
{
    char code[6];       /* type du message */
    char oaci[5];       /* code de la station */
    char wind_dir[4];   /* direction du vent (en degré) */
    char wind_speed[3]; /* vitesse du vent */
    char wind_gust[3];  /* vitesse des rafales de vent */
    char wind_unit[4];  /* unité de mesure de la vitesse du vent (noeud, km/h, mps) */
    char wind_var_n[4]; /* variabilité dans la direction du vent (en degré) */
    char wind_var_x[4]; /* variabilité dans la direction du vent (en degré) */
    char visibility[5]; /* visibilité dominante */
    char weather[50];   /* temps présent (au moment de l'observation) */
    char nebul_low[7];  /* nébulosité en basse couche */
    char nebul_med[7];  /* nébulosité à l'étage moyen */
    char nebul_high[7]; /* nébulosité à l'étage élevé */
    char temp[4];       /* température mesurée */
    char temp_d[4];     /* température du point de rosée */
    char pressure[5];   /* pression atmosphérique (QNH) */
    char reweather[50]; /* temps récent (durant l'heure précédente) */
    char hour[3];       /* heure de l'observation */
    char minute[3];     /* minute de l'observation */
    char day[3];        /* jour de l'observation */
} OutputMetar;
