aboutsummaryrefslogtreecommitdiffstats
path: root/my-evolution/metar.h
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2001-06-09 04:47:52 +0800
committerIain Holmes <iain@src.gnome.org>2001-06-09 04:47:52 +0800
commitd09d4962997e9056652815aab81f49311a6a59a8 (patch)
tree807d49e73be441e0332b67f889b38c0b518f74ef /my-evolution/metar.h
parentda6c1c4d2ef41c60130e4de31160ee8107227588 (diff)
downloadgsoc2013-evolution-d09d4962997e9056652815aab81f49311a6a59a8.tar.gz
gsoc2013-evolution-d09d4962997e9056652815aab81f49311a6a59a8.tar.zst
gsoc2013-evolution-d09d4962997e9056652815aab81f49311a6a59a8.zip
Committing the new My Evolution.
svn path=/trunk/; revision=10163
Diffstat (limited to 'my-evolution/metar.h')
-rw-r--r--my-evolution/metar.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/my-evolution/metar.h b/my-evolution/metar.h
new file mode 100644
index 0000000000..ae9b1644d6
--- /dev/null
+++ b/my-evolution/metar.h
@@ -0,0 +1,46 @@
+/*
+ * metar.h
+ */
+
+#ifndef __METAR_H__
+#define __METAR_H__
+
+#define TIME_RE_STR "^([0-9]{6})Z$"
+#define WIND_RE_STR "^(([0-9]{3})|VRB)([0-9]?[0-9]{2})(G[0-9]?[0-9]{2})?KT$"
+#define VIS_RE_STR "^(([0-9]?[0-9])|(M?1/[0-9]?[0-9]))SM$"
+#define CLOUD_RE_STR "^(CLR|BKN|SCT|FEW|OVC)([0-9]{3})?$"
+#define TEMP_RE_STR "^(M?[0-9][0-9])/(M?[0-9][0-9])$"
+#define PRES_RE_STR "^(A|Q)([0-9]{4})$"
+#define COND_RE_STR "^(-|\\+)?(VC|MI|BC|PR|TS|BL|SH|DR|FZ)?(DZ|RA|SN|SG|IC|PE|GR|GS|UP|BR|FG|FU|VA|SA|HZ|PY|DU|SQ|SS|DS|PO|\\+?FC)$"
+
+enum {
+ TIME_RE,
+ WIND_RE,
+ VIS_RE,
+ CLOUD_RE,
+ TEMP_RE,
+ PRES_RE,
+ COND_RE,
+ RE_NUM
+};
+
+const char *weather_sky_string (Weather *w);
+char *weather_temp_string (Weather *w);
+const char *weather_conditions_string (Weather *w);
+
+void metar_init_re (void);
+gboolean metar_tok_time (char *token,
+ Weather *w);
+gboolean metar_tok_wind (char *tokp,
+ Weather *w);
+gboolean metar_tok_vis (char *tokp,
+ Weather *w);
+gboolean metar_tok_cloud (char *tokp,
+ Weather *w);
+gboolean metar_tok_pres (char *tokp,
+ Weather *w);
+gboolean metar_tok_temp (char *tokp,
+ Weather *w);
+gboolean metar_tok_cond (char *tokp,
+ Weather *w);
+#endif