6 "AWeather is a free real-time weather data viewer that "
7 "supports Level-II NEXRAD files, polarimetric radars, "
8 "and volume rendering.";
12 {"about", "About", print_about, 0.7, NULL},
13 {"news", "News", print_news, 0.3, NULL},
14 {"screenshots", "Screenshots", print_screenshots, 0.5, NULL},
15 {"download", "Download", print_download, 0.7, NULL},
16 {"development", "Development", print_development, 0.3, NULL},
17 {NULL, NULL, NULL, 0.0, NULL},
20 {"grits", "Grits", print_grits, 0.8, NULL},
21 {"rsl", "RSL", print_rsl, 0.3, NULL},
22 {NULL, NULL, NULL, 0.0, NULL},
25 {"contact", "Contact", print_contact, 0.2, NULL},
26 {NULL, NULL, NULL, 0.0, NULL},
29 {"", NULL, print_index, 1.0, desc},
30 {"oldnews", "Old News", print_oldnews, 0.2, NULL},
31 {NULL, "Not found", print_notfound, -1.0, NULL},
32 {NULL, NULL, NULL, 0.0, NULL},
34 const page_t *everything[] = {header, other, footer, special, NULL};
35 const page_t *index = &special[0];
36 const page_t *notfound = &special[1];
39 int main(int argc, char **argv)
43 const char *name = getenv("PATH_INFO");
44 if (name == NULL || name[0] == '\0' || name[1] == '\0')
45 return print_page(index), 0;
47 /* Look up a specific page */
48 for (int i = 0; everything[i]; i++)
49 for (int j = 0; everything[i][j].link; j++) {
50 const page_t *page = &everything[i][j];
51 if (!strcmp(name+1, page->link))
52 return print_page(page), 0;
55 /* Print sitemap by itself */
56 if (!strcmp(name+1, "sitemap.xml"))
57 return print_sitemap(everything), 0;
60 return print_page(notfound), 0;