kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit c1723f2db5dc4d90314df799ac98f6ad05e36d60
parent bbc98cf2a77dcbdf3cec761ddb4b7887c4bef11c
Author: Joris Vink <joris@coders.se>
Date:   Sat,  6 Jul 2013 20:55:22 +0200

Clean up header includes, based on a diff from Ewan Higgs via github.
And while we're messing in it, make sure bsd.c compiles again.

Diffstat:
Makefile | 6+++---
includes/kore.h | 15+++++++++++++++
includes/spdy.h | 3+++
src/accesslog.c | 21+--------------------
src/buf.c | 21---------------------
src/config.c | 21+--------------------
src/connection.c | 26+-------------------------
src/domain.c | 25-------------------------
src/http.c | 19-------------------
src/kore.c | 26+-------------------------
src/linux.c | 24------------------------
src/mem.c | 23-----------------------
src/module.c | 23+----------------------
src/net.c | 21---------------------
src/spdy.c | 20--------------------
src/utils.c | 23-----------------------
src/worker.c | 26++------------------------
17 files changed, 28 insertions(+), 315 deletions(-)

diff --git a/Makefile b/Makefile @@ -3,9 +3,9 @@ CC=gcc BIN=kore -S_SRC+= src/kore.c src/buf.c src/config.c src/net.c src/spdy.c src/http.c \ - src/accesslog.c src/domain.c src/module.c src/utils.c \ - src/worker.c src/connection.c src/mem.c src/zlib_dict.c +S_SRC+= src/kore.c src/accesslog.c src/buf.c src/config.c src/connection.c \ + src/domain.c src/http.c src/mem.c src/module.c src/net.c src/spdy.c \ + src/utils.c src/worker.c src/zlib_dict.c S_OBJS= $(S_SRC:.c=.o) CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes diff --git a/includes/kore.h b/includes/kore.h @@ -17,6 +17,21 @@ #ifndef __H_KORE_H #define __H_KORE_H +#include <sys/queue.h> + +#include <netinet/in.h> +#include <arpa/inet.h> + +#include <openssl/err.h> +#include <openssl/ssl.h> + +#include <errno.h> +#include <regex.h> +#include <syslog.h> +#include <zlib.h> + +#include "spdy.h" + #define KORE_RESULT_ERROR 0 #define KORE_RESULT_OK 1 #define KORE_RESULT_RETRY 2 diff --git a/includes/spdy.h b/includes/spdy.h @@ -17,6 +17,9 @@ #ifndef __H_SPDY_H #define __H_SPDY_H +#include <sys/types.h> +#include <sys/queue.h> + struct spdy_ctrl_frame { u_int16_t version; u_int16_t type; diff --git a/src/accesslog.c b/src/accesslog.c @@ -14,29 +14,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> -#include <sys/types.h> #include <sys/socket.h> -#include <sys/queue.h> -#include <netinet/in.h> -#include <arpa/inet.h> - -#include <openssl/err.h> -#include <openssl/ssl.h> - -#include <errno.h> -#include <fcntl.h> #include <poll.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <syslog.h> -#include <regex.h> -#include <zlib.h> - -#include "spdy.h" + #include "kore.h" #include "http.h" diff --git a/src/buf.c b/src/buf.c @@ -14,27 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/queue.h> - -#include <netinet/in.h> -#include <arpa/inet.h> - -#include <openssl/err.h> -#include <openssl/ssl.h> - -#include <errno.h> -#include <fcntl.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <regex.h> -#include <zlib.h> - -#include "spdy.h" #include "kore.h" struct kore_buf * diff --git a/src/config.c b/src/config.c @@ -14,29 +14,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/queue.h> - -#include <netinet/in.h> -#include <arpa/inet.h> - -#include <openssl/err.h> -#include <openssl/ssl.h> - #include <ctype.h> -#include <errno.h> #include <fcntl.h> #include <pwd.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <regex.h> -#include <zlib.h> - -#include "spdy.h" + #include "kore.h" static int configure_bind(char **); diff --git a/src/connection.c b/src/connection.c @@ -14,34 +14,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> -#include <sys/types.h> #include <sys/socket.h> -#include <sys/queue.h> -#include <sys/wait.h> -#include <netinet/in.h> -#include <arpa/inet.h> - -#include <openssl/err.h> -#include <openssl/ssl.h> - -#include <pwd.h> -#include <errno.h> -#include <grp.h> #include <fcntl.h> -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sched.h> -#include <syslog.h> -#include <time.h> -#include <regex.h> -#include <zlib.h> -#include <unistd.h> - -#include "spdy.h" + #include "kore.h" #include "http.h" diff --git a/src/domain.c b/src/domain.c @@ -14,31 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/queue.h> - -#include <netinet/in.h> -#include <arpa/inet.h> - -#include <openssl/err.h> -#include <openssl/ssl.h> - -#include <ctype.h> -#include <dlfcn.h> -#include <errno.h> -#include <fcntl.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <syslog.h> -#include <regex.h> -#include <zlib.h> - -#include "spdy.h" #include "kore.h" struct kore_domain_h domains; diff --git a/src/http.c b/src/http.c @@ -15,25 +15,6 @@ */ #include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/queue.h> - -#include <netinet/in.h> -#include <arpa/inet.h> - -#include <openssl/err.h> -#include <openssl/ssl.h> - -#include <errno.h> -#include <fcntl.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <regex.h> -#include <time.h> -#include <zlib.h> #include "spdy.h" #include "kore.h" diff --git a/src/kore.c b/src/kore.c @@ -14,35 +14,11 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> -#include <sys/types.h> #include <sys/socket.h> -#include <sys/queue.h> -#include <sys/wait.h> -#include <netinet/in.h> -#include <arpa/inet.h> - -#include <openssl/err.h> -#include <openssl/ssl.h> - -#include <pwd.h> -#include <errno.h> -#include <fcntl.h> #include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sched.h> -#include <syslog.h> -#include <time.h> -#include <regex.h> -#include <zlib.h> -#include <unistd.h> - -#include "spdy.h" + #include "kore.h" -#include "http.h" volatile sig_atomic_t sig_recv; diff --git a/src/linux.c b/src/linux.c @@ -14,36 +14,12 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/queue.h> #include <sys/epoll.h> #include <sys/prctl.h> -#include <sys/wait.h> -#include <netinet/in.h> -#include <arpa/inet.h> - -#include <openssl/err.h> -#include <openssl/ssl.h> - -#include <errno.h> -#include <fcntl.h> -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> #include <sched.h> -#include <syslog.h> -#include <time.h> -#include <regex.h> -#include <zlib.h> -#include <unistd.h> -#include "spdy.h" #include "kore.h" -#include "http.h" static int efd = -1; static u_int32_t event_count = 0; diff --git a/src/mem.c b/src/mem.c @@ -14,29 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/queue.h> -#include <sys/time.h> - -#include <netinet/in.h> -#include <arpa/inet.h> - -#include <openssl/err.h> -#include <openssl/ssl.h> - -#include <errno.h> -#include <fcntl.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <syslog.h> -#include <regex.h> -#include <zlib.h> - -#include "spdy.h" #include "kore.h" #define KORE_MEM_MAGIC 0xd0d0 diff --git a/src/module.c b/src/module.c @@ -14,31 +14,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> #include <sys/stat.h> -#include <sys/queue.h> -#include <netinet/in.h> -#include <arpa/inet.h> - -#include <openssl/err.h> -#include <openssl/ssl.h> - -#include <ctype.h> #include <dlfcn.h> -#include <errno.h> -#include <fcntl.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <syslog.h> -#include <regex.h> -#include <zlib.h> - -#include "spdy.h" + #include "kore.h" static void *mod_handle = NULL; diff --git a/src/net.c b/src/net.c @@ -14,27 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/queue.h> - -#include <netinet/in.h> -#include <arpa/inet.h> - -#include <openssl/err.h> -#include <openssl/ssl.h> - -#include <errno.h> -#include <fcntl.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <regex.h> -#include <zlib.h> - -#include "spdy.h" #include "kore.h" void diff --git a/src/spdy.c b/src/spdy.c @@ -14,26 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/queue.h> - -#include <netinet/in.h> -#include <arpa/inet.h> - -#include <openssl/err.h> -#include <openssl/ssl.h> - -#include <errno.h> -#include <fcntl.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <regex.h> -#include <zlib.h> - #include "spdy.h" #include "kore.h" #include "http.h" diff --git a/src/utils.c b/src/utils.c @@ -14,29 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/queue.h> -#include <sys/time.h> - -#include <netinet/in.h> -#include <arpa/inet.h> - -#include <openssl/err.h> -#include <openssl/ssl.h> - -#include <errno.h> -#include <fcntl.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <syslog.h> -#include <regex.h> -#include <zlib.h> - -#include "spdy.h" #include "kore.h" static struct { diff --git a/src/worker.c b/src/worker.c @@ -14,36 +14,14 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> #include <sys/types.h> -#include <sys/socket.h> -#include <sys/queue.h> -#include <sys/ipc.h> #include <sys/shm.h> #include <sys/wait.h> -#include <netinet/in.h> -#include <arpa/inet.h> - -#include <openssl/err.h> -#include <openssl/ssl.h> - -#include <pwd.h> -#include <errno.h> #include <grp.h> -#include <fcntl.h> -#include <regex.h> +#include <pwd.h> #include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <syslog.h> -#include <semaphore.h> -#include <time.h> -#include <unistd.h> -#include <zlib.h> - -#include "spdy.h" + #include "kore.h" #include "http.h"