aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/blogc-git-receiver.c7
-rw-r--r--src/blogc-runserver.c6
-rw-r--r--src/blogc.c9
-rw-r--r--src/content-parser.c5
-rw-r--r--src/content-parser.h2
-rw-r--r--src/debug.c5
-rw-r--r--src/error.c5
-rw-r--r--src/error.h3
-rw-r--r--src/file.c6
-rw-r--r--src/file.h2
-rw-r--r--src/loader.c6
-rw-r--r--src/renderer.c8
-rw-r--r--src/source-parser.c6
-rw-r--r--src/source-parser.h2
-rw-r--r--src/template-parser.c5
-rw-r--r--src/template-parser.h1
-rw-r--r--src/utf8.c3
-rw-r--r--src/utf8.h3
-rw-r--r--src/utils.c6
-rw-r--r--src/utils.h2
20 files changed, 25 insertions, 67 deletions
diff --git a/src/blogc-git-receiver.c b/src/blogc-git-receiver.c
index e717259..820fce5 100644
--- a/src/blogc-git-receiver.c
+++ b/src/blogc-git-receiver.c
@@ -6,12 +6,8 @@
* See the file LICENSE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif /* HAVE_CONFIG_H */
-
-#include <stdarg.h>
#include <stdbool.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -19,7 +15,6 @@
#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include <dirent.h>
#include <time.h>
diff --git a/src/blogc-runserver.c b/src/blogc-runserver.c
index 81bd5f9..603946d 100644
--- a/src/blogc-runserver.c
+++ b/src/blogc-runserver.c
@@ -13,21 +13,21 @@
#include <event2/event.h>
#include <event2/http.h>
#include <event2/buffer.h>
-#include <event2/keyvalq_struct.h>
#include <magic.h>
#include <signal.h>
-#include <stdarg.h>
#include <stdbool.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "utils.h"
+struct evhttp_request;
+
/**
* this mapping is used to declare "supported" file types, that are forced over
diff --git a/src/blogc.c b/src/blogc.c
index 20e1756..c90070d 100644
--- a/src/blogc.c
+++ b/src/blogc.c
@@ -14,18 +14,15 @@
#include <sys/stat.h>
#endif /* HAVE_SYS_STAT_H */
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif /* HAVE_SYS_TYPES_H */
-
#include <errno.h>
#include <locale.h>
#include <stdbool.h>
#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
#include <string.h>
#include "debug.h"
-#include "source-parser.h"
#include "template-parser.h"
#include "loader.h"
#include "renderer.h"
@@ -78,7 +75,7 @@ blogc_mkdir_recursive(const char *filename)
for (char *tmp = fname; *tmp != '\0'; tmp++) {
if (*tmp != '/' && *tmp != '\\')
continue;
-#if defined(HAVE_SYS_STAT_H) && defined(HAVE_SYS_TYPES_H)
+#ifdef HAVE_SYS_STAT_H
char bkp = *tmp;
*tmp = '\0';
if ((strlen(fname) > 0) &&
diff --git a/src/content-parser.c b/src/content-parser.c
index b4bc790..ca0597b 100644
--- a/src/content-parser.c
+++ b/src/content-parser.c
@@ -6,11 +6,8 @@
* See the file LICENSE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif /* HAVE_CONFIG_H */
-
#include <stdbool.h>
+#include <stdlib.h>
#include <string.h>
#include "content-parser.h"
diff --git a/src/content-parser.h b/src/content-parser.h
index 85bd063..37e38d7 100644
--- a/src/content-parser.h
+++ b/src/content-parser.h
@@ -9,7 +9,7 @@
#ifndef _CONTENT_PARSER_H
#define _CONTENT_PARSER_H
-#include <stdlib.h>
+#include <stddef.h>
#include <stdbool.h>
char* blogc_slugify(const char *str);
diff --git a/src/debug.c b/src/debug.c
index 7039608..9689028 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -6,15 +6,10 @@
* See the file LICENSE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif /* HAVE_CONFIG_H */
-
#include <stdio.h>
#include "template-parser.h"
#include "utils.h"
-
#include "debug.h"
diff --git a/src/error.c b/src/error.c
index 0c297b9..c238f51 100644
--- a/src/error.c
+++ b/src/error.c
@@ -6,14 +6,9 @@
* See the file LICENSE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif /* HAVE_CONFIG_H */
-
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
-#include <string.h>
#include "error.h"
#include "utils.h"
diff --git a/src/error.h b/src/error.h
index acaf49e..31fbaf2 100644
--- a/src/error.h
+++ b/src/error.h
@@ -9,8 +9,7 @@
#ifndef _ERROR_H
#define _ERROR_H
-#include <stdlib.h>
-#include <stdarg.h>
+#include <stddef.h>
typedef enum {
BLOGC_ERROR_SOURCE_PARSER = 1,
diff --git a/src/file.c b/src/file.c
index 547f2f7..dc43056 100644
--- a/src/file.c
+++ b/src/file.c
@@ -6,12 +6,10 @@
* See the file LICENSE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif /* HAVE_CONFIG_H */
-
#include <errno.h>
#include <stdarg.h>
+#include <stdbool.h>
+#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "file.h"
diff --git a/src/file.h b/src/file.h
index 97e5274..d2c4390 100644
--- a/src/file.h
+++ b/src/file.h
@@ -9,8 +9,8 @@
#ifndef _FILE_H
#define _FILE_H
+#include <stddef.h>
#include <stdio.h>
-#include <stdlib.h>
#include "error.h"
#define BLOGC_FILE_CHUNK_SIZE 1024
diff --git a/src/loader.c b/src/loader.c
index 5ca0aac..bd3251e 100644
--- a/src/loader.c
+++ b/src/loader.c
@@ -6,13 +6,11 @@
* See the file LICENSE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif /* HAVE_CONFIG_H */
-
#include <math.h>
#include <stdbool.h>
+#include <stddef.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include "file.h"
#include "source-parser.h"
diff --git a/src/renderer.c b/src/renderer.c
index c9cc15b..27e92bd 100644
--- a/src/renderer.c
+++ b/src/renderer.c
@@ -6,18 +6,14 @@
* See the file LICENSE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif /* HAVE_CONFIG_H */
-
#include <errno.h>
#include <stdbool.h>
+#include <stddef.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include "datetime-parser.h"
#include "error.h"
-#include "loader.h"
-#include "source-parser.h"
#include "template-parser.h"
#include "renderer.h"
#include "utils.h"
diff --git a/src/source-parser.c b/src/source-parser.c
index f250bd3..5d29213 100644
--- a/src/source-parser.c
+++ b/src/source-parser.c
@@ -6,11 +6,7 @@
* See the file LICENSE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif /* HAVE_CONFIG_H */
-
-#include <stdbool.h>
+#include <stdlib.h>
#include <string.h>
#include "content-parser.h"
diff --git a/src/source-parser.h b/src/source-parser.h
index 5cadf95..0d54742 100644
--- a/src/source-parser.h
+++ b/src/source-parser.h
@@ -9,7 +9,7 @@
#ifndef _SOURCE_PARSER_H
#define _SOURCE_PARSER_H
-#include <stdlib.h>
+#include <stddef.h>
#include "error.h"
#include "utils.h"
diff --git a/src/template-parser.c b/src/template-parser.c
index 7e9a444..6ca6eb7 100644
--- a/src/template-parser.c
+++ b/src/template-parser.c
@@ -6,11 +6,8 @@
* See the file LICENSE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif /* HAVE_CONFIG_H */
-
#include <stdbool.h>
+#include <stdlib.h>
#include <string.h>
#include "template-parser.h"
diff --git a/src/template-parser.h b/src/template-parser.h
index fe2721e..19df6af 100644
--- a/src/template-parser.h
+++ b/src/template-parser.h
@@ -9,6 +9,7 @@
#ifndef _TEMPLATE_PARSER_H
#define _TEMPLATE_PARSER_H
+#include <stddef.h>
#include "error.h"
#include "utils.h"
diff --git a/src/utf8.c b/src/utf8.c
index 0c04d60..a2f4fdd 100644
--- a/src/utf8.c
+++ b/src/utf8.c
@@ -26,7 +26,8 @@
// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
#include <stdbool.h>
-#include <inttypes.h>
+#include <stddef.h>
+#include <stdint.h>
#include "utils.h"
#define UTF8_ACCEPT 0
diff --git a/src/utf8.h b/src/utf8.h
index 582ae1c..06fe07e 100644
--- a/src/utf8.h
+++ b/src/utf8.h
@@ -9,8 +9,9 @@
#ifndef _UTF_8_H
#define _UTF_8_H
-#include <inttypes.h>
#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
#include "utils.h"
bool blogc_utf8_validate(const uint8_t *str, size_t len);
diff --git a/src/utils.c b/src/utils.c
index 9a39c61..b42ae4e 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -6,17 +6,11 @@
* See the file LICENSE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif /* HAVE_CONFIG_H */
-
#define SB_STRING_CHUNK_SIZE 128
-#include <ctype.h>
#include <string.h>
#include <stdarg.h>
#include <stdbool.h>
-#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/src/utils.h b/src/utils.h
index aefcbf3..aca02c0 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -12,8 +12,6 @@
#include <stddef.h>
#include <stdarg.h>
#include <stdbool.h>
-#include <stdarg.h>
-#include <stdlib.h>
// memory