diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..beacb20 --- /dev/null +++ b/.clang-format @@ -0,0 +1,20 @@ +--- +Language: Cpp +UseTab: Always +TabWidth: 8 +AlignConsecutiveAssignments: + Enabled: true +AlignConsecutiveDeclarations: + Enabled: true +IndentWidth: 8 +PointerAlignment: Left +ColumnLimit: 0 +AllowShortIfStatementsOnASingleLine: Always +AllowShortBlocksOnASingleLine: Never +AllowShortFunctionsOnASingleLine: Empty +AllowShortLoopsOnASingleLine: true +SpaceBeforeParens: Never +AlignEscapedNewlines: DontAlign +SortIncludes: false +AllowShortEnumsOnASingleLine: false +#IndentPPDirectives: AfterHash diff --git a/external/xemil b/external/xemil index 178fe4a..750c295 160000 --- a/external/xemil +++ b/external/xemil @@ -1 +1 @@ -Subproject commit 178fe4aca775436db87de22765d5dcb52325981c +Subproject commit 750c29566540c46f5a480beb1e4abe032d6a0484 diff --git a/objs.mk b/objs.mk index 4e73336..d6602ae 100644 --- a/objs.mk +++ b/objs.mk @@ -59,6 +59,9 @@ src/src_process.o: src/process.c OBJS += src/src_seed.o src/src_seed.o: src/seed.c $(CC) $(CFLAGS) -c -o $@ src/seed.c +OBJS += src/src_simple.o +src/src_simple.o: src/simple.c + $(CC) $(CFLAGS) -c -o $@ src/simple.c OBJS += src/src_site.o src/src_site.o: src/site.c $(CC) $(CFLAGS) -c -o $@ src/site.c diff --git a/src/classic.c b/src/classic.c index 41c803c..7ac3ff6 100644 --- a/src/classic.c +++ b/src/classic.c @@ -17,8 +17,7 @@ void classic_stylesheet(FILE* out, const char* top) { free(nodes); } - if(breadcrumb_bgcolor == NULL) - breadcrumb_bgcolor = "#003366"; + if(breadcrumb_bgcolor == NULL) breadcrumb_bgcolor = "#003366"; fprintf(out, "body {\n"); fprintf(out, " padding: 0;\n"); @@ -130,8 +129,7 @@ void classic_stylesheet(FILE* out, const char* top) { void classic_head(FILE* out, const char* top, xl_node_t* header) { xl_node_t* child; - fprintf(out, " \n", - top); + fprintf(out, " \n", top); child = header->first_child; while(child != NULL) { @@ -141,10 +139,8 @@ void classic_head(FILE* out, const char* top, xl_node_t* header) { } } -void classic_body(FILE* out, const char* top, const char* title, - xl_node_t* body) { - char year[4 + 1 + 4 + - 1]; /* no one would use our software in year 10000... right? :) */ +void classic_body(FILE* out, const char* top, const char* title, xl_node_t* body) { + char year[4 + 1 + 4 + 1]; /* no one would use our software in year 10000... right? :) */ char* holder = "Unknown people"; char* sitesearch = NULL; xl_node_t** nodes; @@ -189,8 +185,7 @@ void classic_body(FILE* out, const char* top, const char* title, if(sitesearch == NULL) sitesearch = "https://invalid.link"; - fprintf(out, "
| \n"); if((nodes = xl_get_path(skinconf->root, "breadcrumb.link")) != NULL) { @@ -248,18 +237,14 @@ void classic_body(FILE* out, const char* top, const char* title, char* link = xl_get_attribute(nodes[i], "href"); char* name = xl_get_attribute(nodes[i], "name"); - if(link == NULL) - link = "https://invalid.link"; + if(link == NULL) link = "https://invalid.link"; link = u_path(top, link); - if(title == NULL) - title = link; + if(title == NULL) title = link; - if(i > 0) - fprintf(out, " |\n"); - fprintf(out, " %s\n", - link, name); + if(i > 0) fprintf(out, " |\n"); + fprintf(out, " %s\n", link, name); free(link); } @@ -267,28 +252,19 @@ void classic_body(FILE* out, const char* top, const char* title, free(nodes); } fprintf(out, " | \n"); - fprintf(out, "\n"); - fprintf(out, " |