| @@ -1,9 +1,3 @@ | |||
| #include "cms_build.h" | |||
| #include "cms_err.h" | |||
| #include "cms_files.h" | |||
| #include "cms_util.h" | |||
| #include "cms_page.h" | |||
| #include "cms_post.h" | |||
| #include <sys/stat.h> | |||
| #include <sys/types.h> | |||
| #include <dirent.h> | |||
| @@ -11,6 +5,13 @@ | |||
| #include <stdlib.h> | |||
| #include <string.h> | |||
| #include "cms_build.h" | |||
| #include "cms_err.h" | |||
| #include "cms_files.h" | |||
| #include "cms_util.h" | |||
| #include "cms_page.h" | |||
| #include "cms_post.h" | |||
| cms_err* cms_build_make_tree(cms_page* root, char* path, char* dirname) | |||
| { | |||
| DIR* dp = opendir(path); | |||
| @@ -1,13 +1,14 @@ | |||
| #include "cms_err.h" | |||
| #include <stdio.h> | |||
| #include <string.h> | |||
| #include <stdlib.h> | |||
| #include <errno.h> | |||
| #ifdef DEBUG | |||
| #include <error.h> | |||
| #endif | |||
| #include "cms_err.h" | |||
| static char* get_error_message(cms_err* err) | |||
| { | |||
| switch (err->code) | |||
| @@ -1,12 +1,13 @@ | |||
| #include "cms_page.h" | |||
| #include "cms_err.h" | |||
| #include <stdlib.h> | |||
| #include <stddef.h> | |||
| #include <string.h> | |||
| #include <dirent.h> | |||
| #include <sys/types.h> | |||
| #include <errno.h> | |||
| #include "cms_page.h" | |||
| #include "cms_err.h" | |||
| #include <stdlib.h> | |||
| #define PREFIX_LENGTH 5 | |||
| cms_page* cms_page_create() | |||
| @@ -1,9 +1,10 @@ | |||
| #ifndef CMS_PAGE_H | |||
| #define CMS_PAGE_H | |||
| #include <stddef.h> | |||
| #include "cms_err.h" | |||
| #include "cms_post.h" | |||
| #include <stddef.h> | |||
| typedef struct cms_page | |||
| { | |||
| @@ -1,9 +1,10 @@ | |||
| #include "cms_post.h" | |||
| #include "cms_err.h" | |||
| #include <stdlib.h> | |||
| #include <stddef.h> | |||
| #include <string.h> | |||
| #include "cms_post.h" | |||
| #include "cms_err.h" | |||
| #define PREFIX_LENGTH 5 | |||
| cms_post* cms_post_create() | |||
| @@ -1,5 +1,3 @@ | |||
| #include "cms_util.h" | |||
| #include "cms_err.h" | |||
| #include <fcntl.h> | |||
| #include <unistd.h> | |||
| #include <stdio.h> | |||
| @@ -11,6 +9,9 @@ | |||
| #include <sys/types.h> | |||
| #include <errno.h> | |||
| #include "cms_util.h" | |||
| #include "cms_err.h" | |||
| int cms_util_file_exists(char* fname) | |||
| { | |||
| int f = open(fname, O_RDONLY); | |||