00001 /* $Id: helpers2.h 172 2010-05-06 09:50:16Z oh2gve $ 00002 * 00003 * Copyright 2005, 2006, 2007, 2008, 2009, 2010 Tapio Sokura 00004 * Copyright 2007, 2008, 2009, 2010 Heikki Hannikainen 00005 * 00006 * Perl-to-C modifications 00007 * Copyright 2009, 2010 Tapio Aaltonen 00008 * 00009 * This file is part of libfap. 00010 * 00011 * Libfap may be copied only under the terms of either the Artistic License 00012 * or the GNU General Public License, which may be found in the libfap 00013 * source kit. 00014 * 00015 * APRS is a registered trademark of APRS Software and Bob Bruninga, WB4APR. 00016 */ 00017 00024 #ifndef HELPERS2_H 00025 #define HELPERS2_H 00026 00027 00028 #include "fap.h" 00029 00030 00032 #define MAX_DIGIS 8 00033 00035 #define KNOT_TO_KMH 1.852 00036 00038 #define MPH_TO_KMH 1.609344 00039 00041 #define KMH_TO_MS 10.0/36.0 00042 00044 #define MPH_TO_MS (MPH_TO_KMH * KMH_TO_MS) 00045 00047 #define FT_TO_M 0.3048 00048 00050 #define FAHRENHEIT_TO_CELCIUS(x) ((x-32.0)/1.8) 00051 00053 #define HINCH_TO_MM 0.254 00054 00055 00056 00058 typedef struct fapint_llist_item 00059 { 00061 char* text; 00063 struct fapint_llist_item* next; 00064 } fapint_llist_item_t; 00065 00066 00068 void fapint_clear_llist(fapint_llist_item_t* list); 00069 00070 00071 00073 00078 double fapint_get_pos_resolution(int const minute_digit_count); 00079 00080 00082 int fapint_parse_symbol_from_dst_callsign(fap_packet_t* packet); 00083 00084 00086 00092 int fapint_symbol_from_dst_type(char input[2], char* output); 00093 00094 00096 int fapint_is_number(char const* input); 00097 00098 00100 int fapint_check_date(unsigned int year, unsigned int month, unsigned int day); 00101 00102 00104 00112 int fapint_get_nmea_latlon(fap_packet_t* packet, char* field1, char* field2); 00113 00114 00116 void fapint_init_wx_report(fap_wx_report_t* wx_report); 00117 00118 00119 #endif // HELPERS2_H