page_t header[] = {
{"about", "About", print_about, 0.7, NULL},
{"news", "News", print_news, 0.3, NULL},
page_t header[] = {
{"about", "About", print_about, 0.7, NULL},
{"news", "News", print_news, 0.3, NULL},
{"screenshots", "Screenshots", print_screenshots, 0.5, NULL},
{"download", "Download", print_download, 0.7, NULL},
{"development", "Development", print_development, 0.3, NULL},
{"screenshots", "Screenshots", print_screenshots, 0.5, NULL},
{"download", "Download", print_download, 0.7, NULL},
{"development", "Development", print_development, 0.3, NULL},
};
const page_t *everything[] = {header, other, footer, special, NULL};
const page_t *index = &special[0];
};
const page_t *everything[] = {header, other, footer, special, NULL};
const page_t *index = &special[0];
-const page_t *notfound = &special[1];
+const page_t *notfound = &special[2];
+
+/* Helper functions */
+void print_file(char *file)
+{
+ char data[512];
+ FILE *fd = fopen(file, "r");
+ while (!feof(fd)) {
+ size_t size = fread(data, 1, sizeof(data), fd);
+ fwrite(data, 1, size, stdout);
+ }
+}
if (name == NULL || name[0] == '\0' || name[1] == '\0')
return print_page(index), 0;
if (name == NULL || name[0] == '\0' || name[1] == '\0')
return print_page(index), 0;
for (int i = 0; everything[i]; i++)
for (int j = 0; everything[i][j].link; j++) {
const page_t *page = &everything[i][j];
for (int i = 0; everything[i]; i++)
for (int j = 0; everything[i][j].link; j++) {
const page_t *page = &everything[i][j];
return print_page(page), 0;
}
/* Print sitemap by itself */
return print_page(page), 0;
}
/* Print sitemap by itself */