5 "AWeather is a free real-time weather data viewer that "
6 "supports Level-II NEXRAD files, polarimetric radars, "
7 "and volume rendering.";
11 {"about", "About", print_about, 0.7, NULL},
12 {"news", "News", print_news, 0.3, NULL},
13 {"screenshots", "Screenshots", print_screenshots, 0.5, NULL},
14 {"download", "Download", print_download, 0.7, NULL},
15 {"development", "Development", print_development, 0.3, NULL},
16 {NULL, NULL, NULL, 0.0, NULL},
19 {"grits", "Grits", print_grits, 0.8, NULL},
20 {"rsl", "RSL", print_rsl, 0.3, NULL},
21 {NULL, NULL, NULL, 0.0, NULL},
24 {"contact", "Contact", print_contact, 0.2, NULL},
25 {NULL, NULL, NULL, 0.0, NULL},
28 {"", NULL, print_index, 1.0, desc},
29 {NULL, "Not found", print_notfound, -1.0, NULL},
30 {NULL, NULL, NULL, 0.0, NULL},
32 const page_t *everything[] = {header, other, footer, special, NULL};
33 const page_t *index = &special[0];
34 const page_t *notfound = &special[1];
37 int main(int argc, char **argv)
41 const gchar *name = g_getenv("PATH_INFO");
42 if (name == NULL || name[0] == '\0' || name[1] == '\0')
43 return print_page(index), 0;
45 /* Look up a specific page */
46 for (int i = 0; everything[i]; i++)
47 for (int j = 0; everything[i][j].link; j++) {
48 const page_t *page = &everything[i][j];
49 if (g_str_equal(name+1, page->link))
50 return print_page(page), 0;
53 /* Print sitemap by itself */
54 if (g_str_equal(name+1, "sitemap.xml"))
55 return print_sitemap(everything), 0;
58 return print_page(notfound), 0;